/* =========================================
   COMBOHERO.CSS - Combo Hero
   The game view and the note highway are one unit, framed like a TV.
   Note colours are the GameCube controller's own buttons.
   ========================================= */

:root {
    --gc-a: #22b07d;
    --gc-b: #e5484d;
    --gc-xy: #c4c9d4;
    --gc-z: #7c5cff;
    --gc-c: #f2c230;
    --hero-panel: #0b1220;
    --hero-line: rgba(148, 163, 184, 0.16);
    --grade-perfect: #7dfcc6;
    --grade-great: #8fd3ff;
    --grade-good: #ffd27a;
    --grade-miss: #ff6b6b;
}

.hero-main [hidden] { display: none !important; }

.hero-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 20px) 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.hero-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.hero-title {
    font-size: clamp(1.9rem, 5vw, 2.8rem);
    font-weight: 900;
    letter-spacing: -0.035em;
    line-height: 1;
    margin-bottom: 10px;
}
.hero-lede {
    max-width: 58ch;
    color: #a3adbd;
    line-height: 1.55;
}

/* ---- Setup ---- */
.hero-setup {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.hero-step {
    background: var(--hero-panel);
    border: 1px solid var(--hero-line);
    border-radius: 12px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
}
.hero-step-title {
    font-size: 1rem;
    font-weight: 700;
}
.hero-copy {
    color: #a3adbd;
    font-size: 0.88rem;
    line-height: 1.55;
}
.hero-drop {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 22px 16px;
    border: 1.5px dashed rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.hero-drop:hover,
.hero-drop.over {
    border-color: var(--accent-cyan);
    background: rgba(0, 200, 255, 0.05);
}
.hero-drop:focus-within { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.hero-drop-main { font-weight: 700; }
.hero-drop-sub { color: var(--text-muted); font-size: 0.82rem; }

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.75);
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.hero-file-btn:focus-within { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
.hero-link {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-muted);
    font-size: 0.78rem;
    text-decoration: underline;
    cursor: pointer;
}
.hero-link:hover { color: var(--text-primary); }
.hero-msg { font-size: 0.82rem; color: var(--text-muted); min-height: 1.2em; }
.hero-msg.ok { color: var(--grade-perfect); }
.hero-msg.err { color: var(--grade-miss); }
.hero-progress {
    align-self: stretch;
    height: 4px;
    background: rgba(148, 163, 184, 0.15);
    border-radius: 2px;
    overflow: hidden;
}
.hero-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: var(--accent-cyan);
    transition: width 0.1s linear;
}

/* ---- Combo list ---- */
.hero-combos {
    grid-column: 1 / -1;
    background: var(--hero-panel);
    border: 1px solid var(--hero-line);
    border-radius: 12px;
    padding: 18px;
}
.hero-combos-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.hero-filter { display: flex; gap: 6px; flex-wrap: wrap; }
.hero-filter button,
.hero-speed button {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #a3adbd;
    border-radius: 999px;
    padding: 0.3rem 0.8rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
}
.hero-filter button[aria-pressed="true"],
.hero-speed button[aria-pressed="true"] {
    background: rgba(0, 200, 255, 0.12);
    border-color: rgba(0, 200, 255, 0.45);
    color: var(--accent-cyan);
}
.hero-combo-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 420px;
    overflow-y: auto;
}
.hero-combo {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 0.7fr)) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
}
.hero-combo:hover { border-color: rgba(0, 200, 255, 0.35); background: rgba(0, 200, 255, 0.05); }
.hero-combo:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.hero-combo-who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-combo-who small { color: var(--text-muted); font-weight: 500; }
.hero-combo-num { font-variant-numeric: tabular-nums; color: #cbd5e1; }
.hero-combo-num small { color: var(--text-muted); }
.hero-kill {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--gc-b);
    border: 1px solid rgba(229, 72, 77, 0.5);
    border-radius: 4px;
    padding: 1px 6px;
    visibility: hidden;
}
.hero-kill.on { visibility: visible; }
.hero-empty { color: var(--text-muted); font-size: 0.88rem; padding: 8px 2px; }

