/* SuperWolf — Theme v1
   Extends site-v2 / marketing-v5 / dashboard-v1 with mobile-aligned tokens,
   rose CTAs, dashboard shell polish, and mobile navigation.
   New filename: CloudFront caches /css/* and ignores ?v= query strings. */

/* ── Tokens (align web ↔ iOS RoundTheme / Android SWColors) ─────────────── */

:root {
    /* Keep legacy aliases working */
    --sw-teal: #b0d4d4;
    --sw-teal-dark: #7ebcbc;
    --sw-teal-light: #daeeed;
    --sw-dark: #1a1a1a;          /* was teal-tinted #1a2e35 — match mobile ink */
    --sw-green: #4d9460;         /* RoundTheme green (money / birdie) */
    --sw-green-light: #c9e5d2;
    --sw-gold: #e0b821;
    --sw-red: #e07a5f;

    /* New semantic tokens */
    --sw-ink: #1a1a1a;
    --sw-ink-2: #3a3a3a;
    --sw-muted: #7a7a7a;
    --sw-rose: #b86e6e;          /* primary CTA / selection — mobile Rose */
    --sw-rose-dark: #9e5858;
    --sw-coin: #ffd93d;
    --sw-amber: #e89a40;
    --sw-page: #f4f7f7;
    --sw-page-brand: #b0d4d4;
    --sw-surface: #ffffff;
    --sw-paper: #fafaf6;
    --sw-stage: #0a1a17;
    --sw-radius-sm: 8px;
    --sw-radius: 14px;
    --sw-radius-lg: 20px;
    --sw-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --sw-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --sw-shadow-lg: 0 12px 40px rgba(26, 46, 53, 0.12);
}

/* ── Base ───────────────────────────────────────────────────────────────── */

body {
    color: var(--sw-ink-2);
    background-color: var(--sw-page);
}

body.dashboard-body {
    background-color: var(--sw-page);
}

/* Tabular money everywhere we mark it */
.tabular-nums,
.money-pos,
.money-neg,
.money-zero,
.stat-value {
    font-variant-numeric: tabular-nums;
}

.money-pos { color: var(--sw-green); }
.money-neg { color: var(--sw-red); }
.money-zero { color: var(--sw-muted); }

/* ── Buttons ────────────────────────────────────────────────────────────── */

/* Product primary CTA → rose (app parity). Store buttons stay black via .btn-apple. */
.btn-sw {
    background-color: var(--sw-rose);
    border-color: var(--sw-rose);
    color: #fff;
    font-weight: 600;
    border-radius: var(--sw-radius-sm);
}

.btn-sw:hover,
.btn-sw:focus {
    background-color: var(--sw-rose-dark);
    border-color: var(--sw-rose-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184, 110, 110, 0.35);
}

.btn-sw-outline {
    background-color: transparent;
    border: 2px solid var(--sw-ink);
    color: var(--sw-ink);
}

.btn-sw-outline:hover {
    background-color: var(--sw-ink);
    color: #fff;
}

/* Dark CTA when rose is wrong (rare) */
.btn-sw-ink {
    background-color: var(--sw-ink);
    border-color: var(--sw-ink);
    color: #fff;
    font-weight: 600;
    padding: 0.6rem 1.5rem;
    border-radius: var(--sw-radius-sm);
    transition: all 0.15s;
}

.btn-sw-ink:hover {
    background-color: #2a2a2a;
    border-color: #2a2a2a;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.2);
}

/* Soft tertiary */
.btn-sw-soft {
    background-color: var(--sw-teal-light);
    border-color: transparent;
    color: var(--sw-ink);
    font-weight: 600;
}

.btn-sw-soft:hover {
    background-color: var(--sw-teal);
    color: var(--sw-ink);
}

/* ── Brand logo ─────────────────────────────────────────────────────────── */

.brand-logo span {
    color: var(--sw-rose);
}

/* Marketing nav Sign In already uses .btn-sw → rose */

/* ── Cards / surfaces ───────────────────────────────────────────────────── */

.card-sw,
.card-sw-static,
.game-card,
.stat-tile,
.game-tile {
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow);
}

.game-card:hover {
    border-color: var(--sw-teal-dark);
}

/* Feature icons */
.feature-icon-teal {
    background-color: var(--sw-teal-light);
    color: var(--sw-green);
}

.feature-icon-green {
    background-color: var(--sw-green-light);
    color: var(--sw-green);
}

.feature-icon-rose {
    background-color: rgba(184, 110, 110, 0.14);
    color: var(--sw-rose);
}

