/* PickleCue Interactive Demo — demo.css */

:root {
    /* Brand colors from AppTheme.swift */
    --brand: #059669;
    --brand-dark: #047857;
    --brand-light: #6EE7B7;
    --brand-deep: #1B4332;

    /* Neutrals */
    --off-white: #F9FAFB;
    --light-gray: #F3F4F6;
    --medium-gray: #D1D5DB;
    --dark-gray: #6B7280;
    --onyx: #1F2937;
    --black: #111827;

    /* Semantic */
    --success: #10B981;
    --warning: #F59E0B;
    --error: #EF4444;
    --info: #3B82F6;

    /* Page background */
    --page-bg: #0A1628;

    /* Demo frame — iPhone 17 Pro Max (430×932 pt) */
    --frame-w: 430px;
    --frame-h: 932px;
    --radius: 55px;
    --tab-h: 83px;
    --status-h: 59px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'DM Sans', system-ui, sans-serif;
    background: var(--page-bg);
    color: var(--black);
    overflow: hidden;
}

/* ─── Page wrapper ─── */
.demo-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    position: relative;
}

.demo-back {
    position: fixed;
    top: 1.5rem;
    left: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--brand-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 100;
    transition: opacity 0.2s;
}
.demo-back:hover { opacity: 0.7; }
.demo-back svg { width: 18px; height: 18px; }

.demo-label {
    position: fixed;
    bottom: 1.5rem;
    color: rgba(255,255,255,0.3);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* ─── iPhone frame ─── */
.iphone-frame {
    width: var(--frame-w);
    height: var(--frame-h);
    background: #1a1a1a;
    border-radius: var(--radius);
    padding: 10px;
    box-shadow:
        0 60px 120px rgba(0,0,0,0.6),
        0 0 0 1px rgba(255,255,255,0.08),
        inset 0 0 0 1px rgba(255,255,255,0.04);
    position: relative;
    flex-shrink: 0;
}

.iphone-screen {
    width: 100%;
    height: 100%;
    background: var(--off-white);
    border-radius: 36px;
    overflow: hidden;
    position: relative;
}

/* Dynamic Island — iPhone 17 Pro Max */
.dynamic-island {
    position: absolute;
    top: 11px;
    left: 50%;
    transform: translateX(-50%);
    width: 162px;
    height: 37px;
    background: #000;
    border-radius: 20px;
    z-index: 50;
}

/* ─── Status bar ─── */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: var(--status-h);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 28px 6px;
    z-index: 40;
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    pointer-events: none;
}

.status-time { font-variant-numeric: tabular-nums; }

.status-icons {
    display: flex;
    gap: 4px;
    align-items: center;
}

.status-icons svg { width: 16px; height: 16px; fill: currentColor; }

/* ─── Tab Bar ─── */
.tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--tab-h);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 0.5px solid var(--medium-gray);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 8px;
    z-index: 30;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    color: var(--dark-gray);
    transition: color 0.15s;
    -webkit-tap-highlight-color: transparent;
    min-width: 56px;
}

.tab-item.active { color: var(--brand); }

.tab-item svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.tab-item span {
    font-size: 10px;
    font-weight: 500;
}

/* ─── Screen container ─── */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: var(--status-h);
    padding-bottom: var(--tab-h);
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.screen.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.screen.prev {
    opacity: 0;
    transform: translateX(-30px);
}

/* ─── Scrollbar hide ─── */
.screen::-webkit-scrollbar { width: 0; display: none; }

/* ─── Common components ─── */
.screen-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px 8px;
}

.screen-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--black);
}

.screen-header-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.screen-header-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--brand);
}

.section-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 16px 16px 8px;
}

.section-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
}

.section-row .see-all {
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    cursor: pointer;
}

