/* mods/trassa/public/style.css — Trassa: 3D sahna ustida sokin, jiddiy panel; telefon birinchi (≥ 44 px tugmalar, safe-area), landshaft va kompyuter ham */
:root { --acc: #19d3c5; --hot: #ff6a2b; --glass: rgba(10, 13, 20, .62); --glass2: rgba(10, 13, 20, .82); --sa-t: env(safe-area-inset-top); --sa-b: env(safe-area-inset-bottom); --sa-l: env(safe-area-inset-left); --sa-r: env(safe-area-inset-right); }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; background: #0b0d12; color: #eef0f5; }
body { position: fixed; inset: 0; touch-action: none; font-family: Nunito, "Nunito Fallback", var(--font); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#fade { position: fixed; inset: 0; background: #0b0d12; pointer-events: none; opacity: 1; transition: opacity .6s; z-index: 50; }
#fade.off { opacity: 0; }
button { cursor: pointer; }
.ib { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 13px; background: var(--glass); color: #e8ebf2; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); text-decoration: none; font-weight: 800; font-size: 13px; padding: 0; position: relative; }
.ib svg { width: 21px; height: 21px; }
.ib:hover { background: var(--glass2); }
.ib .badge { position: absolute; top: -3px; right: -3px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--acc); color: #04201e; font-size: 11px; line-height: 18px; padding: 0 4px; }

/* ---------- menyu */
#menu { position: fixed; inset: 0; display: flex; flex-direction: column; padding: calc(10px + var(--sa-t)) calc(12px + var(--sa-r)) calc(14px + var(--sa-b)) calc(12px + var(--sa-l)); z-index: 10; pointer-events: none; }
#menu > * { pointer-events: auto; }
body:not([data-mode="menu"]) #menu { display: none; }
.topbar { display: flex; gap: 8px; align-items: center; }
.topbar .sp { flex: 1; }
.hero { text-align: center; margin-top: 4vh; pointer-events: none !important; }
.logo { margin: 0; font-size: clamp(44px, 12vw, 84px); font-weight: 1000; letter-spacing: .08em; font-style: italic; line-height: 1; color: #fff; text-shadow: 0 4px 30px rgba(0,0,0,.45); }
.logo::after { content: ""; display: block; width: 2.2em; height: .09em; margin: .14em auto 0; background: linear-gradient(90deg, transparent, var(--hot), transparent); transform: skewX(-20deg); }
.tag { margin: 10px 0 0; font-size: 15px; color: #dfe4ee; text-shadow: 0 1px 10px rgba(0,0,0,.6); font-weight: 700; }
.sp2 { flex: 1; min-height: 8px; pointer-events: none !important; }
.panel { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.trackRow { display: flex; align-items: stretch; gap: 8px; }
.arr { width: 44px; flex: none; border: 0; border-radius: 13px; background: var(--glass); color: #fff; display: grid; place-items: center; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.arr svg { width: 20px; height: 20px; }
#trCard { flex: 1; min-width: 0; padding: 8px 12px; border-radius: 13px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 8px; }
#trCard b { font-size: 17px; font-weight: 900; }
#trCard small { grid-row: 2; color: #aab3c4; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#trBest { grid-row: 1 / 3; grid-column: 2; align-self: center; font-size: 12.5px; color: #cfd6e2; text-align: right; font-weight: 800; }
#trBest i { display: block; font-style: normal; font-size: 11px; color: #8d97a9; font-weight: 700; }
.bigBtn { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 64px; border: 0; border-radius: 18px; background: var(--hot); color: #fff; font-size: 24px; font-weight: 1000; letter-spacing: .02em; box-shadow: 0 10px 30px rgba(255, 106, 43, .32); transition: transform .08s; }
.bigBtn small { font-size: 12.5px; font-weight: 800; opacity: .9; letter-spacing: 0; }
.bigBtn:active { transform: scale(.98); }
.bigBtn:disabled { opacity: .5; box-shadow: none; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.seg button { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: #b6bfd0; font-weight: 800; font-size: 14px; }
.seg button[aria-selected="true"] { background: rgba(255,255,255,.14); color: #fff; }
#friends { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 15px; background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.fRow { display: flex; gap: 6px; }
.smallBtn { min-height: 44px; padding: 0 14px; border: 0; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.smallBtn svg { width: 18px; height: 18px; }
.smallBtn:hover { background: rgba(255,255,255,.18); }
#btnCreate { flex: 1; }
.joinBox { display: flex; gap: 6px; flex: 1.15; min-width: 0; margin: 0; }
.joinBox input { flex: 1; min-width: 0; height: 44px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.28); color: #fff; padding: 0 10px; font-size: 16px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.joinBox input::placeholder { letter-spacing: 0; font-weight: 700; color: #8d97a9; text-transform: none; font-size: 14px; }
.joinBox .smallBtn { padding: 0 12px; }
#rooms { display: flex; flex-direction: column; gap: 4px; }
#rooms:empty { display: none; }
.room { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px 0 10px; border-radius: 11px; background: rgba(255,255,255,.06); font-size: 13.5px; }
.room b { font-weight: 900; letter-spacing: .08em; }
.room span { flex: 1; color: #b9c2d2; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room .smallBtn { min-height: 36px; background: var(--acc); color: #04201e; }
.rooms-h { font-size: 11.5px; color: #8d97a9; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 2px 4px 0; }

/* ---------- HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hudTL { position: absolute; top: calc(10px + var(--sa-t)); left: calc(12px + var(--sa-l)); }
.pos { font-weight: 1000; font-style: italic; line-height: 1; text-shadow: 0 2px 12px rgba(0,0,0,.6); }
.pos b { font-size: 46px; } .pos span { font-size: 20px; color: #d6dbe5; }
.lap { margin-top: 4px; display: inline-block; padding: 4px 10px; border-radius: 10px; background: var(--glass); font-size: 13px; font-weight: 800; color: #cfd6e2; }
.lap b { color: #fff; }
#hList { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; font-weight: 800; }
#hList li { display: flex; align-items: center; gap: 6px; padding: 2px 8px 2px 6px; border-radius: 8px; background: rgba(10,13,20,.45); color: #d5dbe6; width: 150px; }
#hList li.me { background: rgba(255,106,43,.85); color: #fff; }
#hList li i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
#hList li em { font-style: normal; width: 14px; text-align: right; color: #9aa4b6; }
#hList li.me em { color: #fff; }
#hList li span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#hudTC { position: absolute; top: calc(12px + var(--sa-t)); left: 50%; transform: translateX(-50%); text-align: center; text-shadow: 0 2px 10px rgba(0,0,0,.6); }
#hudTC b { display: block; font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
#hudTC small { font-size: 12.5px; color: #d6dbe5; font-weight: 800; font-variant-numeric: tabular-nums; }
#hudTR { position: absolute; top: calc(10px + var(--sa-t)); right: calc(12px + var(--sa-r)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hb { pointer-events: auto; width: 44px; height: 44px; border: 0; border-radius: 13px; background: var(--glass); color: #fff; display: grid; place-items: center; }
.hb svg { width: 20px; height: 20px; }
#mini { width: 120px; height: 120px; border-radius: 14px; background: rgba(10,13,20,.35); }
#hudB { position: absolute; bottom: calc(14px + var(--sa-b)); left: 50%; transform: translateX(-50%); text-align: center; }
#spd { font-weight: 1000; font-style: italic; text-shadow: 0 2px 12px rgba(0,0,0,.6); line-height: 1; }
#spd b { font-size: 40px; font-variant-numeric: tabular-nums; } #spd small { font-size: 13px; margin-left: 4px; color: #d6dbe5; }
#nitroBar { width: 160px; height: 8px; margin: 6px auto 0; border-radius: 4px; background: rgba(10,13,20,.55); overflow: hidden; }
#nitroBar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #39b6ff, #7fe3ff); border-radius: 4px; }
#nitroBar.on i { background: linear-gradient(90deg, #ff9a3c, #ffe08a); }
#msg { position: absolute; top: 30%; left: 0; right: 0; text-align: center; text-shadow: 0 3px 18px rgba(0,0,0,.65); opacity: 0; transition: opacity .25s; }
#msg.on { opacity: 1; }
#msg b { display: block; font-size: clamp(40px, 11vw, 88px); font-weight: 1000; font-style: italic; letter-spacing: .02em; }
#msg small { display: block; font-size: 17px; font-weight: 800; color: #f1f3f7; }
#msg.warn b { color: #ffcf5a; font-size: clamp(26px, 6vw, 44px); }
#keys { position: absolute; bottom: calc(90px + var(--sa-b)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 92vw; transition: opacity .5s; }
#keys span { padding: 6px 10px; border-radius: 10px; background: var(--glass2); font-size: 13px; font-weight: 800; color: #dfe4ee; white-space: nowrap; }
#keys kbd { display: inline-block; min-width: 22px; padding: 1px 6px; margin-right: 4px; border-radius: 6px; background: rgba(255,255,255,.16); font: inherit; font-size: 12px; text-align: center; }
#keys.off { opacity: 0; }
#net { position: absolute; top: calc(70px + var(--sa-t)); left: 50%; transform: translateX(-50%); padding: 6px 12px; border-radius: 10px; background: rgba(200,60,60,.85); font-size: 13px; font-weight: 800; }

/* ---------- sensor boshqaruv */
#touch { position: fixed; left: 0; right: 0; bottom: 0; height: 46%; z-index: 6; pointer-events: none; }
#steer { position: absolute; left: calc(8px + var(--sa-l)); bottom: calc(10px + var(--sa-b)); width: min(46vw, 250px); height: min(34vh, 150px); display: flex; gap: 8px; pointer-events: auto; touch-action: none; }
.half { flex: 1; border-radius: 20px; background: rgba(10,13,20,.38); border: 1px solid rgba(255,255,255,.12); display: grid; place-items: center; transition: background .08s; }
.half::before { content: ""; width: 0; height: 0; border-top: 15px solid transparent; border-bottom: 15px solid transparent; }
.half.l::before { border-right: 22px solid rgba(255,255,255,.85); margin-right: 4px; }
.half.r::before { border-left: 22px solid rgba(255,255,255,.85); margin-left: 4px; }
.half.on { background: rgba(255,255,255,.22); }
#acts { position: absolute; right: calc(8px + var(--sa-r)); bottom: calc(10px + var(--sa-b)); width: min(46vw, 230px); height: min(34vh, 150px); pointer-events: none; }
.tb { position: absolute; border: 1px solid rgba(255,255,255,.14); background: rgba(10,13,20,.42); color: #fff; font-weight: 900; pointer-events: auto; touch-action: none; display: grid; place-items: center; padding: 0; }
.tb .lbl { position: relative; z-index: 1; font-size: 13px; letter-spacing: .02em; }
.tb.on { background: rgba(255,255,255,.24); }
.tb.drift { right: 0; bottom: 0; width: 46%; height: 62%; border-radius: 20px; }
.tb.brake { left: 0; bottom: 0; width: 46%; height: 40%; border-radius: 16px; }
.tb.brake .lbl { font-size: 12px; color: #d9dfe9; }
.tb.nitro { left: 6%; top: 0; width: 64px; height: 64px; border-radius: 50%; }
.tb.nitro .ring { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); transform: rotate(-90deg); }
.tb.nitro .ring circle { fill: none; stroke-width: 4; }
.tb.nitro .ring .bg { stroke: rgba(255,255,255,.14); }
.tb.nitro .ring .fg { stroke: #6fd3ff; stroke-dasharray: 132; stroke-dashoffset: 132; stroke-linecap: round; transition: stroke-dashoffset .15s; }
.tb.nitro.ready { border-color: #6fd3ff; box-shadow: 0 0 18px rgba(111,211,255,.35); }
.tip { position: absolute; padding: 5px 9px; border-radius: 9px; background: var(--hot); color: #fff; font-size: 12.5px; font-weight: 900; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .4s; }
#touch.teach .tip { opacity: 1; }
#tipSteer { left: 50%; top: -34px; transform: translateX(-50%); }
#tipDrift { right: 0; top: -2px; transform: translateY(-110%); }
#tipNitro { left: 0; top: -34px; }
@media (orientation: portrait) {
  #steer, #acts { height: min(22vh, 150px); }
  #touch { height: 34%; }
  #hList { display: none; }
  #mini { width: 96px; height: 96px; }
  #hudB { bottom: calc(min(22vh, 150px) + 24px + var(--sa-b)); }
  #spd b { font-size: 32px; }
  .tb.nitro { width: 58px; height: 58px; top: -12px; }
}
body.touch #nitroBar { display: none; }
body:not(.touch) #touch { display: none !important; }

/* ---------- xona, natija (kartalar) */
#lobby, #end { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: calc(12px + var(--sa-t)) calc(12px + var(--sa-r)) calc(12px + var(--sa-b)) calc(12px + var(--sa-l)); background: rgba(5,7,12,.35); }
.card { width: 100%; max-width: 460px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y; padding: 16px; border-radius: 20px; background: rgba(13,16,24,.9); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 12px; }
.lobTop { display: flex; align-items: center; gap: 10px; }
.lobTop small { display: block; font-size: 11.5px; color: #8d97a9; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.lobTop b { font-size: 30px; font-weight: 1000; letter-spacing: .14em; }
.lobTop .sp { flex: 1; }
.lobTrack { display: flex; gap: 8px; align-items: stretch; }
.lobTrack > div { flex: 1; padding: 8px 12px; border-radius: 13px; background: rgba(255,255,255,.07); }
.lobTrack b { display: block; font-size: 16px; } .lobTrack small { color: #aab3c4; font-size: 12.5px; }
.lobTrack .arr { background: rgba(255,255,255,.1); }
.lobTrack .arr:disabled { opacity: .25; }
#lobPlayers { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#lobPlayers li { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 10px; border-radius: 11px; background: rgba(255,255,255,.07); font-weight: 800; font-size: 14px; min-width: 0; }
#lobPlayers li i { width: 12px; height: 12px; border-radius: 4px; flex: none; }
#lobPlayers li span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#lobPlayers li small { color: #8d97a9; font-size: 11px; }
#lobPlayers li.empty { color: #6f7889; font-weight: 700; justify-content: center; border: 1px dashed rgba(255,255,255,.1); background: transparent; }
.lobPub { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: #cfd6e2; min-height: 36px; }
.lobPub input { width: 20px; height: 20px; accent-color: var(--acc); }
#lobNote { margin: 0; text-align: center; font-size: 13px; color: #9aa4b6; min-height: 18px; }
.endHead { display: flex; align-items: center; gap: 14px; }
#endPlace { font-size: 54px; font-weight: 1000; font-style: italic; line-height: 1; color: var(--hot); min-width: 70px; text-align: center; }
.endHead b { display: block; font-size: 20px; font-weight: 900; }
.endHead small { color: #aab3c4; font-size: 13px; }
.endStats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.endStats div { padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.07); }
.endStats small { display: block; font-size: 11.5px; color: #8d97a9; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.endStats b { font-size: 18px; font-weight: 900; font-variant-numeric: tabular-nums; }
#endLaps { display: flex; gap: 6px; flex-wrap: wrap; font-size: 13px; color: #cfd6e2; font-weight: 700; font-variant-numeric: tabular-nums; }
#endLaps span { padding: 3px 8px; border-radius: 8px; background: rgba(255,255,255,.06); }
#endLaps span.best { background: rgba(25,211,197,.2); color: #8ff3ea; }
#endBoard .gu-table { width: 100%; font-size: 13.5px; }
#endBoard .tabs { display: flex; gap: 4px; margin-bottom: 6px; }
#endBoard .tabs button { flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: rgba(255,255,255,.07); color: #b6bfd0; font-weight: 800; font-size: 13px; }
#endBoard .tabs button[aria-selected="true"] { background: rgba(255,255,255,.16); color: #fff; }
#endBoard .note { font-size: 12.5px; color: #8d97a9; text-align: center; margin: 4px 0 0; }
.medal { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.m0 { background: #f2c230; } .m1 { background: #c9cfd8; } .m2 { background: #c98a52; }
.endBtns { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.row2 { display: flex; gap: 8px; } .row2 .smallBtn { flex: 1; }
@media (orientation: landscape) and (max-height: 520px) {
  .hero { margin-top: 0; }
  .logo { font-size: 44px; }
  .tag { display: none; }
  .panel { max-width: 400px; margin: 0 calc(8px + var(--sa-r)) 0 auto; gap: 8px; }
  .bigBtn { min-height: 54px; font-size: 21px; }
  #friends { padding: 6px; }
  #rooms .room:nth-child(n+3) { display: none; }
  .card { max-width: 640px; }
  #steer, #acts { height: min(42vh, 150px); }
}
@media (min-width: 900px) and (min-height: 600px) {
  .panel { margin-bottom: 2vh; }
  #mini { width: 150px; height: 150px; }
}
