:root {
  --ink: #eae4d3;
  --ink-dim: #a89f88;
  --bg: #10120d;
  --bg-panel: #1a1f16;
  --moss: #4c6b4a;
  --moss-bright: #7fa76f;
  --gold: #d1a94e;
  --border: #eae4d3;
  --scanline: rgba(0, 0, 0, 0.28);
  --brand: #c1622e;
  --brand-light: #e2924f;
  --brand-dark: #7a3c17;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Press Start 2P', 'Courier New', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.crt {
  width: 100%;
  max-width: 720px;
  padding: 16px;
}

.verdant-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 25px;
}

.verdant-mark img {
  width: 208px;
  height: 48px;
  image-rendering: pixelated;
  filter:
    drop-shadow(-1px -1px 0 rgba(255, 255, 255, 0.15))
    drop-shadow(2px 2px 0 rgba(0, 0, 0, 0.55));
}

.verdant-sub {
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--ink-dim);
}

.console {
  background: var(--bg-panel);
  border: 4px solid var(--border);
  box-shadow:
    0 0 0 4px var(--bg),
    0 0 0 8px var(--moss),
    8px 8px 0 0 rgba(0, 0, 0, 0.6);
  padding: 14px;
}

.console-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  text-align: center;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 4px dashed var(--moss);
}

.console-title {
  font-size: clamp(14px, 4vw, 20px);
  color: var(--gold);
  letter-spacing: 2px;
  text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.6);
}

.console-sub {
  font-size: 9px;
  color: var(--ink-dim);
  letter-spacing: 1px;
}

.screen {
  position: relative;
  background: #05130a;
  border: 3px solid var(--moss);
  overflow: hidden;
  aspect-ratio: 320 / 180;
  cursor: pointer;
}

#scene {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
}

.screen::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    var(--scanline) 0px,
    var(--scanline) 1px,
    transparent 2px,
    transparent 3px
  );
  mix-blend-mode: multiply;
  animation: flicker 6s infinite;
}

@keyframes flicker {
  0%, 96%, 100% { opacity: 1; }
  97% { opacity: 0.85; }
  98% { opacity: 1; }
  99% { opacity: 0.9; }
}

.overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 10px;
  z-index: 2;
}

.location-label {
  position: absolute;
  top: 8px;
  left: 10px;
  margin: 0;
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
}

.select-title {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gold);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.7);
  white-space: nowrap;
}

.caption {
  margin: 0 0 6px;
  font-size: 9px;
  line-height: 1.7;
  text-align: center;
  color: var(--ink);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
  max-width: 90%;
}

.doorway-hint {
  position: absolute;
  margin: 0;
  font-size: 8px;
  color: var(--gold);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
  animation: bob 1.2s ease-in-out infinite;
  left: 50%;
  transform: translateX(-50%);
}

@keyframes bob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

.item-hint {
  position: absolute;
  margin: 0;
  font-size: 7px;
  letter-spacing: 0.5px;
  font-style: italic;
  color: var(--ink);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
  left: 50%;
  bottom: 26%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.4s ease;
  white-space: nowrap;
}

.item-hint.is-visible {
  opacity: 1;
}

.toast {
  position: absolute;
  left: 50%;
  top: 14%;
  margin: 0;
  padding: 6px 10px;
  max-width: 84%;
  font-size: 8px;
  line-height: 1.6;
  text-align: center;
  letter-spacing: 0.5px;
  color: var(--bg);
  background: var(--gold);
  border: 2px solid var(--border);
  transform: translate(-50%, -6px);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.shop-panel {
  pointer-events: auto;
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 2px dashed var(--gold);
  background: rgba(10, 10, 8, 0.78);
}

.shop-note {
  font-size: 7px;
  color: var(--gold);
  line-height: 1.6;
  margin: 0 0 8px;
  letter-spacing: 0.5px;
}

.shop-link {
  display: inline-block;
  font-size: 9px;
  color: var(--bg);
  background: var(--gold);
  padding: 7px 9px;
  text-decoration: none;
  border: 2px solid var(--border);
}

.shop-link:hover {
  background: var(--ink);
}

.console-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding-top: 12px;
  margin-top: 4px;
  font-size: 8px;
  color: var(--ink-dim);
  letter-spacing: 1px;
}

.mute-btn {
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  color: var(--ink-dim);
  background: transparent;
  border: 2px solid var(--moss);
  padding: 4px 6px;
  cursor: pointer;
}

.mute-btn:hover {
  color: var(--ink);
  border-color: var(--moss-bright);
}

.mute-btn.is-muted {
  color: var(--ink-dim);
  opacity: 0.5;
}

.brand-mark {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding-top: 14px;
  text-align: center;
  text-decoration: none;
  border-top: 4px dashed var(--moss);
}

.brand-word {
  display: inline-block;
  font-family: 'Press Start 2P', 'Courier New', monospace;
  font-size: clamp(14px, 4.5vw, 24px);
  line-height: 1.6;
  letter-spacing: 3px;
  color: var(--brand);
  text-shadow:
    -2px -2px 0 var(--brand-light),
    2px 2px 0 var(--brand-dark),
    4px 4px 0 rgba(0, 0, 0, 0.55);
  margin: 0 5px;
  transition: transform 0.15s ease;
}

.brand-mark:hover .brand-word,
.brand-mark:focus-visible .brand-word {
  transform: translateY(-2px);
}
