/* ==========================================================================
   Dashboard Page Styles
   ========================================================================== */

/* ==========================================================================
   Die Kopfzeile des Dashboards: der Reiterstreifen links, der Login-Bonus
   rechts daneben auf derselben Hoehe.

   Der Bonus stand bis dahin ueber der ersten der drei Spalten und liess deren
   Tabelle gut hundert Pixel tiefer beginnen als die beiden daneben. Er
   erzaehlt ohnehin vom Konto und nicht vom Verein, also steht er jetzt da, wo
   das Auge beim Reinkommen schon ist: oben rechts neben den Reitern.
   ========================================================================== */
.dashboard-head {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

/* Der Streifen nimmt, was uebrig bleibt — `min-width: 0`, damit eine lange
   Reiterzeile die Karte daneben nicht aus der Zeile schiebt. */
.dashboard-head > .nav {
    flex: 1 1 auto;
    min-width: 0;
}

/* So breit wie eine der drei Spalten darunter, aber nie mehr als ein Drittel
   der Zeile: der Bonus ist eine Fortschrittsleiste mit Tagzahlen darunter und
   braucht Platz fuer sie, darf den Reitern aber keinen nehmen. */
.dashboard-head__login {
    flex: 0 0 auto;
    width: 320px;
    max-width: 33%;
    margin-bottom: 1rem;
}

@media screen and (max-width: 768px) {
    /* Unter 768px dockt der Reiterstreifen unter der Infoleiste. Ein
       Flex-Kasten um ihn herum waere der Bezug seiner `sticky`-Position und
       nur eine Zeile hoch — es gaebe nichts zum Kleben. `contents` loest den
       Kasten auf: der Streifen haengt wieder direkt in der Seite, und der
       Bonus steht darunter, wo er vorher auch stand. */
    .dashboard-head {
        display: contents;
    }

    .dashboard-head__login {
        width: auto;
        max-width: none;
        margin-bottom: 0.75rem;
    }
}

/* ==========================================================================
   Der Kopf der ersten Spalte: Wappen und Vereinsname — und darunter die
   Tabelle, in der der Verein steht. Das Format, mit dem das Dashboard vor
   #706 begann: der Verein ist die Ueberschrift dieser Spalte, also traegt sie
   keine zweite.
   ========================================================================== */
.dashboard-club {
    min-width: 0;
    margin-bottom: 1rem;
}

/* Der Name steht in der Tinte der Seite, nicht in der eines Links: die ganze
   Flaeche ist anklickbar, und ein blauer Vereinsname sagt das kein zweites
   Mal. */
.dashboard-club__link {
    color: inherit;
}

.dashboard-club__link:hover {
    color: inherit;
}

/* Das Wappen fuellt die Spalte, bleibt aber bei seiner Groesse, wenn sie
   breiter ist als es selbst. */
.dashboard-club__link img,
.dashboard-club__link svg {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   The three columns: the short schedule, the checklist, the league table.

   They sit in the same kind of row as the promo cards underneath them — same
   2rem gap, same `md` breakpoint — so every table is exactly as wide as the
   card below it and starts on the same pixel (#706).
   ========================================================================== */
.dashboard-column {
    /* `1 1 0` and not Bootstrap's `flex-fill`: a table sized by its content
       makes the column with the longest club name in it the widest one. */
    flex: 1 1 0;
    min-width: 0;
    /* Eine Spalte ist selbst eine Spalte: so kann das, was in ihr unten
       steht, die Hoehe der Zeile mitnehmen, statt 120px darueber aufzuhoeren
       (#706). */
    display: flex;
    flex-direction: column;
}

/* Das Klemmbrett ist die kuerzeste der drei Listen und liesse die Spalte
   sonst deutlich frueher enden als die beiden daneben. Als Blatt Papier darf
   es unten Luft haben — eine Tabelle duerfte das nicht. */
.dashboard-column > .clipboard {
    flex: 1 1 auto;
}

/* The three only end on the same line when their rows are equally tall, so
   one height holds for all three tables — a schedule row carries a 20px
   emblem, which is what sets it. The horizontal padding stays with each
   table: the schedule splits its width between two team names and has none
   to give away, the standings have room. */
.dashboard-columns {
    --dashboard-row-height: 2.25rem;
}

.dashboard-columns .table td {
    height: var(--dashboard-row-height);
    padding-top: 0;
    padding-bottom: 0;
    vertical-align: middle;
}

/* The checklist is a table like the two beside it: an icon column and the
   sentence next to it, in the same quiet line-per-row rhythm as the schedule
   (#706). `fixed` is what gives the sentence a width to be cut against —
   without it a long warning widens the column instead. */
.urgency-table {
    table-layout: fixed;
}

.urgency-table td {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

/* The row is painted by its status (`table-warning` / `table-success`), so
   the sentence on it reads in the row's own ink — including the warning,
   which is a link and would otherwise take the link colour. */
.urgency-table a {
    color: inherit;
    border-bottom: none;
}

.urgency-table a:hover {
    color: inherit;
    text-decoration: underline;
}

/* One line per row, like the schedule beside it: a warning that wrapped would
   push its column past the other two. Below 768px the columns are under each
   other and the full page width is there, so the sentence wraps instead of
   being cut. */
.urgency-table td > * {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media screen and (max-width: 767px) {
    .urgency-table td > * {
        white-space: normal;
    }

    .dashboard-columns .table td {
        height: auto;
        padding-top: 0.35rem;
        padding-bottom: 0.35rem;
    }
}

/* Der Kopf einer Spielplan-Tabelle: das Zeichen des Wettbewerbs gross und
   ohne Flaeche darunter, der Name daneben, beides mittig ueber der Tabelle,
   die er benennt. Er ist zugleich der Weg auf die Seite, die den Wettbewerb
   ganz zeigt — ein Eck-Knopf dafuer braucht es nicht, wenn die Ueberschrift
   schon dorthin fuehrt (#706). */
/* `a.` statt `.`: `utilities.css` macht aus jedem Link ein `inline-block`
   (a:link ist eine Klasse wert), und ein Flex-Container ist er damit nicht. */
a.dashboard-schedule__head {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.35rem 0;
    color: inherit;
    text-decoration: none;
}

a.dashboard-schedule__head:hover h6 {
    text-decoration: underline;
}

.dashboard-schedule__icon {
    font-size: 1.5rem;
    line-height: 1;
    color: var(--mini-schedule-tone);
}

/* Jeder Wettbewerb hat seine Farbe, und sie gilt fuer alles, was in seiner
   Tabelle hervorgehoben ist: das Zeichen, der eigene Vereinsname, die
   Anzeigetafel. Die Liga behaelt den Akzent; Pokal und Freundschaftsspiel
   nehmen die lesbare Form ihrer Rolle, weil Amber und Grau als Vollton auf
   Weiss nicht zu lesen waeren (1,6 bzw. 2,4). */
.dashboard-schedule--info {
    --mini-schedule-tone: var(--bs-info);
}

.dashboard-schedule--warning {
    --mini-schedule-tone: var(--bs-warning-text-emphasis);
}

.dashboard-schedule--secondary {
    --mini-schedule-tone: var(--bs-secondary-text-emphasis);
}

/* Drei Tabellen untereinander in einer Spalte: was sie auseinanderhaelt, ist
   die Luft zwischen ihnen und die Ueberschrift ueber jeder — nicht ein
   Rahmen um jede. */
.dashboard-schedule + .dashboard-schedule {
    margin-top: 1.25rem;
}

/* Every row is rendered; the show-all row only takes the cover off the ones
   past the preview. */
.urgency-row--hidden {
    display: none;
}

/* Dashboard mini standing emblem */
.dashboard-emblem {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    margin-top: -4px;
}

/* Action Card Badge */
.action-card-badge {
    width: 20px;
    padding: 0;
    height: 20px;
    line-height: 22px;
    border: none;
    position: absolute;
    transform: translate(0, -14px);
    font-size: 10px;
}

/* Unread chat badge on the "Friends" tab (#604) */
.chat-unread-badge {
    padding: 0.15em 0.45em;
    font-size: 10px;
    line-height: 1.4;
    vertical-align: text-top;
}

/* Sponsor Sprite */
.sponsor-sprite {
    background-size: 1536px 1024px;
    max-width: 100%;
    border-radius: 0;
}

.mini-balance-chart-container {
    position: relative;
    height: 180px;
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
}

/* Card Claim Title (initially hidden) */
.card-claim-title--hidden {
    display: none;
}

/* Dashboard promo cards (feature-request / referral) */
.dashboard-promo-img {
    height: 200px;
    object-fit: contain;
    margin: 0 1rem 0.5rem 0;
}

/* Equal-width three-card row at the bottom of the dashboard. Cards must size
 * 1/3 each on desktop and stack on mobile. !important is required because
 * Bootstrap's .flex-fill sets `flex: 1 1 auto !important`, which otherwise
 * lets cards size by intrinsic content (the video iframe card ends up
 * narrower than the image cards). */
.dashboard-promo-row > .card {
    flex: 1 1 0;
    min-width: 0;
}

.dashboard-promo-row .dashboard-promo-img {
    height: 140px;
    margin: 0 auto 0.75rem;
    display: block;
}

/* The standings without a head: the position is the first cell and the points
   the last, so the row says what the three column names used to (#706). */
.standing-table {
    table-layout: fixed;
}

.standing-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The unread-message count on the checklist column's corner button. */
.dashboard-column__action {
    position: relative;
}

.dashboard-column__badge {
    position: absolute;
    top: -0.35rem;
    right: -0.35rem;
    padding: 0.15em 0.4em;
    font-size: 10px;
    line-height: 1.3;
    pointer-events: none;
}

.video-card .ratio {
    border-radius: 4px;
    overflow: hidden;
}

/* Friends sub-page table */
.friends-table .friends-avatar-cell {
    width: 56px;
}

.friends-avatar {
    width: 32px;
    border-radius: 50%;
    object-fit: cover;
}

/* Matches .account-friend-avatar--default so the placeholder looks the
 * same as on the account overlay (no padding, just a faint tint). */
.friends-avatar--default {
    opacity: 0.7;
    background-color: rgba(var(--bs-body-color-rgb), 0.05);
}

.friends-emblem {
    display: inline-flex;
    width: 24px;
    height: 24px;
}

/* Table links: drop the underline / bottom border and render in info blue
 * so the table reads as a list of links without visual noise. Bootstrap's
 * .text-success / .text-danger keep their !important colour for the
 * win/loss result link. */
.friends-table a {
    color: var(--bs-info);
    border-bottom: none;
    text-decoration: none;
    vertical-align: middle;
}

.friends-table a:hover {
    color: var(--bs-info);
    text-decoration: underline;
}

/* Video thumbnail link (native app fallback for YouTube embed) */
.video-thumbnail-link {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}

.video-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(var(--app-white-rgb), 0.85);
    text-shadow: 0 2px 8px rgba(var(--app-black-rgb), 0.6);
    pointer-events: none;
}


/* Youth Player Options Overlay */
.youth-options-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 575px) {
    .youth-options-grid {
        grid-template-columns: 1fr;
    }
}

.youth-option-card {
    background: rgba(var(--app-white-rgb), 0.04);
    border: 1px solid rgba(var(--app-white-rgb), 0.08);
    border-radius: 8px;
    padding: 0.75rem;
    /* Portrait left, name/stats/button right — stacked, one candidate was
       taller than half a 390px screen. */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
}

.youth-option-card__image {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
}

.youth-option-card__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.youth-option-card__name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    overflow-wrap: break-word;
}

/* Position, age and level share one row under the name — stacked they made
   the card so tall that a single candidate filled a 390px screen. */
.youth-option-card__meta {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: rgba(var(--bs-body-color-rgb), 0.75);
    margin-bottom: 0.5rem;
}

.youth-option-card__meta > span {
    display: inline-flex;
    align-items: center;
}

/* ==========================================================================
   Friends sub-page: chat list
   ========================================================================== */

.chat-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* One conversation row: avatar | name + preview | timestamp.
   A button rather than a link so it never renders as underlined link text —
   the click sets the `chat_user` query param, which opens the overlay. */
/* Flaeche, Rahmen und Radius bringt die `Card` mit (#737) — vorher stand hier
   eine nachgebaute Karte aus eigenem Rahmen, eigenem Radius und einer Fuellung
   aus 3 % Tinte. Hier steht nur noch, dass die Zeile eine Zeile ist: Bootstrap
   stellt den Inhalt einer Karte untereinander. */
.chat-list-item {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    text-align: left;
    cursor: pointer;
}

.chat-list-item:hover {
    border-color: var(--bs-info);
}

.chat-list-item__avatar {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    object-fit: cover;
}

.chat-list-item__avatar--default {
    opacity: 0.7;
    background-color: rgba(var(--bs-body-color-rgb), 0.05);
}

.chat-list-item__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.chat-list-item__name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* The preview is always a single line — long messages are cut off. */
.chat-list-item__preview {
    font-size: 0.875rem;
    color: rgba(var(--bs-body-color-rgb), 0.6);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-list-item--unread .chat-list-item__preview {
    color: rgba(var(--bs-body-color-rgb), 0.75);
    font-weight: 500;
}

.chat-list-item__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
    flex: 0 0 auto;
    margin-left: auto;
}

.chat-list-item__time {
    font-size: 0.75rem;
    color: rgba(var(--bs-body-color-rgb), 0.55);
    white-space: nowrap;
}

/* ==========================================================================
   Friends sub-page: who is online right now (#480)
   ========================================================================== */

.online-users {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.online-users__count {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: rgba(var(--bs-body-color-rgb), 0.6);
}

/* A green dot carries "live" faster than any wording can. */
.online-users__dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--bs-success);
}

/* The strip scrolls sideways on its own; the page never does. */
.online-users__strip {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.25rem;
    scrollbar-width: thin;
}

.online-users__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
    width: 4rem;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    cursor: pointer;
}

