html {
  font-size: 21px; /* ~130% of 16px default — makes game feel like 150% zoom */
}

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

.memory-app {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: calc(100vh - 50px);
}

/* ── Start screen ── */
#start-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 50px);
  gap: 1rem;
}

#start-screen h1 {
  font-size: 2rem;
  color: #a0c4ff;
  margin-bottom: 0.5rem;
}

#start-screen input[type="text"] {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border: 2px solid #444;
  border-radius: 6px;
  background: #16213e;
  color: #e0e0e0;
  width: 240px;
  text-align: center;
}

#start-screen input[type="text"]:focus {
  outline: none;
  border-color: #a0c4ff;
}

/* ── Buttons ── */
button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  padding: 0.5rem 1.2rem;
  transition: opacity 0.15s;
}

button:hover:not(:disabled) {
  opacity: 0.85;
}

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

.btn-primary {
  background: #a0c4ff;
  color: #1a1a2e;
  font-weight: 600;
  padding: 0.6rem 1.6rem;
  font-size: 1rem;
}

.btn-yes  { background: #4caf7d; color: #fff; min-width: 80px; }
.btn-no   { background: #e05c5c; color: #fff; min-width: 80px; }
.btn-high { background: #7b9cff; color: #fff; min-width: 80px; }
.btn-low  { background: #c97bff; color: #fff; min-width: 80px; }
.btn-submit { background: #a0c4ff; color: #1a1a2e; font-weight: 600; }

/* ── Game layout ── */
#game-screen {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  width: 100%;
  height: calc(100vh - 50px);
  background: #111;
}

.quadrant {
  background: #16213e;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 1rem;
  position: relative;
  overflow: hidden;
}

.quadrant h2 {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  position: absolute;
  top: 0.75rem;
  left: 1rem;
}

/* ── Timer bar (per-minigame) ── */
.timer-bar-wrap {
  width: 100%;
  height: 4px;
  background: #2a2a4a;
  border-radius: 2px;
  position: absolute;
  bottom: 0;
  left: 0;
}

.timer-bar {
  height: 100%;
  border-radius: 2px;
  background: #a0c4ff;
  transition: width 0.25s linear;
}

/* ── Recall ── */
.recall-combos {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.combo-chip {
  background: #0f3460;
  border: 1px solid #2a4a7a;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #a0c4ff;
  min-width: 4rem;
  text-align: center;
}

.recall-probe {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.1em;
}

.recall-buttons {
  display: flex;
  gap: 1rem;
}

/* ── Audible ── */
.audible-buttons {
  display: flex;
  gap: 1rem;
}

.audible-waiting {
  color: #555;
  font-style: italic;
}

/* ── Gauge ── */
.gauge-wrap {
  cursor: pointer;
  user-select: none;
}

.gauge-wrap:active { opacity: 0.9; }

.zone-green  { fill: none; stroke: #4caf7d; stroke-width: 18; }
.zone-yellow { fill: none; stroke: #f0c040; stroke-width: 18; }
.zone-red    { fill: none; stroke: #e05c5c; stroke-width: 18; }
.gauge-bg    { fill: none; stroke: #2a2a4a; stroke-width: 20; }
.needle      { stroke: #fff; stroke-width: 3; stroke-linecap: round; }
.gauge-center { fill: #a0c4ff; }

/* ── Addition ── */
.addition-grid {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.3rem;
  font-size: 1.4rem;
  font-family: monospace;
}

.addition-row {
  display: flex;
  gap: 0.3rem;
}

.digit-box {
  width: 2.2rem;
  height: 2.6rem;
  text-align: center;
  font-size: 1.4rem;
  font-family: monospace;
  background: #0f3460;
  border: 2px solid #2a4a7a;
  border-radius: 4px;
  color: #fff;
  caret-color: #a0c4ff;
}

.digit-box:focus {
  outline: none;
  border-color: #a0c4ff;
}

.digit-box.readonly {
  border-color: transparent;
  background: transparent;
  color: #a0c4ff;
  pointer-events: none;
}

.addition-divider {
  width: 100%;
  height: 2px;
  background: #444;
  border-radius: 1px;
}

.addition-submit-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

/* ── Idle / waiting state ── */
.idle-msg {
  color: #444;
  font-style: italic;
  font-size: 0.9rem;
}

/* ── Results page ── */
body.results-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.results-header {
  background: #16213e;
  padding: 1rem 1.5rem;
  border-bottom: 2px solid #0f3460;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.results-header h1 {
  font-size: 1.2rem;
  color: #a0c4ff;
}

.results-header a {
  color: #a0c4ff;
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.7;
}

.results-header a:hover { opacity: 1; }

.results-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 56px);
}

/* Left panel */
.results-left {
  background: #16213e;
  border-right: 2px solid #0f3460;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.filters {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid #0f3460;
}

.filters label {
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.1rem;
  display: block;
}

.filters input[type="text"],
.filters input[type="date"] {
  width: 100%;
  padding: 0.4rem 0.6rem;
  background: #0f3460;
  border: 1px solid #2a4a7a;
  border-radius: 4px;
  color: #e0e0e0;
  font-size: 0.85rem;
}

.filters input:focus {
  outline: none;
  border-color: #a0c4ff;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.attempt-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.attempt-item {
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  margin-bottom: 2px;
}

.attempt-item:hover {
  background: #1e2d5a;
}

.attempt-item.selected {
  background: #0f3460;
  border-color: #a0c4ff;
}

.attempt-item .attempt-user {
  font-weight: 600;
  font-size: 0.95rem;
}

.attempt-item .attempt-meta {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}

.attempt-item .attempt-incomplete {
  font-size: 0.7rem;
  color: #e05c5c;
}

/* Right panel */
.results-right {
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.no-selection {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #444;
  font-style: italic;
}

.stats-section h3 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #2a2a4a;
  padding-bottom: 0.4rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.stat-card {
  background: #0f3460;
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.stat-card .stat-label {
  font-size: 0.75rem;
  color: #888;
  margin-bottom: 0.2rem;
}

.stat-card .stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: #a0c4ff;
}

.minigame-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.minigame-table th {
  text-align: left;
  padding: 0.4rem 0.6rem;
  color: #888;
  font-weight: 500;
  border-bottom: 1px solid #2a2a4a;
}

.minigame-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #1a1a3a;
}

.aggregate-section {
  background: #16213e;
  border-radius: 10px;
  padding: 1rem 1.5rem;
}

.aggregate-section h3 {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 0.75rem;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
