:root {
  --bg: #05060c;
  --panel: rgba(12, 15, 28, 0.72);
  --panel-2: rgba(20, 26, 46, 0.78);
  --line: rgba(255, 255, 255, 0.09);
  --text: #eaf0ff;
  --muted: #8e98b8;
  --cyan: #22d3ff;
  --pink: #ff2e88;
  --gold: #ffc531;
  --green: #3fe08a;
  --red: #ff4b5c;
  --cD: #9aa3b5; --cC: #3fd17a; --cB: #3d8bff; --cA: #b45cff; --cS: #ffc531;
  --font: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; user-select: none; }
button, input, select { font-family: inherit; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
#speedlines { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; opacity: 0; transition: opacity .25s; }
#vignette { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(20, 110, 255, 0.45) 100%); }
#vignette.shock { background: radial-gradient(ellipse at center, transparent 40%, rgba(255, 40, 200, 0.5) 100%); }
#app { position: fixed; inset: 0; pointer-events: none; }
#app > * { pointer-events: auto; }

/* ---------- 로고 ---------- */
.logo { font-weight: 900; font-style: italic; letter-spacing: .02em; line-height: .9; text-transform: uppercase;
  background: linear-gradient(100deg, #fff 0%, #cfe9ff 40%, var(--cyan) 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 4px 18px rgba(34, 211, 255, .35)); }
.logo span { display: block; background: linear-gradient(100deg, var(--pink), #ff8a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo.huge { font-size: clamp(64px, 9vw, 140px); }
.logo.big { font-size: 64px; }
.logo.small { font-size: 18px; }
.logo.small span { display: inline; margin-left: 6px; }

/* ---------- 공통 ---------- */
.screen { position: absolute; inset: 0; display: none; pointer-events: none; }
.screen.active { display: block; animation: fadeIn .35s ease; }
.screen > * { pointer-events: auto; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%); box-shadow: 0 20px 60px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05); }
.overlay { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 22px;
  background: radial-gradient(ellipse at center, rgba(10, 14, 30, .6), rgba(2, 3, 8, .92)); z-index: 50; }
.overlay.show { display: flex; animation: fadeIn .25s; }
.loader { width: 280px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.loader i { display: block; height: 100%; width: 40%; background: linear-gradient(90deg, var(--cyan), var(--pink)); border-radius: 6px; animation: load 1.1s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-110%); } 100% { transform: translateX(260%); } }
#loading-text { color: var(--muted); letter-spacing: .1em; }

.btn { position: relative; border: 0; cursor: pointer; padding: 12px 26px; font-weight: 800; font-size: 15px; letter-spacing: .04em; color: #fff;
  background: rgba(255, 255, 255, .08); transform: skewX(-12deg); border-radius: 6px; transition: transform .15s, background .15s, box-shadow .15s; }
.btn > span { display: inline-block; transform: skewX(12deg); }
.btn:hover { background: rgba(255, 255, 255, .16); transform: skewX(-12deg) translateY(-2px); }
.btn:active { transform: skewX(-12deg) translateY(1px); }
.btn.primary { background: linear-gradient(100deg, var(--cyan), #2f7dff); color: #04121c; box-shadow: 0 8px 30px rgba(34, 211, 255, .35); }
.btn.primary:hover { box-shadow: 0 10px 40px rgba(34, 211, 255, .55); }
.btn.pink { background: linear-gradient(100deg, var(--pink), #ff7a3d); box-shadow: 0 8px 30px rgba(255, 46, 136, .35); }
.btn.gold { background: linear-gradient(100deg, #ffd65c, #ff9f1c); color: #2a1800; box-shadow: 0 8px 30px rgba(255, 197, 49, .35); }
.btn.wide { width: 100%; padding: 14px; font-size: 16px; }
.btn.small { padding: 8px 16px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.6); }
.btn.back { position: absolute; top: 86px; left: 28px; z-index: 5; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font-size: 18px; cursor: pointer; transition: .15s; }
.icon-btn:hover { background: rgba(255, 255, 255, .14); }

.tabs { display: flex; gap: 6px; }
.tab { flex: 1; padding: 10px 14px; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .05); color: var(--muted); font-weight: 800; cursor: pointer; transition: .15s; }
.tab:hover { color: #fff; }
.tab.active { background: rgba(34, 211, 255, .16); color: #fff; box-shadow: inset 0 -2px 0 var(--cyan); }
.class-tabs .tab { flex: 0 0 auto; min-width: 64px; font-style: italic; font-size: 16px; }
.class-tabs .tab[data-cls="D"].active { box-shadow: inset 0 -3px 0 var(--cD); background: rgba(154, 163, 181, .15); }
.class-tabs .tab[data-cls="C"].active { box-shadow: inset 0 -3px 0 var(--cC); background: rgba(63, 209, 122, .15); }
.class-tabs .tab[data-cls="B"].active { box-shadow: inset 0 -3px 0 var(--cB); background: rgba(61, 139, 255, .15); }
.class-tabs .tab[data-cls="A"].active { box-shadow: inset 0 -3px 0 var(--cA); background: rgba(180, 92, 255, .15); }
.class-tabs .tab[data-cls="S"].active { box-shadow: inset 0 -3px 0 var(--cS); background: rgba(255, 197, 49, .15); }
.class-tabs.center { justify-content: center; margin: 0 auto 18px; width: max-content; }

.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; font-weight: 900; font-style: italic; color: #0a0c12; transform: skewX(-10deg); }
.badge.D { background: var(--cD); } .badge.C { background: var(--cC); } .badge.B { background: var(--cB); } .badge.A { background: var(--cA); } .badge.S { background: var(--cS); }

label { display: block; font-size: 13px; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
label small { color: #5f6a8a; font-weight: 600; margin-left: 4px; }
input, select { display: block; width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(0, 0, 0, .35); color: #fff; font-size: 15px; outline: none; transition: border .15s, box-shadow .15s; user-select: text; }
input:focus, select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 255, .15); }
select option, select optgroup { background: #0d1120; }
label.check { display: flex; align-items: center; gap: 10px; color: var(--text); cursor: pointer; }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--cyan); }
.form-msg { min-height: 20px; margin: 10px 0 0; font-size: 14px; color: var(--red); text-align: center; }
.form-msg.ok { color: var(--green); }

/* ---------- 로그인 ---------- */
#scr-login .login-brand { position: absolute; left: 6vw; bottom: 12vh; pointer-events: none; }
.tagline { margin: 18px 0 0 6px; color: #b8c4e6; letter-spacing: .32em; font-size: 13px; font-weight: 700; }
.login-card { position: absolute; right: 7vw; top: 50%; transform: translateY(-50%); width: 380px; padding: 26px 28px 22px; }
.login-card .auth-tabs { margin-bottom: 22px; }
.login-card form { animation: fadeIn .25s; }
.login-card::before { content: ""; position: absolute; inset: -1px; border-radius: 18px; padding: 1px; pointer-events: none;
  background: linear-gradient(140deg, rgba(34, 211, 255, .6), transparent 40%, transparent 60%, rgba(255, 46, 136, .6));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }

/* ---------- 상단 바 ---------- */
#topbar { position: absolute; top: 0; left: 0; right: 0; height: 68px; display: flex; align-items: center; gap: 24px; padding: 0 24px;
  background: linear-gradient(180deg, rgba(4, 5, 12, .9), rgba(4, 5, 12, 0)); z-index: 10; }
#topbar[hidden] { display: none; }
.tb-brand { margin-right: auto; }
.tb-player { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 900; font-size: 18px;
  background: linear-gradient(135deg, var(--cyan), var(--pink)); color: #050610; }
.tb-sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.owner-badge { padding: 4px 10px; border-radius: 6px; background: linear-gradient(100deg, #ffd65c, #ff9f1c); color: #2a1800; font-weight: 900; font-size: 12px; font-style: italic; letter-spacing: .08em; box-shadow: 0 0 18px rgba(255, 197, 49, .45); }
.tb-cur { display: flex; gap: 10px; }
.cur { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); font-weight: 800; }
.cur i { font-style: normal; font-size: 11px; font-weight: 900; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.cur.credits i { background: linear-gradient(135deg, #ffe27a, #ffad1f); color: #3a2200; }
.cur.tokens i { background: linear-gradient(135deg, #7ff3ff, #2f7dff); color: #001a33; }
.cur b.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.25); color: var(--gold); } }
.tb-actions { display: flex; gap: 8px; }

/* ---------- 메인 메뉴 ---------- */
.menu-tiles { position: absolute; left: 5vw; top: 50%; transform: translateY(-50%); display: grid; grid-template-columns: 320px 260px; gap: 16px; }
.tile { position: relative; text-align: left; border: 1px solid var(--line); border-radius: 18px; padding: 22px 22px 20px; min-height: 140px; cursor: pointer; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, rgba(20, 28, 54, .85), rgba(10, 12, 24, .8)); backdrop-filter: blur(12px); transition: transform .2s, box-shadow .2s, border-color .2s; }
.tile::after { content: ""; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(34, 211, 255, .25), transparent 70%); transition: .3s; }
.tile:hover { transform: translateY(-4px) skewX(-2deg); border-color: rgba(34, 211, 255, .6); box-shadow: 0 16px 50px rgba(34, 211, 255, .2); }
.tile:hover::after { transform: scale(1.4); }
.tile.big { grid-row: span 2; min-height: 296px; background: linear-gradient(150deg, rgba(255, 46, 136, .35), rgba(20, 20, 50, .85) 60%); }
.tile.big::after { background: radial-gradient(circle, rgba(255, 46, 136, .35), transparent 70%); width: 260px; height: 260px; }
.tile.owner { background: linear-gradient(150deg, rgba(255, 197, 49, .3), rgba(20, 20, 40, .85) 65%); grid-column: span 2; min-height: 110px; }
.tile em { display: block; font-style: italic; font-weight: 900; font-size: 13px; letter-spacing: .25em; color: var(--cyan); }
.tile.big em { color: #ff9ac4; }
.tile.owner em { color: var(--gold); }
.tile strong { display: block; font-size: 30px; font-weight: 900; margin: 8px 0 6px; font-style: italic; }
.tile.big strong { font-size: 44px; margin-top: 150px; }
.tile small { color: #aab4d4; font-size: 13px; }
.menu-car { position: absolute; right: 4vw; bottom: 6vh; padding: 18px 24px; min-width: 340px; }
.menu-car .mc-top { display: flex; align-items: center; gap: 12px; }
.menu-car h3 { margin: 0; font-size: 24px; font-style: italic; }
.menu-car .brand { color: var(--muted); font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.menu-car .rank { margin-left: auto; text-align: right; font-weight: 900; font-size: 26px; font-style: italic; color: var(--gold); }
.menu-car .rank small { display: block; font-size: 11px; color: var(--muted); letter-spacing: .2em; }
.menu-stats { position: absolute; right: 4vw; top: 92px; display: flex; gap: 10px; }
.menu-stats div { padding: 10px 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); text-align: center; backdrop-filter: blur(10px); }
.menu-stats b { display: block; font-size: 20px; font-style: italic; }
.menu-stats small { color: var(--muted); font-size: 11px; letter-spacing: .1em; }

/* ---------- 차고 ---------- */
.garage-left { position: absolute; left: 24px; top: 140px; bottom: 24px; width: 360px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.car-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.car-list::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .logs::-webkit-scrollbar, .event-grid::-webkit-scrollbar { width: 6px; }
.car-list::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .logs::-webkit-scrollbar-thumb, .event-grid::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 6px; }
.car-card { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px 12px 18px; border-radius: 12px; cursor: pointer; border: 1px solid transparent;
  background: rgba(255, 255, 255, .04); transition: .15s; overflow: hidden; }
.car-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--paint, #888); }
.car-card:hover { background: rgba(255, 255, 255, .09); }
.car-card.sel { border-color: var(--cyan); background: rgba(34, 211, 255, .1); }
.car-card .cc-name { flex: 1; min-width: 0; }
.car-card .cc-name b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.car-card .cc-name small { color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.car-card .cc-side { text-align: right; font-size: 12px; font-weight: 800; }
.car-card .cc-side .rk { color: var(--gold); font-style: italic; font-size: 14px; }
.car-card .owned { color: var(--green); }
.car-card .locked { color: var(--muted); }
.car-card .using { color: var(--cyan); }
.garage-right { position: absolute; right: 24px; top: 140px; bottom: 24px; width: 380px; padding: 22px; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.cd-head { display: flex; gap: 12px; align-items: center; }
.cd-head h2 { margin: 0; font-size: 26px; font-style: italic; line-height: 1.05; }
.cd-head .brand { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.cd-rank { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-radius: 12px; background: rgba(255, 197, 49, .08); border: 1px solid rgba(255, 197, 49, .25); }
.cd-rank b { font-size: 30px; font-style: italic; color: var(--gold); }
.cd-rank small { color: var(--muted); letter-spacing: .2em; font-weight: 800; }
.stat { display: grid; grid-template-columns: 70px 1fr 64px; align-items: center; gap: 10px; font-size: 13px; font-weight: 700; }
.stat .bar { height: 8px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; position: relative; }
.stat .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: linear-gradient(90deg, var(--cyan), #6f7dff); transition: width .4s; }
.stat .bar i.up { background: linear-gradient(90deg, rgba(255, 197, 49, .9), var(--gold)); }
.stat span { text-align: right; color: var(--muted); }
.lv { display: flex; gap: 4px; }
.lv i { flex: 1; height: 10px; border-radius: 3px; background: rgba(255, 255, 255, .08); transform: skewX(-20deg); }
.lv i.on { background: linear-gradient(90deg, var(--gold), #ff9f1c); box-shadow: 0 0 8px rgba(255, 197, 49, .5); }
.section-t { font-size: 12px; color: var(--muted); font-weight: 800; letter-spacing: .18em; margin-top: 4px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .15); cursor: pointer; transition: .15s; }
.swatches button:hover { transform: scale(1.12); }
.swatches button.on { border-color: #fff; box-shadow: 0 0 0 3px rgba(34, 211, 255, .6); }
.cd-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.price { font-size: 22px; font-weight: 900; font-style: italic; }
.price.credits { color: var(--gold); } .price.tokens { color: var(--cyan); }

/* ---------- 이벤트 ---------- */
.page-head { position: absolute; top: 80px; left: 0; right: 0; text-align: center; pointer-events: none; }
.page-head h1 { margin: 0; font-size: 44px; font-style: italic; font-weight: 900; letter-spacing: .05em;
  background: linear-gradient(100deg, #fff, var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
#event-tabs { position: absolute; top: 170px; left: 50%; transform: translateX(-50%); }
.event-grid { position: absolute; top: 230px; left: 0; right: 0; bottom: 24px; padding: 0 6vw; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; align-content: start; overflow-y: auto; }
.event-grid.tracks { top: 190px; grid-template-columns: repeat(3, minmax(260px, 380px)); justify-content: center; }
.ev-card { position: relative; border-radius: 18px; overflow: hidden; cursor: pointer; border: 1px solid var(--line); min-height: 220px; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px;
  transition: transform .2s, box-shadow .2s, border-color .2s; }
.ev-card:hover { transform: translateY(-5px); box-shadow: 0 18px 50px rgba(0, 0, 0, .5); border-color: rgba(255, 255, 255, .35); }
.ev-card .bgart { position: absolute; inset: 0; z-index: -1; }
.ev-card.neon .bgart { background: linear-gradient(180deg, rgba(5, 3, 15, 0) 30%, rgba(5, 3, 15, .95)), radial-gradient(circle at 70% 30%, #ff2bd6 0, transparent 35%), radial-gradient(circle at 25% 40%, #19e3ff 0, transparent 30%), linear-gradient(160deg, #2a0f4d, #0b0520); }
.ev-card.desert .bgart { background: linear-gradient(180deg, rgba(20, 8, 0, 0) 35%, rgba(20, 8, 0, .95)), radial-gradient(circle at 70% 55%, #ffd36b 0, #ff8a3d 12%, transparent 30%), linear-gradient(180deg, #2b3a7c, #ff9d5c 60%, #b0582c); }
.ev-card.alpine .bgart { background: linear-gradient(180deg, rgba(0, 10, 30, 0) 35%, rgba(0, 10, 30, .95)), linear-gradient(160deg, transparent 50%, #e9f3ff 50.5%, #a9c3df 70%), linear-gradient(200deg, transparent 55%, #ffffff 55.5%, #b8cce2 75%), linear-gradient(180deg, #2a6ad4, #cfe6ff); }
.ev-card .ev-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: center; }
.ev-card h3 { margin: 0 0 4px; font-size: 24px; font-style: italic; }
.ev-card .ev-meta { color: #c7d0ea; font-size: 13px; display: flex; gap: 12px; flex-wrap: wrap; }
.ev-card .ev-reward { margin-top: 10px; display: flex; gap: 10px; font-weight: 800; font-size: 14px; }
.ev-card .ev-reward .c { color: var(--gold); } .ev-card .ev-reward .t { color: var(--cyan); }
.ev-card .cleared { padding: 4px 10px; border-radius: 6px; font-size: 12px; font-weight: 900; background: rgba(63, 224, 138, .2); color: var(--green); }
.ev-card.locked { filter: grayscale(.7) brightness(.7); }
.ev-card.locked::after { content: "🔒 참가 가능한 차량 없음"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 800; background: rgba(0, 0, 0, .6); padding: 8px 14px; border-radius: 8px; }

/* ---------- 오너 ---------- */
.owner-wrap { position: absolute; top: 190px; left: 4vw; right: 4vw; bottom: 24px; display: grid; grid-template-columns: 1fr 400px; gap: 18px; }
.owner-users { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.owner-search { display: flex; gap: 10px; align-items: center; }
.owner-search input { margin: 0; }
.table-wrap { overflow: auto; min-height: 0; }
.utable { width: 100%; border-collapse: collapse; font-size: 14px; }
.utable th { position: sticky; top: 0; background: #0e1224; text-align: left; padding: 10px; color: var(--muted); font-size: 12px; letter-spacing: .1em; }
.utable td { padding: 11px 10px; border-top: 1px solid var(--line); }
.utable tr { cursor: pointer; transition: background .12s; }
.utable tbody tr:hover { background: rgba(255, 255, 255, .05); }
.utable tr.sel { background: rgba(255, 197, 49, .12); }
.utable td.num { font-variant-numeric: tabular-nums; }
.owner-grant { padding: 20px; overflow-y: auto; }
.owner-grant h2 { margin: 0 0 12px; font-style: italic; }
.owner-grant h3 { margin: 22px 0 8px; font-size: 14px; color: var(--muted); letter-spacing: .1em; }
.target-box { padding: 14px; border-radius: 12px; background: rgba(255, 197, 49, .08); border: 1px dashed rgba(255, 197, 49, .4); margin-bottom: 16px; font-weight: 700; }
.target-box b { color: var(--gold); font-size: 18px; }
.quick-btns { display: flex; gap: 6px; margin: -6px 0 14px; }
.quick-btns button { flex: 1; padding: 7px 0; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: #fff; font-weight: 800; cursor: pointer; font-size: 12px; }
.quick-btns button:hover { background: rgba(255, 255, 255, .12); }
.quick-btns button.reset { color: var(--muted); }
.hint { font-size: 12px; color: #6a7494; margin: 0 0 12px; }
.logs { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; font-size: 12px; }
.logs div { padding: 8px 10px; border-radius: 8px; background: rgba(255, 255, 255, .04); color: #b8c2e0; }
.logs b { color: #fff; }

/* ---------- HUD ---------- */
.hud { font-style: italic; }
.hud * { pointer-events: none; }
.hud-pos { position: absolute; top: 22px; left: 30px; text-shadow: 0 4px 20px rgba(0, 0, 0, .6); }
.hud-pos small { font-size: 12px; letter-spacing: .3em; color: #cfe; font-weight: 800; }
.hud-pos b { font-size: 84px; font-weight: 900; line-height: .9; }
.hud-pos span { font-size: 30px; font-weight: 800; color: #c8d2f0; margin-left: 4px; }
.hud-lap { font-size: 22px; font-weight: 900; color: var(--gold); margin-top: 4px; }
.hud-time { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-size: 36px; font-weight: 900; font-variant-numeric: tabular-nums; text-shadow: 0 4px 20px rgba(0, 0, 0, .6);
  padding: 4px 22px; background: rgba(0, 0, 0, .35); border-radius: 10px; transform: translateX(-50%) skewX(-10deg); }
.hud-right { position: absolute; top: 18px; right: 22px; display: flex; gap: 14px; align-items: flex-start; }
#h-minimap { width: 170px; height: 170px; border-radius: 50%; background: rgba(0, 0, 0, .45); border: 2px solid rgba(255, 255, 255, .12); }
.hud-stand { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-width: 150px; }
.hud-stand li { display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 8px; border-radius: 6px; background: rgba(0, 0, 0, .45); font-weight: 800; font-size: 14px; transform: skewX(-10deg); }
.hud-stand li i { width: 4px; height: 16px; border-radius: 2px; }
.hud-stand li.me { background: linear-gradient(90deg, rgba(34, 211, 255, .55), rgba(34, 211, 255, .15)); }
.hud-stand li .n { min-width: 16px; color: var(--muted); }
.hud-stand li.me .n { color: #fff; }
.hud-speed { position: absolute; right: 26px; bottom: 22px; width: 300px; height: 300px; }
#h-gauge { position: absolute; inset: 0; width: 300px; height: 300px; }
.spd { position: absolute; left: 0; right: 0; top: 104px; text-align: center; }
.spd b { display: block; font-size: 76px; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(34, 211, 255, .5); }
.spd small { letter-spacing: .3em; color: var(--muted); font-weight: 800; font-size: 13px; }
.nitro-bar { position: absolute; left: 30px; right: 30px; bottom: 34px; height: 18px; border-radius: 4px; background: rgba(0, 0, 0, .55); transform: skewX(-20deg); overflow: hidden; border: 1px solid rgba(255, 255, 255, .15); }
.nitro-bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #1b5cff, var(--cyan)); box-shadow: 0 0 20px var(--cyan); }
.nitro-bar.on .fill { background: linear-gradient(90deg, #7fe8ff, #fff); animation: flick .12s infinite; }
.nitro-bar.full .fill { background: linear-gradient(90deg, var(--pink), #ffb3e6); box-shadow: 0 0 20px var(--pink); }
@keyframes flick { 50% { opacity: .75; } }
.nitro-bar i { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0, 0, 0, .6); z-index: 2; }
.nitro-bar i:nth-child(1) { left: 33.3%; } .nitro-bar i:nth-child(2) { left: 66.6%; } .nitro-bar i:nth-child(3) { display: none; }
.nitro-bar span { position: absolute; right: 8px; top: 0; font-size: 11px; line-height: 18px; font-weight: 900; letter-spacing: .2em; z-index: 3; color: rgba(255, 255, 255, .85); }
.shock-ready { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; font-weight: 900; color: var(--pink); letter-spacing: .1em; opacity: 0; transition: .2s; text-shadow: 0 0 12px var(--pink); }
.shock-ready.show { opacity: 1; animation: flick .6s infinite; }
.hud-count { position: absolute; top: 34%; left: 0; right: 0; text-align: center; font-size: 180px; font-weight: 900; color: #fff; text-shadow: 0 0 40px rgba(34, 211, 255, .8); }
.hud-count.pop { animation: countPop .9s ease-out; }
@keyframes countPop { 0% { transform: scale(2.2); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { transform: scale(.85); opacity: 0; } }
.hud-notify { position: absolute; top: 20%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.note { font-size: 40px; font-weight: 900; letter-spacing: .04em; padding: 4px 26px; transform: skewX(-12deg); animation: notePop 1.6s ease-out forwards;
  text-shadow: 0 0 24px currentColor; color: #fff; }
.note.takedown { color: #ff9b3d; font-size: 52px; }
.note.good { color: #ffe066; font-size: 32px; }
.note.nitro { color: #6fd8ff; font-size: 30px; }
.note.bad { color: #ff5468; font-size: 56px; }
.note.shock { color: #ff4fd8; font-size: 56px; }
.note.stunt { color: #8dff7a; font-size: 46px; }
.note.lap { color: #9fd8ff; font-size: 44px; }
.note.go { color: #7dff9a; font-size: 120px; }
.note.finish { color: var(--gold); font-size: 90px; }
@keyframes notePop { 0% { transform: skewX(-12deg) scale(1.8); opacity: 0; } 12% { transform: skewX(-12deg) scale(1); opacity: 1; } 75% { opacity: 1; } 100% { transform: skewX(-12deg) translateY(-30px); opacity: 0; } }
.hud-drift { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%) skewX(-12deg); font-size: 30px; font-weight: 900; color: #ffd36b; text-shadow: 0 0 18px #ff9f1c; opacity: 0; transition: opacity .15s; }
.hud-drift.show { opacity: 1; }
.hud-help { position: absolute; left: 30px; bottom: 24px; font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .7); font-style: normal; padding: 8px 14px; border-radius: 8px; background: rgba(0, 0, 0, .4); transition: opacity 1s; }

/* ---------- 결과 ---------- */
.results { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, 92vw); padding: 30px 34px; text-align: center; }
.res-place { font-size: 120px; font-weight: 900; font-style: italic; line-height: 1; background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 6px 30px rgba(255, 197, 49, .4)); }
.res-place.lose { background: linear-gradient(180deg, #fff, #8ea0c8); -webkit-background-clip: text; background-clip: text; }
.res-sub { font-size: 22px; font-weight: 900; font-style: italic; letter-spacing: .2em; margin-bottom: 20px; }
.res-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.res-grid div { padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, .05); }
.res-grid b { display: block; font-size: 22px; font-style: italic; }
.res-grid small { color: var(--muted); font-size: 12px; font-weight: 700; }
.res-rewards { text-align: left; border-top: 1px solid var(--line); padding-top: 14px; margin-bottom: 20px; }
.res-rewards div { display: flex; justify-content: space-between; padding: 6px 4px; font-weight: 700; }
.res-rewards .total { font-size: 20px; color: var(--gold); border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; }
.res-btns { display: flex; gap: 12px; justify-content: center; }

/* ---------- 모달 / 토스트 ---------- */
.modal { width: min(560px, 92vw); max-height: 82vh; overflow-y: auto; padding: 26px; }
.modal h2 { margin: 0 0 16px; font-style: italic; }
.modal .pick { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.modal .row { display: flex; gap: 10px; justify-content: flex-end; }
.seg { display: flex; gap: 6px; margin: 6px 0 18px; }
.seg button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: #fff; font-weight: 800; cursor: pointer; }
.seg button.on { background: rgba(34, 211, 255, .2); border-color: var(--cyan); }
input[type=range] { padding: 0; accent-color: var(--cyan); }
.keys { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; color: #c8d0ea; }
.keys kbd { display: inline-block; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); font-family: inherit; font-weight: 800; font-size: 12px; color: #fff; }
#toasts { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 60; pointer-events: none; }
.toast { padding: 12px 20px; border-radius: 12px; background: rgba(12, 16, 30, .92); border: 1px solid var(--line); font-weight: 700; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); animation: toast 3s forwards; }
.toast.ok { border-color: rgba(63, 224, 138, .5); }
.toast.err { border-color: rgba(255, 75, 92, .6); color: #ffd0d5; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-10px); } 10%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }

/* ---------- 인증 코드 / 랭킹 / 공지 ---------- */
.verify-info { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.verify-info b { color: var(--cyan); }
#form-verify input[name=code] { text-align: center; letter-spacing: .4em; font-size: 22px; font-weight: 800; }
.verify-row { display: flex; justify-content: space-between; margin-top: 12px; }
.linklike { background: none; border: 0; color: var(--muted); cursor: pointer; font-weight: 700; font-size: 13px; }
.linklike:hover { color: #fff; }
.rank-wrap { position: absolute; top: 230px; left: 50%; transform: translateX(-50%); width: min(560px, 92vw); max-height: 60vh; overflow-y: auto; padding: 18px; }
.rank-wrap select { margin-bottom: 14px; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-list li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .04); font-weight: 700; }
.rank-list li.me { background: linear-gradient(90deg, rgba(34, 211, 255, .25), rgba(34, 211, 255, .06)); }
.rank-list .rk { width: 30px; font-family: var(--disp); font-style: italic; font-weight: 900; color: var(--gold); }
.rank-list li:nth-child(1) .rk { color: #ffd700; } .rank-list li:nth-child(2) .rk { color: #cdd6e4; } .rank-list li:nth-child(3) .rk { color: #e0955a; }
.rank-list .nm { flex: 1; }
.rank-list .tm { font-variant-numeric: tabular-nums; color: #dfe6fb; }
.rank-empty { color: var(--muted); text-align: center; padding: 20px; }
.owner-grant textarea { width: 100%; margin-top: 6px; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .1); background: rgba(0, 0, 0, .35); color: #fff; font-size: 14px; font-family: inherit; resize: vertical; }

@media (max-width: 1100px) {
  .menu-tiles { grid-template-columns: 260px 220px; }
  .garage-left { width: 300px; } .garage-right { width: 320px; }
  .owner-wrap { grid-template-columns: 1fr; overflow-y: auto; }
}
