/* FLOBTRIS — neon 80s / outrun */

:root {
  --bg: #0D0221;
  --pink: #FF2975;
  --purple: #B026FF;
  --cyan: #2DE2E6;
  --yellow: #FFD319;
  --mint: #01F9C6;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

[x-cloak] { display: none !important; }

html, body {
  height: 100%;
  background: var(--bg);
  color: #E8E3F5;
  font-family: 'Orbitron', 'Segoe UI', sans-serif;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}

#bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
}

.scanlines {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.18) 0px,
    rgba(0, 0, 0, 0.18) 1px,
    transparent 1px,
    transparent 3px
  );
  mix-blend-mode: multiply;
}

.frame {
  position: relative;
  z-index: 10;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
}

.title {
  font-size: clamp(28px, 5vh, 48px);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.12em;
  background: linear-gradient(180deg, #fff 0%, var(--cyan) 35%, var(--purple) 65%, var(--pink) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 12px rgba(176, 38, 255, 0.6));
}

.layout {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 130px;
}

.panel {
  border: 1px solid rgba(45, 226, 230, 0.35);
  border-radius: 6px;
  background: rgba(13, 2, 33, 0.75);
  padding: 8px;
  box-shadow: 0 0 12px rgba(45, 226, 230, 0.12), inset 0 0 20px rgba(176, 38, 255, 0.05);
  text-align: center;
}

.panel h2 {
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(45, 226, 230, 0.7);
  margin-bottom: 6px;
}

.panel canvas { display: block; margin: 0 auto; }

.keys-hint p {
  font-size: 9px;
  line-height: 1.8;
  color: rgba(232, 227, 245, 0.65);
  letter-spacing: 0.05em;
}

.stats .stat-big {
  font-size: 18px;
  color: var(--yellow);
  text-shadow: 0 0 10px rgba(255, 211, 25, 0.7);
  margin-bottom: 8px;
}

.stats .stat-mid {
  font-size: 15px;
  color: #fff;
  margin-bottom: 8px;
}

.item-slot .slot-icon {
  font-size: 34px;
  line-height: 1.3;
  filter: grayscale(1) opacity(0.4);
  transition: filter 0.2s;
}

.item-slot.armed .slot-icon { filter: none; }

.item-slot.armed {
  border-color: var(--yellow);
  box-shadow: 0 0 16px rgba(255, 211, 25, 0.45), inset 0 0 24px rgba(255, 211, 25, 0.08);
  animation: armed-pulse 1.2s ease-in-out infinite;
}

@keyframes armed-pulse {
  50% { box-shadow: 0 0 26px rgba(255, 211, 25, 0.75), inset 0 0 24px rgba(255, 211, 25, 0.15); }
}

.item-slot .slot-name {
  font-size: 9px;
  letter-spacing: 0.15em;
  margin-top: 4px;
  color: rgba(232, 227, 245, 0.8);
}

.effects .effect-line {
  font-size: 10px;
  line-height: 2;
  color: var(--mint);
  text-shadow: 0 0 8px rgba(1, 249, 198, 0.6);
  white-space: nowrap;
}

.board-wrap {
  position: relative;
  border: 2px solid var(--purple);
  border-radius: 4px;
  box-shadow: 0 0 24px rgba(176, 38, 255, 0.5), inset 0 0 30px rgba(176, 38, 255, 0.08);
  line-height: 0;
}

#board {
  display: block;
  max-height: 76vh;
  width: auto;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(13, 2, 33, 0.78);
  backdrop-filter: blur(2px);
  z-index: 20;
  line-height: 1.4;
}

.overlay-box {
  text-align: center;
  padding: 24px 28px;
  border: 1px solid rgba(45, 226, 230, 0.5);
  border-radius: 8px;
  background: rgba(13, 2, 33, 0.9);
  box-shadow: 0 0 30px rgba(45, 226, 230, 0.25);
}

.tagline {
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--cyan);
  text-shadow: 0 0 10px rgba(45, 226, 230, 0.8);
  margin-bottom: 16px;
}

.tagline.small { font-size: 10px; margin-bottom: 10px; }

.final-score {
  font-size: 26px;
  color: var(--yellow);
  text-shadow: 0 0 12px rgba(255, 211, 25, 0.8);
  margin-bottom: 16px;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.2em;
  padding: 10px 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 0 16px rgba(255, 41, 117, 0.5);
  transition: transform 0.1s, box-shadow 0.1s;
}

.btn:hover { transform: scale(1.05); box-shadow: 0 0 26px rgba(255, 41, 117, 0.8); }
.btn:active { transform: scale(0.97); }

.btn-small { font-size: 10px; padding: 8px 10px; letter-spacing: 0.1em; }

/* Spinner */
.spin-box {
  min-width: 220px;
  border-color: var(--yellow);
  box-shadow: 0 0 34px rgba(255, 211, 25, 0.35);
}

.spin-icon {
  font-size: 56px;
  line-height: 1.4;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

.spin-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.18em;
  margin-top: 8px;
  color: #fff;
}

.spin-box.landed-good {
  border-color: var(--mint);
  box-shadow: 0 0 40px rgba(1, 249, 198, 0.7);
  animation: landed-pop 0.25s ease-out;
}

