/* EduFabTech — game-light.css (Light memory) — every class prefixed gm-light- */
.gm-light-box {
  --gl-gold: #ffd24a;
  --gl-cyan: #19e3ff;
  width: min(560px, 100%);
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid var(--border, #1f2733);
  border-radius: var(--radius, 12px);
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(255, 210, 74, .08), transparent 60%),
    linear-gradient(180deg, #131822 0%, #0d1118 100%);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  font-family: var(--sans, system-ui, sans-serif);
  color: var(--text, #edf0f5);
  -webkit-user-select: none;
  user-select: none;
}

/* ── HUD ─────────────────────────────────────────────── */
.gm-light-hud {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm, 8px);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
  border: 1px solid rgba(255, 255, 255, .06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 4px 12px rgba(0, 0, 0, .25);
}
.gm-light-level {
  font-weight: 700;
  font-size: 1rem;
  color: var(--gl-gold);
  letter-spacing: .01em;
  white-space: nowrap;
}
.gm-light-status {
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  letter-spacing: .02em;
  color: var(--muted, #6f7c8d);
  transition: color .2s;
}
.gm-light-status[data-kind="show"] { color: var(--gl-gold); text-shadow: 0 0 14px rgba(255, 210, 74, .45); }
.gm-light-status[data-kind="input"] { color: var(--brand, #43d49b); text-shadow: 0 0 14px rgba(67, 212, 155, .45); }
.gm-light-status[data-kind="win"] { color: var(--brand, #43d49b); text-shadow: 0 0 18px rgba(67, 212, 155, .7); }
.gm-light-status[data-kind="over"] { color: var(--err, #ef6a62); }
.gm-light-time {
  font-family: var(--mono, ui-monospace, monospace);
  font-size: .95rem;
  color: var(--muted, #6f7c8d);
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ── Board ───────────────────────────────────────────── */
.gm-light-board {
  padding: 12px;
  border-radius: var(--radius, 12px);
  background: linear-gradient(180deg, #0a0d13 0%, #0e121a 100%);
  border: 1px solid #0b0e14;
  box-shadow: inset 0 4px 18px rgba(0, 0, 0, .6), inset 0 -1px 0 rgba(255, 255, 255, .04);
  touch-action: none;
}
.gm-light-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  aspect-ratio: 1 / 1;
  -webkit-tap-highlight-color: transparent;
}

/* A pad: raised tile with a lamp inside */
.gm-light-pad {
  position: relative;
  min-width: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0;
  border: 1px solid #2a3443;
  border-radius: 18%;
  background: linear-gradient(160deg, #1c2430 0%, #131822 55%, #0f131b 100%);
  box-shadow:
    0 6px 0 #0a0d13,
    0 10px 18px rgba(0, 0, 0, .5),
    inset 0 1px 0 rgba(255, 255, 255, .08),
    inset 0 -2px 6px rgba(0, 0, 0, .45);
  cursor: pointer;
  overflow: hidden;
  touch-action: none;
  transform: translateY(0);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.gm-light-pad:focus-visible {
  outline: 3px solid var(--link, #86c8ff);
  outline-offset: 2px;
}
.gm-light-pad:active {
  transform: translateY(4px);
  box-shadow:
    0 2px 0 #0a0d13,
    0 4px 10px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 255, 255, .06),
    inset 0 -2px 6px rgba(0, 0, 0, .45);
}
.gm-light-grid[aria-disabled="true"] .gm-light-pad { cursor: default; }

/* The lamp: the glowing disc inside the tile */
.gm-light-lamp {
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #2a3444 0%, #1a212c 55%, #131822 100%);
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .55), inset 0 -1px 0 rgba(255, 255, 255, .05);
  opacity: .9;
  transition: background .12s ease, box-shadow .12s ease, transform .12s ease;
  pointer-events: none;
}
.gm-light-num {
  position: absolute;
  right: 10%;
  bottom: 7%;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: clamp(.7rem, 2.6vw, .85rem);
  font-weight: 600;
  color: rgba(237, 240, 245, .28);
  pointer-events: none;
  transition: color .12s;
}

/* Lit by the sequence: gold */
.gm-light-pad.gm-light-lit {
  border-color: rgba(255, 210, 74, .8);
  box-shadow:
    0 6px 0 #0a0d13,
    0 0 0 2px rgba(255, 210, 74, .25),
    0 0 28px 6px rgba(255, 210, 74, .45),
    inset 0 1px 0 rgba(255, 255, 255, .1);
}
.gm-light-pad.gm-light-lit .gm-light-lamp {
  background: radial-gradient(circle at 40% 35%, #fff6c8 0%, var(--gl-gold) 45%, #e8a52a 100%);
  box-shadow: 0 0 24px 8px rgba(255, 210, 74, .75), 0 0 48px 14px rgba(255, 210, 74, .3), inset 0 -2px 6px rgba(200, 120, 0, .35);
  transform: scale(1.06);
  opacity: 1;
}
.gm-light-pad.gm-light-lit .gm-light-num { color: rgba(10, 12, 17, .55); }

/* Lit by the player's tap: green, with a pop */
.gm-light-pad.gm-light-hit {
  border-color: rgba(67, 212, 155, .8);
  box-shadow:
    0 6px 0 #0a0d13,
    0 0 0 2px rgba(67, 212, 155, .25),
    0 0 28px 6px rgba(67, 212, 155, .45),
    inset 0 1px 0 rgba(255, 255, 255, .1);
  animation: gm-light-pop .22s ease-out;
}
.gm-light-pad.gm-light-hit .gm-light-lamp {
  background: radial-gradient(circle at 40% 35%, #dfffee 0%, var(--brand, #43d49b) 45%, #1f9b6c 100%);
  box-shadow: 0 0 24px 8px rgba(67, 212, 155, .75), 0 0 48px 14px rgba(67, 212, 155, .3), inset 0 -2px 6px rgba(0, 90, 60, .35);
  transform: scale(1.06);
  opacity: 1;
}
.gm-light-pad.gm-light-hit .gm-light-num { color: rgba(10, 12, 17, .55); }

/* Whole board flash on a completed sequence */
.gm-light-pad.gm-light-flash .gm-light-lamp {
  background: radial-gradient(circle at 40% 35%, #ffffff 0%, var(--gl-cyan) 50%, #0e9fb8 100%);
  box-shadow: 0 0 22px 6px rgba(25, 227, 255, .6);
  opacity: 1;
  animation: gm-light-flash .3s ease-out;
}
.gm-light-box.gm-light-win .gm-light-board { box-shadow: inset 0 4px 18px rgba(0, 0, 0, .6), 0 0 32px rgba(67, 212, 155, .35); }

/* Wrong tap: red pad, the expected one outlined, board shakes */
.gm-light-pad.gm-light-wrong {
  border-color: var(--err, #ef6a62);
  box-shadow: 0 6px 0 #0a0d13, 0 0 24px 6px rgba(239, 106, 98, .5);
}
.gm-light-pad.gm-light-wrong .gm-light-lamp {
  background: radial-gradient(circle at 40% 35%, #ffd6d3 0%, var(--err, #ef6a62) 50%, #b23a34 100%);
  box-shadow: 0 0 22px 8px rgba(239, 106, 98, .6);
  opacity: 1;
}
.gm-light-pad.gm-light-expected { border-color: rgba(255, 210, 74, .9); }
.gm-light-pad.gm-light-expected .gm-light-lamp {
  box-shadow: inset 0 0 0 3px rgba(255, 210, 74, .85), 0 0 14px 2px rgba(255, 210, 74, .35);
}
.gm-light-box.gm-light-shake .gm-light-board { animation: gm-light-shake .3s ease-in-out; }
.gm-light-box[data-phase="over"] { border-color: rgba(239, 106, 98, .5); }

/* Progress dots */
.gm-light-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 10px;
  margin: 12px 0 0;
}
.gm-light-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #222b38;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .5);
  transition: background .12s, box-shadow .12s;
}
.gm-light-dot.gm-light-dot-on {
  background: var(--brand, #43d49b);
  box-shadow: 0 0 8px rgba(67, 212, 155, .7);
}

.gm-light-hint {
  margin: 10px 0 0;
  font-size: .78rem;
  line-height: 1.4;
  text-align: center;
  color: var(--muted, #6f7c8d);
}

@keyframes gm-light-pop {
  0% { transform: translateY(0) scale(1); }
  45% { transform: translateY(1px) scale(1.07); }
  100% { transform: translateY(0) scale(1); }
}
@keyframes gm-light-flash {
  0% { transform: scale(.9); }
  40% { transform: scale(1.1); }
  100% { transform: scale(1.06); }
}
@keyframes gm-light-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* Reduced motion: instant state changes only */
.gm-light-reduced .gm-light-pad,
.gm-light-reduced .gm-light-lamp,
.gm-light-reduced .gm-light-num,
.gm-light-reduced .gm-light-dot,
.gm-light-reduced .gm-light-status { transition: none; }
.gm-light-reduced .gm-light-pad.gm-light-hit,
.gm-light-reduced .gm-light-pad.gm-light-flash .gm-light-lamp,
.gm-light-reduced.gm-light-shake .gm-light-board { animation: none; }
.gm-light-reduced .gm-light-pad.gm-light-lit .gm-light-lamp,
.gm-light-reduced .gm-light-pad.gm-light-hit .gm-light-lamp { transform: none; }

@media (max-width: 400px) {
  .gm-light-box { padding: 8px; }
  .gm-light-board { padding: 8px; }
  .gm-light-grid { gap: 8px; }
  .gm-light-hud { padding: 6px 8px; }
  .gm-light-status { font-size: 1.05rem; }
  .gm-light-level, .gm-light-time { font-size: .85rem; }
  .gm-light-hint { display: none; }
}
