:root {
  color-scheme: dark;
  --bg: #0c0f14;
  --panel: #131922;
  --text: #e9eef8;
  --muted: #8ca0bf;
  --accent: #66a3ff;
  --danger: #ff6f6f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(circle at top, #151c2b, var(--bg));
  color: var(--text);
  min-height: 100vh;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.header h1 {
  margin: 0;
  font-size: 2rem;
}

.header p {
  margin-top: 6px;
  color: var(--muted);
}

.stats {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.stats > div {
  background: var(--panel);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #243044;
}

#timer.warn {
  color: #ffc766;
}

#timer.danger {
  color: var(--danger);
}

#timer {
  position: relative;
  display: inline-block;
}

#timer.flash-once {
  animation: timer-pop 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

#timer.flash-once::after {
  content: '';
  position: absolute;
  inset: -6px -10px;
  border-radius: 8px;
  border: 2px solid var(--accent);
  background: rgba(102, 163, 255, 0.15);
  animation: timer-ping 0.9s cubic-bezier(0, 0, 0.2, 1) forwards;
  pointer-events: none;
}

@keyframes timer-pop {
  0%   { transform: scale(1); color: var(--text); text-shadow: none; }
  75%  { transform: scale(1.45); color: var(--accent); text-shadow: 0 0 18px var(--accent), 0 0 40px rgba(102, 163, 255, 0.5); }
  100% { transform: scale(1); color: var(--text); text-shadow: none; }
}

@keyframes timer-ping {
  0%   { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

#timer.flash.flash-toggle {
  opacity: 0.25;
}

#timer.flash {
  transition: opacity 0.3s ease;
}

#board {
  width: 100%;
  min-height: 62vh;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #2a3852;
  background: #0b111b;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.5;
  padding: 14px;
  outline: none;
}

#board:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
}

button {
  border: 1px solid #2a3d63;
  background: #16233a;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: #1d3050;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  color: var(--muted);
}
