:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: rgba(14, 27, 46, .78);
  --panel-solid: #0f2035;
  --line: rgba(178, 215, 255, .13);
  --text: #f5f8ff;
  --muted: #90a3ba;
  --cyan: #41e6cf;
  --blue: #5e86ff;
  --pink: #fb6fbe;
  --danger: #ff7287;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { min-height: 100vh; margin: 0; color: var(--text); background:
  radial-gradient(circle at 15% 5%, rgba(54, 107, 255, .16), transparent 32rem),
  linear-gradient(180deg, #081321 0%, #06101d 70%, #08111e 100%); overflow-x: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; border-radius: 999px; filter: blur(80px); pointer-events: none; opacity: .18; }
.ambient-one { width: 26rem; height: 26rem; background: var(--cyan); top: 34rem; right: -15rem; }
.ambient-two { width: 20rem; height: 20rem; background: var(--pink); top: 6rem; left: -14rem; }
.shell { position: relative; width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.topbar { height: 96px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; color: #04151b; font-weight: 900; font-size: 24px; background: linear-gradient(135deg, var(--cyan), #8cf4ff); box-shadow: 0 0 28px rgba(65,230,207,.2); }
.brand strong { display: block; font-size: 21px; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 1px; color: var(--muted); font-size: 9px; letter-spacing: .2em; }
.local-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; color: #bcd0e7; background: rgba(255,255,255,.025); font-size: 13px; }
.local-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.top-actions { display: flex; align-items: center; gap: 9px; }
.import-entry { padding: 9px 13px; border: 1px solid rgba(65,230,207,.25); border-radius: 999px; color: var(--cyan); text-decoration: none; background: rgba(65,230,207,.06); font-size: 13px; transition: .18s ease; }
.import-entry:hover { border-color: rgba(65,230,207,.55); background: rgba(65,230,207,.11); }
.hero { min-height: 620px; display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 72px; padding: 64px 0 72px; }
.eyebrow { margin: 0 0 18px; color: var(--cyan); font-size: 11px; font-weight: 800; letter-spacing: .19em; }
.hero h1 { margin: 0; max-width: 620px; font-size: clamp(44px, 5.4vw, 68px); line-height: 1.08; letter-spacing: -.055em; }
.hero h1 span { background: linear-gradient(90deg, #fff 8%, #92aefa 48%, var(--cyan)); background-clip: text; color: transparent; }
.typewriter-title { min-height: 3.24em; }
.typewriter-line { display: block; min-height: 1.08em; white-space: nowrap; }
.typewriter-caret { display: none; width: .08em; height: .82em; margin-left: .08em; vertical-align: -.04em; background: var(--cyan); box-shadow: 0 0 16px rgba(65,230,207,.65); animation: caret-blink .85s steps(1,end) infinite; }
.typewriter-line.typing .typewriter-caret { display: inline-block; }
@keyframes caret-blink { 0%,45% { opacity: 1; } 46%,100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .typewriter-caret { animation: none; } }
.lead { max-width: 540px; margin: 28px 0; color: #a8b9cd; font-size: 17px; line-height: 1.75; }
.source-note { display: inline-flex; gap: 10px; flex-wrap: wrap; color: #738aa4; font-size: 12px; }
.source-note span { color: #c7d7ea; }
.query-card { position: relative; padding: 29px; border: 1px solid rgba(160,205,255,.17); border-radius: 26px; background: linear-gradient(145deg, rgba(18,37,61,.92), rgba(9,21,36,.9)); box-shadow: 0 35px 80px rgba(0,5,14,.38), inset 0 1px rgba(255,255,255,.035); backdrop-filter: blur(20px); }
.query-card::before { content: ""; position: absolute; inset: 0 22% auto; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .65; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 25px; }
.card-heading p { margin: 0 0 5px; color: var(--muted); font-size: 9px; letter-spacing: .18em; }
.card-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.secure-badge { padding: 7px 10px; border-radius: 9px; color: var(--cyan); background: rgba(65,230,207,.08); font-size: 11px; }
.game-picker { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; padding: 0; margin: 0 0 21px; border: 0; }
.game-picker legend { padding: 0; margin-bottom: 10px; color: #90a3ba; font-size: 11px; }
.game-picker input { position: absolute; opacity: 0; pointer-events: none; }
.game-picker span { display: block; padding: 11px 8px; border: 1px solid var(--line); border-radius: 12px; text-align: center; background: rgba(255,255,255,.02); transition: .18s ease; }
.game-picker b, .game-picker small { display: block; }
.game-picker b { font-size: 13px; }
.game-picker small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .09em; }
.game-picker input:checked + span { border-color: rgba(65,230,207,.7); background: rgba(65,230,207,.1); box-shadow: inset 0 0 0 1px rgba(65,230,207,.12); }
.game-picker input:focus-visible + span { outline: 2px solid white; outline-offset: 2px; }
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; margin-bottom: 8px; color: #a8bad0; font-size: 11px; }
.field input { width: 100%; height: 49px; padding: 0 15px; border: 1px solid var(--line); border-radius: 12px; outline: 0; color: var(--text); background: rgba(3,12,22,.55); letter-spacing: .04em; transition: .2s ease; }
.field input::placeholder { color: #52677e; letter-spacing: normal; }
.field input:focus { border-color: rgba(65,230,207,.58); box-shadow: 0 0 0 4px rgba(65,230,207,.08); }
.primary-button { width: 100%; height: 51px; display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 5px; border: 0; border-radius: 13px; color: #03151a; background: linear-gradient(110deg, var(--cyan), #83f0ff); font-weight: 850; box-shadow: 0 12px 30px rgba(65,230,207,.14); transition: transform .18s ease, filter .18s ease; }
.primary-button:hover { filter: brightness(1.07); transform: translateY(-1px); }
.primary-button:disabled { opacity: .55; cursor: wait; transform: none; }
.primary-button b { font-size: 18px; }
.form-message { min-height: 19px; margin: 13px 0 0; color: var(--danger); text-align: center; font-size: 12px; }
.form-message.success { color: var(--cyan); }
.first-time { margin: 7px 0 0; color: #657b94; text-align: center; font-size: 10px; line-height: 1.5; }
.import-dialog { width: min(520px, calc(100% - 24px)); max-height: calc(100vh - 30px); padding: 0; border: 0; border-radius: 24px; color: var(--text); background: transparent; overflow: auto; }
.import-dialog::backdrop { background: rgba(2,8,16,.78); backdrop-filter: blur(8px); }
.dialog-card { padding: 26px; border: 1px solid rgba(160,205,255,.19); border-radius: 24px; background: linear-gradient(145deg,#142741,#091827); box-shadow: 0 30px 100px rgba(0,0,0,.55); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; }
.dialog-head p { margin: 0 0 5px; color: var(--cyan); font-size: 9px; letter-spacing: .17em; }
.dialog-head h2 { margin: 0; font-size: 25px; }
.dialog-close { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: rgba(255,255,255,.03); font-size: 23px; line-height: 1; }
.file-drop { min-height: 112px; display: grid; place-items: center; align-content: center; gap: 7px; margin-bottom: 20px; padding: 20px; border: 1px dashed rgba(65,230,207,.35); border-radius: 15px; text-align: center; background: rgba(65,230,207,.045); cursor: pointer; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop strong { color: #eaf5ff; font-size: 14px; }
.file-drop span { color: var(--muted); font-size: 11px; line-height: 1.55; }
.file-drop.ready { border-style: solid; border-color: var(--cyan); background: rgba(65,230,207,.09); }
.hidden { display: none !important; }
.results { padding: 20px 0 70px; scroll-margin-top: 20px; }
.results-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; }
.results-head .eyebrow { margin-bottom: 6px; }
.results-head h2 { margin: 0; font-size: clamp(28px, 5vw, 44px); letter-spacing: -.04em; }
.updated-at { color: var(--muted); font-size: 11px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr 1.35fr; gap: 12px; margin-bottom: 18px; }
.stats-grid article { min-width: 0; padding: 19px 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(14,29,48,.67); }
.stats-grid span { display: block; color: var(--muted); font-size: 9px; letter-spacing: .14em; }
.stats-grid strong { display: block; margin-top: 7px; overflow: hidden; color: #eaf2ff; font-size: 22px; text-overflow: ellipsis; white-space: nowrap; }
.stats-grid article:first-child strong { color: var(--cyan); }
.score-panel { overflow: hidden; border: 1px solid var(--line); border-radius: 19px; background: rgba(10,23,39,.72); }
.tabs { display: flex; gap: 3px; padding: 10px; border-bottom: 1px solid var(--line); }
.tab { padding: 10px 15px; border: 0; border-radius: 10px; color: var(--muted); background: transparent; font-size: 13px; }
.tab.active { color: var(--text); background: rgba(255,255,255,.07); }
.tab em { margin-left: 5px; color: var(--cyan); font-style: normal; font-size: 10px; }
.score-list { min-height: 100px; }
.score-row { display: grid; grid-template-columns: 34px 58px minmax(0,1fr) auto; align-items: center; gap: 14px; padding: 13px 18px; border-bottom: 1px solid rgba(166,205,255,.075); }
.score-row:last-child { border-bottom: 0; }
.rank { color: #5f7690; text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.cover { position: relative; width: 58px; height: 58px; overflow: hidden; display: grid; place-items: center; border-radius: 10px; color: #7d93aa; background: linear-gradient(135deg,#172f4b,#122036); font-size: 18px; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.song { min-width: 0; }
.song strong { display: block; overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.song-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.difficulty { display: inline-block; min-width: 23px; padding: 3px 5px; border-radius: 5px; color: #fff; text-align: center; font-weight: 800; background: #c23f7a; }
.difficulty.lv-0 { background: #40aa70; }.difficulty.lv-1 { background: #e1a934; }.difficulty.lv-2 { background: #e44c54; }.difficulty.lv-3 { background: #9b56cf; }.difficulty.lv-4 { background: #bdc4d0; color: #6b3d83; }
.score-value { min-width: 125px; text-align: right; }
.score-value strong { display: block; color: var(--cyan); font-size: 17px; font-variant-numeric: tabular-nums; }
.score-value small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.empty-state, .list-empty { display: grid; place-items: center; gap: 8px; min-height: 180px; padding: 30px; border: 1px solid var(--line); border-radius: 18px; color: var(--muted); text-align: center; background: rgba(10,23,39,.55); }
.empty-state strong { color: var(--text); font-size: 18px; }.empty-state span { font-size: 13px; }
.list-empty { min-height: 130px; border: 0; border-radius: 0; font-size: 13px; }
footer { padding: 24px 0 38px; border-top: 1px solid var(--line); color: #50657d; text-align: center; font-size: 10px; letter-spacing: .08em; }
@media (max-width: 820px) {
  .hero { min-height: auto; grid-template-columns: 1fr; gap: 42px; padding: 50px 0 64px; }
  .hero-copy { text-align: center; }.hero-copy .lead { margin-left: auto; margin-right: auto; }.source-note { justify-content: center; }
  .query-card { width: min(500px,100%); margin: 0 auto; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  .stats-grid article:last-child { grid-column: 1 / -1; }
}
@media (max-width: 540px) {
  .shell { width: min(100% - 24px,1120px); }
  .topbar { height: 76px; }.local-pill { display: none; }.import-entry { padding: 7px 9px; font-size: 10px; }
  .hero { padding-top: 38px; }.hero h1 { font-size: clamp(34px, 10.5vw, 43px); }.lead { font-size: 14px; margin: 21px 0; }
  .query-card { padding: 22px 17px; border-radius: 20px; }
  .dialog-card { padding: 22px 17px; }
  .game-picker { gap: 5px; }.game-picker span { padding: 10px 4px; }.game-picker b { font-size: 11px; }
  .results-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .stats-grid { gap: 8px; }.stats-grid article { padding: 15px; }.stats-grid strong { font-size: 18px; }
  .score-row { grid-template-columns: 48px minmax(0,1fr) auto; gap: 10px; padding: 12px 10px; }.rank { display: none; }
  .cover { width: 48px; height: 48px; border-radius: 8px; }.score-value { min-width: 90px; }.score-value strong { font-size: 14px; }
  .song strong { font-size: 12px; }
}
