/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #161618;
  --tile-bg: #1a1a1c;
  --tile-bg-light: #222224;
  --tile-border: #111113;
  --text-white: #f0f0f0;
  --text-green: var(--accent-color, #CEFF00);
  --seam: rgba(0,0,0,0.7);
  /* Tile size scales to fit 26 cols + gaps + padding within viewport */
  --tile-size: clamp(16px, calc((100vw - 80px) / 28), 72px);
  --tile-gap: clamp(1px, 0.25vw, 3px);
  --row-gap: clamp(2px, 0.4vw, 6px);
  --flip-duration: 250ms;
  --board-padding: clamp(16px, 3.5vw, 48px);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  font-family: 'Space Mono', 'Helvetica Neue', Helvetica, monospace;
}

/* ─── Subtle grid background ─── */
.grid-bg {
  position: fixed;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.4) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.4) 1px, transparent 1px);
  background-size: 48px 48px;
  z-index: 0;
}


/* ─── Lens Effects ─── */
.lens-effects {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}


/* Vignette — darkened edges like a real camera lens */
.lens-vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(0,0,0,0.15) 70%,
    rgba(0,0,0,0.4) 100%
  );
}

/* Chromatic aberration — RGB split on edges */
.lens-aberration {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%,
      rgba(255,0,0,0.015) 0%,
      transparent 50%
    ),
    radial-gradient(ellipse at 80% 50%,
      rgba(0,100,255,0.015) 0%,
      transparent 50%
    ),
    radial-gradient(ellipse at 50% 15%,
      rgba(255,0,100,0.01) 0%,
      transparent 40%
    ),
    radial-gradient(ellipse at 50% 85%,
      rgba(0,200,255,0.01) 0%,
      transparent 40%
    );
}

/* ─── 3D Board Frame ─── */
.board-frame {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}


.board-frame-inner {
  position: relative;
  border-radius: 12px;
  padding: 6px;
  /* Outer bezel — dark metal frame */
  background: linear-gradient(180deg, #2a2a2e 0%, #18181a 40%, #111113 100%);
  box-shadow:
    /* Outer drop shadow */
    0 20px 60px rgba(0,0,0,0.7),
    0 8px 24px rgba(0,0,0,0.5),
    /* Top highlight — overhead light catch */
    inset 0 1px 0 rgba(255,255,255,0.08),
    /* Bottom shadow */
    inset 0 -1px 0 rgba(0,0,0,0.5),
    /* Side bevels */
    inset 1px 0 0 rgba(255,255,255,0.03),
    inset -1px 0 0 rgba(255,255,255,0.03),
    /* Ambient glow from tiles */
    0 0 80px rgba(206, 255, 0, 0.03);
}

/* Inner recessed panel where tiles sit */
.board-frame-inner::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 8px;
  background: #0c0c0e;
  box-shadow:
    inset 0 2px 8px rgba(0,0,0,0.8),
    inset 0 -1px 0 rgba(255,255,255,0.02);
  z-index: 0;
}


/* ─── Logo on frame — backlit inset glow ─── */
.board-logo {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  height: var(--board-padding);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.board-logo img {
  height: 16px;
  width: auto;
  position: relative;
  z-index: 3;
  opacity: 0.9;
  filter:
    brightness(10)
    drop-shadow(0 0 2px rgba(255,255,255,0.8))
    drop-shadow(0 0 6px rgba(255,255,255,0.4))
    drop-shadow(0 0 14px rgba(255,255,255,0.2))
    drop-shadow(0 0 30px rgba(255,255,255,0.1));
  animation: logoGlow 4s ease-in-out infinite;
}

/* Inset recess — sits behind everything */
.board-logo::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% + 20px);
  height: 75%;
  border-radius: 4px;
  background: rgba(0,0,0,0.4);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.8),
    inset 0 1px 8px rgba(0,0,0,0.5),
    inset 0 -1px 1px rgba(255,255,255,0.05),
    inset 2px 0 3px rgba(0,0,0,0.3),
    inset -2px 0 3px rgba(0,0,0,0.3),
    0 1px 0 rgba(255,255,255,0.04),
    0 -1px 0 rgba(0,0,0,0.4);
  z-index: 1;
}

/* Frosted light bleed — on top of recess, behind logo */
.board-logo::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% + 50px);
  height: 250%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
    rgba(255,255,255,0.08) 0%,
    rgba(255,255,255,0.03) 40%,
    transparent 70%
  );
  filter: blur(6px);
  z-index: 2;
}

