:root {
  --color-accent: #e84419;
  --color-cream: #f5ded4;
  --color-graphite: #535461;
  --color-bg: #202126;
  --color-surface: #2f3037;
  --color-surface-soft: #3d3e47;
  --color-muted: rgba(245, 222, 212, 0.68);
  --color-dim: rgba(245, 222, 212, 0.42);
  --shadow-focus: 0 0 0 2px var(--color-cream), 0 0 22px rgba(232, 68, 25, 0.85);
  --radius: 8px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  width: 100%;
  height: 100%;
  background: #000;
}

body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  color: var(--color-cream);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}


button, input, textarea {
  font: inherit;
}

.screen {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 600px;
  height: 600px;
  display: flex;
  flex-direction: column;
  padding: var(--space-2);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(245, 222, 212, 0.05), rgba(232, 68, 25, 0.04)),
    var(--color-bg);
}

.hidden {
  display: none !important;
}

.top-bar {
  display: flex;
  align-items: center;
  height: 48px;
  flex-shrink: 0;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.top-bar-logo-link {
  display: flex;
  flex-shrink: 0;
  line-height: 0;
  text-decoration: none;
  background: transparent;
}

.top-bar-logo-link:focus,
.top-bar-logo-link:focus-visible,
.top-bar-logo-link.focusable,
.top-bar-logo-link.focusable.focused {
  outline: none;
  box-shadow: none;
  background: transparent;
}

.top-bar-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  object-fit: contain;
  flex-shrink: 0;
}

.title {
  flex: 1;
  color: var(--color-cream);
  font-size: 22px;
  font-weight: 700;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  overflow: hidden;
  padding: var(--space-2);
}

.content--compact {
  gap: var(--space-1);
}

.content--scroll {
  overflow-y: auto;
}

.mt-1 {
  margin-top: var(--space-1);
}

.mt-2 {
  margin-top: var(--space-2);
}

.focusable {
  outline: none;
  border-radius: var(--radius);
  transition: box-shadow 0.15s, background 0.15s, color 0.15s;
  cursor: pointer;
}

.focusable.focused {
  box-shadow: var(--shadow-focus);
}

.btn,
.menu-btn,
.back-btn {
  border: 1px solid rgba(245, 222, 212, 0.16);
  background: var(--color-graphite);
  color: var(--color-cream);
  cursor: pointer;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 var(--space-5);
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 650;
}

.btn:active,
.menu-btn:active,
.back-btn:active {
  background: var(--color-accent);
}

.btn-secondary {
  background: transparent;
  color: var(--color-muted);
  border-color: rgba(245, 222, 212, 0.24);
  font-size: 14px;
}

.menu-btn {
  display: flex;
  align-items: center;
  width: 100%;
  height: 56px;
  gap: var(--space-3);
  padding: 0 var(--space-4);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 650;
  text-align: left;
}

.menu-btn .icon {
  width: 32px;
  flex-shrink: 0;
  color: var(--color-accent);
  font-size: 22px;
  text-align: center;
}

.menu-btn.selected {
  border-color: var(--color-accent);
  background: rgba(232, 68, 25, 0.22);
}

.back-btn {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius);
  color: var(--color-accent);
  font-size: 24px;
}

.helper-text,
.composer-note {
  color: var(--color-muted);
  font-size: 14px;
  text-align: center;
}

.accent {
  color: var(--color-accent);
  font-weight: 650;
}

.composer-note {
  padding: 1px 0 2px;
  font-size: 10px;
}

.section-label {
  padding: 3px 2px 1px;
  color: var(--color-accent);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.field-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.field-label,
.typo-row .name {
  color: var(--color-muted);
  font-size: 10px;
}

.field-label {
  padding-left: 2px;
}

.input,
.editable {
  width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid rgba(245, 222, 212, 0.16);
  border-radius: var(--radius);
  outline: none;
  background: var(--color-surface);
  color: var(--color-cream);
  font-size: 15px;
}

.input {
  height: 32px;
  padding-block: 0;
}

.input::placeholder,
.editable:empty::before {
  color: var(--color-dim);
}

textarea.input {
  height: 36px;
  padding-block: 6px;
  resize: none;
  line-height: 1.4;
}

.editable:empty::before {
  content: attr(data-placeholder);
}

.unsupported .input,
.unsupported .editable {
  height: 26px;
  min-height: 26px;
  border-color: rgba(232, 68, 25, 0.3);
  background: rgba(232, 68, 25, 0.08);
  color: var(--color-dim);
  font-size: 13px;
}

.unsupported .field-label,
.footer-hint {
  color: var(--color-dim);
}

.unsupported-field {
  background: rgba(232, 68, 25, 0.1);
  border: 1px solid rgba(232, 68, 25, 0.25);
  border-radius: var(--radius);
  padding: 4px;
}

.unsupported-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 4px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-cream);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}

