:root {
  --bg-top: #03283e;
  --bg-bottom: #03283e;
  --frame: #000000;
  --frame-edge: #6b6b6b;
  --text: #e0e0e0;
  --dim: #b6b6b6;
  --accent: #d5d5d5;
  --player-one: #ffd84d;
  --player-two: #fe062c;
  --danger: #ff9a9a;
  --panel: #000000;
  --shadow: rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  position: relative;
  overflow-x: hidden;
  display: grid;
  place-items: center;
  padding: 24px;
  background: #03283e;
    
  color: var(--text);
  font-family: "Lucida Console", "Courier New", Courier, monospace;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 3px
    );
  opacity: 0.14;
  pointer-events: none;
}



.app-shell {
  width: 100%;
  max-width: 880px;
  outline: none;
}

.terminal-frame {
  position: relative;
  width: 100%;
  border: 3px solid var(--frame-edge);
  border-radius: 0;
  background: var(--panel);
  box-shadow:
    0 24px 80px var(--shadow),
    inset 0 0 0 2px rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.focus-hint {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.78);
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.terminal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 2px solid var(--frame-edge);
  background: linear-gradient(180deg, #f1f4ff, #565656);
}

.terminal-title {
  margin: 0;
  color: #000000;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  font-weight: bold;
}

.terminal-body {
  padding: 22px;
}

.boot-log {
  margin-bottom: 16px;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  opacity: 1;
  max-height: 120px;
  overflow: hidden;
  transition: opacity 240ms ease, max-height 240ms ease, margin-bottom 240ms ease;
}

.boot-log.hidden {
  opacity: 0;
  max-height: 0;
  margin-bottom: 0;
}

.boot-log p,
.hud p,
.credit-line {
  margin: 0;
}

.hud {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.status-line {
  color: var(--accent);
  font-size: 1.1rem;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.14);
}

.meta-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-line {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--dim);
}

.hint-line,
.credit-line {
  color: var(--dim);
  font-size: 0.95rem;
}

.controls {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.drop-button,
.reset-button,
.panel-toggle {
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.drop-button {
  min-height: 42px;
}

.drop-button:hover,
.drop-button:focus-visible,
.reset-button:hover,
.reset-button:focus-visible,
.panel-toggle:hover,
.panel-toggle:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.08);
}

.drop-button:disabled {
  cursor: not-allowed;
  color: #575757;
  border-color: rgba(145, 160, 215, 0.2);
  box-shadow: none;
  transform: none;
}

.board {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.98), rgba(0, 0, 0, 0.98));
  color: var(--text);
  font-size: clamp(0.9rem, 1.8vw, 1.22rem);
  line-height: 1.45;
  white-space: pre;
  overflow-x: auto;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.12);
}

.insight-shell {
  margin-top: 16px;
}

.panel-toggle {
  width: 100%;
  min-height: 42px;
  padding: 0 14px;
  text-align: left;
}

.insight-panel {
  margin-top: 10px;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.panel-line {
  margin: 0;
  color: var(--text);
}

.panel-line + .panel-line {
  margin-top: 10px;
}

.panel-details {
  margin: 12px 0 0;
  padding: 12px;
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.16);
  color: var(--dim);
  font: inherit;
  line-height: 1.5;
  white-space: pre-wrap;
}

.token-empty {
  color: #ffffff;
}

.token-p1 {
  color: var(--player-one);
  text-shadow: 0 0 8px rgba(255, 204, 77, 0.35);
}

.token-p2 {
  color: var(--player-two);
  text-shadow: 0 0 8px rgba(255, 107, 107, 0.35);
}

.token-falling {
  animation: falling-blink 90ms steps(2, end) infinite;
}

.token-winning {
  animation: winner-blink 700ms steps(2, end) infinite;
}

.column-label {
  color: var(--dim);
}

.message-win {
  color: var(--player-one);
}

.message-win.player-two {
  color: var(--player-two);
}

.message-draw {
  color: var(--danger);
}

.footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-actions-primary {
  flex: 1 1 auto;
}

.audio-controls {
  display: grid;
  gap: 10px;
  justify-items: end;
  flex: 0 0 320px;
}

.audio-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  width: 100%;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--dim);
  font-size: 0.95rem;
}

.volume-label {
  white-space: nowrap;
}

.volume-slider {
  width: 160px;
  accent-color: var(--player-one);
  cursor: pointer;
}

.reset-button {
  min-height: 44px;
  padding: 0 16px;
}

@keyframes falling-blink {
  0% {
    filter: brightness(1);
  }

  100% {
    filter: brightness(1.25);
  }
}

@keyframes winner-blink {
  0% {
    opacity: 1;
    filter: brightness(1);
  }

  50% {
    opacity: 0.2;
    filter: brightness(1.7);
  }

  100% {
    opacity: 1;
    filter: brightness(1);
  }
}

@media (max-width: 720px) {
  body {
    padding: 14px;
  }

  .terminal-body {
    padding: 16px;
  }

  .controls {
    gap: 8px;
  }

  .meta-panel {
    grid-template-columns: 1fr;
  }

  .footer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .footer-actions {
    width: 100%;
    flex-direction: column;
  }

  .audio-controls {
    width: 100%;
    justify-items: stretch;
    flex: 1 1 auto;
  }

  .audio-buttons {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .volume-control {
    width: 100%;
    justify-content: space-between;
  }

  .volume-slider {
    width: min(220px, 100%);
  }

  .reset-button {
    width: 100%;
  }
}