@keyframes logoGlow {
  0%, 100% {
    filter:
      brightness(10)
      drop-shadow(0 0 2px rgba(255,255,255,0.7))
      drop-shadow(0 0 6px rgba(255,255,255,0.3))
      drop-shadow(0 0 14px rgba(255,255,255,0.15))
      drop-shadow(0 0 30px rgba(255,255,255,0.08));
  }
  50% {
    filter:
      brightness(10)
      drop-shadow(0 0 3px rgba(255,255,255,0.9))
      drop-shadow(0 0 8px rgba(255,255,255,0.5))
      drop-shadow(0 0 18px rgba(255,255,255,0.25))
      drop-shadow(0 0 40px rgba(255,255,255,0.12));
  }
}

/* ─── Power LED ─── */
.power-led {
  position: absolute;
  bottom: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--board-padding);
  height: var(--board-padding);
}

.power-led-light {
  width: 12px;
  height: 4px;
  border-radius: 1px;
  background: #CEFF00;
  box-shadow:
    0 0 2px #CEFF00,
    0 0 6px rgba(206,255,0,0.6),
    0 0 14px rgba(206,255,0,0.25),
    inset 0 0 1px rgba(255,255,255,0.4);
  animation: ledPulse 3s ease-in-out infinite;
}

@keyframes ledPulse {
  0%, 100% { opacity: 0.7; box-shadow: 0 0 2px #CEFF00, 0 0 6px rgba(206,255,0,0.4), 0 0 10px rgba(206,255,0,0.15); }
  50% { opacity: 1; box-shadow: 0 0 3px #CEFF00, 0 0 8px rgba(206,255,0,0.6), 0 0 16px rgba(206,255,0,0.3); }
}

/* ─── Board (tile container) ─── */
#board {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--row-gap);
  padding: var(--board-padding);
}

/* ─── Row ─── */
.flap-row {
  display: flex;
  gap: var(--tile-gap);
  justify-content: center;
}

/* ─── Single Tile ─── */
.tile {
  width: var(--tile-size);
  height: calc(var(--tile-size) * 1.2);
  perspective: 200px;
  position: relative;
}

/* Tile housing — the physical frame */
.tile-housing {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 3px;
  background: var(--tile-border);
  box-shadow:
    0 2px 4px rgba(0,0,0,0.5),
    0 1px 1px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.02);
  overflow: visible;
  transform-style: preserve-3d;
}

/* ─── Top and bottom halves ─── */
.tile-top,
.tile-bottom {
  position: absolute;
  left: 1px;
  right: 1px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tile-top {
  top: 1px;
  height: calc(50% - 1px);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--tile-bg-light) 0%, var(--tile-bg) 100%);
  /* Top-lit by overhead light */
  box-shadow: inset 0 1px 1px rgba(255,255,255,0.04);
}

.tile-bottom {
  bottom: 1px;
  height: calc(50% - 1px);
  border-radius: 0 0 2px 2px;
  background: linear-gradient(180deg, var(--tile-bg) 0%, #151517 100%);
  /* Self-shadow from top flap */
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
}

/* Dynamic shadow cast by the flipping top flap onto the bottom half */
.tile-shadow-overlay {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: calc(50% - 1px);
  border-radius: 0 0 2px 2px;
  background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 60%, transparent 100%);
  opacity: 0;
  z-index: 3;
  pointer-events: none;
  transition: opacity 0.05s linear;
}

/* Character positioning — text spans the full tile, clipped by each half */
.tile-top .char,
.tile-bottom .char {
  position: absolute;
  font-size: calc(var(--tile-size) * 0.6);
  font-weight: 700;
  line-height: calc(var(--tile-size) * 1.2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-white);
  user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tile-top .char {
  top: 0;
  /* Vertically center in full tile, but only top half visible */
}

.tile-bottom .char {
  bottom: 0;
}

/* Green highlight */
.tile[data-color="green"] .char {
  color: var(--text-green);
  text-shadow: 0 0 8px rgba(206,255,0,0.15), 0 1px 2px rgba(0,0,0,0.3);
}

/* ─── Center seam ─── */
.tile-housing::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: var(--seam);
  z-index: 5;
  /* Slight 3D groove effect */
  box-shadow: 0 1px 0 rgba(255,255,255,0.02);
}