.spin-box.landed-good .spin-name { color: var(--mint); text-shadow: 0 0 12px rgba(1, 249, 198, 0.9); }

.spin-box.landed-bad {
  border-color: var(--pink);
  box-shadow: 0 0 40px rgba(255, 41, 117, 0.7);
  animation: landed-shake 0.3s ease-out;
}

.spin-box.landed-bad .spin-name { color: var(--pink); text-shadow: 0 0 12px rgba(255, 41, 117, 0.9); }

@keyframes landed-pop {
  0% { transform: scale(0.9); }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes landed-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.target-banner {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  width: max-content;
  max-width: 92%;
  padding: 6px 16px;
  background: rgba(13, 2, 33, 0.92);
  border: 1px solid rgba(255, 41, 117, 0.5);
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--pink);
  text-shadow: 0 0 10px rgba(255, 41, 117, 0.9);
  box-shadow: 0 0 14px rgba(255, 41, 117, 0.25);
  animation: banner-blink 0.8s step-end infinite;
  pointer-events: none;
}

@keyframes banner-blink { 50% { opacity: 0.35; } }

/* High scores */
.hiscores {
  margin: 0 auto 16px;
  min-width: 190px;
}

.hiscores h3 {
  font-size: 10px;
  letter-spacing: 0.25em;
  color: var(--yellow);
  text-shadow: 0 0 8px rgba(255, 211, 25, 0.7);
  margin-bottom: 8px;
}

.hs-row {
  display: flex;
  gap: 10px;
  font-size: 12px;
  line-height: 1.9;
  color: #E8E3F5;
}

.hs-rank { color: var(--purple); width: 18px; text-align: right; }
.hs-name { color: var(--cyan); letter-spacing: 0.2em; }
.hs-score { margin-left: auto; color: var(--yellow); }

.hiscores-empty {
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(232, 227, 245, 0.5);
  margin-bottom: 16px;
}

.hint {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: rgba(232, 227, 245, 0.45);
  margin-top: 10px;
}

.rank-line {
  font-size: 13px;
  letter-spacing: 0.25em;
  color: var(--mint);
  text-shadow: 0 0 10px rgba(1, 249, 198, 0.8);
  margin: -8px 0 12px;
}

.glow-good {
  color: var(--mint);
  text-shadow: 0 0 12px rgba(1, 249, 198, 0.9);
  animation: banner-blink 1s step-end infinite;
}

/* Arcade initials entry */
.entry-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 6px 0 16px;
}

.entry-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.entry-letter {
  width: 44px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  border: 2px solid rgba(45, 226, 230, 0.4);
  border-radius: 6px;
  background: rgba(13, 2, 33, 0.9);
  cursor: pointer;
}

.entry-letter.active {
  border-color: var(--yellow);
  color: var(--yellow);
  box-shadow: 0 0 16px rgba(255, 211, 25, 0.5);
  animation: armed-pulse 1s ease-in-out infinite;
}

.entry-slot .arrow {
  font-family: inherit;
  font-size: 12px;
  padding: 4px 12px;
  color: var(--cyan);
  background: rgba(45, 226, 230, 0.08);
  border: 1px solid rgba(45, 226, 230, 0.4);
  border-radius: 4px;
  cursor: pointer;
}

.entry-slot .arrow:active { background: rgba(45, 226, 230, 0.3); }

.audio-btns { display: flex; gap: 6px; }
.audio-btns .btn-small { flex: 1; }

/* Touch controls */
.touch-controls {
  display: none;
  gap: 8px;
  padding: 8px 0 4px;
}

.tbtn {
  font-family: inherit;
  font-size: 18px;
  font-weight: 800;
  min-width: 52px;
  min-height: 52px;
  color: var(--cyan);
  background: rgba(13, 2, 33, 0.85);
  border: 1px solid rgba(45, 226, 230, 0.5);
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(45, 226, 230, 0.2);
  touch-action: none;
}

.tbtn:active { background: rgba(45, 226, 230, 0.25); }

.tbtn-wide { font-size: 12px; letter-spacing: 0.1em; min-width: 72px; }

.tbtn-item {
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--yellow);
  border-color: rgba(255, 211, 25, 0.6);
  box-shadow: 0 0 10px rgba(255, 211, 25, 0.25);
}

@media (pointer: coarse), (max-width: 700px) {
  .touch-controls {
    display: flex;
    width: min(100%, 430px);
    justify-content: center;
  }
  .tbtn {
    flex: 1;
    min-width: 0;
    min-height: 48px;
    padding: 0 2px;
    font-size: 15px;
  }
  .tbtn-wide { font-size: 11px; }
  .tbtn-item { font-size: 11px; }
  .side.side-left { display: none; }
  .side { width: 92px; }
  .layout { gap: 8px; }
  .frame { gap: 4px; }
  .title { font-size: clamp(20px, 4vh, 34px); }
  #board { max-height: 56vh; }
  .panel { padding: 6px; }
  .stats .stat-big { font-size: 14px; }
  .stats .stat-mid { font-size: 12px; }
  .overlay-box {
    padding: 14px 12px;
    max-width: 96%;
  }
  .hiscores { min-width: 0; }
  .spin-box { min-width: 0; }
  .spin-icon { font-size: 42px; }
  .entry-letter { width: 38px; height: 46px; font-size: 24px; }
}
