:root { --g: #8dff9f; --gd: #2c6b3a; --bg: #020a05; --red: #ff6a55; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--g); overflow: hidden; overscroll-behavior: none;
  font-family: ui-monospace, Menlo, Consolas, "Courier New", monospace; touch-action: none; -webkit-user-select: none; user-select: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; display: block; }
.hidden { display: none !important; }
button { font: inherit; color: var(--g); background: rgba(5, 30, 12, 0.85); border: 1px solid var(--g); border-radius: 6px;
  padding: 11px 18px; letter-spacing: 0.08em; cursor: pointer; touch-action: manipulation; min-height: 44px; }
button:hover { background: rgba(20, 70, 30, 0.9); }
button:active { background: var(--g); color: #021; }
button.ghost { border-color: var(--gd); color: #6fcf85; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: radial-gradient(ellipse at center, rgba(2, 14, 6, 0.78), rgba(1, 6, 3, 0.97)); overflow-y: auto; touch-action: pan-y; z-index: 20; }
.card { max-width: 640px; width: 100%; margin: auto; padding: 18px 20px; border: 1px solid var(--gd); border-radius: 10px; background: rgba(2, 16, 7, 0.82); }
h1 { margin: 0 0 6px; font-size: clamp(28px, 7vw, 46px); letter-spacing: 0.18em; text-shadow: 0 0 14px rgba(141, 255, 159, 0.5); }
h2 { margin: 4px 0 8px; letter-spacing: 0.12em; }
p { line-height: 1.45; margin: 8px 0; }
.tag { font-size: clamp(14px, 3.6vw, 17px); color: #c8ffd2; }
.small { font-size: 12.5px; color: #6fcf85; line-height: 1.5; }
ul { padding-left: 18px; margin: 8px 0; font-size: 13.5px; line-height: 1.5; color: #bff5c8; }
li { margin-bottom: 7px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.chk { font-size: 13px; color: #6fcf85; display: flex; gap: 6px; align-items: center; min-height: 44px; }
#nights { display: grid; gap: 8px; margin: 14px 0 4px; }
.night { display: flex; justify-content: space-between; align-items: center; text-align: left; gap: 10px; width: 100%; }
.night b { display: block; font-size: 15px; }
.night span.s { font-size: 12px; color: #6fcf85; letter-spacing: 0; }
.night .gr { font-size: 22px; min-width: 30px; text-align: right; color: #d6ffdc; }
#rGrade { font-size: 64px; font-weight: 700; line-height: 1; margin: 6px 0; text-shadow: 0 0 18px rgba(141, 255, 159, 0.6); }
#rGrade.bad { color: var(--red); text-shadow: 0 0 18px rgba(255, 106, 85, 0.5); }
#rStats { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; font-size: 14px; }
#rStats div span { color: #6fcf85; }
#topbtns { position: fixed; top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); display: flex; gap: 6px; z-index: 10; }
#topbtns button { padding: 6px 10px; min-height: 36px; font-size: 12px; opacity: 0.8; }
#topbtns button.off { opacity: 0.4; text-decoration: line-through; }
#touch { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#stickRing { position: absolute; width: 120px; height: 120px; margin: -60px 0 0 -60px; border: 2px solid rgba(141, 255, 159, 0.35); border-radius: 50%; display: none; }
#stickKnob { position: absolute; left: 36px; top: 36px; width: 48px; height: 48px; border-radius: 50%; background: rgba(141, 255, 159, 0.35); border: 2px solid var(--g); }
.tbtn { position: absolute; pointer-events: auto; border-radius: 50%; width: 92px; height: 92px; font-size: 14px; background: rgba(40, 8, 4, 0.55); border-color: var(--red); color: #ffb3a3; opacity: 0.9; padding: 0; }
#fireBtn { right: max(60px, calc(env(safe-area-inset-right) + 54px)); bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); }
#fireBtn.on { background: var(--red); color: #200; }
#brakeBtn { right: max(160px, calc(env(safe-area-inset-right) + 150px)); bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); width: 66px; height: 66px; font-size: 11px; background: rgba(5, 30, 12, 0.6); border-color: var(--g); color: var(--g); }
#brakeBtn.on { background: var(--g); color: #021; }
#thrWrap { position: absolute; right: max(10px, env(safe-area-inset-right)); bottom: max(18px, calc(env(safe-area-inset-bottom) + 10px)); width: 38px; height: min(46vh, 280px); border: 1px solid var(--g); border-radius: 8px; background: rgba(5, 30, 12, 0.5); pointer-events: auto; overflow: hidden; }
#thrFill { position: absolute; left: 0; right: 0; bottom: 0; height: 60%; background: rgba(141, 255, 159, 0.35); }
#thrLabel { position: absolute; top: 4px; width: 100%; text-align: center; font-size: 10px; }
@media (orientation: portrait) {
  #fireBtn { right: 62px; bottom: calc(env(safe-area-inset-bottom) + 16px); }
  #brakeBtn { right: 168px; bottom: calc(env(safe-area-inset-bottom) + 16px); }
}
.noTouch #touch { display: none; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