/* ─── Flipping flap (top half rotating down) ─── */
.tile-flap {
  position: absolute;
  left: 1px;
  right: 1px;
  top: 1px;
  height: calc(50% - 1px);
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--tile-bg-light) 0%, var(--tile-bg) 100%);
  box-shadow:
    inset 0 1px 1px rgba(255,255,255,0.04),
    0 2px 6px rgba(0,0,0,0.5);
  transform-origin: bottom center;
  transform: rotateX(0deg);
  backface-visibility: hidden;
  z-index: 4;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transform-style: preserve-3d;
}

.tile-flap .char {
  position: absolute;
  top: 0;
  font-size: calc(var(--tile-size) * 0.6);
  font-weight: 700;
  line-height: calc(var(--tile-size) * 1.2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-white);
  user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tile[data-color="green"] .tile-flap .char {
  color: var(--text-green);
  text-shadow: 0 0 8px rgba(206,255,0,0.15), 0 1px 2px rgba(0,0,0,0.3);
}

/* Light catch during flip */
.tile-flap::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 20%,
    rgba(255,255,255,0.08) 45%,
    rgba(255,255,255,0.14) 50%,
    rgba(255,255,255,0.08) 55%,
    transparent 80%
  );
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

/* ─── Flap bottom (rotating up into place) ─── */
.tile-flap-bottom {
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: calc(50% - 1px);
  border-radius: 0 0 2px 2px;
  background: linear-gradient(180deg, var(--tile-bg) 0%, #151517 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.4);
  transform-origin: top center;
  transform: rotateX(90deg);
  backface-visibility: hidden;
  z-index: 4;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

.tile-flap-bottom .char {
  position: absolute;
  bottom: 0;
  font-size: calc(var(--tile-size) * 0.6);
  font-weight: 700;
  line-height: calc(var(--tile-size) * 1.2);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--text-white);
  user-select: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.tile[data-color="green"] .tile-flap-bottom .char {
  color: var(--text-green);
  text-shadow: 0 0 8px rgba(206,255,0,0.15), 0 1px 2px rgba(0,0,0,0.3);
}

/* ─── Animation classes ─── */
.tile-flap.flipping {
  opacity: 1;
  animation: flapDown var(--flip-duration) ease-in forwards;
}
.tile-flap.flipping::before {
  opacity: 1;
}

.tile-flap-bottom.flipping {
  opacity: 1;
  animation: flapUp var(--flip-duration) ease-out forwards;
  animation-delay: calc(var(--flip-duration) * 0.4);
}

@keyframes flapDown {
  0%   {
    transform: rotateX(0deg);
    filter: blur(0px);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.04), 0 2px 6px rgba(0,0,0,0.5);
  }
  30% {
    filter: blur(0.3px);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.02), 0 4px 12px rgba(0,0,0,0.6);
  }
  60%  {
    filter: blur(0.8px);
    box-shadow: inset 0 0 0 rgba(255,255,255,0), 0 6px 16px rgba(0,0,0,0.7);
  }
  100% {
    transform: rotateX(-90deg);
    filter: blur(0.2px);
    box-shadow: inset 0 0 0 rgba(255,255,255,0), 0 0px 0px rgba(0,0,0,0);
  }
}

@keyframes flapUp {
  0%   {
    transform: rotateX(90deg);
    filter: blur(0.3px);
    box-shadow: inset 0 0 0 rgba(255,255,255,0), 0 0 0 rgba(0,0,0,0);
  }
  40% {
    filter: blur(0.6px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6), 0 -2px 8px rgba(0,0,0,0.3);
  }
  70% {
    filter: blur(0.3px);
  }
  100% {
    transform: rotateX(0deg);
    filter: blur(0px);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.4), 0 0 0 rgba(0,0,0,0);
  }
}

/* Shadow that sweeps across bottom half as top flap passes */
@keyframes castShadow {
  0%   { opacity: 0; }
  20%  { opacity: 0.6; }
  50%  { opacity: 0.9; }
  80%  { opacity: 0.4; }
  100% { opacity: 0; }
}

.tile-shadow-overlay.casting {
  animation: castShadow var(--flip-duration) ease-in-out forwards;
}

/* GPU compositing — 60fps */
.tile-flap.flipping,
.tile-flap-bottom.flipping,
.tile-shadow-overlay.casting {
  will-change: transform, filter, opacity;
}

