/*
 * arenas.css
 * Page-specific styles for the root arenas.php (public Arena directory &
 * detail page). "Arena" is PlayPool's public-facing name for a club/venue.
 * Self-contained, matching the brand tokens and card/hero patterns already
 * established in player-profile.css / seasonal.css.
 */

:root {
    --pp-dark: #0a1a17;
    --pp-dark-2: #112922;
    --pp-felt: #0d7a4a;
    --pp-felt-light: #15a060;
    --pp-gold: #d4a843;
    --pp-gold-light: #e6c06a;
    --pp-cream: #f4efe3;
    --pp-cream-dark: #e8dfcd;
    --pp-red: #b71c1c;
    --pp-bg: #f5f3ef;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.06);
    --card-shadow-hover: 0 8px 30px rgba(0,0,0,0.1);
}
* { box-sizing: border-box; }
html, body { overflow-x: hidden; max-width: 100%; }
html { overflow-y: scroll; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar { display: none; width: 0; background: transparent; }
body {
    font-family: 'Poppins', system-ui, sans-serif;
    color: #222;
    background: var(--pp-bg);
    margin: 0;
    padding-top: 60px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

#mainContent {
    padding-top: 32px;
    padding-bottom: 40px;
    max-width: 100%;
    padding-left: 40px;
    padding-right: 40px;
    flex: 1 0 auto;
    width: 100%;
}
.footer { flex-shrink: 0; }
.view-detail { display: none; }
.view-list { display: block; }

/* ─── FOOTER ─── */
.footer {
    background: var(--pp-dark);
    color: rgba(244,239,227,0.6);
    padding: 32px 0;
    text-align: center;
}
.footer a { color: rgba(244,239,227,0.6); text-decoration: none; }
.footer a:hover { color: var(--pp-gold); }

/* ─── DIRECTORY TOOLBAR + SEARCH ─── */
.roster-toolbar { margin-bottom: 22px; }
.roster-search {
    position: relative;
    max-width: 360px;
}
.roster-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 0.85rem;
}
.roster-search input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    outline: none;
    transition: border-color .2s;
}
.roster-search input:focus { border-color: var(--pp-felt); }

