:root {
  --bg: #15110c;
  --fg: #f2ece0;
  --dim: #9a9082;
  --amber: #22C55E;
  --wood: #16A34A;
  --ok: #57c84d;
  --line: rgba(242, 236, 224, 0.14);
  --glass: rgba(22, 18, 13, 0.74);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--fg);
  font-family: 'Manrope', system-ui, sans-serif; -webkit-user-select: none; user-select: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }

/* лого Grandis */
#logo { position: fixed; top: 16px; left: 22px; z-index: 6; display: flex; align-items: center; gap: 13px;
  font-family: 'JetBrains Mono', monospace; }
#logo .glogo { height: 28px; width: auto; display: block; }
#logo .tagline { font-size: 9px; letter-spacing: 0.26em; font-weight: 700; color: var(--dim); text-transform: uppercase;
  padding-left: 13px; border-left: 1px solid var(--line); white-space: nowrap; }

/* подсказка */
#hint { position: fixed; bottom: 22px; left: 50%; translate: -50% 0; z-index: 6;
  font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim);
  background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 10px 18px; backdrop-filter: blur(8px);
  transition: opacity .8s; text-align: center; }
#hint.fade { opacity: 0; pointer-events: none; }

/* кнопка звука */
#sound { position: fixed; top: 18px; left: 200px; z-index: 6; width: 36px; height: 36px;
  font-size: 15px; color: var(--fg); background: var(--glass); border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer; backdrop-filter: blur(8px); transition: color .2s, border-color .2s; }
#sound:hover { border-color: var(--fg); }
#sound.off { color: var(--dim); }
#sound.off::after { content: ''; position: absolute; inset: 8px 6px; border-top: 1.5px solid var(--dim); transform: rotate(-45deg); }
@media (max-width: 640px) { #sound { left: 66px; } }

/* зум карты */
#zoom { position: fixed; left: 22px; bottom: 22px; z-index: 6; display: flex; flex-direction: column; gap: 6px; }
#zoom button { width: 38px; height: 38px; font-size: 20px; font-weight: 700; line-height: 1; color: var(--fg);
  background: var(--glass); border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
  backdrop-filter: blur(8px); display: grid; place-items: center; transition: border-color .2s, color .2s; }
#zoom button:hover { border-color: var(--amber); color: var(--amber); }
#zoom #zoom-fit { font-size: 15px; }

#vignette { position: fixed; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse 80% 74% at 50% 46%, transparent 56%, rgba(4, 3, 2, 0.5) 100%); }

/* HUD заказа справа */
#orderHud { position: fixed; top: 18px; right: 18px; z-index: 6; width: 262px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px 14px;
  backdrop-filter: blur(12px); font-family: 'JetBrains Mono', monospace; }
#orderHud .oh-chip { font-size: 9px; letter-spacing: 0.34em; color: var(--dim); margin-bottom: 8px; }
#orderHud .oh-title { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 18px; line-height: 1.1;
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
#orderHud .oh-prog { font-size: 10px; color: var(--amber); letter-spacing: 0.1em; margin-bottom: 12px; }
#orderHud .oh-track { height: 4px; background: rgba(255,255,255,.08); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
#orderHud .oh-fill { height: 100%; width: 0; background: var(--amber); border-radius: 3px; transition: width .4s cubic-bezier(.2,.8,.2,1); }
#orderHud .oh-list { list-style: none; display: grid; gap: 2px; max-height: 46vh; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
#orderHud .oh-list li { display: flex; align-items: center; gap: 9px; font-size: 11px; letter-spacing: 0.02em;
  color: var(--dim); padding: 5px 6px; border-radius: 6px; transition: background .2s, color .2s; }
#orderHud .oh-list li .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; border: 1.5px solid currentColor; }
#orderHud .oh-list li.done { color: var(--ok); }
#orderHud .oh-list li.done .dot { background: var(--ok); border-color: var(--ok); }
#orderHud .oh-list li.current { color: var(--fg); background: rgba(34,197,94,.14); }
#orderHud .oh-list li.current .dot { background: var(--amber); border-color: var(--amber); animation: dotPulse 1s infinite; }
@keyframes dotPulse { 50% { box-shadow: 0 0 0 4px rgba(34,197,94,.25); } }

/* toast */
#toast { position: fixed; bottom: 66px; left: 50%; translate: -50% 0; z-index: 7;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; letter-spacing: 0.14em; color: var(--fg);
  background: var(--glass); border: 1px solid var(--line); border-radius: 6px; padding: 12px 22px; backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none; transition: opacity .3s; text-align: center; }
#toast.show { opacity: 1; }