.online-users__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bs-success);
}

.online-users__avatar--default {
    opacity: 0.7;
    background-color: rgba(var(--bs-body-color-rgb), 0.05);
}

.online-users__item:hover .online-users__avatar {
    border-color: var(--bs-info);
}

/* One line, cut off — a long manager name must not widen the tile. */
.online-users__name {
    max-width: 100%;
    font-size: 0.6875rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(var(--bs-body-color-rgb), 0.75);
}

/* Shared prev/next pagination for the chat and friends lists. */
.list-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.list-pagination-label {
    color: rgba(var(--bs-body-color-rgb), 0.7);
    font-size: 0.9rem;
}

/* Daily login streak bar (#501). Dark card design and title font/size carried
   over from the retired "Next Up" card (#596) — same `bg-dark` frame and
   Carter One title as the rest of the dashboard's dark cards. */
.daily-login-bar {
    text-align: left;
    position: relative;
    /* The milestone labels hang below the track and need the room (#706). */
    padding-bottom: 12px;
}

.daily-login-title {
    font-size: 1rem;
}

.daily-login-progress-label {
    color: rgba(var(--app-white-rgb), 0.7);
}

.daily-login-track {
    position: relative;
    height: 10px;
    border-radius: 5px;
    background-color: rgb(var(--app-white-rgb));
    border: 1px solid var(--bs-border-color);
}