.status-msg,
.composer-status,
.inline-note,
#sensor-status,
#storage-value,
#music-status {
  min-height: 40px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 14px;
  text-align: center;
  word-break: break-word;
}

.composer-status {
  min-height: 26px;
  display: flex;
  align-items: center;
  margin-top: var(--space-1);
  font-size: 12px;
  text-align: left;
}

.status-success {
  color: var(--color-accent) !important;
}

.status-error {
  color: var(--color-accent) !important;
  border: 1px solid rgba(232, 68, 25, 0.6);
}

.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 44px;
  padding: 10px var(--space-4);
  border-radius: var(--radius);
  background: var(--color-surface);
  font-size: 15px;
}

.data-row .label {
  color: var(--color-muted);
}

.data-row .value {
  color: var(--color-cream);
  font-family: "Courier New", monospace;
  font-weight: 700;
}

.sensor-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  align-items: start;
}

.sensor-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--space-2);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.sensor-col-title {
  color: var(--color-cream);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.sensor-col-desc {
  color: var(--color-muted);
  font-size: 11px;
  text-align: center;
  margin-bottom: 2px;
}

.data-row--sm {
  min-height: 28px;
  padding: 6px var(--space-3);
  font-size: 13px;
}

.data-row--sm .value {
  font-size: 12px;
}

.compass-bar {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-3);
  margin-top: var(--space-2);
}

.compass-label {
  color: var(--color-muted);
  font-size: 12px;
  text-align: center;
  margin-bottom: var(--space-1);
}

.compass-viewport {
  position: relative;
  overflow: hidden;
  height: 36px;
  border-radius: 4px;
  background: var(--color-bg);
}

.compass-track {
  display: flex;
  align-items: center;
  height: 100%;
  white-space: nowrap;
  will-change: transform;
}

.compass-dir {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  height: 100%;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-muted);
  flex-shrink: 0;
}

.compass-dir--major {
  color: var(--color-cream);
  font-weight: 700;
  font-size: 16px;
}

.compass-dir--north {
  color: var(--color-accent);
  font-weight: 700;
  font-size: 16px;
}

.compass-tick {
  width: 1px;
  height: 12px;
  background: var(--color-dim);
  flex-shrink: 0;
}

.compass-tick--major {
  height: 18px;
  background: var(--color-muted);
}

.compass-center {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
  background: var(--color-accent);
  pointer-events: none;
}

.compass-center::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--color-accent);
}

.compass-readout {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-cream);
  margin-top: var(--space-1);
  min-height: 20px;
}

.swipe-pad {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: var(--space-2);
  min-height: 390px;
  padding: var(--space-2) 18px;
}

.swipe-action {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 96px;
  border: 1px solid rgba(245, 222, 212, 0.16);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-cream);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.swipe-action--up {
  grid-column: 2;
  grid-row: 1;
}

.swipe-action--left {
  grid-column: 1;
  grid-row: 2;
}

.swipe-action--ok {
  grid-column: 2;
  grid-row: 2;
  background: var(--color-graphite);
}

.swipe-action--right {
  grid-column: 3;
  grid-row: 2;
}

.swipe-action--down {
  grid-column: 2;
  grid-row: 3;
}

.swipe-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(232, 68, 25, 0.18);
  color: var(--color-accent);
  font-size: 30px;
  line-height: 1;
}

.swipe-action--ok .swipe-arrow {
  width: 64px;
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-cream);
  font-size: 18px;
}

.swipe-action.is-active {
  border-color: var(--color-accent);
  background: rgba(232, 68, 25, 0.24);
}

.swipe-action.is-active .swipe-arrow {
  animation: inputPulse 0.38s ease-out;
}

.swipe-action--up.is-active .swipe-arrow {
  animation-name: swipeUpPulse;
}

.swipe-action--down.is-active .swipe-arrow {
  animation-name: swipeDownPulse;
}

.swipe-action--left.is-active .swipe-arrow {
  animation-name: swipeLeftPulse;
}

.swipe-action--right.is-active .swipe-arrow {
  animation-name: swipeRightPulse;
}

.input-readout {
  min-height: 48px;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 14px;
  text-align: center;
}

@keyframes inputPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.14); }
  100% { transform: scale(1); }
}

