:root {
  --bg: #07061a; --bezel: #14112a; --lav: #cfc3ff; --violet: #a077ff; --purple: #6b2fd6; --pink: #ff3ea5; --chrome: #e8e4ff;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--lav);
  font-family: "Press Start 2P", monospace; -webkit-font-smoothing: none;
  overflow-x: hidden;
  /* iOS: sin selección, sin lupa, sin callout, sin zoom por doble tap */
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior: none;
}
.room {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding: 6px 0 16px; padding-top: max(6px, env(safe-area-inset-top));
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(107,47,214,0.45), transparent 70%),
    radial-gradient(ellipse 60% 30% at 50% 100%, rgba(43,75,255,0.25), transparent 70%),
    var(--bg);
  position: relative;
}
/* piso ajedrez en perspectiva (solo pantallas anchas) */
.room::before {
  content: ""; position: fixed; left: -50vw; right: -50vw; bottom: 0; height: 32vh; z-index: 0; pointer-events: none;
  background: repeating-conic-gradient(#ece9ff 0 25%, #14103a 0 50%) 0 0 / 120px 120px;
  transform: perspective(600px) rotateX(62deg); transform-origin: 50% 100%; opacity: 0.3;
  -webkit-mask-image: linear-gradient(to top, #000 30%, transparent 100%); mask-image: linear-gradient(to top, #000 30%, transparent 100%);
  display: none;
}

/* ---------- consola portátil (atomic purple) ---------- */
.cabinet {
  position: relative; z-index: 1; width: 100%; max-width: 440px;
  padding: 8px 6px 14px; border-radius: 18px 18px 48px 18px;
  background:
    radial-gradient(120% 60% at 30% 0%, rgba(255,255,255,0.16), transparent 60%),
    linear-gradient(180deg, rgba(190,150,255,0.55), rgba(120,70,210,0.55) 40%, rgba(80,40,160,0.6));
  box-shadow: 0 20px 50px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.35), inset 0 -3px 0 rgba(0,0,0,0.35), 0 0 0 1px rgba(200,170,255,0.4);
  overflow: hidden; touch-action: none;
}
.cabinet::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 6px, transparent 6px 14px);
}
.tv-top { display: flex; align-items: baseline; justify-content: space-between; padding: 2px 6px 6px; position: relative; }
.tv-brand { font-size: 11px; letter-spacing: 2px; color: var(--chrome); text-shadow: 0 0 8px rgba(207,195,255,0.6); }
.tv-brand b { font-weight: normal; padding: 2px 6px; border: 2px solid var(--chrome); border-radius: 12px; }
.tv-brand em { font-style: normal; margin-left: 4px; }
.tv-freq { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 14px; color: #f0e8ff; }

.tv-bezel {
  position: relative; background: var(--bezel); border-radius: 10px 10px 26px 10px; padding: 6px 6px 6px;
  box-shadow: inset 0 0 0 2px #241f45, inset 0 0 24px rgba(0,0,0,0.9);
}
.tv-screen {
  position: relative; aspect-ratio: 3 / 4; width: 100%;
  border-radius: 4px; overflow: hidden; background: #000;
  box-shadow: inset 0 0 30px rgba(0,0,0,0.8);
}
#game {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  image-rendering: pixelated; image-rendering: crisp-edges;
  touch-action: none; cursor: pointer;
}
.crt-scanlines {
  position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 3px, rgba(0,0,0,0.10) 3px 4px);
}
.crt-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 85% 80% at 50% 50%, transparent 60%, rgba(0,0,0,0.45) 100%); }
.crt-glare { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 30%, transparent 45%); }
.osd { position: absolute; bottom: 6px; right: 8px; font-size: 8px; color: #7dff8a; text-shadow: 0 0 4px #3ddc84; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.osd.show { opacity: 1; }

.tv-side { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 2px 2px; }
.led { width: 8px; height: 8px; border-radius: 50%; background: #3a1b1b; box-shadow: 0 0 0 2px #1a1130; margin-right: 4px; }
.led.on { background: #ff3ea5; box-shadow: 0 0 8px #ff3ea5, 0 0 0 2px #1a1130; }
.pill {
  font-family: inherit; font-size: 8px; color: var(--lav); letter-spacing: 1px;
  padding: 10px 12px; min-height: 36px; border-radius: 18px; border: 2px solid #3b3568; cursor: pointer;
  background: linear-gradient(180deg, #2a2450, #14112a); box-shadow: 0 3px 0 #0a0818;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
}
.pill.on, .pill:active { transform: translateY(2px); box-shadow: 0 1px 0 #0a0818; background: #3b3568; }
.pill.off { color: #6f6a99; text-decoration: line-through; }
.dial { margin-left: auto; font-size: 7px; color: #f0e8ff; letter-spacing: 2px; }

.hint-keys { display: none; margin: 10px 0 0; font-size: 7px; color: #d9ccff; text-align: center; opacity: 0.8; position: relative; }

.ticket { margin-top: 12px; position: relative; z-index: 1; }
.ticket-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; justify-content: center;
  background: repeating-linear-gradient(135deg, #eae6ff 0 8px, #dcd6ff 8px 16px); color: #1a1440;
  border-radius: 10px; padding: 12px 14px; font-size: 9px; box-shadow: 0 8px 20px rgba(0,0,0,0.5);
}
.ticket-label { font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 16px; }
.ticket code { font-size: 16px; letter-spacing: 2px; background: #1a1440; color: #fff; padding: 8px 12px; border-radius: 6px; -webkit-user-select: text; user-select: text; }
.ticket button, .ticket a { font-family: inherit; font-size: 8px; padding: 10px 12px; border-radius: 6px; border: 2px solid #1a1440; background: #fff; color: #1a1440; cursor: pointer; text-decoration: none; }
.ticket a { background: var(--pink); color: #fff; border-color: var(--pink); }

.credits { position: relative; z-index: 1; margin: 14px 0 0; font-size: 8px; color: #6f6a99; text-align: center; }
.credits a { color: var(--violet); text-decoration: none; }

@media (min-width: 700px) {
  .room { justify-content: center; padding: 24px 12px; }
  .room::before { display: block; }
  .cabinet { max-width: 460px; }
  .hint-keys { display: block; }
}
@media (hover: none) and (pointer: coarse) { .hint-keys { display: none !important; } }
