/* Base */
:root {
    --bg: #07080d;
    --bg-soft: #0d1018;
    --panel: rgba(17, 20, 30, .88);
    --panel-2: #131722;
    --border: rgba(255, 255, 255, .09);
    --text: #f7f7fa;
    --muted: #969dab;
    --accent: #ff315d;
    --accent-2: #8b5cf6;
    --good: #4ade80;
    --shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 12% 0%, rgba(139, 92, 246, .13), transparent 28rem),
        radial-gradient(circle at 88% 16%, rgba(255, 49, 93, .10), transparent 25rem),
        var(--bg);
    color: var(--text);
    font: 15px/1.6 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }

.site-header {
    min-height: 74px;
    max-width: 1220px;
    margin: 0 auto;
    padding: 0 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.brand-mark { font-size: 21px; letter-spacing: -.02em; }
.brand span:last-child { color: var(--muted); font-size: 11px; }
.main-nav { display: flex; gap: 8px; }
.main-nav a { padding: 9px 13px; border-radius: 10px; color: var(--muted); font-weight: 650; }
.main-nav a:hover, .main-nav a.active { background: rgba(255,255,255,.055); color: var(--text); }

.site-main { max-width: 1220px; min-height: calc(100vh - 150px); margin: 0 auto; padding: 58px 26px 80px; }
.panel { background: linear-gradient(180deg, rgba(21,25,37,.96), rgba(13,16,24,.96)); border: 1px solid var(--border); box-shadow: var(--shadow); }
.eyebrow { color: #c2c7d1; font-size: 11px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
.muted { color: var(--muted); }
.status-dot { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 14px rgba(74,222,128,.55); }
.status-dot.offline { background: var(--accent); box-shadow: none; }

.hero { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 48px; align-items: center; min-height: 500px; }
.hero h1 { margin: 17px 0 20px; max-width: 800px; font-size: clamp(52px, 7vw, 92px); line-height: .96; letter-spacing: -.055em; text-transform: uppercase; }
.hero h1 span { background: linear-gradient(90deg, var(--accent), #ff7852, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy > p { max-width: 630px; color: var(--muted); font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 19px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.035); font-weight: 750; }
.button:hover { background: rgba(255,255,255,.075); }
.button.primary { border-color: transparent; background: linear-gradient(120deg, var(--accent), #e94b76); }
.sync-line { margin-top: 20px; color: #6f7684; font-size: 12px; }

.champion-card { position: relative; overflow: hidden; padding: 24px; border-radius: 22px; text-align: center; }
.champion-card::before { content:""; position:absolute; inset:0 0 auto; height:2px; background:linear-gradient(90deg, transparent, #f6c95e, transparent); }
.champion-card .crown { position: absolute; top: 15px; right: 20px; color: #f6c95e; font-size: 26px; }
.champion-card img { width: 230px; aspect-ratio: 1; object-fit: contain; margin: 18px auto 8px; border-radius: 18px; background: rgba(0,0,0,.18); }
.champion-card h2 { margin: 8px 0 0; font-size: 29px; letter-spacing: -.03em; }
.champion-card p { margin: 3px 0 18px; color: var(--muted); }
.champion-stats { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.champion-stats span { padding: 13px 4px; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.champion-stats span + span { border-left: 1px solid var(--border); }
.champion-stats strong { display: block; color: var(--text); font-size: 16px; }
.champion-card > a { color: #f6c95e; font-weight: 750; }

.stat-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin: 30px 0 46px; }
.home-stats { grid-template-columns: repeat(4, 1fr); }
.stat { padding: 18px 20px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,.025); }
.stat span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.stat strong { display: block; margin-top: 5px; font-size: 24px; letter-spacing: -.03em; }

.section-block { margin-top: 58px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 19px; }
.section-heading h2 { margin: 4px 0 0; font-size: 30px; letter-spacing: -.035em; }
.section-heading > a { color: var(--muted); font-weight: 700; }
.leader-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.leader-card { position: relative; padding: 16px; border-radius: 16px; transition: transform .18s ease, border-color .18s ease; }
.leader-card:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.18); }
.leader-card img { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: 14px; border-radius: 12px; background: rgba(0,0,0,.17); }
.leader-position { position: absolute; top: 12px; left: 12px; padding: 4px 8px; border-radius: 8px; background: rgba(7,8,13,.78); font-weight: 850; }
.leader-card strong, .leader-card span { display: block; }
.leader-card div span { color: var(--muted); font-size: 12px; }
.leader-card b { display: block; margin-top: 10px; color: #ff91a8; }

.page-intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.page-intro h1 { margin: 6px 0 3px; font-size: clamp(39px, 5vw, 64px); line-height: 1; letter-spacing: -.05em; }
.page-intro p { margin: 10px 0 0; color: var(--muted); }
.search { display: flex; gap: 8px; min-width: min(100%, 410px); }
.search input { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 11px; outline: 0; background: var(--panel-2); color: var(--text); }
.search input:focus { border-color: rgba(139,92,246,.75); }
.search button { padding: 0 17px; border: 0; border-radius: 11px; background: var(--text); color: #101118; font-weight: 800; cursor: pointer; }

.creature-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.creature-card { overflow: hidden; border: 1px solid var(--border); border-radius: 16px; background: var(--panel); }
.creature-art { display: block; background: linear-gradient(145deg, #121623, #0b0d14); }
.creature-art img, .art-placeholder { width: 100%; aspect-ratio: 1; object-fit: contain; }
.art-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 45px; }
.creature-card-body { padding: 16px; }
.creature-card h3 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.025em; }
.creature-card h3 a:hover { color: #ff8ca4; }
.owner { margin: 2px 0 13px; color: var(--muted); }
.card-stats { display: flex; justify-content: space-between; padding-top: 11px; border-top: 1px solid var(--border); color: #c9ced7; font-size: 12px; font-weight: 700; }

.profile-hero { display: grid; grid-template-columns: minmax(280px, .72fr) minmax(0, 1.28fr); align-items: center; gap: 55px; margin-bottom: 35px; }
.profile-art { border-radius: 22px; padding: 22px; }
.profile-art img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.profile-copy h1 { margin: 9px 0 0; font-size: clamp(48px, 6vw, 78px); line-height: 1; letter-spacing: -.055em; }
.profile-owner { margin: 11px 0 0; color: var(--muted); font-size: 18px; }
.title-line { margin: 12px 0 0; color: #d9b9ff; }
.level-progress { max-width: 610px; margin-top: 30px; }
.level-progress-copy { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 7px; color: var(--muted); font-size: 12px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: rgba(255,255,255,.07); }
.progress-track span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.content-panel { padding: 24px; border-radius: 17px; }
.detail-list > div, .skill-grid > div { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.detail-list > div:last-child, .skill-grid > div:last-child { border-bottom: 0; }
.detail-list span, .skill-grid span { color: var(--muted); }
.skill-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }

.tabs { display: flex; padding: 4px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.025); }
.tabs a { padding: 8px 13px; border-radius: 8px; color: var(--muted); font-weight: 700; }
.tabs a.active { background: #f5f5f7; color: #11131a; }
.leaderboard-panel { overflow: hidden; border-radius: 17px; }
.leaderboard-head, .leader-row { display: grid; grid-template-columns: 55px minmax(0,1fr) 145px; align-items: center; gap: 10px; }
.leaderboard-head { padding: 10px 18px; color: #6f7684; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.leader-row { min-height: 75px; padding: 10px 18px; border-top: 1px solid var(--border); }
.leader-row:hover { background: rgba(255,255,255,.025); }
.rank { font-size: 18px; font-weight: 850; }
.leader-person { display: flex; align-items: center; gap: 13px; min-width: 0; }
.leader-person img { width: 52px; height: 52px; object-fit: contain; border-radius: 11px; background: rgba(0,0,0,.2); }
.leader-person strong, .leader-person small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-person small { color: var(--muted); }
.leader-value { text-align: right; font-size: 20px; }

.goal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.goal-card { position: relative; min-height: 175px; padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: linear-gradient(150deg, rgba(26,30,44,.95), rgba(13,16,24,.95)); }
.goal-card h2 { max-width: 86%; margin: 30px 0 4px; font-size: 20px; line-height: 1.2; }
.goal-card p { color: var(--muted); }
.goal-reward { position: absolute; top: 18px; right: 18px; color: #ff98ad; font-size: 11px; font-weight: 850; }
.goal-target { display: block; margin-top: 15px; font-size: 28px; }
.compact-goals { grid-template-columns: repeat(2, 1fr); }
.compact-goals .goal-card { min-height: 95px; }
.compact-goals .goal-card strong { display: block; margin-top: 7px; }
.goal-state { color: var(--muted); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.goal-card.complete { border-color: rgba(74,222,128,.30); background: linear-gradient(150deg, rgba(27,58,45,.45), rgba(13,16,24,.95)); }
.goal-card.complete .goal-state { color: var(--good); }

.empty-state { max-width: 680px; margin: 90px auto; text-align: center; }
.empty-state h1, .empty-state h2 { margin: 10px 0; font-size: 39px; letter-spacing: -.04em; }
.empty-state p { color: var(--muted); }
.empty-state .button { margin-top: 12px; }

.site-footer { max-width: 1220px; min-height: 76px; margin: 0 auto; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid var(--border); color: #606775; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

@media (max-width: 980px) {
    .hero { grid-template-columns: 1fr; }
    .champion-card { max-width: 480px; }
    .stat-grid, .home-stats { grid-template-columns: repeat(3, 1fr); }
    .leader-cards { grid-template-columns: repeat(3, 1fr); }
    .creature-grid { grid-template-columns: repeat(3, 1fr); }
    .goal-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 720px) {
    .site-header { align-items: flex-start; flex-direction: column; padding-top: 17px; padding-bottom: 14px; }
    .main-nav { width: 100%; overflow-x: auto; }
    .site-main { padding-top: 38px; }
    .hero { min-height: 0; }
    .hero h1 { font-size: 51px; }
    .page-intro { align-items: stretch; flex-direction: column; }
    .search { min-width: 0; width: 100%; }
    .stat-grid, .home-stats { grid-template-columns: repeat(2, 1fr); }
    .leader-cards, .creature-grid { grid-template-columns: repeat(2, 1fr); }
    .profile-hero, .two-column { grid-template-columns: 1fr; }
    .profile-art { max-width: 470px; }
    .goal-grid, .compact-goals { grid-template-columns: 1fr; }
    .leaderboard-head, .leader-row { grid-template-columns: 40px minmax(0,1fr) 90px; }
    .leader-person img { width: 44px; height: 44px; }
}

@media (max-width: 470px) {
    .site-main { padding-left: 17px; padding-right: 17px; }
    .brand span:last-child { display: none; }
    .main-nav a { padding-left: 9px; padding-right: 9px; }
    .hero h1 { font-size: 43px; }
    .stat-grid, .home-stats, .leader-cards, .creature-grid { grid-template-columns: 1fr; }
    .skill-grid { grid-template-columns: 1fr; }
    .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
}


/* Phase 1.1 additions */
.creature-image { display: block; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.profile-meta span {
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: #bbc1ce;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.profile-skills { margin-bottom: 16px; }

.maintenance-body {
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 20% 15%, rgba(139,92,246,.13), transparent 34%),
        radial-gradient(circle at 80% 80%, rgba(255,52,95,.11), transparent 34%),
        var(--bg);
}
.maintenance-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
}
.maintenance-card {
    width: min(690px, 100%);
    padding: 48px;
    border-radius: 22px;
    text-align: center;
}
.maintenance-mark {
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: 950;
    letter-spacing: -.03em;
}
.maintenance-card h1 {
    margin: 14px 0;
    font-size: clamp(42px, 7vw, 70px);
    line-height: .98;
    letter-spacing: -.055em;
}
.maintenance-card > p {
    max-width: 520px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.65;
}
.maintenance-note {
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
    color: #6f7684;
    font-size: 12px;
}


/* Phase 1.2: synchronised-data notice */
.freshness-notice {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    margin: 0 0 22px;
    padding: 14px 16px;
    border: 1px solid rgba(255,255,255,.075);
    border-radius: 14px;
    background: rgba(255,255,255,.025);
}
.freshness-icon {
    display: grid;
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 50%;
    color: #c9cfda;
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 700;
}
.freshness-notice strong {
    display: block;
    margin: 1px 0 3px;
    color: #eceef3;
    font-size: 13px;
}
.freshness-notice p {
    margin: 0;
    color: #949cab;
    font-size: 12px;
    line-height: 1.5;
}
.freshness-notice small {
    display: block;
    margin-top: 5px;
    color: #686f7c;
    font-size: 11px;
}


/* Phase 1.3: friendlier maintenance screen */
.maintenance-card {
    overflow: hidden;
    position: relative;
}
.maintenance-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, #ff345f, #ff795e, #8958ee);
}
.maintenance-brand {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}
.maintenance-mark {
    margin: 0;
    color: #f7f7fa;
    font-size: 22px;
    font-weight: 950;
    letter-spacing: -.035em;
}
.maintenance-subbrand {
    color: #a5adbb;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.maintenance-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 8px 13px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 999px;
    background: rgba(255,255,255,.025);
    color: #c8ced8;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.maintenance-pulse {
    background: #ffbf47;
    box-shadow: 0 0 14px rgba(255,191,71,.45);
}
.maintenance-card h1 {
    margin: 22px 0 16px;
    font-size: clamp(48px, 8vw, 78px);
}
.maintenance-message {
    max-width: 560px !important;
    color: #aab1be !important;
    font-size: 18px !important;
}
.maintenance-divider {
    width: 72px;
    height: 2px;
    margin: 30px auto 24px;
    border-radius: 99px;
    background: linear-gradient(90deg, #ff345f, #8958ee);
}
.maintenance-reassurance {
    margin: 0;
    color: #d5d9e1;
    font-size: 13px;
    font-weight: 650;
}
.maintenance-checkback {
    margin: 9px 0 0;
    color: #747c8b;
    font-size: 12px;
}