/* ── Dashboard shell ────────────────────────────────────────────────────── */

.dashboard-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--sw-surface);
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9aa8a8;
    margin: 1rem 0 0.35rem;
    padding: 0 0.5rem;
}

.sidebar-section-label:first-child {
    margin-top: 0.25rem;
}

.sidebar-link {
    border-radius: var(--sw-radius-sm);
}

.sidebar-link:hover {
    background-color: var(--sw-teal-light);
    color: var(--sw-ink);
}

.sidebar-link.active {
    background-color: rgba(184, 110, 110, 0.12);
    color: var(--sw-rose);
    font-weight: 600;
}

.sidebar-link.active i {
    color: var(--sw-rose);
}

.dashboard-main {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1100px;
    padding: 1.5rem 1.25rem;
}

.dashboard-main-wide {
    max-width: 1280px;
}

@media (min-width: 992px) {
    .dashboard-main {
        padding: 2rem 2.5rem;
    }
}

/* Mobile top bar (replaces missing sidebar under 768px) */
.dashboard-topbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 1030;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.dashboard-topbar .brand-logo {
    font-size: 1.1rem;
}

.dashboard-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: none;
    border-radius: var(--sw-radius-sm);
    background: transparent;
    color: var(--sw-ink);
    font-size: 1.6rem;
    line-height: 1;
}

.dashboard-menu-btn:hover {
    background: var(--sw-teal-light);
}

.dashboard-topbar-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Offcanvas nav reuses sidebar-link styles */
.offcanvas-dashboard {
    width: min(300px, 88vw) !important;
}

.offcanvas-dashboard .offcanvas-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.offcanvas-dashboard .offcanvas-body {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.15rem 1.5rem;
}

.offcanvas-dashboard .offcanvas-body > nav {
    flex: 1 1 auto;
    min-height: 0;
}

.offcanvas-dashboard .sidebar-link {
    padding: 0.7rem 0.875rem; /* larger tap targets */
}

@media (max-width: 767.98px) {
    .sidebar {
        display: none !important;
    }

    .dashboard-topbar {
        display: flex;
    }

    .dashboard-main {
        padding: 1.15rem 1rem 2rem;
        max-width: none;
    }
}

/* ── Empty states ───────────────────────────────────────────────────────── */

.empty-state {
    text-align: center;
    padding: 2.5rem 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--sw-radius);
    background: var(--sw-surface);
    box-shadow: var(--sw-shadow);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: var(--sw-teal-light);
    color: var(--sw-green);
}

.empty-state p {
    color: var(--sw-muted);
    margin-bottom: 1rem;
}

/* ── Auth page ──────────────────────────────────────────────────────────── */

.auth-page {
    min-height: calc(100vh - 8rem);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 1rem;
    background:
        radial-gradient(ellipse 80% 60% at 90% 10%, rgba(184, 110, 110, 0.12), transparent 55%),
        radial-gradient(ellipse 70% 50% at 0% 100%, rgba(176, 212, 212, 0.55), transparent 50%),
        linear-gradient(160deg, var(--sw-teal-light) 0%, #fff 48%, #f0f7f4 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card .brand-logo {
    font-size: 1.6rem;
}

/* ── Marketing: hero phone stack ────────────────────────────────────────── */

.hero-phone-stack {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 320px;
}

.hero-phone-stack .phone-mockup {
    width: 220px;
}

.hero-phone-stack .phone-mockup.back {
    position: absolute;
    transform: translate(48px, 18px) rotate(6deg);
    opacity: 0.92;
    z-index: 0;
}

.hero-phone-stack .phone-mockup.front {
    position: relative;
    z-index: 1;
    transform: translate(-28px, -8px) rotate(-3deg);
}

@media (max-width: 860px) {
    .hero-phone-stack {
        min-height: 0;
        margin-top: 0.5rem;
    }

    .hero-phone-stack .phone-mockup {
        width: 180px;
    }

    .hero-phone-stack .phone-mockup.back {
        transform: translate(36px, 14px) rotate(5deg);
    }

    .hero-phone-stack .phone-mockup.front {
        transform: translate(-20px, -4px) rotate(-2deg);
    }
}

/* Hero CTA: store stays black */
.hero-v2-cta .btn-apple {
    padding: 0.65rem 1.35rem;
}

/* ── Marketing section helpers ──────────────────────────────────────────── */

.section-divider {
    background: var(--sw-rose);
}

.hero-v2-title .accent {
    color: var(--sw-rose);
}

.hero-v2-eyebrow {
    color: var(--sw-rose);
}

/* Nav pills active already uses green — keep for success semantics */

/* ── Live pulse (for "In Progress") ─────────────────────────────────────── */

.live-dot {
    display: inline-block;
    width: 0.55em;
    height: 0.55em;
    border-radius: 50%;
    background: var(--sw-green);
    margin-right: 0.35em;
    vertical-align: middle;
    animation: sw-pulse 1.6s ease-in-out infinite;
}

@keyframes sw-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* ── Page headers ───────────────────────────────────────────────────────── */

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sw-ink);
    margin: 0 0 0.25rem;
    letter-spacing: -0.02em;
}

