/* ==========================================================================
   My Team Page Styles
   Emblem editor and option selectors
   ========================================================================== */

/* ==========================================================================
   Emblem Editor
   ========================================================================== */

/* The preview sticks under the overlay header and shrinks from 200px to 100px
   while the card scrolls. The bar itself is only as tall as the small emblem;
   the large one overhangs into the spacer below, which scrolls away 1:1 with
   the content — so the shrinking never moves the layout. The size comes from
   `--emblem-editor-preview-size`, set by the scroll handler in emblemEditor.js. */
.emblem-editor__preview {
    position: sticky;
    top: var(--emblem-editor-sticky-top, 0);
    z-index: 10;
    height: calc(100px + 16px);
    padding: 8px 0;
    background-color: var(--bs-card-bg);
}

.emblem-editor__preview-emblem {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: var(--emblem-editor-preview-size, 200px);
    height: var(--emblem-editor-preview-size, 200px);
}

.emblem-editor__preview-emblem svg {
    display: block;
    width: 100%;
    height: 100%;
}

.emblem-editor__preview-spacer {
    height: 100px;
    margin-bottom: 12px;
}

.emblem-editor__section {
    margin-bottom: 15px;
    text-align: center;
}

/* Warum die hellen Toene bei Farbe 1 fehlen — direkt unter der Ueberschrift,
   sonst liest es sich wie eine halbe Palette (#706). */
.emblem-editor__hint {
    margin-bottom: 8px;
    text-align: center;
}

.emblem-editor__section--toggles {
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Option Selector Boxes (shapes, patterns) */
.emblem-editor__option {
    display: inline-block;
    padding: 8px;
    margin: 4px;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(var(--app-black-rgb), 0.1);
    transition: border-color 0.2s ease;
}

.emblem-editor__option:hover {
    border-color: rgba(var(--app-accent-rgb), 0.5);
}

.emblem-editor__option--selected {
    border-color: var(--bs-info);
}

/* Pattern option with text */
.emblem-editor__option--pattern {
    padding: 8px 12px;
    font-size: 14px;
}

/* Color option */
.emblem-editor__color {
    display: inline-block;
    width: 36px;
    height: 36px;
    margin: 3px;
    border-radius: 4px;
    cursor: pointer;
    /* Permanent neutral grey outline so light swatches (white, cream) stay
       visible against the white modal background. */
    border: 2px solid var(--app-swatch-border);
    transition: border-color 0.2s ease;
}

.emblem-editor__color:hover {
    border-color: var(--app-swatch-border-hover);
}

.emblem-editor__color--selected {
    border-color: rgb(var(--app-black-rgb));
}

/* Icon picker */
.emblem-editor__section--icons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-height: 260px;
    overflow-y: auto;
}

.emblem-editor__icon {
    width: 56px;
    height: 56px;
    padding: 6px;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--app-white-rgb), 0.95);
}

.emblem-editor__icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

.emblem-editor__icon--none {
    background: rgba(var(--app-black-rgb), 0.25);
    color: rgba(var(--app-white-rgb), 0.8);
    font-size: 22px;
}

.emblem-editor__icon--selected {
    border-color: var(--bs-info);
}

/* ==========================================================================
   Team Name Editor
   ========================================================================== */

.team-name-preview {
    font-size: 24px;
    font-weight: bold;
    padding: 15px;
    background: rgba(var(--app-black-rgb), 0.1);
    border-radius: 4px;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Emblem Viewer
   ========================================================================== */

.emblem-viewer {
    cursor: pointer;
    text-align: center;
}

/* Team Info Table — flush in a `card-body p-0` as it is. Inside a padded
   card body, `--bleed` stretches it over the padding to the card's edges;
   on the base class that margin pushed the rows 1rem past an unpadded card
   (#693). */
.team-info-table--bleed {
    margin: 0 -1rem;
    width: calc(100% + 2rem);
}

/* Long values (e.g. a long stadium name) must wrap instead of overflowing and
   breaking the table layout (#459, #511). The selector has to out-specify
   `table.table td { white-space: nowrap }` from components/table.css — without
   resetting that, no amount of overflow-wrap makes the text break. */
table.table.team-info-table td {
    white-space: normal;
    overflow-wrap: anywhere;
    overflow-wrap: break-word;
}

/* Coach Avatar */
.coach-avatar {
    display: flex;
    justify-content: center;
}

.coach-avatar__img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(var(--app-white-rgb), 0.1);
}

.coach-avatar__img--default {
    object-fit: cover;
    opacity: 0.7;
}

/* Coach info shown centered below the avatar (no table). */
.coach-info__name {
    font-size: 1.15rem;
}

/* The coach card body links to the manager's profile. */
.coach-card-link {
    display: block;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.coach-card-link:hover,
.coach-card-link:focus {
    color: inherit;
    background-color: rgba(var(--app-white-rgb), 0.05);
}

/* Stadium Modal */
.stadium-modal-container {
    min-height: 300px;
}

/* The lineup picker and its icon buttons stay on one row down to 390px: the
   select gives up width first (`u-max-w-240` still caps it on desktop), so the
   new-lineup button keeps its place beside the rename button instead of
   wrapping onto a line of its own. */
.lineup-slot-select {
    flex: 1 1 7rem;
    min-width: 0;
}
