:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f7f7f7;
  background: #101010;
  font-synthesis: none;
  --accent: #d8ff35;
  --panel: rgba(20, 20, 20, 0.88);
  --border: rgba(255, 255, 255, 0.14);
}

* { box-sizing: border-box; }

html, body, #game {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body { background: #111; }
canvas { display: block; }

button { font: inherit; }

.hud {
  position: fixed;
  z-index: 5;
  pointer-events: none;
}

.hud--top {
  top: 20px;
  left: 22px;
  right: 22px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 13px;
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(12px);
  border-radius: 14px;
}

.brand__dot {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(216, 255, 53, 0.7);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 13px; letter-spacing: 0.08em; }
.brand small { margin-top: 2px; color: #aaa; font-size: 11px; }

.shift-progress {
  width: min(260px, 36vw);
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 13px;
  backdrop-filter: blur(12px);
  font-size: 12px;
}

.progress-track {
  height: 5px;
  margin-top: 7px;
  overflow: hidden;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
}

#progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.35s ease;
}

.stats-panel {
  position: fixed;
  top: 106px;
  left: 22px;
  z-index: 5;
  width: 190px;
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  backdrop-filter: blur(12px);
  pointer-events: none;
}

.stat {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 12px;
}
.stat:last-child { border-bottom: 0; }
.stat span { color: #aaa; }
.stat strong { font-variant-numeric: tabular-nums; }
.stat--danger strong { color: #ff8b8b; }

.controls-tip {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 5;
  display: flex;
  gap: 14px;
  transform: translateX(-50%);
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  color: #bbb;
  font-size: 12px;
  pointer-events: none;
  backdrop-filter: blur(12px);
}

kbd {
  padding: 2px 6px;
  border: 1px solid rgba(255,255,255,0.25);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: rgba(255,255,255,0.08);
  color: white;
  font-family: inherit;
}

.interaction-prompt {
  position: fixed;
  left: 50%;
  bottom: 72px;
  z-index: 6;
  transform: translateX(-50%);
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: #101010;
  font-weight: 700;
  font-size: 13px;
  box-shadow: 0 10px 35px rgba(0,0,0,0.35);
}

.dialogue {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  width: min(500px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border: 1px solid rgba(255,255,255,0.17);
  border-radius: 20px;
  background: rgba(18,18,18,0.96);
  box-shadow: 0 25px 90px rgba(0,0,0,0.55);
  backdrop-filter: blur(18px);
}

.dialogue__speaker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: var(--accent);
  color: #111;
  font-weight: 900;
}

.dialogue__speaker span,
.dialogue__speaker strong { display: block; }
.dialogue__speaker span { color: #888; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; }
.dialogue__speaker strong { margin-top: 2px; }
.dialogue h2 { margin: 20px 0 8px; font-size: clamp(22px, 4vw, 34px); line-height: 1.05; }
.dialogue p { color: #ccc; line-height: 1.5; }
.dialogue__hint { margin-bottom: 0; color: #777 !important; font-size: 11px; }

.choices { display: grid; gap: 9px; margin-top: 18px; }
.choice-button {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  background: rgba(255,255,255,0.055);
  color: white;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.choice-button:hover {
  transform: translateY(-1px);
  border-color: rgba(216,255,53,0.6);
  background: rgba(216,255,53,0.1);
}
.choice-button:disabled { opacity: 0.5; cursor: default; }

.toast-stack {
  position: fixed;
  top: 100px;
  right: 22px;
  z-index: 30;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 44px));
  pointer-events: none;
}

.toast {
  position: relative;
  padding: 14px 44px 13px 15px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(15,15,15,0.94);
  box-shadow: 0 12px 35px rgba(0,0,0,0.3);
  animation: toast-in 0.2s ease;
  font-size: 13px;
  line-height: 1.45;
  pointer-events: auto;
}
.toast--out { animation: toast-out 0.17s ease forwards; }
.toast__body { margin-top: 4px; }
.toast__close {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.toast__close:active { background: var(--accent); color: #111; }
.toast__hint { display: block; margin-top: 7px; color: #777; font-size: 10px; }

.toast strong { color: var(--accent); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-6px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-6px); } }

.start-screen,
.ending-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(circle at center, rgba(34,34,34,0.7), rgba(5,5,5,0.95));
  backdrop-filter: blur(12px);
}

.ending-screen { overflow-y: auto; }

.start-card,
.ending-card {
  width: min(620px, 100%);
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 26px;
  background: rgba(18,18,18,0.94);
  box-shadow: 0 30px 100px rgba(0,0,0,0.55);
}

.eyebrow { color: var(--accent) !important; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }
.start-card h1 { margin: 8px 0 12px; font-size: clamp(48px, 11vw, 88px); line-height: 0.9; letter-spacing: -0.06em; }
.start-card p,
.ending-card p { color: #bbb; line-height: 1.55; }
.start-card small { display: block; margin-top: 16px; color: #727272; line-height: 1.4; }

.primary-button {
  margin-top: 12px;
  padding: 13px 18px;
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: #111;
  font-weight: 900;
  cursor: pointer;
}
.primary-button:hover { filter: brightness(1.06); }

.ending-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 8px;
}
.ending-metric {
  padding: 13px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}
.ending-metric span, .ending-metric strong { display: block; }
.ending-metric span { color: #858585; font-size: 11px; }
.ending-metric strong { margin-top: 5px; font-size: 18px; }

[hidden] { display: none !important; }

@media (max-width: 700px) {
  .stats-panel { top: auto; left: 12px; bottom: 72px; width: 160px; }
  .hud--top { top: 12px; left: 12px; right: 12px; }
  .shift-progress { width: 150px; }
  .brand small { display: none; }
  .controls-tip { width: calc(100vw - 24px); justify-content: center; gap: 8px; }
  .controls-tip span:last-child { display: none; }
  .dialogue { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
  .toast-stack { top: 82px; right: 12px; }
}

.start-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.start-actions .primary-button,
.start-actions .secondary-button {
  margin-top: 0;
}

.secondary-button,
.danger-button,
.icon-button {
  font: inherit;
  cursor: pointer;
}

.secondary-button {
  padding: 13px 18px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  background: rgba(255,255,255,0.06);
  color: #f7f7f7;
  font-weight: 800;
}
.secondary-button:hover { background: rgba(255,255,255,0.1); }

.phone-fab {
  position: fixed;
  right: 22px;
  top: 106px;
  z-index: 12;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(18,18,18,0.9);
  color: var(--accent);
  font-size: 21px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.phone-fab:hover { transform: translateY(-1px); }


.quit-shift-button {
  position: fixed;
  right: 22px;
  top: 166px;
  z-index: 26;
  padding: 9px 13px;
  border: 1px solid rgba(255, 105, 105, 0.42);
  border-radius: 12px;
  background: rgba(70, 12, 12, 0.9);
  color: #ffaaaa;
  font-weight: 850;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}
.quit-shift-button:hover,
.quit-shift-button:active {
  background: #d42a2a;
  color: #fff;
}

.phone-panel {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(8px);
}

.phone-shell {
  position: relative;
  width: min(390px, 100%);
  max-height: min(780px, calc(100vh - 36px));
  overflow: auto;
  padding: 28px 18px 20px;
  border: 6px solid #090909;
  border-radius: 38px;
  background: linear-gradient(180deg, #20242b 0%, #11141a 100%);
  box-shadow: 0 35px 100px rgba(0,0,0,0.65);
}

.phone-notch {
  position: absolute;
  top: 7px;
  left: 50%;
  width: 112px;
  height: 22px;
  transform: translateX(-50%);
  border-radius: 0 0 15px 15px;
  background: #050505;
}

.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 7px;
}
.phone-header small,
.phone-header strong { display: block; }
.phone-header small { color: #8e96a3; font-size: 11px; }
.phone-header strong { margin-top: 2px; font-size: 19px; }

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: white;
  font-size: 24px;
  line-height: 1;
}

.phone-balance {
  margin-top: 20px;
  padding: 20px;
  border-radius: 24px;
  background: linear-gradient(135deg, #d8ff35, #9cd820);
  color: #111;
}
.phone-balance span,
.phone-balance strong,
.phone-balance small { display: block; }
.phone-balance span { font-size: 12px; opacity: 0.65; }
.phone-balance strong { margin-top: 6px; font-size: 38px; letter-spacing: -0.05em; }
.phone-balance small { margin-top: 7px; opacity: 0.7; }

.phone-progress {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 17px;
  background: rgba(255,255,255,0.04);
}
.phone-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}
.phone-progress span { color: #949aa3; }
.phone-progress-track {
  height: 7px;
  margin-top: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,0.09);
}
#phone-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.25s ease;
}

.phone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}
.phone-card {
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 17px;
  background: rgba(255,255,255,0.045);
}
.phone-card span,
.phone-card strong { display: block; }
.phone-card span { color: #858c97; font-size: 11px; }
.phone-card strong { margin-top: 6px; font-size: 17px; }

.phone-message {
  margin-top: 14px;
  padding: 15px;
  border-radius: 17px;
  background: rgba(87, 132, 255, 0.14);
  border: 1px solid rgba(110, 148, 255, 0.2);
}
.phone-message strong { font-size: 12px; }
.phone-message p { margin: 7px 0 0; color: #bdc7df; font-size: 13px; line-height: 1.45; }

.danger-button {
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255,100,100,0.28);
  border-radius: 14px;
  background: rgba(255,72,72,0.1);
  color: #ff9a9a;
  font-weight: 750;
}

.mobile-controls {
  position: fixed;
  inset: auto 0 max(12px, env(safe-area-inset-bottom)) 0;
  z-index: 18;
  display: none;
  justify-content: space-between;
  align-items: flex-end;
  padding: 0 16px;
  pointer-events: none;
}

.dpad {
  position: relative;
  width: 152px;
  height: 152px;
  pointer-events: auto;
}
.dpad button,
.mobile-actions button {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid rgba(255,255,255,0.22);
  background: rgba(18,18,18,0.76);
  color: white;
  backdrop-filter: blur(9px);
  box-shadow: 0 10px 28px rgba(0,0,0,0.25);
}
.dpad button {
  position: absolute;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 18px;
}
.dpad button:active,
.mobile-actions button:active,
.dpad button.is-active {
  background: rgba(216,255,53,0.9);
  color: #111;
}
.dpad__up { left: 50px; top: 0; }
.dpad__left { left: 0; top: 50px; }
.dpad__down { left: 50px; top: 100px; }
.dpad__right { left: 100px; top: 50px; }

.mobile-actions {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: auto;
}
.mobile-actions button {
  border-radius: 50%;
  font-weight: 900;
}
.mobile-phone {
  width: 54px;
  height: 54px;
  color: var(--accent) !important;
  font-size: 20px;
}
.mobile-action {
  width: 76px;
  height: 76px;
  background: rgba(216,255,53,0.86) !important;
  color: #111 !important;
  font-size: 25px;
}

@media (pointer: coarse), (max-width: 820px) {
  .mobile-controls { display: flex; }
  .controls-tip { display: none; }
  .phone-fab { display: none; }
  .stats-panel {
    top: 84px;
    bottom: auto;
    left: 12px;
    width: 154px;
    padding: 6px 10px;
  }
  .stat { padding: 6px 0; font-size: 11px; }
  .dialogue {
    right: 10px;
    bottom: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 18px;
  }
  .dialogue h2 { font-size: 25px; }
  .interaction-prompt {
    bottom: 176px;
    max-width: calc(100vw - 30px);
    text-align: center;
  }
  .ending-card,
  .start-card { max-height: calc(100dvh - 24px - env(safe-area-inset-bottom)); overflow: auto; }
  .ending-screen {
    display: block;
    padding: 12px 12px calc(100px + env(safe-area-inset-bottom));
  }
  .ending-card {
    width: 100%;
    max-height: none;
    padding: 22px 18px 112px;
  }
  .ending-grid { grid-template-columns: 1fr 1fr; }
  #restart-button {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    z-index: 60;
    width: auto;
    margin: 0;
    padding: 15px 18px;
    box-shadow: 0 -16px 35px rgba(5,5,5,0.82);
  }
  .quit-shift-button {
    top: 86px;
    right: 12px;
    padding: 8px 11px;
    font-size: 12px;
  }
  .toast-stack {
    top: 142px;
    right: 10px;
    width: calc(100vw - 20px);
  }
}

@media (max-width: 430px) {
  .hud--top { align-items: stretch; }
  .brand { padding: 8px 10px; }
  .shift-progress { width: 132px; padding: 8px 10px; }
  .stats-panel { width: 146px; }
  .dpad { transform: scale(0.88); transform-origin: left bottom; }
  .mobile-actions { transform: scale(0.9); transform-origin: right bottom; }
  .phone-shell { border-radius: 30px; }
  .start-actions { display: grid; }
  .ending-card h2 { margin: 8px 0; font-size: 25px; }
  .ending-card > p { margin: 7px 0; font-size: 13px; }
  .ending-grid { gap: 6px; margin-top: 12px; }
  .ending-metric { padding: 10px; }
  .ending-metric strong { font-size: 16px; }
  .ending-metric span { font-size: 10px; }
}

.phone-section {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 17px;
  background: rgba(255,255,255,0.035);
}

.phone-section__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 9px;
}
.phone-section__title strong { font-size: 13px; }
.phone-section__title span { color: #8f96a1; font-size: 11px; }

.phone-inbox,
.phone-achievements {
  display: grid;
  gap: 8px;
}

.phone-inbox-item,
.achievement-item {
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.06);
}

.phone-inbox-item > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}
.phone-inbox-item strong,
.achievement-item strong { font-size: 12px; }
.phone-inbox-item span { color: #727985; font-size: 10px; }
.phone-inbox-item p,
.achievement-item p {
  margin: 5px 0 0;
  color: #b8c0cc;
  font-size: 12px;
  line-height: 1.4;
}

.achievement-item {
  background: rgba(216,255,53,0.07);
  border-color: rgba(216,255,53,0.12);
}
.achievement-item strong { color: var(--accent); }
.phone-empty { margin: 0; color: #777f8b; font-size: 12px; line-height: 1.4; }

.start-subtitle {
  margin: -2px 0 16px;
  color: #d8ff35;
  font-size: clamp(18px, 3vw, 28px);
  line-height: 1.1;
  font-weight: 750;
}

.creator-credit,
.ending-credit {
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #8f8f8f;
  font-size: 12px;
  line-height: 1.45;
}

.creator-credit strong,
.creator-credit a {
  display: block;
}

.creator-credit a,
.ending-credit a,
.about-game a {
  color: var(--accent);
  text-decoration: none;
}

.creator-credit a:hover,
.ending-credit a:hover,
.about-game a:hover {
  text-decoration: underline;
}

.about-game p {
  margin: 0 0 8px;
  color: #b8c0cc;
  font-size: 12px;
  line-height: 1.45;
}

.about-game a {
  display: inline-block;
  font-size: 12px;
  line-height: 1.45;
}

.ending-credit {
  margin-top: 12px;
  padding-top: 10px;
}

@media (max-width: 700px) {
  .creator-credit { margin-top: 13px; padding-top: 11px; }
  .creator-credit,
  .ending-credit { font-size: 11px; }
}

#phone-news-tone { font-size: 13px; line-height: 1.22; }

#phone-news-tone { font-size: 13px; line-height: 1.22; overflow-wrap: anywhere; }

/* v1.4: камера и ненавязчивые автоматические уведомления */
.camera-reset-button {
  position: fixed;
  right: 22px;
  top: 162px;
  z-index: 12;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(18,18,18,0.9);
  color: #f7f7f7;
  font-size: 25px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.camera-reset-button:active { color: var(--accent); transform: scale(0.96); }

.toast {
  overflow: hidden;
  padding: 13px 15px 15px;
  pointer-events: auto;
  cursor: pointer;
}
.toast__hint { margin-top: 6px; }
.toast__timer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255,255,255,0.08);
}
.toast__timer::after {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform-origin: left center;
  animation: toast-countdown linear forwards;
  animation-duration: var(--toast-duration, 7s);
}
@keyframes toast-countdown { to { transform: scaleX(0); } }

@media (max-width: 700px) {
  .camera-reset-button {
    top: auto;
    right: 12px;
    bottom: 154px;
    width: 44px;
    height: 44px;
  }
  .controls-tip #control-4 { display: none; }
  .toast-stack {
    width: min(330px, calc(100vw - 24px));
  }
}
.toast__close { display: none !important; }

/* v1.7 — управление относительно камеры, отдельная подсказка и более спокойный HUD */
.help-button {
  position: fixed;
  right: 22px;
  top: 218px;
  z-index: 13;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: rgba(18,18,18,0.9);
  color: var(--accent);
  font-size: 23px;
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}
.help-button:active { transform: scale(0.96); }

.help-panel {
  position: fixed;
  inset: 0;
  z-index: 46;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.52);
  backdrop-filter: blur(8px);
}
.help-card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 22px;
  background: rgba(17,17,17,0.97);
  box-shadow: 0 28px 90px rgba(0,0,0,0.55);
}
.help-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.help-card__header small,
.help-card__header strong { display: block; }
.help-card__header small { color: #858585; font-size: 11px; }
.help-card__header strong { margin-top: 3px; font-size: 22px; }
.help-grid { display: grid; gap: 9px; margin-top: 16px; }
.help-grid article {
  padding: 13px 14px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
}
.help-grid article strong { color: var(--accent); font-size: 13px; }
.help-grid article p { margin: 5px 0 0; color: #bdbdbd; font-size: 13px; line-height: 1.45; }

.touch-move-hint {
  align-self: flex-end;
  margin: 0 0 24px 10px;
  padding: 9px 12px;
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 13px;
  background: rgba(15,15,15,0.58);
  color: rgba(255,255,255,0.82);
  font-size: 12px;
  line-height: 1.15;
  text-align: center;
  pointer-events: none;
  transition: opacity .25s ease;
  backdrop-filter: blur(8px);
}
.touch-move-hint small { color: rgba(255,255,255,0.54); }
.touch-move-hint.is-hidden { opacity: 0; }

.touch-joystick {
  position: fixed;
  z-index: 25;
  width: 94px;
  height: 94px;
  margin: -47px 0 0 -47px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  background: rgba(12,12,12,0.42);
  box-shadow: inset 0 0 0 12px rgba(255,255,255,0.035);
  pointer-events: none;
  backdrop-filter: blur(5px);
}
.touch-joystick__knob {
  position: absolute;
  left: 27px;
  top: 27px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(216,255,53,0.92);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}

/* Уведомление — это короткая внутриигровая реплика, а не отдельное окно с таймером. */
.toast-stack {
  width: min(300px, calc(100vw - 24px));
}
.toast {
  padding: 11px 13px;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.38;
  cursor: default;
  pointer-events: none;
}
.toast__body { margin-top: 3px; }
.toast__hint,
.toast__timer { display: none !important; }

@media (pointer: coarse), (max-width: 820px) {
  .mobile-controls { padding: 0 12px; }
  .mobile-actions { margin-left: auto; }
  .help-button {
    top: auto;
    right: 12px;
    bottom: 210px;
    width: 44px;
    height: 44px;
  }
  .camera-reset-button { bottom: 158px; }
  .stats-panel {
    width: 138px;
    padding: 5px 9px;
  }
  .stats-panel .stat:nth-child(n+4) { display: none; }
  .stat { padding: 5px 0; font-size: 10.5px; }
  .dialogue {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-height: 54dvh;
    padding: 14px;
    border-radius: 17px;
  }
  .dialogue__speaker { gap: 9px; }
  .avatar { width: 34px; height: 34px; border-radius: 10px; }
  .dialogue h2 { margin: 12px 0 6px; font-size: 20px; }
  .dialogue p { margin: 7px 0; font-size: 13px; line-height: 1.38; }
  .choices { gap: 7px; margin-top: 11px; }
  .choice-button { padding: 10px 11px; border-radius: 11px; font-size: 13px; line-height: 1.3; }
  .dialogue__hint { display: none; }
  .toast-stack {
    top: 84px;
    right: 10px;
    width: min(270px, calc(100vw - 20px));
  }
  .toast { font-size: 11.5px; }
  .interaction-prompt {
    bottom: 112px;
    padding: 9px 13px;
    font-size: 12px;
  }
  .help-card { padding: 17px; border-radius: 19px; }
  .help-grid article { padding: 11px 12px; }
}

@media (max-width: 430px) {
  .brand strong { font-size: 12px; }
  .shift-progress { width: 126px; }
  .mobile-action { width: 70px; height: 70px; }
  .mobile-phone { width: 50px; height: 50px; }
  .touch-move-hint { font-size: 11px; margin-bottom: 18px; }
}

/* Минутное холодное открытие */
.intro-screen {
  position: fixed;
  inset: 0;
  z-index: 49;
  overflow: hidden;
  pointer-events: auto;
  background: transparent;
  transition: opacity .45s ease;
}
.intro-screen[hidden] { display: none !important; }
.intro-screen--out { opacity: 0; }
.intro-curtain {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #050505;
  opacity: 1;
  pointer-events: none;
}
.intro-caption {
  position: absolute;
  left: clamp(20px, 6vw, 82px);
  bottom: clamp(72px, 12vh, 132px);
  z-index: 2;
  width: min(680px, calc(100vw - 40px));
  text-shadow: 0 3px 22px rgba(0,0,0,.82);
}
.intro-caption small {
  display: block;
  margin-bottom: 9px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.intro-caption p {
  max-width: 650px;
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 4.5vw, 48px);
  font-weight: 780;
  line-height: 1.04;
  letter-spacing: -.025em;
}
.intro-caption__line--in { animation: intro-line-in .5s ease both; }
@keyframes intro-line-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.intro-phone {
  position: absolute;
  z-index: 3;
  left: clamp(20px, 7vw, 100px);
  top: clamp(78px, 14vh, 150px);
  width: min(260px, calc(100vw - 40px));
  padding: 25px 18px 18px;
  border: 1px solid rgba(255,255,255,.19);
  border-radius: 28px;
  background: rgba(10,12,14,.92);
  box-shadow: 0 24px 80px rgba(0,0,0,.55);
  backdrop-filter: blur(16px);
  animation: intro-phone-in .55s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes intro-phone-in {
  from { opacity: 0; transform: translateY(18px) rotate(-2deg); }
  to { opacity: 1; transform: translateY(0) rotate(-2deg); }
}
.intro-phone__notch {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 72px;
  height: 8px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: #020202;
}
.intro-phone small,
.intro-phone strong { display: block; }
.intro-phone small { color: #8f98a4; font-size: 10px; }
.intro-phone strong { margin-top: 5px; font-size: 17px; line-height: 1.15; }
.intro-phone > div:not(.intro-phone__notch) {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: 12px;
}
.intro-phone span { color: #9098a2; }
.intro-phone b { color: var(--accent); }
.intro-phone p { margin: 10px 0 0; color: #c7ccd3; font-size: 12px; }
.intro-skip {
  position: absolute;
  z-index: 4;
  right: max(18px, env(safe-area-inset-right));
  top: max(18px, env(safe-area-inset-top));
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(10,10,10,.62);
  color: rgba(255,255,255,.78);
  font-size: 11px;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(10px);
}
.intro-skip:active { color: #111; background: var(--accent); }
.intro-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  height: 4px;
  background: rgba(255,255,255,.09);
}
#intro-progress-bar {
  width: 100%;
  height: 100%;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left center;
}
body.intro-running .hud,
body.intro-running .stats-panel,
body.intro-running .phone-fab,
body.intro-running .camera-reset-button,
body.intro-running .help-button,
body.intro-running .quit-shift-button,
body.intro-running .mobile-controls,
body.intro-running .interaction-prompt,
body.intro-running .controls-tip,
body.intro-running .toast-stack {
  opacity: 0 !important;
  pointer-events: none !important;
}

@media (max-width: 700px) {
  .intro-caption {
    left: 18px;
    right: 18px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    width: auto;
  }
  .intro-caption p { font-size: clamp(23px, 8vw, 34px); }
  .intro-phone {
    left: 18px;
    top: calc(68px + env(safe-area-inset-top));
    width: 230px;
    padding: 22px 16px 16px;
  }
  .intro-skip {
    top: calc(14px + env(safe-area-inset-top));
    right: 14px;
  }
}

/* v2.4 — аккуратная заставка и более понятное разделение управления */
.start-screen {
  overflow: auto;
  align-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    linear-gradient(135deg, rgba(216,255,53,.055) 0 1px, transparent 1px 32px),
    radial-gradient(circle at 50% 22%, rgba(70,76,53,.46), rgba(5,5,5,.97) 58%);
  background-size: 32px 32px, auto;
}

.start-card {
  position: relative;
  width: min(720px, 100%);
  max-height: calc(100dvh - 36px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow: auto;
  padding: clamp(24px, 4.4vw, 42px);
  border-radius: 18px;
  border: 1px solid rgba(216,255,53,.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,.045), transparent 28%),
    rgba(13,13,13,.97);
  box-shadow: 0 32px 110px rgba(0,0,0,.66), inset 0 0 0 1px rgba(255,255,255,.025);
}

.start-card::after {
  content: '';
  position: absolute;
  right: -54px;
  top: -72px;
  width: 190px;
  height: 190px;
  border: 26px solid rgba(216,255,53,.08);
  transform: rotate(17deg);
  pointer-events: none;
}

.start-card__masthead {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.11);
  color: #888;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.start-card__issue { color: var(--accent); }
.start-card h1 {
  margin: 7px 0 5px;
  font-size: clamp(58px, 11vw, 92px);
  line-height: .86;
  letter-spacing: -.075em;
}
.start-card .eyebrow { margin: 22px 0 0; }
.start-lead {
  max-width: 620px;
  margin: 16px 0 0;
  color: #c3c3c3 !important;
  font-size: 15px;
  line-height: 1.5 !important;
}

.start-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 20px;
}
.start-facts span {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.035);
  color: #989898;
  font-size: 11px;
  line-height: 1.2;
}
.start-facts strong {
  display: block;
  margin-bottom: 4px;
  color: #fff;
  font-size: 21px;
}

.start-featured {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.start-featured article {
  padding: 13px 14px;
  border-left: 3px solid #e7c56b;
  background: rgba(231,197,107,.075);
}
.start-featured article small,
.start-featured article strong,
.start-featured article span { display: block; }
.start-featured article small { color: #92866d; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.start-featured article strong { margin-top: 5px; font-size: 18px; letter-spacing: .02em; }
.start-featured article span { margin-top: 4px; color: #aaa; font-size: 11px; }
.start-featured__comic {
  border-left-color: #4d80ff !important;
  background: rgba(77,128,255,.075) !important;
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}
.start-featured__comic small { color: #859dd1 !important; }

.start-actions { margin-top: 18px; }
.start-actions button { min-height: 46px; }
.start-controls-note {
  margin: 13px 0 0 !important;
  color: #737373 !important;
  font-size: 11px;
  line-height: 1.4 !important;
}
.start-card .creator-credit { margin-top: 15px; }

/* Вступление: подписи не перекрывают телефон и не вылезают за safe-area. */
.intro-caption {
  left: max(22px, env(safe-area-inset-left));
  bottom: max(58px, calc(40px + env(safe-area-inset-bottom)));
  width: min(650px, calc(100vw - 44px));
  padding: 14px 16px 15px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(5,5,5,.76), rgba(5,5,5,.08));
}
.intro-caption p { font-size: clamp(23px, 4.4vw, 43px); line-height: 1.06; }
.intro-phone {
  left: auto;
  right: max(24px, calc(env(safe-area-inset-right) + 12px));
  top: max(78px, calc(env(safe-area-inset-top) + 58px));
  transform: none;
  animation-name: intro-phone-clean-in;
}
@keyframes intro-phone-clean-in {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Жесты разделены визуально: нижняя левая часть — ходьба, правая — камера. */
.touch-move-hint {
  min-width: 116px;
  margin: 0 0 18px 2px;
  border-radius: 999px;
  background: rgba(15,15,15,.68);
}
.touch-joystick { box-shadow: inset 0 0 0 14px rgba(255,255,255,.035), 0 12px 35px rgba(0,0,0,.32); }

@media (max-width: 700px) {
  .start-screen { place-items: start center; }
  .start-card {
    max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    padding: 20px 18px;
    border-radius: 15px;
  }
  .start-card__masthead { font-size: 8.5px; }
  .start-card__status { text-align: right; }
  .start-card .eyebrow { margin-top: 17px; font-size: 9px; }
  .start-card h1 { margin-top: 6px; font-size: clamp(54px, 18vw, 72px); }
  .start-lead { margin-top: 13px; font-size: 13.5px; line-height: 1.42 !important; }
  .start-facts { gap: 6px; margin-top: 15px; }
  .start-facts span { padding: 9px 8px; font-size: 9.5px; }
  .start-facts strong { font-size: 18px; }
  .start-featured { grid-template-columns: 1fr; gap: 6px; margin-top: 6px; }
  .start-featured article { padding: 10px 11px; }
  .start-featured article strong { font-size: 16px; }
  .start-actions { display: grid; margin-top: 14px; }
  .start-actions button { width: 100%; }
  .start-controls-note { font-size: 10px; }
  .intro-caption {
    left: 14px;
    right: 14px;
    bottom: calc(48px + env(safe-area-inset-bottom));
    width: auto;
    padding: 11px 12px 12px;
  }
  .intro-caption p { font-size: clamp(22px, 7.7vw, 32px); }
  .intro-phone {
    left: 14px;
    right: auto;
    top: calc(66px + env(safe-area-inset-top));
    width: min(224px, calc(100vw - 28px));
  }
}

@media (max-height: 650px) and (max-width: 900px) {
  .start-featured { display: none; }
  .start-card .creator-credit { margin-top: 10px; }
  .start-card { padding-top: 16px; padding-bottom: 16px; }
}
