/* ============================================================================
 *  XenoXanadu — Minesweeper — palette + board-specific styling.
 *  Structural chrome (controls bar, segmented toggle, AI panel) comes from the
 *  shared lib/arcade.css; this file only carries Minesweeper's own identity:
 *  the LED HUD, the bevelled tile grid, the classic number colours, and the
 *  hint/auto highlight pulses.
 * ========================================================================== */
:root {
  --bg:        #0c0d0f;
  --bg-2:      #131417;
  --panel:     #131417;
  --panel-2:   #1a1c20;
  --grid:      #24262b;
  --line:      #313338;
  --text:      #e7e6e0;
  --muted:     #8a8d93;
  --accent:    #cf5a52;          /* muted mine red */
  --on-accent: #0c0d0f;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --wrap-max: 860px;

  --seg-bg: #131417;
  --seg-active-bg: #1a1c20;

  /* covered-tile bevel */
  --tile:      #1a1c20;
  --tile-2:    #131417;
  --tile-hi:   #2a2d32;          /* top/left light edge */
  --tile-lo:   #0a0b0d;          /* bottom/right shadow edge */
  --revealed:  #0e1012;          /* opened square */
}

body { background: var(--bg); }

h1 {
  text-align: center; margin: 4px 0 6px; font-size: clamp(30px, 6vw, 46px);
  font-weight: 800; letter-spacing: 5px; text-transform: uppercase; color: var(--text);
  font-family: var(--mono);
}
.tagline { text-align: center; color: var(--muted); font-size: 12px; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 24px; font-family: var(--mono); }

/* ---------- LED HUD ---------- */
.hud {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  margin: 0 auto 16px; max-width: 360px;
}
.hud-readout {
  font-weight: 800; font-size: 20px; letter-spacing: 2px; color: #cf5a52;
  background: var(--bg-2); border: 1px solid var(--grid); border-radius: 0;
  padding: 7px 12px; min-width: 96px; text-align: center;
  font-family: var(--mono);
}
#timer { color: #5fa8b8; }
.face {
  font-size: 26px; line-height: 1; cursor: pointer; background: var(--panel-2);
  border: 1px solid var(--grid); border-radius: 0; padding: 4px 10px;
  transition: transform .06s ease, border-color .12s ease;
}
.face:hover { border-color: var(--accent); }
.face:active { transform: translateY(2px); }

/* ---------- board ---------- */
.board-scroll { overflow: auto; padding: 6px; margin: 0 -6px 18px; }
.board {
  --cell: 32px;
  display: grid; gap: 0; width: max-content; margin: 0 auto;
  grid-template-columns: repeat(var(--cols), var(--cell));
  border: 2px solid var(--grid); border-radius: 0;
  background: var(--tile-lo);
  user-select: none; touch-action: manipulation;
}
.board.intermediate { --cell: 30px; }
.board.expert { --cell: 27px; }

.cell {
  width: var(--cell); height: var(--cell);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: calc(var(--cell) * 0.52); line-height: 1;
  cursor: pointer; box-sizing: border-box; position: relative;
  border: 1px solid #0c1118; font-family: var(--mono);
}
/* covered: raised bevel */
.cell.hidden {
  background: var(--tile);
  border-top: 2px solid var(--tile-hi); border-left: 2px solid var(--tile-hi);
  border-right: 2px solid var(--tile-lo); border-bottom: 2px solid var(--tile-lo);
}
.cell.hidden:hover { filter: brightness(1.18); }
.cell.flag { color: #cf5a52; }
.cell.flag.bad { color: var(--muted); }            /* wrong flag, shown on loss */
.cell.flag.bad::after {
  content: "✕"; position: absolute; font-size: calc(var(--cell) * 0.62);
  color: #cf5a52; opacity: .9;
}
/* opened: recessed flat */
.cell.open {
  background: var(--revealed); cursor: default;
  border: 1px solid #070a0e;
  box-shadow: inset 1px 1px 0 #00000060;
}
.cell.open:hover { filter: none; }
.cell.mine { background: #4a1a18; }
.cell.mine.boom { background: #6b2420;
  animation: boom .4s ease; }
@keyframes boom { 0% { transform: scale(.5); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

/* classic muted number colours — distinct but calm */
.cell[data-n="1"] { color: #6f9bd1; }
.cell[data-n="2"] { color: #9ec27a; }
.cell[data-n="3"] { color: #cf5a52; }
.cell[data-n="4"] { color: #9b86c4; }
.cell[data-n="5"] { color: #c7a24a; }
.cell[data-n="6"] { color: #5fb6b0; }
.cell[data-n="7"] { color: #e7e6e0; }
.cell[data-n="8"] { color: #8a8d93; }

/* solver / hint highlights */
.cell.hint-safe  { animation: pulseSafe 1s ease-in-out infinite; z-index: 2; }
.cell.hint-mine  { animation: pulseMine 1s ease-in-out infinite; z-index: 2; }
.cell.hint-guess { animation: pulseGuess 1s ease-in-out infinite; z-index: 2; }
.cell.hint-src   { box-shadow: inset 0 0 0 2px #c7a24a; z-index: 1; }
@keyframes pulseSafe  { 0%,100% { box-shadow: inset 0 0 0 2px #9ec27a; } 50% { box-shadow: inset 0 0 0 3px #9ec27a; } }
@keyframes pulseMine  { 0%,100% { box-shadow: inset 0 0 0 2px #cf5a52; } 50% { box-shadow: inset 0 0 0 3px #cf5a52; } }
@keyframes pulseGuess { 0%,100% { box-shadow: inset 0 0 0 2px #c7a24a; } 50% { box-shadow: inset 0 0 0 3px #c7a24a; } }

/* win / lose wash over the whole board */
.board.lost  { animation: flashLose .5s ease; }
.board.won   { border-color: #9ec27a; }
@keyframes flashLose { 0%,100% { } 30% { border-color: #cf5a52; } }

/* ---------- assistant bar (solver — visible even on the hosted site) ---------- */
.assist {
  max-width: 620px; margin: 0 auto 14px; display: flex; flex-direction: column;
  gap: 10px; align-items: center;
}
.assist-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.assist-btn {
  cursor: pointer; border: 1px solid var(--grid); border-radius: 0; padding: 8px 14px;
  font-family: var(--mono); font-weight: 700; font-size: 13px; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text); background: var(--panel-2);
  transition: color .12s, border-color .12s, background .12s, transform .08s;
}
.assist-btn:hover { border-color: var(--accent); color: var(--accent); }
.assist-btn:active { transform: translateY(1px); }
.assist-btn:disabled { opacity: .4; cursor: not-allowed; }
.assist-btn.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.flag-toggle.on { background: #cf5a52; border-color: #cf5a52; color: var(--on-accent); }
.assist-msg {
  text-align: center; color: var(--muted); font-size: 13px; line-height: 1.5;
  min-height: 20px; max-width: 600px; font-family: var(--mono);
}
.assist-msg b { color: var(--text); }
.assist-msg.safe b { color: #9ec27a; }
.assist-msg.mine b { color: #cf5a52; }
.assist-msg.win  { color: #9ec27a; }
.assist-msg.lose { color: #cf5a52; }

/* ---------- AI panel extras (rest comes from arcade.css .xeno-ai) ---------- */
.xeno-ai { max-width: 620px; }
.ai-explain { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text);
  cursor: pointer; font-family: var(--mono); }
.ai-explain input { accent-color: var(--accent); }