/* ─── Card ─── */
.card {
    background: #fff;
    border-radius: 16px;
    margin: 0 16px 12px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card-sm {
    background: #fff;
    border-radius: 12px;
    margin: 0 16px 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* ─── Badge ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}
.badge-brand { background: rgba(5,150,105,0.12); color: var(--brand); }
.badge-warning { background: rgba(245,158,11,0.12); color: #B45309; }
.badge-info { background: rgba(59,130,246,0.12); color: var(--info); }

/* ─── Avatar ─── */
.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }

.avatar-stack {
    display: flex;
}
.avatar-stack .avatar { margin-left: -8px; border: 2px solid #fff; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ─── Search bar ─── */
.search-bar {
    margin: 0 16px 12px;
    background: var(--light-gray);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark-gray);
    font-size: 15px;
}
.search-bar svg { width: 16px; height: 16px; fill: var(--dark-gray); flex-shrink: 0; }

/* ─── Filter pills ─── */
.filter-row {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }

.filter-pill {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    background: var(--light-gray);
    color: var(--dark-gray);
    transition: all 0.15s;
    border: 1.5px solid transparent;
}

.filter-pill.active {
    background: rgba(5,150,105,0.12);
    color: var(--brand);
    border-color: var(--brand);
}

/* ══════════════════════════════════
   HOME SCREEN
   ══════════════════════════════════ */

.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px 4px;
}

.home-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.home-avatar svg { width: 20px; height: 20px; fill: #fff; }

.home-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-deep);
}

.home-icons {
    display: flex;
    gap: 8px;
}
.home-icons .icon-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.home-icons .icon-btn svg { width: 22px; height: 22px; fill: var(--brand); }

/* Welcome card */
.welcome-card {
    background: linear-gradient(135deg, var(--brand-deep), #0F3D2B);
    border-radius: 16px;
    margin: 8px 16px 12px;
    padding: 16px;
    color: #fff;
}

.welcome-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 14px;
}

.welcome-greeting { font-size: 18px; font-weight: 700; }
.welcome-sub { font-size: 14px; color: var(--brand-light); margin-top: 2px; }

.welcome-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.welcome-action {
    background: rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.15s;
}
.welcome-action:hover { background: rgba(255,255,255,0.18); }

.welcome-action-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
}
.welcome-action-icon svg { width: 16px; height: 16px; fill: var(--brand-light); }

.welcome-action span { font-size: 12px; font-weight: 600; }

/* Weather widget */
.weather-card {
    background: #fff;
    border-radius: 14px;
    margin: 0 16px 12px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.weather-loc {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--dark-gray);
    margin-bottom: 6px;
}
.weather-loc svg { width: 12px; height: 12px; fill: var(--brand); }

.weather-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.weather-temp {
    font-size: 28px;
    font-weight: 700;
    color: var(--black);
}

.weather-desc {
    font-size: 13px;
    color: var(--dark-gray);
}

.weather-right {
    text-align: right;
}
.weather-stat {
    font-size: 12px;
    color: var(--dark-gray);
    line-height: 1.6;
}

.weather-play {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--light-gray);
    font-size: 13px;
    font-weight: 600;
    color: var(--brand);
}
.weather-play svg { width: 16px; height: 16px; fill: var(--brand); }

/* Game card (home) */
.game-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.game-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
}

.game-card-detail {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--dark-gray);
}
.game-card-detail svg { width: 14px; height: 14px; fill: var(--brand); }

.game-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2px;
}

.game-card-players {
    font-size: 13px;
    color: var(--dark-gray);
}

/* Court chips */
.court-chips {
    display: flex;
    gap: 10px;
    padding: 0 16px 12px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.court-chips::-webkit-scrollbar { display: none; }

.court-chip {
    min-width: 130px;
    background: #fff;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
    flex-shrink: 0;
}

.court-chip-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.court-chip-type.outdoor { color: var(--brand); }
.court-chip-type.indoor { color: var(--info); }

.court-chip-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 4px;
}

.court-chip-rating {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: var(--dark-gray);
}
.court-chip-rating svg { width: 12px; height: 12px; fill: var(--warning); }

/* ══════════════════════════════════
   COURTS SCREEN
   ══════════════════════════════════ */

.map-view {
    height: 260px;
    background: linear-gradient(145deg, #E8F0E8 0%, #D4E4D4 50%, #C8D8C8 100%);
    position: relative;
    overflow: hidden;
}

.map-marker {
    position: absolute;
    cursor: pointer;
    transition: transform 0.2s;
}
.map-marker:hover { transform: scale(1.15); }

.map-marker svg { width: 32px; height: 32px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }

.map-marker.selected svg { width: 38px; height: 38px; }

/* Map roads */
.map-view::before {
    content: '';
    position: absolute;
    top: 30%;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.6);
}
.map-view::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 45%;
    width: 3px;
    background: rgba(255,255,255,0.6);
}

/* Court preview card */
.court-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.court-preview-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.court-preview-icon svg { width: 24px; height: 24px; fill: #fff; }

.court-preview-info { flex: 1; }

.court-preview-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
}