@keyframes swipeUpPulse {
  0% { transform: translateY(8px); opacity: 0.65; }
  55% { transform: translateY(-12px) scale(1.12); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes swipeDownPulse {
  0% { transform: translateY(-8px); opacity: 0.65; }
  55% { transform: translateY(12px) scale(1.12); opacity: 1; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes swipeLeftPulse {
  0% { transform: translateX(8px); opacity: 0.65; }
  55% { transform: translateX(-12px) scale(1.12); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

@keyframes swipeRightPulse {
  0% { transform: translateX(-8px); opacity: 0.65; }
  55% { transform: translateX(12px) scale(1.12); opacity: 1; }
  100% { transform: translateX(0); opacity: 1; }
}

.btn-group {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

.btn-group .btn {
  flex: 1;
}

.storage-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  align-items: start;
}

.storage-col {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.storage-col-title {
  color: var(--color-cream);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

.storage-limit {
  color: var(--color-dim);
  font-size: 11px;
  text-align: center;
  margin-bottom: 2px;
}

.storage-col #storage-value,
.storage-col #session-value {
  height: 64px;
  padding: var(--space-2);
  border-radius: var(--radius);
  background: var(--color-bg);
  color: var(--color-muted);
  font-size: 12px;
  text-align: center;
  word-break: break-word;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-group--col .btn {
  min-height: 40px;
  padding: 0 var(--space-2);
  font-size: 13px;
}

.btn--sm {
  min-height: 40px;
  padding: 0 var(--space-2);
  font-size: 13px;
}

.display-intro {
  padding: 8px 12px;
  border: 1px solid rgba(245, 222, 212, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(245, 222, 212, 0.04), rgba(232, 68, 25, 0.05)),
    var(--color-surface);
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  word-break: break-word;
}

.display-intro .hl {
  color: var(--color-accent);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(232, 68, 25, 0.55);
}

#screen-display .section-label {
  display: flex;
  align-items: center;
  gap: 6px;
}

#screen-display .section-label::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(232, 68, 25, 0.8);
}

.display-col {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.color-palette {
  display: flex;
  gap: var(--space-2);
  padding: 2px 0;
}

.typo-scale {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  padding: 2px 0;
}

.swatch {
  flex: 1;
  min-width: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  border-radius: var(--radius);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.swatch span {
  opacity: 0.8;
}

.swatch--accent {
  background: var(--color-accent);
  color: var(--color-cream);
  box-shadow: 0 0 16px rgba(232, 68, 25, 0.45);
}

.swatch--cream {
  background: var(--color-cream);
  color: var(--color-bg);
}

.swatch--graphite {
  background: var(--color-graphite);
  color: var(--color-cream);
  border: 1px solid rgba(245, 222, 212, 0.2);
}

.typo-scale {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0;
}

.typo-row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.typo-row .name {
  width: 56px;
  flex-shrink: 0;
  text-align: right;
}

.typo-chip {
  margin-left: auto;
  flex-shrink: 0;
  padding: 1px 6px;
  border: 1px solid rgba(245, 222, 212, 0.18);
  border-radius: 999px;
  color: var(--color-dim);
  font-size: 10px;
  font-weight: 650;
}

.type-h1 {
  font-size: 28px;
  font-weight: 700;
}

.type-h2 {
  font-size: 22px;
  font-weight: 700;
}

.type-body {
  font-size: 16px;
}

.type-body2 {
  font-size: 14px;
}

.type-meta {
  color: var(--color-muted);
  font-size: 12px;
}

.safe-zone-demo {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-height: 48px;
  padding: 8px 8px;
  margin-top: auto;
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius);
  color: var(--color-muted);
  font-size: 12px;
  text-align: center;
  gap: 2px;
}

.safe-zone-inner {
  color: var(--color-cream);
  font-size: 13px;
  font-weight: 700;
}

.safe-zone-margin {
  color: var(--color-dim);
  font-size: 11px;
}

/* ── Location (positions) demo ── */
#loc-data {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.loc-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 30px;
  padding: 4px var(--space-4);
  border: 1px solid rgba(245, 222, 212, 0.2);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 650;
  text-align: center;
}

.loc-badge-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-dim);
}

.loc-badge--search {
  border-color: var(--color-accent);
  color: var(--color-cream);
}

.loc-badge--search .loc-badge-dot {
  background: var(--color-accent);
  animation: locBlink 0.8s ease-in-out infinite;
}

.loc-badge--ok {
  border-color: rgba(232, 68, 25, 0.85);
  color: var(--color-cream);
}

.loc-badge--ok .loc-badge-dot {
  background: var(--color-accent);
  box-shadow: 0 0 8px rgba(232, 68, 25, 0.9);
}

.loc-badge--error {
  border-color: rgba(232, 68, 25, 0.95);
  color: #ff8a70;
}

.loc-badge--error .loc-badge-dot {
  background: #ff8a70;
}

.loc-hud {
  display: flex;
  gap: var(--space-2);
}

.loc-hud-row {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px var(--space-2);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.loc-hud-label {
  color: var(--color-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loc-hud-value {
  color: var(--color-cream);
  font-family: "Courier New", monospace;
  font-size: 21px;
  font-weight: 700;
  white-space: nowrap;
}

.loc-tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.loc-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 4px;
  border-radius: var(--radius);
  background: var(--color-surface);
  min-width: 0;
}

.loc-tile--wide {
  grid-column: 1 / -1;
}

.loc-tile-label {
  color: var(--color-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.loc-tile-value {
  color: var(--color-cream);
  font-family: "Courier New", monospace;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.loc-history {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 96px;
  overflow-y: auto;
  scrollbar-width: none;
}

.loc-history::-webkit-scrollbar {
  display: none;
}

.loc-history-title {
  color: var(--color-dim);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-left: 2px;
}

.loc-history-row {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--color-surface);
  color: var(--color-muted);
  font-family: "Courier New", monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes locBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* ── Continuous Draw (Drag) module ── */
#home-menu {
  overflow-y: auto;
  scrollbar-width: none;
  padding: var(--space-2) var(--space-2);
}

#home-menu::-webkit-scrollbar {
  display: none;
}

.content--draw {
  position: relative;
  min-height: 0;
}

#stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(245, 222, 212, 0.16);
  border-radius: var(--radius);
  background: var(--color-surface);
  touch-action: none;
  outline: none;
}

#drawCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  touch-action: none;
  cursor: crosshair;
  z-index: 1;
}

#drawBox {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 560px;
  height: 350px;
  transform: translate(-50%, -50%);
  border: 2px dashed var(--color-accent);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 2;
}

#reset {
  width: 100%;
  min-height: 42px;
  padding: 0 var(--space-4);
  border: 1px solid rgba(245, 222, 212, 0.24);
  border-radius: var(--radius);
  background: var(--color-graphite);
  color: var(--color-cream);
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
}

#status {
  min-height: 32px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid rgba(245, 222, 212, 0.16);
  border-radius: var(--radius);
  background: rgba(32, 33, 38, 0.9);
  color: var(--color-muted);
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

#drawStatus {
  font-weight: 700;
}

#drawStatus.active {
  color: var(--color-cream);
}

.footer-hint {
  flex-shrink: 0;
  padding: var(--space-2) 0;
  font-size: 12px;
  text-align: center;
}

#back-toast {
  position: absolute;
  bottom: 64px;
  left: 50%;
  z-index: 99;
  padding: var(--space-2) var(--space-5);
  border-radius: var(--radius);
  background: var(--color-accent);
  color: var(--color-cream);
  font-size: 16px;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%);
  transition: opacity 0.25s;
}