/* Force GPU layer promotion on all tiles for smooth 60fps */
.tile-housing {
  transform: translateZ(0);
}

/* ═══════════════════════════════════════════════════════════════════
   Settings Panel — hover-reveal editor
   ═══════════════════════════════════════════════════════════════════ */

/* Trigger — bottom-left corner, invisible until hover */
.settings-trigger {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s, background 0.2s;
  color: rgba(255,255,255,0.3);
}

/* Reveal on hover near bottom-left corner */
body:hover .settings-trigger {
  opacity: 0.4;
}
.settings-trigger:hover {
  opacity: 1 !important;
  background: rgba(255,255,255,0.06);
  color: #CEFF00;
}

/* First-load hint tooltip */
.settings-hint {
  position: absolute;
  left: calc(100% + 10px);
  bottom: 50%;
  transform: translateY(50%);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 6px 12px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  animation: hintReveal 6s ease-in-out forwards;
  animation-delay: 3s;
}

/* Little arrow pointing left toward the gear */
.settings-hint::before {
  content: '';
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-right-color: rgba(0,0,0,0.6);
}

@keyframes hintReveal {
  0%   { opacity: 0; transform: translateY(50%) translateX(6px); }
  15%  { opacity: 1; transform: translateY(50%) translateX(0); }
  80%  { opacity: 1; transform: translateY(50%) translateX(0); }
  100% { opacity: 0; transform: translateY(50%) translateX(0); }
}

/* Force trigger visible during hint */
.settings-trigger:has(.settings-hint) {
  animation: triggerPulse 2s ease-in-out 3;
  animation-delay: 3s;
}

@keyframes triggerPulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; color: #CEFF00; }
}

/* Panel */
.settings-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: 380px;
  height: 100vh;
  z-index: 99;
  background: #111113;
  border-right: 1px solid rgba(255,255,255,0.06);
  box-shadow: 4px 0 40px rgba(0,0,0,0.6);
  transform: translateX(-100%);
  transition: transform 0.35s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.settings-panel.open {
  transform: translateX(0);
}

/* Header */
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.settings-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #CEFF00;
}

.settings-sub {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
  margin-top: 2px;
}

.settings-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.3);
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.settings-close:hover {
  color: white;
  background: rgba(255,255,255,0.06);
}

/* Help section */
.settings-help {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  line-height: 1.6;
}
.settings-help strong {
  color: rgba(255,255,255,0.6);
}
.help-green {
  color: #CEFF00;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
}

/* Zoom control */
.settings-zoom {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.zoom-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.08);
  outline: none;
  cursor: pointer;
}

.zoom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #CEFF00;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(206,255,0,0.3);
}

.zoom-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #CEFF00;
  border: none;
  cursor: pointer;
}

.zoom-value {
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  min-width: 36px;
  text-align: right;
}

/* Color picker */
.settings-color {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.color-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  margin-bottom: 8px;
}

.color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.color-picker {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  background: none;
  padding: 0;
}
.color-picker::-webkit-color-swatch-wrapper { padding: 0; }
.color-picker::-webkit-color-swatch { border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; }

.color-hex {
  flex: 1;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 6px 8px;
  font-family: 'Space Mono', monospace;
  font-size: 12px;
  color: white;
  text-transform: uppercase;
  outline: none;
}
.color-hex:focus {
  border-color: rgba(206,255,0,0.3);
}

.color-presets {
  display: flex;
  gap: 6px;
}

.preset-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.preset-dot:hover {
  transform: scale(1.15);
}
.preset-dot.active {
  border-color: white;
}

/* Message list */
.settings-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}

.msg-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.msg-card:hover {
  border-color: rgba(206,255,0,0.15);
}

.msg-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.msg-card-num {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.2);
  text-transform: uppercase;
}