.daily-login-fill {
    height: 100%;
    border-radius: 5px;
    background-color: var(--bs-info);
    transition: width 0.4s ease;
}

.daily-login-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 0.65rem;
    color: var(--bs-secondary-color);
    background-color: rgb(var(--app-white-rgb));
    border: 1px solid var(--bs-border-color);
}

.daily-login-marker--reached {
    color: var(--app-ink-on-accent);
    background-color: var(--bs-info);
    border-color: var(--bs-info);
}

.daily-login-marker--next {
    color: var(--bs-info);
    border-color: var(--bs-info);
    box-shadow: 0 0 0 3px rgba(var(--bs-info-rgb), 0.25);
}

.daily-login-labels {
    position: relative;
    height: 1rem;
    margin-top: 0.5rem;
}

.daily-login-label {
    position: absolute;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: rgba(var(--app-white-rgb), 0.7);
}

.daily-login-label--reached {
    color: var(--bs-info);
    font-weight: bold;
}

/* Gift lying on top of the whole bar while a milestone reward is waiting to be
   collected (#501). It covers the track so the reward — not the progress — is
   what the eye lands on, and it swallows the click that would otherwise open
   the detail overlay.

   It takes the card's shape: out over the card border and with the card's own
   hand-drawn corners. Filling only the padding box left a rectangle with the
   corners and the border sticking out around it. */
.daily-login-gift {
    position: absolute;
    inset: calc(-1 * var(--bs-card-border-width));
    z-index: 2;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background-color: rgba(var(--bs-info-rgb), 0.92);
    color: var(--app-ink-on-accent);
    font-weight: bold;
    cursor: pointer;
}

.daily-login-gift:hover {
    background-color: rgba(var(--bs-info-rgb), 1);
}

.daily-login-gift-emoji {
    font-size: 2rem;
    line-height: 1;
    animation: daily-login-gift-wiggle 1.6s ease-in-out infinite;
}

.daily-login-gift-count {
    color: var(--bs-info);
    background-color: rgb(var(--app-white-rgb)) !important;
}

@keyframes daily-login-gift-wiggle {
    0%, 60%, 100% {
        transform: rotate(0) scale(1);
    }
    70% {
        transform: rotate(-12deg) scale(1.12);
    }
    80% {
        transform: rotate(12deg) scale(1.12);
    }
    90% {
        transform: rotate(-6deg) scale(1.06);
    }
}

@media (prefers-reduced-motion: reduce) {
    .daily-login-gift-emoji {
        animation: none;
    }
}

.daily-login-row--me {
    font-weight: bold;
    color: var(--bs-info);
}