/* ---- Game ---- */
.hero-game { display: flex; flex-direction: column; gap: 14px; }
.hero-game-bar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.hero-back {
    background: none;
    border: none;
    color: #a3adbd;
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    padding: 4px 0;
}
.hero-back:hover { color: #fff; }
.hero-combo-name { font-size: 1.05rem; font-weight: 700; flex: 1; min-width: 0; }
.hero-speed { display: flex; gap: 4px; }

/* The TV: game view on top, highway docked underneath. */
.hero-stage {
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: #060a12;
    box-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8);
}
.hero-view {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #0b1424;
}
.hero-view canvas { display: block; width: 100%; height: 100%; }
.hero-count {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}
.hero-count:empty { display: none; }
.hero-pct {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    display: flex;
    justify-content: center;
    gap: clamp(16px, 8vw, 90px);
    pointer-events: none;
}
.hero-pct-p { text-align: center; line-height: 1; }
.hero-pct-num {
    font-size: clamp(1.4rem, 4.2vw, 2.4rem);
    font-weight: 900;
    font-style: italic;
    color: #fff;
    -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.55);
    paint-order: stroke fill;
    font-variant-numeric: tabular-nums;
}
.hero-pct-num small { font-size: 0.55em; }
.hero-pct-name { font-size: 0.7rem; font-weight: 700; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 3px #000; }
.hero-pct-p.you .hero-pct-name::after { content: ' (you)'; color: var(--accent-cyan); }
.hero-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: var(--gc-c);
}
.hero-highway {
    display: block;
    width: 100%;
    height: clamp(210px, 30vw, 290px);
    background: var(--hero-panel);
    border-top: 1px solid rgba(148, 163, 184, 0.2);
}

.hero-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-hint { color: var(--text-muted); font-size: 0.8rem; flex: 1 1 280px; line-height: 1.5; }

/* ---- Results ---- */
.hero-results {
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 26px;
    align-items: start;
    background: var(--hero-panel);
    border: 1px solid var(--hero-line);
    border-radius: 12px;
    padding: 20px;
}
.hero-acc { display: flex; flex-direction: column; }
.hero-acc-num { font-size: 3rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-acc-label { color: var(--text-muted); font-size: 0.85rem; }
.hero-counts { display: grid; grid-template-columns: auto auto; gap: 4px 14px; font-size: 0.9rem; }
.hero-counts dt { font-weight: 700; }
.hero-counts dd { font-variant-numeric: tabular-nums; text-align: right; }
.hero-counts .perfect { color: var(--grade-perfect); }
.hero-counts .great { color: var(--grade-great); }
.hero-counts .good { color: var(--grade-good); }
.hero-counts .miss { color: var(--grade-miss); }
.hero-counts .extra { color: var(--text-muted); }
.hero-tendency { min-width: 0; }
.hero-tendency h3 { font-size: 0.9rem; font-weight: 700; margin-bottom: 8px; }
.hero-spread { display: block; width: 100%; height: 120px; }
.hero-tendency p { color: #a3adbd; font-size: 0.86rem; margin-top: 8px; line-height: 1.5; }

.hero-fine { color: var(--text-muted); font-size: 0.78rem; line-height: 1.6; max-width: 80ch; }

@media (max-width: 760px) {
    .hero-setup { grid-template-columns: 1fr; }
    .hero-combo { grid-template-columns: minmax(0, 1fr) auto auto; }
    .hero-combo .hero-combo-num:nth-of-type(3) { display: none; }
    .hero-combo .hero-kill { display: none; }
    .hero-results { grid-template-columns: 1fr 1fr; }
    .hero-tendency { grid-column: 1 / -1; }
}

@media (prefers-reduced-motion: reduce) {
    .hero-progress span { transition: none; }
}