/* ─── ARENA DIRECTORY GRID ─── */
.arena-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}
.arena-card {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 24px 18px;
    text-align: center;
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.arena-card:hover { transform: translateY(-4px); box-shadow: var(--card-shadow-hover); }
.arena-card-logo {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    margin: 0 auto 14px;
    display: block;
    border: 3px solid var(--pp-cream-dark);
}
.arena-card-logo-fallback {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    margin: 0 auto 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--pp-felt), var(--pp-felt-light));
    color: #fff;
    font-size: 1.6rem;
}
.arena-card-name {
    font-weight: 700;
    color: var(--pp-dark);
    font-size: 0.95rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.arena-card-meta {
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.arena-card-stats {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding-top: 14px;
    border-top: 1px solid #f0f0f0;
}
.arena-card-stats .astat { text-align: center; }
.arena-card-stats .astat .n {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.25rem;
    color: var(--pp-felt);
    line-height: 1;
}
.arena-card-stats .astat .l {
    font-size: 0.58rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #aaa;
    margin-top: 3px;
}

/* ─── ARENA HERO (detail view) ─── */
.arena-hero {
    position: relative;
    background: linear-gradient(160deg, #0a1a17 0%, #0d3d2a 60%, #0f5538 100%);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 24px;
}
.arena-hero-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 32px 40px 26px;
    color: var(--pp-cream);
}
.arena-logo-wrap { flex-shrink: 0; }
.arena-hero-logo {
    width: 110px;
    height: 110px;
    border-radius: 20px;
    object-fit: cover;
    border: 4px solid rgba(244,239,227,0.25);
    display: block;
}
.arena-hero-logo-fallback {
    display: flex;
    width: 110px;
    height: 110px;
    border-radius: 20px;
    align-items: center;
    justify-content: center;
    background: rgba(244,239,227,0.1);
    border: 4px solid rgba(244,239,227,0.25);
    font-size: 2.4rem;
    color: rgba(244,239,227,0.7);
}
.arena-hero-body { min-width: 0; flex: 1; }
.arena-hero-name {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.1;
    margin: 0 0 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.arena-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.arena-hero-tags .tag {
    background: rgba(244,239,227,0.1);
    border: 1px solid rgba(244,239,227,0.2);
    color: rgba(244,239,227,0.85);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.arena-hero-tags .tag i { color: var(--pp-gold-light); }

.arena-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(5,14,12,0.55);
    border-top: 1px solid rgba(244,239,227,0.14);
}
.arena-hero-stats .stat {
    text-align: center;
    padding: 16px 8px;
    border-left: 1px solid rgba(244,239,227,0.1);
}
.arena-hero-stats .stat:first-child { border-left: none; }
.arena-hero-stats .stat .num {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.5rem;
    color: var(--pp-cream);
    line-height: 1;
}
.arena-hero-stats .stat .label {
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(244,239,227,0.55);
    margin-top: 5px;
}

/* ─── ARENA SECTIONS ─── */
.arena-section {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    margin-bottom: 24px;
}
.section-heading {
    font-family: 'Bebas Neue', sans-serif;
    letter-spacing: 0.5px;
    font-size: 1.15rem;
    color: var(--pp-dark);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-heading i { color: var(--pp-felt); font-size: 0.95rem; }
.arena-description {
    color: #444;
    font-size: 0.92rem;
    margin: 0;
    white-space: pre-line;
}

/* teams list */
.team-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}
.team-row:last-child { border-bottom: none; }
.team-row-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--pp-felt), var(--pp-dark-2));
    color: rgba(244,239,227,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.95rem;
}
.team-row-info { flex: 1; min-width: 0; }
.team-row-name {
    font-weight: 600;
    color: var(--pp-dark);
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.team-row-meta { font-size: 0.72rem; color: #999; margin-top: 2px; }

/* ─── GALLERY ─── */
.section-count { margin-left: auto; font-family: 'Poppins', sans-serif; font-size: 0.75rem; letter-spacing: 0; color: #999; }
.arena-albums {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.album-card {
    display: flex; flex-direction: column;
    padding: 0; border: 0; text-align: left;
    background: white; border-radius: 14px; overflow: hidden;
    box-shadow: 0 0 0 1px #eee8db, var(--card-shadow);
    font-family: 'Poppins', sans-serif; cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.album-card:hover, .album-card:focus-visible { transform: translateY(-3px); box-shadow: 0 0 0 1px #e2d9c5, var(--card-shadow-hover); outline: none; }
.album-cover {
    position: relative; display: block; aspect-ratio: 4 / 3;
    background: var(--pp-dark-2) center / cover no-repeat;
}
.album-count {
    position: absolute; right: 10px; bottom: 10px;
    padding: 3px 10px; border-radius: 999px;
    background: rgba(10,26,23,0.72); color: var(--pp-cream);
    font-size: 0.72rem; font-weight: 600;
}
.album-info { display: block; padding: 12px 14px 14px; }
.album-title { display: block; font-weight: 600; font-size: 0.92rem; color: var(--pp-dark); line-height: 1.3; overflow-wrap: anywhere; }
.album-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 2px; font-size: 0.76rem; color: #888; line-height: 1.45;
}

/* photo viewer */
body.lb-open { overflow: hidden; }
.pp-lightbox {
    position: fixed; inset: 0; z-index: 2000;
    display: flex; flex-direction: column;
    background: #07120f;
    color: var(--pp-cream);
    animation: lb-in .18s ease-out;
}
.pp-lightbox[hidden] { display: none; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.lb-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 12px; }
.lb-title strong { font-family: 'Bebas Neue', sans-serif; font-weight: 400; font-size: 1.4rem; letter-spacing: 0.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-title span { font-size: 0.8rem; color: rgba(244,239,227,0.6); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lb-close, .lb-nav {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; flex-shrink: 0;
    border: 0; border-radius: 50%;
    background: rgba(244,239,227,0.1); color: var(--pp-cream);
    font-size: 1.1rem; cursor: pointer; transition: background .15s;
}
.lb-close:hover, .lb-nav:hover { background: rgba(244,239,227,0.22); }
.lb-close:focus-visible, .lb-nav:focus-visible, .lb-thumb:focus-visible { outline: 2px solid var(--pp-gold); outline-offset: 2px; }
.lb-body { flex: 1; min-height: 0; display: flex; align-items: center; gap: 12px; padding: 0 16px; }
.lb-stage { flex: 1; min-width: 0; height: 100%; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.lb-stage img {
    max-width: 100%; max-height: calc(100% - 36px);
    object-fit: contain; border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    transition: opacity .2s; user-select: none; -webkit-user-drag: none;
}
.lb-stage img.is-loading { opacity: 0.35; }
.lb-stage figcaption { min-height: 1.4em; font-size: 0.85rem; color: rgba(244,239,227,0.8); text-align: center; }
.lb-nav[hidden], .lb-strip[hidden] { display: none; }
.lb-strip {
    display: flex; gap: 6px; padding: 12px 16px 16px;
    overflow-x: auto; scrollbar-width: none; justify-content: safe center;
}
.lb-strip::-webkit-scrollbar { display: none; }
.lb-thumb {
    flex: 0 0 56px; height: 56px; padding: 0;
    border: 2px solid transparent; border-radius: 8px;
    background: #222 center / cover no-repeat;
    opacity: 0.5; cursor: pointer; transition: opacity .15s, border-color .15s;
}
.lb-thumb:hover { opacity: 0.85; }
.lb-thumb.active { opacity: 1; border-color: var(--pp-gold); }
@media (max-width: 767px) {
    .arena-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .album-info { padding: 10px 12px 12px; }
    .lb-body { padding: 0; }
    .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 1; width: 40px; height: 40px; background: rgba(6,16,14,0.55); }
    .lb-prev { left: 8px; }
    .lb-next { right: 8px; }
    .lb-stage img { border-radius: 0; }
    .lb-stage figcaption { padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .pp-lightbox, .album-card, .lb-stage img { animation: none; transition: none; }
}

/* ─── PLAYPOOL APPROVED ARENAS (category A) ─── */
.arena-group-head { grid-column: 1 / -1; margin: 8px 2px -4px; }
.arena-group-head:not(:first-child) { margin-top: 22px; }
.arena-group-head h2 {
    display: flex; align-items: center; gap: 8px; margin: 0;
    font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem; letter-spacing: .5px; color: var(--pp-dark);
}
.arena-group-head p { margin: 0; font-size: .8rem; color: #888; }
.arena-group-n { font-family: 'Poppins', sans-serif; font-size: .72rem; font-weight: 600; letter-spacing: 0; background: var(--pp-cream-dark); color: var(--pp-dark); border-radius: 999px; padding: 1px 8px; }
.arena-card { position: relative; }
.arena-card.is-approved { box-shadow: 0 0 0 1.5px rgba(212,168,67,.55), var(--card-shadow); }
.arena-card.is-approved:hover { box-shadow: 0 0 0 1.5px rgba(212,168,67,.8), var(--card-shadow-hover); }
.pp-approved-pill {
    position: absolute; top: 10px; left: 10px;
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px 2px 3px; border-radius: 999px;
    background: #fbf3dc; color: #7a5a12;
    font-size: .64rem; font-weight: 700; letter-spacing: .2px; line-height: 1.6;
}
.pp-approved-pill img { display: block; }
.arena-hero-approved:empty { display: none; }
.pp-approved-seal { position: absolute; top: 18px; right: 24px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.35)); }
.pp-approved-seal img { display: block; width: 96px; height: 96px; }
.arena-hero-tags .tag-approved { background: rgba(212,168,67,.18); color: #f3d27a; display: inline-flex; align-items: center; gap: 5px; }
.arena-hero-tags .tag-approved img { display: block; }
.arena-hero-inner { position: relative; }
@media (min-width: 769px) {
    .arena-hero.has-seal .arena-hero-inner { padding-right: 140px; }
}
@media (max-width: 768px) {
    .pp-approved-seal { display: none; }   /* the "PlayPool Approved Arena" tag stays */
}

/* ─── JOIN CTA ─── */
.arena-cta {
    background: linear-gradient(135deg, var(--pp-dark) 0%, var(--pp-dark-2) 100%);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.arena-cta-text h3 {
    color: var(--pp-cream);
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: 1.3rem;
    letter-spacing: 0.3px;
    margin: 0 0 4px;
}
.arena-cta-text p {
    color: rgba(244,239,227,0.65);
    font-size: 0.85rem;
    margin: 0;
}
.arena-cta-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* empty / loading states */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #999;
}
.empty-state i { font-size: 2.4rem; color: #ddd; margin-bottom: 12px; display: block; }
.empty-state h3 { font-size: 1.1rem; color: #666; margin: 0 0 6px; }
.empty-state p { font-size: 0.85rem; margin: 0; }

/* skeleton loading */
.skeleton { background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%); background-size: 200% 100%; animation: pp-shimmer 1.4s infinite; border-radius: 6px; }
@keyframes pp-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-card { height: 190px; }

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    #mainContent { padding-left: 16px; padding-right: 16px; }
    .roster-search { max-width: 100%; }

    .arena-hero-inner { flex-direction: column; text-align: center; padding: 28px 20px 20px; }
    .arena-hero-tags { justify-content: center; }
    .arena-hero-name { -webkit-line-clamp: 3; }
    .arena-hero-stats .stat { padding: 12px 4px; }
    .arena-hero-stats .stat .num { font-size: 1.25rem; }
    .arena-hero-stats .stat .label { font-size: 0.54rem; }

    .arena-section { padding: 18px; }
    .arena-cta { flex-direction: column; align-items: stretch; text-align: center; }
    .arena-cta-actions { justify-content: center; }
}

@media (max-width: 576px) {
    .arena-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
    .arena-card { padding: 18px 12px; }
    .arena-hero-logo, .arena-hero-logo-fallback { width: 84px; height: 84px; }
}

/* ─── TOURNAMENTS HELD AT THIS ARENA ─── */
.t-row {
    display: flex; align-items: center; gap: 14px;
    padding: 12px 8px; margin: 0 -8px;
    border-bottom: 1px solid #f0f0f0; border-radius: 10px;
    color: inherit; text-decoration: none;
    transition: background .15s;
}
.t-row:last-child { border-bottom: none; }
.t-row:hover, .t-row:focus-visible { background: #f7f5f0; color: inherit; text-decoration: none; }
.t-date {
    flex: none; width: 52px; padding: 6px 0; border-radius: 10px; text-align: center;
    background: linear-gradient(135deg, var(--pp-felt), var(--pp-dark-2)); color: var(--pp-cream);
    line-height: 1.1;
}
.t-day { display: block; font-family: 'Bebas Neue', sans-serif; font-size: 1.35rem; }
.t-mon { display: block; font-size: 0.6rem; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.t-info { flex: 1; min-width: 0; }
.t-name { font-weight: 600; color: var(--pp-dark); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-meta { font-size: 0.72rem; color: #888; margin-top: 3px; }
.t-meta i { color: var(--pp-felt); margin-right: 2px; }
.t-sep { margin: 0 4px; color: #ccc; }
.t-badge {
    flex: none; font-size: 0.68rem; font-weight: 600; padding: 3px 10px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 5px;
}
.t-badge.live { background: #e3f6ec; color: #0d7a4a; }
.t-badge.upcoming { background: #fdf3dc; color: #9a7213; }
.t-badge.ended { background: #eee; color: #777; }
.t-badge .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #15a060; animation: tLivePulse 1.4s infinite; }
@keyframes tLivePulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.t-arrow { flex: none; color: #ccc; font-size: 0.8rem; }
.t-more-wrap { text-align: center; padding-top: 12px; }
.t-more {
    border: 1px solid var(--pp-cream-dark); background: #fff; color: var(--pp-felt);
    font-weight: 600; font-size: 0.82rem; padding: 8px 18px; border-radius: 20px; cursor: pointer;
}
.t-more:hover { background: var(--pp-cream); }

@media (max-width: 576px) {
    .t-row { gap: 10px; flex-wrap: wrap; }
    .t-info { flex-basis: calc(100% - 100px); }
    .t-arrow { display: none; }
    .t-badge { margin-left: 62px; }
}
@media (prefers-reduced-motion: reduce) { .t-badge .live-dot { animation: none; } }