#back-toast.is-visible {
  opacity: 1;
}

/* ── Snake Game ── */
.snake-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4);
  background: rgba(32, 33, 38, 0.92);
  z-index: 10;
}

.snake-overlay.hidden {
  display: none !important;
}

.snake-overlay-title {
  color: var(--color-cream);
  font-size: 28px;
  font-weight: 700;
  text-shadow: 0 0 20px rgba(232, 68, 25, 0.6);
}

.snake-overlay-score {
  color: var(--color-accent);
  font-size: 22px;
  font-weight: 700;
}

.snake-overlay-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: 300px;
}

#snake-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(245, 222, 212, 0.16);
  border-radius: var(--radius);
  background: var(--color-surface);
  touch-action: none;
}

#snakeCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
}

#snake-status {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  min-height: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius);
  background: rgba(32, 33, 38, 0.85);
  color: var(--color-accent);
  font-size: 14px;
  text-align: right;
  pointer-events: none;
}

#snakeStatus {
  font-weight: 700;
}

.snake-start-btn {
  background: transparent;
  border: 2px solid var(--color-accent);
  border-radius: var(--radius);
  color: var(--color-accent);
  font-size: 22px;
  font-weight: 700;
  padding: var(--space-3) var(--space-5);
  cursor: pointer;
  letter-spacing: 0.5px;
}

.snake-start-btn.focused {
  box-shadow: var(--shadow-focus);
}