.court-preview-meta {
    display: flex;
    gap: 12px;
    margin-top: 3px;
}

.court-preview-stat {
    font-size: 12px;
    color: var(--dark-gray);
    display: flex;
    align-items: center;
    gap: 3px;
}
.court-preview-stat svg { width: 12px; height: 12px; }

.court-preview-arrow {
    color: var(--medium-gray);
}
.court-preview-arrow svg { width: 20px; height: 20px; fill: currentColor; }

/* ══════════════════════════════════
   PLAY SCREEN
   ══════════════════════════════════ */

.partner-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, rgba(5,150,105,0.08), rgba(5,150,105,0.04));
    border: 1px solid rgba(5,150,105,0.15);
    border-radius: 12px;
    margin: 0 16px 12px;
    padding: 12px;
    cursor: pointer;
}

.partner-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(5,150,105,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.partner-banner-text { flex: 1; }
.partner-banner-title { font-size: 14px; font-weight: 600; color: var(--black); }
.partner-banner-desc { font-size: 12px; color: var(--dark-gray); }
.partner-banner-arrow { color: var(--brand); font-size: 18px; }

/* Game full card */
.game-full {
    background: #fff;
    border-radius: 14px;
    margin: 0 16px 10px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
}

.game-full-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.game-full-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
}

.game-full-meta {
    font-size: 13px;
    color: var(--dark-gray);
    margin-bottom: 3px;
}

.game-full-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--light-gray);
}

.spots-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--warning);
}

/* ══════════════════════════════════
   LEAGUES SCREEN
   ══════════════════════════════════ */

.league-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-radius: 14px;
    margin: 0 16px 10px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    cursor: pointer;
}

.league-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.league-info { flex: 1; }

.league-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--black);
}

.league-details {
    font-size: 13px;
    color: var(--dark-gray);
    margin-top: 2px;
}

.league-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--brand);
    margin-top: 2px;
}

.league-arrow {
    color: var(--medium-gray);
}
.league-arrow svg { width: 18px; height: 18px; fill: currentColor; }

/* ══════════════════════════════════
   LEAGUE DETAIL (sub-screen)
   ══════════════════════════════════ */

.detail-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--off-white);
    z-index: 20;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: var(--status-h);
    padding-bottom: 16px;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    -webkit-overflow-scrolling: touch;
}

.detail-screen.open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.detail-screen::-webkit-scrollbar { width: 0; display: none; }

/* Detail header */
.detail-nav {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
}

.detail-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--brand);
}
.detail-back svg { width: 22px; height: 22px; fill: currentColor; }

.detail-title {
    flex: 1;
    font-size: 17px;
    font-weight: 600;
    color: var(--black);
}

/* League detail hero */
.league-hero {
    text-align: center;
    padding: 0 16px 16px;
}

.league-hero-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--brand-deep), var(--brand));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin: 0 auto 8px;
}

.league-hero-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--black);
}

.league-hero-sub {
    font-size: 14px;
    color: var(--dark-gray);
    margin-top: 2px;
}

/* Detail tabs */
.detail-tabs {
    display: flex;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--medium-gray);
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.detail-tabs::-webkit-scrollbar { display: none; }

.detail-tab {
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dark-gray);
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.detail-tab.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

/* Detail tab content */
.detail-content {
    display: none;
    padding: 12px 0;
}
.detail-content.active { display: block; }

/* Overview tab */
.overview-stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 16px;
    margin-bottom: 12px;
}

.overview-stat {
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.overview-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
}

.overview-stat-label {
    font-size: 12px;
    color: var(--dark-gray);
    margin-top: 2px;
}

.overview-info {
    padding: 0 16px;
}

.overview-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--light-gray);
    font-size: 14px;
}

.overview-row-label { color: var(--dark-gray); }
.overview-row-value { font-weight: 600; color: var(--black); }

/* Members tab */
.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
}

