.control-strip {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(7, 18, 16, 0.76);
}

.control-strip label {
  display: grid;
  gap: 5px;
  min-width: min(255px, 100%);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

select {
  min-height: 44px;
  padding: 9px 34px 9px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--cream);
  background: #10231e;
  font-weight: 750;
}

.mode-switch {
  display: flex;
  margin-left: auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.22);
}

.mode {
  min-height: 36px;
  padding: 5px 12px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 900;
}

.mode.active {
  color: #102016;
  background: var(--acid);
}

.grill-stage {
  isolation: isolate;
  min-height: 520px;
  display: grid;
  place-items: center;
  background:
    repeating-linear-gradient(90deg, transparent 0 42px, rgba(255, 255, 255, 0.016) 43px 44px),
    #0a1312;
}

.grill-frame {
  position: relative;
  z-index: 2;
  width: min(730px, 100%);
  padding: clamp(9px, 2vw, 18px);
  border: clamp(7px, 1.4vw, 14px) solid #5f6862;
  border-radius: 21px;
  background:
    linear-gradient(90deg, transparent 47%, rgba(255, 255, 255, 0.08) 49% 51%, transparent 53%),
    #202723;
  box-shadow:
    inset 0 0 0 3px #232a27,
    inset 0 0 22px rgba(255, 255, 255, 0.06),
    0 30px 70px rgba(0, 0, 0, 0.52);
}

.mine-board {
  --cols: 9;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: clamp(2px, 0.55vw, 5px);
  padding: clamp(5px, 1.1vw, 10px);
  border-radius: 9px;
  background:
    repeating-linear-gradient(#121816 0 5px, #28322e 6px 9px),
    #151b19;
}

.cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #5d665f;
  border-radius: clamp(3px, 0.7vw, 7px);
  color: var(--cream);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), transparent 36%),
    #39443e;
  box-shadow:
    inset -3px -3px 0 rgba(0, 0, 0, 0.26),
    0 2px 4px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  font-size: clamp(0.72rem, 2.4vw, 1.2rem);
  font-weight: 950;
  touch-action: manipulation;
  transition: transform 80ms ease, background 150ms ease;
}

.cell:hover:not(.revealed),
.cell:focus-visible:not(.revealed) {
  z-index: 2;
  border-color: var(--acid);
  transform: translateY(-1px) scale(1.04);
}

.cell.revealed {
  border-color: rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at 60% 30%, rgba(255, 132, 53, 0.08), transparent 42%),
    #171d1a;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.55);
  cursor: default;
}

.cell.flagged::before {
  content: "";
  width: 68%;
  height: 12%;
  border-radius: 999px;
  background: linear-gradient(90deg, #b9c1bb, #fff, #8e9992);
  box-shadow: 0 0 7px rgba(255, 255, 255, 0.25);
  transform: rotate(-37deg);
}

.cell.flagged::after {
  content: "◆";
  position: absolute;
  top: 3%;
  right: 8%;
  color: var(--pink);
  font-size: 0.62em;
}

.cell.flare {
  border-color: #ff8a4c;
  color: #ffe1ad;
  background: radial-gradient(circle, #ffb03a, #d84220 42%, #32120d 74%);
  animation: flare 400ms ease-out;
}

@keyframes flare {
  50% { transform: scale(1.22); box-shadow: 0 0 35px #ff5722; }
}

.cell.wrong-flag {
  background: #591f32;
}

.cell[data-count="1"] { color: #79d9ff; }
.cell[data-count="2"] { color: #83f5a8; }
.cell[data-count="3"] { color: #ffbe62; }
.cell[data-count="4"] { color: #ff7fae; }
.cell[data-count="5"],
.cell[data-count="6"],
.cell[data-count="7"],
.cell[data-count="8"] { color: #d8a2ff; }

.heat-glow {
  position: absolute;
  z-index: 0;
  width: 80%;
  height: 42%;
  bottom: -22%;
  border-radius: 50%;
  background: #ff4a1f;
  filter: blur(75px);
  opacity: 0.16;
  pointer-events: none;
}

.controls-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.55;
  text-align: center;
}

.centered { justify-content: center; }
.result-link { display: inline-grid; place-items: center; text-decoration: none; }

@media (max-width: 590px) {
  .grill-stage {
    min-height: 390px;
    padding: 7px;
  }

  .mode-switch {
    width: 100%;
    margin-left: 0;
  }

  .mode {
    flex: 1;
  }

  .cell {
    font-size: clamp(0.62rem, 3.7vw, 1rem);
  }
}
