body[data-mode="grid"] { --accent: #a9dff5; }
[data-mode="grid"] .arcade-art { background-image: url("assets/arena-night.webp"); background-position: 64% 48%; }
.cover-grid { --cover: url("assets/arena-night.webp"); }
[data-stage="grid"] .arcade-hero { min-height: 210px; }
[data-stage="grid"] .arcade-hero h1 { font-size: clamp(2.8rem, 5vw, 5rem); }
.grid-topbar { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin: 16px 0 12px; }
.grid-status { display: flex; align-items: center; gap: 13px; color: #aebdcc; font-size: .78rem; }
.grid-status strong { color: var(--accent); font: 900 1.1rem var(--display); }
.grid-panel { padding: clamp(9px, 1.5vw, 18px); overflow: hidden; }
.cs-grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 7px; }
.cs-grid th { vertical-align: middle; }
.cs-grid thead th:first-child { width: 18%; }
.grid-corner { color: #7890a6; font: 650 .72rem var(--mono); }
.grid-column-label, .grid-row-label { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 0; color: #dbe5ed; text-align: center; }
.grid-column-label strong, .grid-row-label strong { overflow-wrap: anywhere; font-size: .79rem; line-height: 1.25; }
.grid-column-label .flag, .grid-row-label .flag { width: 24px; height: 17px; }
.grid-row-label { padding: 7px; border: 1px solid #334b62; background: #101e2e; }
.cs-grid td { padding: 0; }
.grid-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; width: 100%; min-height: 105px; padding: 9px 5px; border: 1px dashed #465f77; border-radius: 4px; background: #0b1825; color: #8fa5b9; }
.grid-cell > .icon { width: 22px; height: 22px; }
.grid-cell > span { font-size: .68rem; }
.grid-cell:not(:disabled):hover { border-color: var(--accent); border-style: solid; background: #14283a; color: var(--accent); }
.grid-cell.filled { border: 1px solid #5b9b80; background: linear-gradient(140deg, #1a3b35, #11272a); color: #a0e9c2; }
.grid-cell.revealed { border: 1px solid #52677b; background: #152333; color: #b8c8d5; }
.grid-cell strong { max-width: 100%; overflow-wrap: anywhere; font: 900 clamp(1rem, 1.8vw, 1.45rem)/1.05 var(--display); }
.grid-cell small { max-width: 100%; color: #b1c1ce; font-size: .62rem; line-height: 1.2; overflow-wrap: anywhere; }
.grid-cell .flag { width: 22px; height: 15px; }
.grid-actions { display: flex; justify-content: center; margin-top: 10px; }
.grid-result { position: relative; margin-top: 16px; overflow: hidden; border-top: 2px solid var(--accent); }
.grid-result h2 { font: 900 clamp(2rem, 4vw, 3.4rem)/1 var(--display); }
.grid-result p { margin-top: 10px; color: #b7c7d4; }
.grid-result .result-actions { margin-top: 18px; }
.grid-picker-clues { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 12px; border: 1px solid #3b536a; background: #0c1926; }
.grid-picker-clues .grid-column-label, .grid-picker-clues .grid-row-label { border: 0; background: transparent; color: var(--accent); }
.grid-picker-form { display: flex; gap: 8px; }
.grid-picker-form input { width: 100%; min-width: 0; min-height: 46px; padding: 0 12px; border: 1px solid #465e76; background: #091422; color: var(--text); }
.grid-suggestions { display: grid; gap: 5px; max-height: 280px; overflow-y: auto; }
.grid-suggestion { display: flex; align-items: center; gap: 9px; min-height: 45px; padding: 8px 10px; border: 1px solid #364e65; border-radius: 3px; background: #132235; text-align: left; }
.grid-suggestion small { margin-left: auto; color: #aebdcc; }
.grid-suggestion.used { opacity: .5; }
.grid-suggestion:hover { border-color: var(--accent); }
@media (max-width: 749px) {
  [data-stage="grid"] .arcade-hero { display: none; }
  .grid-panel { margin-top: 0; }
}
@media (max-width: 560px) {
  .grid-topbar { align-items: stretch; flex-direction: column; }
  .grid-topbar .segmented { width: 100%; }
  .grid-topbar .segmented button { flex: 1; min-width: 0; padding-inline: 5px; }
  .grid-status { justify-content: space-between; }
  .cs-grid { border-spacing: 3px; }
  .cs-grid thead th:first-child { width: 20%; }
  .grid-cell { min-height: 93px; padding: 6px 2px; }
  .grid-cell strong { font-size: .9rem; }
  .grid-cell small { font-size: .55rem; }
  .grid-cell > span { display: none; }
  .grid-column-label, .grid-row-label { flex-direction: column; gap: 3px; }
  .grid-column-label strong, .grid-row-label strong { font-size: .65rem; }
  .grid-row-label { padding: 4px 2px; }
  .grid-picker-form { flex-direction: column; }
}