.member-info { flex: 1; }
.member-name { font-size: 14px; font-weight: 600; color: var(--black); }
.member-rating { font-size: 12px; color: var(--dark-gray); }
.member-role {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}
.member-role.captain { background: rgba(245,158,11,0.12); color: #B45309; }
.member-role.player { background: var(--light-gray); color: var(--dark-gray); }

/* Chat tab */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 360px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chat-messages::-webkit-scrollbar { width: 0; display: none; }

.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg.them {
    background: var(--light-gray);
    color: var(--black);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.chat-msg.me {
    background: var(--brand);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-sender {
    font-size: 11px;
    font-weight: 600;
    color: var(--dark-gray);
    margin-bottom: 2px;
}

.chat-input-row {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid var(--light-gray);
    background: #fff;
}

.chat-input {
    flex: 1;
    border: 1px solid var(--medium-gray);
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
}
.chat-input:focus { border-color: var(--brand); }

.chat-send {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--brand);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}
.chat-send:hover { background: var(--brand-dark); }
.chat-send svg { width: 18px; height: 18px; fill: #fff; }

/* Standings tab */
.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 0 16px;
    width: calc(100% - 32px);
}

.standings-table th {
    text-align: left;
    padding: 8px 6px;
    font-weight: 600;
    color: var(--dark-gray);
    border-bottom: 1px solid var(--medium-gray);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.standings-table td {
    padding: 10px 6px;
    border-bottom: 1px solid var(--light-gray);
    color: var(--black);
}

.standings-table tr:hover { background: var(--light-gray); }

.rank-badge {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
}
.rank-1 { background: #FEF3C7; color: #B45309; }
.rank-2 { background: #E5E7EB; color: #374151; }
.rank-3 { background: #FDE7CC; color: #9A3412; }
.rank-other { background: var(--light-gray); color: var(--dark-gray); }

/* Matches tab */
.match-card {
    background: #fff;
    border-radius: 12px;
    margin: 0 16px 8px;
    padding: 12px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.match-card-date {
    font-size: 11px;
    color: var(--dark-gray);
    margin-bottom: 6px;
}

.match-card-teams {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.match-team-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.match-team-name {
    font-weight: 600;
    color: var(--black);
}
.match-team-name.winner { color: var(--brand); }

.match-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* Bracket tab */
.bracket-container {
    padding: 12px 16px;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.bracket-container::-webkit-scrollbar { display: none; }

.bracket-round {
    display: flex;
    gap: 16px;
    min-width: max-content;
}

.bracket-column {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 140px;
}

.bracket-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--dark-gray);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
    text-align: center;
}

.bracket-match {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

.bracket-team {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    font-size: 12px;
    border-bottom: 1px solid var(--light-gray);
}
.bracket-team:last-child { border-bottom: none; }

.bracket-team.winner {
    background: rgba(5,150,105,0.06);
    font-weight: 600;
    color: var(--brand);
}

.bracket-team-score {
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

/* ══════════════════════════════════
   MORE SCREEN
   ══════════════════════════════════ */

.more-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
}

.more-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}
.more-avatar svg { width: 32px; height: 32px; fill: #fff; }

.more-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--black);
}

.more-rating {
    font-size: 14px;
    color: var(--dark-gray);
    margin-top: 2px;
}

.more-stats {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}

.more-stat {
    text-align: center;
}

.more-stat-val {
    font-size: 18px;
    font-weight: 700;
    color: var(--brand);
}

.more-stat-label {
    font-size: 11px;
    color: var(--dark-gray);
}

.more-menu {
    padding: 0 16px;
}

.more-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--light-gray);
    cursor: pointer;
}

.more-menu-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.more-menu-icon svg { width: 18px; height: 18px; fill: #fff; }

.more-menu-label {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--black);
}

.more-menu-arrow {
    color: var(--medium-gray);
    font-size: 16px;
}

/* ─── Responsive ─── */
@media (max-height: 960px) {
    .iphone-frame {
        --frame-h: 820px;
        --radius: 48px;
    }
}

@media (max-height: 860px) {
    .iphone-frame {
        --frame-h: 720px;
        --radius: 42px;
    }
}

@media (max-width: 420px) {
    .iphone-frame {
        --frame-w: 100vw;
        --frame-h: 100vh;
        --radius: 0px;
        padding: 0;
        box-shadow: none;
    }
    .dynamic-island { display: none; }
    .demo-back { display: none; }
    .demo-label { display: none; }
    .iphone-screen { border-radius: 0; }
}

/* ─── Embedded in iframe ─── */
html.embedded body { background: transparent; overflow: hidden; }
html.embedded .demo-back { display: none; }
html.embedded .demo-label { display: none; }
html.embedded .demo-page { padding: 0; display: flex; align-items: flex-start; justify-content: center; }
html.embedded .iphone-frame {
    box-shadow: none;
    transform: scale(0.773);
    transform-origin: top center;
}

/* ─── Reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
    .screen, .detail-screen {
        transition: none;
    }
}