/* nameplate над станцией */
#nameplate { position: fixed; top: 0; left: 0; z-index: 5; transform: translate(-9999px, -9999px);
  pointer-events: none; translate: -50% -120%; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; color: var(--fg); background: var(--glass);
  border: 1px solid var(--acc, var(--line)); box-shadow: 0 0 22px color-mix(in srgb, var(--acc, #fff) 30%, transparent);
  border-radius: 6px; padding: 7px 13px; backdrop-filter: blur(10px); opacity: 0; transition: opacity .2s; white-space: nowrap; }
#nameplate.show { opacity: 1; }

/* инфо-карточка станции (появляется при подходе) */
#stationCard { position: fixed; top: 0; left: 0; z-index: 9; width: 340px; max-width: calc(100vw - 32px);
  background: var(--glass); border: 1px solid var(--acc, var(--line)); border-radius: 14px; overflow: hidden;
  backdrop-filter: blur(16px); box-shadow: 0 20px 60px -20px rgba(0,0,0,.85), 0 0 0 1px color-mix(in srgb, var(--acc, #fff) 22%, transparent);
  opacity: 0; visibility: hidden; transform: translate(-9999px, -9999px) scale(.96);
  transition: opacity .25s, transform .25s cubic-bezier(.2,.8,.2,1); }
#stationCard.show { opacity: 1; visibility: visible; }
#stationCard .sc-media { height: 168px; background: linear-gradient(135deg, color-mix(in srgb, var(--acc, #22C55E) 40%, #15110c), #15110c);
  display: grid; place-items: center; position: relative; overflow: hidden; }
#stationCard .sc-media.empty::after { content: attr(data-n); font-family: 'Unbounded', sans-serif; font-weight: 800;
  font-size: 74px; color: color-mix(in srgb, var(--acc, #fff) 55%, transparent); line-height: 1; }
#stationCard .sc-media img, #stationCard .sc-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
#stationCard .sc-body { padding: 16px 18px 18px; }
#stationCard .sc-kicker { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--acc, var(--dim)); margin-bottom: 6px; }
#stationCard .sc-title { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 20px; line-height: 1.1; margin-bottom: 10px; }
#stationCard .sc-text { font-size: 13.5px; line-height: 1.6; color: #d8d2c6; margin-bottom: 16px; }
#stationCard .sc-ok { width: 100%; font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 13px;
  letter-spacing: 0.08em; text-transform: uppercase; color: #15110c; background: var(--acc, var(--fg));
  border: none; border-radius: 9px; padding: 13px; cursor: pointer; transition: filter .2s; }
#stationCard .sc-ok:hover { filter: brightness(1.12); }
@media (max-width: 560px) { #stationCard { width: 300px; } #stationCard .sc-media { height: 140px; } }

/* модалки */
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center;
  background: rgba(6, 4, 2, 0.82); backdrop-filter: blur(14px);
  opacity: 0; visibility: hidden; transition: opacity .4s, visibility .4s; }
.modal.show { opacity: 1; visibility: visible; }
.card { width: min(560px, 92vw); max-height: 90vh; overflow-y: auto; padding: 34px 30px; text-align: center; }
.card .chip { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.4em; color: var(--amber); margin-bottom: 16px; }
.card h1 { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: clamp(26px, 5vw, 40px); line-height: 1.08;
  text-transform: uppercase; margin-bottom: 12px; }
.card p.lead { color: var(--dim); font-size: 14px; line-height: 1.7; margin-bottom: 24px; }

.orders { display: grid; gap: 12px; grid-template-columns: 1fr; text-align: left; }
.order-btn { display: flex; align-items: center; gap: 16px; padding: 16px 18px; cursor: pointer;
  background: rgba(242,236,224,0.04); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, background .2s; }
.order-btn:hover { border-color: var(--amber); background: rgba(34,197,94,0.08); }
.order-btn .em { font-size: 34px; line-height: 1; flex: none; }
.order-btn .ob-name { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 17px; margin-bottom: 3px; }
.order-btn .ob-desc { color: var(--dim); font-size: 12px; line-height: 1.5; }
.order-btn .ob-steps { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--amber); margin-top: 6px; letter-spacing: 0.08em; }

.card button.cta { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 13px; letter-spacing: 0.12em;
  text-transform: uppercase; color: #15110c; background: var(--fg); border: none; border-radius: 9px; padding: 15px 38px;
  cursor: pointer; margin-top: 22px; }
.card button.cta:hover { background: #fff; }
.card a.cta { display: block; text-decoration: none; text-align: center; }
.card .cta.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); margin-top: 10px; }
.card .cta.ghost:hover { color: var(--fg); border-color: var(--fg); background: transparent; }
.win-emoji { font-size: 84px; line-height: 1; margin-bottom: 8px; }

/* купон */
.coupon { display: flex; align-items: stretch; gap: 0; margin: 26px 0 8px; text-align: left;
  border: 2px dashed var(--amber); border-radius: 14px; overflow: hidden;
  background: linear-gradient(180deg, rgba(34,197,94,.10), rgba(34,197,94,.03)); }
.coupon .cp-left { display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 20px; background: rgba(34,197,94,.14); border-right: 2px dashed var(--amber); min-width: 118px; }
.coupon .cp-percent { font-family: 'Unbounded', sans-serif; font-weight: 800; font-size: 40px; line-height: 1; color: var(--amber); }
.coupon .cp-off { font-family: 'JetBrains Mono', monospace; font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--dim); margin-top: 5px; }
.coupon .cp-right { padding: 16px 18px; flex: 1; }
.coupon .cp-label { font-family: 'JetBrains Mono', monospace; font-size: 9px; letter-spacing: 0.34em; text-transform: uppercase; color: var(--dim); }
.coupon .cp-cat { font-family: 'Unbounded', sans-serif; font-weight: 700; font-size: 16px; margin: 3px 0 10px; color: var(--fg); }
.coupon .cp-code { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 17px; letter-spacing: 0.06em;
  color: var(--amber); background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 7px;
  padding: 8px 12px; display: inline-block; user-select: all; }
.coupon .cp-note { font-family: 'Manrope', sans-serif; font-size: 11px; color: var(--dim); margin-top: 8px; }
@media (max-width: 480px) { .coupon { flex-direction: column; } .coupon .cp-left { border-right: none; border-bottom: 2px dashed var(--amber); flex-direction: row; gap: 10px; min-width: 0; } }

@media (max-width: 640px) {
  #logo .name { display: none; }
  #orderHud { width: 210px; top: 14px; right: 12px; padding: 12px; }
  #orderHud .oh-list { max-height: 38vh; }
}