.page-header .page-sub {
    color: var(--sw-muted);
    margin: 0;
    font-size: 0.92rem;
}

.page-header .page-icon {
    color: var(--sw-rose);
    margin-right: 0.25rem;
}

/* ── Entity cards (list rows) ───────────────────────────────────────────── */

.entity-card {
    display: block;
    text-decoration: none;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-left: 4px solid var(--entity-accent, var(--sw-teal-dark));
    border-radius: var(--sw-radius);
    padding: 0.95rem 1.15rem;
    background: var(--sw-surface);
    box-shadow: var(--sw-shadow);
    transition: all 0.15s;
}

.entity-card:hover {
    box-shadow: var(--sw-shadow-md);
    transform: translateY(-1px);
    border-color: rgba(0, 0, 0, 0.08);
    border-left-color: var(--entity-accent, var(--sw-teal-dark));
}

.entity-card--tournament { --entity-accent: var(--sw-gold); }
.entity-card--round { --entity-accent: var(--sw-teal-dark); }
.entity-card--wolf { --entity-accent: var(--sw-rose); }
.entity-card--league { --entity-accent: var(--sw-green); }
.entity-card--trip { --entity-accent: #5c9cf5; }

.entity-card-title {
    font-weight: 700;
    color: var(--sw-ink);
    font-size: 0.98rem;
    margin: 0 0 0.15rem;
}

.entity-card-meta {
    color: var(--sw-muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.entity-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    background: var(--sw-teal-light);
    color: var(--sw-green);
}

.entity-card--tournament .entity-card-icon {
    background: rgba(224, 184, 33, 0.18);
    color: #a8860a;
}

.entity-card--wolf .entity-card-icon {
    background: rgba(184, 110, 110, 0.14);
    color: var(--sw-rose);
}

.entity-card--league .entity-card-icon {
    background: var(--sw-green-light);
    color: var(--sw-green);
}

.entity-card--trip .entity-card-icon {
    background: rgba(92, 156, 245, 0.16);
    color: #3577d1;
}

/* Live badge */
.badge-live {
    background-color: #e8f5ec;
    color: var(--sw-green);
}

/* ── Stat tiles polish ──────────────────────────────────────────────────── */

.stat-tile {
    border-radius: var(--sw-radius);
    transition: box-shadow 0.15s;
}

.stat-tile:hover {
    box-shadow: var(--sw-shadow-md);
}

.stat-tile.stat-live .stat-value {
    color: var(--sw-green);
}

/* ── Pack signature showcase ────────────────────────────────────────────── */

.pack-signature {
    background:
        radial-gradient(ellipse 70% 80% at 100% 0%, rgba(184, 110, 110, 0.1), transparent 50%),
        radial-gradient(ellipse 60% 70% at 0% 100%, rgba(176, 212, 212, 0.45), transparent 55%),
        var(--sw-surface);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--sw-radius-lg);
    box-shadow: var(--sw-shadow);
    padding: 1.5rem;
}

.pack-signature #sig-preview {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ── Dashboard welcome ──────────────────────────────────────────────────── */

.dash-welcome h1 {
    letter-spacing: -0.02em;
}

.dash-welcome a {
    color: var(--sw-rose);
    font-weight: 600;
}

.dash-welcome a:hover {
    color: var(--sw-rose-dark);
}

/* Mobile: subnav sits below topbar */
@media (max-width: 767.98px) {
    .td-subnav {
        top: 52px; /* dashboard-topbar height approx */
        margin-left: -0.25rem;
        margin-right: -0.25rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* ── Round follow paper feel ────────────────────────────────────────────── */

.rf-card {
    border-radius: var(--sw-radius);
    box-shadow: var(--sw-shadow);
}

/* Soft teal wash behind round-follow content area only when wide */
.dashboard-main-wide .rf-card {
    background: var(--sw-surface);
}

/* Badge live used on lists + round status */
.badge-status.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}