.msg-card-delete {
  background: none;
  border: none;
  color: rgba(255,255,255,0.15);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.msg-card-delete:hover {
  color: #ff4444;
  background: rgba(255,0,0,0.08);
}

.msg-line-input {
  width: 100%;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 6px 8px;
  font-family: 'Space Mono', monospace;
  font-size: 11px;
  color: white;
  margin-bottom: 4px;
  outline: none;
  transition: border-color 0.15s;
}
.msg-line-input:focus {
  border-color: rgba(206,255,0,0.3);
}
.msg-line-input::placeholder {
  color: rgba(255,255,255,0.15);
}

.msg-line-count {
  text-align: right;
  font-size: 9px;
  color: rgba(255,255,255,0.15);
  font-family: 'Space Mono', monospace;
  margin-bottom: 2px;
}
.msg-line-count.over {
  color: #ff4444;
}

/* Action buttons */
.settings-actions {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  gap: 8px;
}

.btn-add, .btn-reset {
  flex: 1;
  padding: 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.btn-add {
  background: #CEFF00;
  color: #111;
}
.btn-add:hover {
  filter: brightness(1.1);
}

.btn-reset {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.4);
  border: 1px solid rgba(255,255,255,0.06);
}
.btn-reset:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.6);
}

/* Footer */
.settings-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255,255,255,0.15);
}

.settings-version {
  font-family: 'Space Mono', monospace;
}

/* Scrollbar */
.settings-messages::-webkit-scrollbar {
  width: 4px;
}
.settings-messages::-webkit-scrollbar-track {
  background: transparent;
}
.settings-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
}

/* Hide trigger when panel is open */
.settings-panel.open ~ .settings-trigger {
  opacity: 0 !important;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════════
   WINDOWLESS MODE — board fills full viewport, no frame
   ═══════════════════════════════════════════════════════════════ */

body.windowless .board-frame {
  align-items: stretch;
  justify-content: stretch;
}

body.windowless .board-frame-inner {
  border-radius: 0;
  padding: 0;
  background: #0c0c0e;
  box-shadow: none;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: none !important; /* override zoom in windowless */
}

body.windowless .board-frame-inner::before {
  display: none; /* remove recessed inner panel */
}

body.windowless .board-logo {
  display: none; /* hide frame logo — use windowless brand instead */
}

body.windowless .power-led {
  display: none;
}

body.windowless .grid-bg,
body.windowless .lens-effects {
  display: none;
}

body.windowless #board {
  /* Scale to fill 16:9 within viewport */
  transform-origin: center;
}

/* Windowless branding — bottom-right corner, subtle */
.windowless-brand {
  display: none;
  position: fixed;
  bottom: 16px;
  right: 20px;
  z-index: 20;
  align-items: center;
  gap: 8px;
  opacity: 0.25;
  pointer-events: none;
}

body.windowless .windowless-brand {
  display: flex;
}

.windowless-brand img {
  height: 14px;
  width: auto;
  filter: brightness(10);
}

.windowless-brand span {
  font-family: 'Space Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.15em;
}

/* ═══════════════════════════════════════════════════════════════
   FONT SELECTOR
   ═══════════════════════════════════════════════════════════════ */

.settings-font {
  padding: 0 20px;
  margin-bottom: 16px;
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.font-option {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
  color: rgba(255,255,255,0.5);
  font-size: 16px;
  font-weight: 700;
  padding: 10px 4px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.font-option:nth-child(1) { font-family: 'Space Mono', monospace; }
.font-option:nth-child(2) { font-family: 'JetBrains Mono', monospace; }
.font-option:nth-child(3) { font-family: 'IBM Plex Mono', monospace; }
.font-option:nth-child(4) { font-family: 'Inconsolata', monospace; }
.font-option:nth-child(5) { font-family: 'Source Code Pro', monospace; }
.font-option:nth-child(6) { font-family: 'Fira Code', monospace; }

.font-option:hover {
  border-color: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.8);
}

.font-option.active {
  border-color: var(--accent-color, #CEFF00);
  color: var(--accent-color, #CEFF00);
  background: rgba(206, 255, 0, 0.06);
}

.font-name {
  display: block;
  margin-top: 6px;
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.1em;
}

/* ═══════════════════════════════════════════════════════════════
   TOGGLE BUTTON (Windowless mode)
   ═══════════════════════════════════════════════════════════════ */

.settings-toggle-row {
  padding: 0 20px;
  margin-bottom: 16px;
}

.settings-toggle-desc {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  line-height: 1.5;
  margin-top: 4px;
  margin-bottom: 8px;
}

.btn-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.4);
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-toggle:hover {
  border-color: rgba(255,255,255,0.2);
}

.btn-toggle.active {
  background: var(--accent-color, #CEFF00);
  color: #000;
  border-color: var(--accent-color, #CEFF00);
}
