@font-face { font-family: 'Russo One'; src: url(fonts/russo-one-cyrillic-400-normal.woff2) format('woff2'); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap }
@font-face { font-family: 'Russo One'; src: url(fonts/russo-one-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC; font-display: swap }
@font-face { font-family: 'Rubik'; src: url(fonts/rubik-cyrillic-wght-normal.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; font-display: swap }
@font-face { font-family: 'Rubik'; src: url(fonts/rubik-latin-wght-normal.woff2) format('woff2'); font-weight: 300 900; unicode-range: U+0000-00FF, U+2000-206F, U+20AC; font-display: swap }
@font-face { font-family: 'JB'; src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format('woff2'); font-weight: 100 800; unicode-range: U+0000-00FF; font-display: swap }
@font-face { font-family: 'JB'; src: url(fonts/jetbrains-mono-cyrillic-wght-normal.woff2) format('woff2'); font-weight: 100 800; unicode-range: U+0400-045F; font-display: swap }

:root {
  --asph: #14161d; --asph2: #1c1f28; --line: #ffd23a; --kakao: #fee500; --kbg: #b2c7d9; --paper: #f6f1e4; --ink: #22201c;
  --red: #d8342a; --mute: #8d93a3; --orange: #ff6a1a; --ok: #3ccf7a;
  --kor: 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent }
html { scroll-behavior: smooth }
body {
  margin: 0; background: var(--asph); color: #eef0f5; font: 16px/1.5 Rubik, system-ui, sans-serif;
  background-image:
    radial-gradient(ellipse 60% 40% at 15% 0%, rgba(255,170,60,.18), transparent 70%),
    radial-gradient(ellipse 50% 35% at 90% 10%, rgba(255,210,58,.08), transparent 70%),
    repeating-linear-gradient(90deg, transparent 0 calc(25% - 3px), rgba(255,210,58,.05) calc(25% - 3px) 25%);
  overflow-x: hidden;
}
.noise { position: fixed; inset: 0; pointer-events: none; opacity: .06; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E") }
b { font-weight: 600 }
.muted { color: var(--mute) }
h1, h2 { font-family: 'Russo One', Rubik, sans-serif; font-weight: 400; letter-spacing: .01em; margin: 0 }

/* Герой */
.hero > * { min-width: 0 }
.hero { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr; gap: 0; padding: max(18px, env(safe-area-inset-top)) 18px 0; max-width: 1180px; margin: 0 auto }
@media (min-width: 900px) { .hero { grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); align-items: center; padding-top: 40px } }
.tag { display: inline-block; font: 600 12px JB, monospace; color: var(--asph); background: var(--line); padding: 4px 9px; border-radius: 4px; transform: rotate(-1.5deg) }
h1 { font-size: clamp(40px, 12.4vw, 92px); line-height: .9; margin: 14px 0 10px; color: #fff; text-shadow: 0 6px 0 #000, 0 0 40px rgba(255,170,60,.25) }
h1 span { color: var(--line) }
.sub { font-size: 18px; color: #c9cdd8; margin: 0 0 10px }
.sub b { color: #fff }
.kor { font: 500 14px var(--kor); color: var(--mute); letter-spacing: .05em }
.stage { position: relative; height: min(118vw, 560px); margin: 0 -18px }
@media (min-width: 900px) { .stage { margin: 0; height: 560px } }
#car { width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: crosshair }
.stage-hint { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font: 500 12px JB, monospace; color: var(--mute); white-space: nowrap; pointer-events: none }
.gauge {
  position: absolute; right: 14px; bottom: 14px; width: 210px; background: linear-gradient(#ffcf33, #f2b400); color: #1b1a17;
  border-radius: 18px 18px 22px 22px; padding: 10px 10px 12px; box-shadow: 0 10px 0 #9c7400, 0 18px 30px rgba(0,0,0,.5); transform: rotate(2deg);
}
.gauge-top { display: flex; justify-content: space-between; font: 700 10px JB, monospace; letter-spacing: .04em; margin-bottom: 6px }
.gauge-screen { background: #a9c1a3; border-radius: 8px; padding: 6px 10px; display: flex; align-items: baseline; justify-content: flex-end; gap: 6px;
  box-shadow: inset 0 3px 0 rgba(0,0,0,.25); font-family: JB, monospace; color: #1f2b1d }
.gauge-screen b { font-size: 36px; font-weight: 700; line-height: 1 }
.gauge.ok .gauge-screen { background: #a9d9a8 } .gauge.warn .gauge-screen { background: #f1d98a } .gauge.bad .gauge-screen { background: #f2a49a }
.gauge-panel { font: 700 13px Rubik; margin: 8px 2px 2px }
.gauge-text { font-size: 13px; line-height: 1.3; min-height: 34px; margin: 0 2px }
.gauge-btn { margin-top: 8px; width: 100%; border: 0; border-radius: 10px; background: #1b1a17; color: var(--line); font: 600 12px Rubik; padding: 7px; cursor: pointer }
.gauge.pulse { animation: pulse .25s }
@keyframes pulse { 50% { transform: rotate(2deg) scale(1.05) } }
@media (max-width: 560px) { .gauge { width: 176px; right: 10px; bottom: 6px } .gauge-screen b { font-size: 28px } .gauge-text { font-size: 12px } }

/* Прогресс */
.bar { position: sticky; top: 0; z-index: 20; background: rgba(20,22,29,.86); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid #2a2e3a }
.bar-in { max-width: 820px; margin: 0 auto; padding: 10px 18px; display: flex; align-items: center; gap: 12px; font: 600 13px JB, monospace }
.prog { flex: 1; height: 10px; border-radius: 5px; background: #2a2e3a; overflow: hidden }
.prog i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(-45deg, var(--line) 0 10px, #e9b800 10px 20px); transition: width .4s }
.save { color: var(--mute); transition: color .3s } .save.ok { color: var(--ok) } .save.busy { color: var(--line) } .save.err { color: var(--red) }

main { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 0 16px 60px }
section { margin-top: 56px }
h2 { font-size: 30px; margin-bottom: 14px; display: flex; align-items: baseline; gap: 12px }
h2 em { font: 600 14px JB, monospace; color: var(--asph); background: var(--line); padding: 2px 7px; border-radius: 4px; font-style: normal }

.howto { position: relative; background: var(--asph2); border: 2px dashed #3a3f4e; border-radius: 18px; padding: 22px 20px 14px; margin-top: 30px }
.howto p { margin: 0 0 10px }
.sticker { position: absolute; top: -14px; left: 16px; background: var(--orange); color: #fff; font: 700 12px JB, monospace; padding: 4px 10px; border-radius: 6px; transform: rotate(-3deg); text-transform: uppercase }

/* Протокол осмотра */
.sheet { background: var(--paper); color: var(--ink); border-radius: 6px; padding: 18px 16px 8px; box-shadow: 0 2px 0 #d8d0bb, 0 20px 40px rgba(0,0,0,.4);
  transform: rotate(-.4deg); background-image: repeating-linear-gradient(transparent 0 31px, rgba(0,60,140,.07) 31px 32px) }
.sheet-head { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 4px }
.sheet-head b { font: 700 17px var(--kor); display: block } .sheet-head small { font: 500 12px JB, monospace; color: #6b655a }
.stamp { width: 62px; height: 62px; border: 3px solid var(--red); color: var(--red); border-radius: 50%; display: grid; place-items: center; font: 800 18px var(--kor);
  transform: rotate(-14deg); opacity: .85; flex: none }
.row { display: grid; grid-template-columns: 34px 1fr; gap: 4px 10px; padding: 10px 2px; border-bottom: 1px dashed #c9c0aa }
.row .n { font: 700 14px JB, monospace; color: #8a8270; padding-top: 2px }
.row .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #8a8270; font-weight: 600 }
.row textarea { grid-column: 2; width: 100%; border: 0; background: transparent; resize: none; font: 500 16px Rubik; color: var(--ink); padding: 0; outline: none; field-sizing: content; min-height: 1.5em }
.row textarea:focus { background: rgba(255,210,58,.25); border-radius: 4px }
.row .chk { color: var(--red); font-weight: 800 }

/* Дорога карьеры */
.road { position: relative; display: grid; gap: 14px; padding-left: 34px }
.road::before { content: ''; position: absolute; left: 12px; top: 6px; bottom: 6px; width: 8px; border-radius: 4px;
  background: repeating-linear-gradient(var(--line) 0 18px, transparent 18px 30px), #2a2e3a }
.step { position: relative; background: var(--asph2); border: 1px solid #2c3140; border-radius: 14px; padding: 14px 16px }
.step::before { content: attr(data-i); position: absolute; left: -36px; top: 12px; width: 32px; height: 32px; border-radius: 50%; background: var(--line); color: var(--asph);
  display: grid; place-items: center; font: 700 14px JB, monospace; box-shadow: 0 0 0 4px var(--asph) }
.step h3 { margin: 0 0 4px; font: 400 20px 'Russo One' } .step h3 small { font: 500 13px var(--kor); color: var(--mute); margin-left: 8px }
.step p { margin: 0; color: #c3c8d4; font-size: 15px }
.step.q { border-style: dashed; opacity: .7 }

/* Комнаты */
.rooms { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px; margin: 0 -16px 8px; padding-left: 16px; scrollbar-width: none; position: sticky; top: 41px; z-index: 10; background: var(--asph); padding-top: 8px }
.rooms::-webkit-scrollbar { display: none }
.room-btn { flex: none; border: 1px solid #333949; background: var(--asph2); color: #dfe3ec; border-radius: 999px; padding: 7px 12px; font: 500 14px Rubik; cursor: pointer; display: flex; gap: 6px; align-items: center }
.room-btn i { font-style: normal; background: var(--red); color: #fff; border-radius: 999px; font: 700 11px JB; padding: 1px 6px }
.room-btn i.z { background: var(--ok) }

/* Чат «как в Какао» */
.chat { background: var(--kbg); color: #111; border-radius: 22px; overflow: hidden; margin-bottom: 28px; box-shadow: 0 20px 40px rgba(0,0,0,.35); scroll-margin-top: 100px }
.chat-head { background: rgba(178,199,217,.92); padding: 12px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(0,0,0,.06) }
.chat-head b { font-size: 16px } .chat-head span { color: #55606d; font-size: 14px }
.chat-head .back { font-size: 22px; color: #333 }
.chat-body { padding: 10px 12px 16px }
.day { text-align: center; margin: 6px 0 12px } .day span { background: rgba(0,0,0,.12); color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 999px }
.msg { display: grid; grid-template-columns: 40px 1fr; gap: 0 8px; margin: 14px 0 6px }
.ava { width: 40px; height: 40px; border-radius: 15px; background: #ffd23a; display: grid; place-items: center; font-size: 22px; grid-row: span 2 }
.who { font-size: 13px; color: #3b4651; margin-bottom: 3px }
.bub-wrap { display: flex; align-items: flex-end; gap: 5px }
.bub { background: #fff; border-radius: 4px 16px 16px 16px; padding: 9px 12px; max-width: 520px; font-size: 15.5px; line-height: 1.4; box-shadow: 0 1px 0 rgba(0,0,0,.05) }
.bub .qn { font: 700 11px JB, monospace; color: #8a96a3; display: block; margin-bottom: 2px }
.unread { color: #e6b800; font: 700 11px JB; text-shadow: 0 0 1px rgba(0,0,0,.2) }
.time { font-size: 11px; color: #56616d; white-space: nowrap }
.reply { margin: 6px 0 0 48px }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px }
.chip { border: 1.5px solid rgba(0,0,0,.12); background: rgba(255,255,255,.55); color: #1a1d22; border-radius: 999px; padding: 6px 11px; font: 500 14px Rubik; cursor: pointer; transition: transform .1s }
.chip:active { transform: scale(.95) }
.chip.on { background: var(--kakao); border-color: #d9c300; font-weight: 600 }
.chip.x { text-decoration: line-through; opacity: .5 }
.input { display: flex; gap: 6px; align-items: flex-end; background: #fff; border-radius: 16px; padding: 6px 6px 6px 12px }
.input textarea { flex: 1; border: 0; outline: none; resize: none; font: 15.5px/1.4 Rubik; color: #111; background: transparent; padding: 5px 0; field-sizing: content; min-height: 1.4em; max-height: 50vh }
.clip { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; font-size: 18px; flex: none; background: #f1f3f5 }
.mine { display: flex; justify-content: flex-end; margin: 8px 0 0 }
.mine .bub { background: var(--kakao); border-radius: 16px 4px 16px 16px; white-space: pre-wrap; word-break: break-word }
.mine .read { font: 600 11px JB; color: #56616d; align-self: flex-end; margin-right: 5px }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap }
.thumbs:not(:empty) { margin-top: 6px }
.thumb { position: relative; width: 64px; height: 64px; border-radius: 10px; overflow: hidden; background: #ddd }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block }
.thumb button { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; line-height: 1; cursor: pointer }
.thumb.up::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.6) url() }

/* Блокнот */
.note-new { background: var(--paper); border-radius: 10px; padding: 12px; color: var(--ink) }
.note-new textarea { width: 100%; border: 0; background: transparent; font: 16px/1.45 Rubik; outline: none; resize: vertical; color: var(--ink) }
.note-act { display: flex; align-items: center; gap: 8px; margin-top: 6px }
.note-act .thumbs { flex: 1 }
.note { background: #fffbe0; color: var(--ink); border-radius: 4px; padding: 12px 14px 10px; margin-top: 12px; box-shadow: 0 8px 18px rgba(0,0,0,.3); position: relative; white-space: pre-wrap }
.note:nth-child(odd) { transform: rotate(.6deg) } .note:nth-child(even) { transform: rotate(-.5deg) }
.note small { display: block; color: #8a8270; font: 500 11px JB, monospace; margin-top: 6px }
.note .del { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: #a09784; cursor: pointer; font-size: 16px }

.btn { border: 0; border-radius: 12px; background: var(--line); color: var(--asph); font: 700 15px Rubik; padding: 10px 16px; cursor: pointer; box-shadow: 0 4px 0 #a88a00 }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #a88a00 }
.btn.big { font: 400 22px 'Russo One'; padding: 16px 26px; width: 100% }
.final p { color: #c9cdd8 }
.send-st { margin-top: 12px; font: 500 14px JB, monospace; color: var(--mute); text-align: center }

footer { text-align: center; color: #555b6b; font: 500 12px JB, monospace; padding: 30px 0 calc(30px + env(safe-area-inset-bottom)) }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translate(-50%, 120px); background: #fff; color: #111; padding: 10px 16px; border-radius: 12px;
  font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.4); transition: transform .3s; z-index: 50; max-width: 90vw }
.toast.on { transform: translate(-50%, 0) }
.ro .input, .ro .clip, .ro #note-add { opacity: .5; pointer-events: none }
.mine[hidden] { display: none }
@media (min-width: 900px) { h1 { font-size: 80px } }
.gdd-link { display: inline-block; margin-top: 14px; background: var(--kakao); color: #111; text-decoration: none; font: 700 15px Rubik; padding: 10px 14px; border-radius: 4px 16px 16px 16px; box-shadow: 0 4px 0 #a88a00 }
