/* ==================== shared/rink.css ====================
   Rink, player marker, jersey and bench styles shared by the League and Teams pages. */

/* ==================== ALL-STAR RINK ==================== */

.rink-scroll { overflow-x: auto; margin: 10px 0; }

.rink-wrap { min-width: 680px; }

.rink {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 425;
    container-type: inline-size;
}

.rink-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.rink-player {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 12%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.jersey {
    width: 56px;
    width: 5.9cqw;
    height: auto;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.35));
}

.jersey-fallback {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #34495e;
    color: #fff;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.8rem;
    filter: none;
}

.player-name, .player-team, .player-meta {
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: rgba(255,255,255,0.92);
    border-radius: 3px;
    padding: 1px 6px;
}
.player-name {
    margin-top: 2px;
    font-weight: 600;
    font-size: 11px;
    font-size: clamp(10px, 1.25cqw, 14px);
}
.player-meta {
    font-size: 10px;
    font-size: clamp(9px, 1.1cqw, 12px);
    color: #34495e;
}

.player-team {
    font-size: 9px;
    font-size: clamp(8.5px, 1cqw, 11px);
    color: #7f8c8d;
}

/* ==================== BENCHES ==================== */

.benches {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 12px;
    container-type: inline-size;
}

.bench {
    border: 1px solid var(--border);
    border-bottom: 8px solid #8d6e4c;   /* the bench plank */
    border-radius: 8px 8px 4px 4px;
    padding: 8px 8px 6px;
}
.bench-left { background: rgba(52,152,219,0.10); }
.bench-right { background: rgba(231,76,60,0.10); }

.bench-title {
    font-size: 0.72rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin-bottom: 6px;
}

.bench-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    gap: 8px 4px;
}

.bench-player {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.bench .jersey {
    width: 32px;
    width: clamp(28px, 3.8cqw, 40px);
}

/* bench names wrap to two lines instead of truncating, since the cells are narrow */
.bench .player-name {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.15;
}

/* ==================== HALF RINK (Teams page) ==================== */

.half-rink-wrap {
    width: 100%;
    max-width: 560px;
    min-width: 340px;
    margin: 0 auto;
}

.half-rink { aspect-ratio: 506 / 425; }

.half-rink .rink-player { width: 25%; }

.half-rink .jersey {
    width: 46px;
    width: clamp(40px, 9cqw, 60px);
}

.half-rink .player-name {
    font-size: 11px;
    font-size: clamp(10px, 2.3cqw, 13px);
}
.half-rink .player-team {
    font-size: 9px;
    font-size: clamp(8.5px, 1.9cqw, 11px);
}
.half-rink .player-meta {
    font-size: 10px;
    font-size: clamp(9px, 2cqw, 12px);
}

/* one bench under the half rink: five players in a single row */
.team-bench { grid-template-columns: 1fr; }
.team-bench .bench-grid { grid-template-rows: auto; }
.team-bench .jersey {
    width: 36px;
    width: clamp(34px, 8cqw, 50px);
}

/* gold star marking a division all-star */
.gold-star {
    color: #f5b301;
    text-shadow: 0 0 1px rgba(122, 80, 0, 0.7);
}

/* ==================== RINK HEADS (division names above the rink) ==================== */

.rink-heads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    margin-bottom: 8px;
}
.rink-head {
    text-align: center;
    font-size: 1.3rem;
    font-weight: 700;
    padding-bottom: 4px;
    border-bottom: 3px solid;
}
.rink-head-left { color: #2980b9; border-color: rgba(52,152,219,0.55); }
.rink-head-right { color: #c0392b; border-color: rgba(231,76,60,0.55); }

/* two small benches (5 players each) under a rink whose halves are single teams */
.half-benches .bench-grid { grid-template-rows: auto; }

/* silver star marking a player who is in the week's All-Stars (outlined so it shows on the white name label) */
.silver-star {
    color: #aab3c0;
    -webkit-text-stroke: 0.5px #56657a;
    text-shadow: 0 0 1px #56657a;
}

/* ---------- phones: the full rink turns 90 degrees so it fills the screen top to bottom ---------- */
.rink-rot { position: relative; }
@media (max-width: 700px) {
    .rink-scroll { overflow-x: visible; }
    .rink-wrap { min-width: 0; display: flex; flex-direction: column; }
    .rink-heads { display: contents; }
    .rink-heads .rink-head:first-child { order: 1; margin-bottom: 6px; }
    .rink-rot { order: 2; width: 100%; aspect-ratio: 425 / 1000; container-type: inline-size; }
    .rink-heads .rink-head:last-child { order: 3; margin-top: 6px; }
    .benches { order: 4; }
    .rink-rot > .rink { position: absolute; top: 0; left: 0; width: 235.294cqw; height: 100cqw; transform-origin: 0 0; transform: translateX(100cqw) rotate(90deg); }
    .rink-rot .rink-player { transform: translate(-50%, -50%) rotate(-90deg); width: 17%; }
}
