* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #02030a;
  color: #d8f4ff;
  font-family: ui-monospace, "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  user-select: none;
}

#game {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

#hud {
  position: fixed;
  inset: 0;
  padding: 18px 26px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(80, 200, 255, 0.8);
  letter-spacing: 0.08em;
}
#hud[hidden] { display: none; }

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #6fa8c8;
}
.big { font-size: 34px; font-weight: 700; line-height: 1.1; }
.mult {
  font-size: 20px;
  color: #b6ff5c;
  text-shadow: 0 0 10px rgba(160, 255, 80, 0.8);
}
.mult.bump { animation: bump 0.18s ease-out; }
@keyframes bump {
  from { transform: scale(1.5); }
  to { transform: scale(1); }
}
.mult { transform-origin: left center; display: inline-block; }

.hud-center { text-align: center; font-size: 20px; }
.hud-right { text-align: right; font-size: 20px; line-height: 1.6; }
.pips { color: #ffffff; letter-spacing: 0.2em; }
.pips.bombs { color: #ff9a2f; text-shadow: 0 0 10px rgba(255, 150, 40, 0.9); }

#dungeon-hud {
  position: fixed;
  right: 26px;
  bottom: 18px;
  text-align: right;
  pointer-events: none;
}
#dungeon-hud[hidden], #minimap[hidden] { display: none; }
#minimap { display: block; width: 160px; height: 160px; margin-left: auto; opacity: 0.9; }

#modes { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin: 0 0 24px; }
#modes[hidden] { display: none; }
#modes button {
  flex: 0 1 220px;
  padding: 14px 16px;
  font: inherit;
  font-size: 22px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #6fa8c8;
  background: rgba(10, 20, 45, 0.6);
  border: 2px solid rgba(110, 170, 200, 0.3);
  cursor: pointer;
}
#modes button small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: #6fa8c8;
}
#modes button.selected {
  color: #fff;
  border-color: #2fd6ff;
  box-shadow: 0 0 18px rgba(47, 214, 255, 0.6), inset 0 0 18px rgba(47, 214, 255, 0.15);
  text-shadow: 0 0 10px #2fd6ff;
}

#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(2, 3, 10, 0.55), rgba(2, 3, 10, 0.88));
  cursor: pointer;
}
#overlay[hidden] { display: none; }

.panel { text-align: center; padding: 24px; max-width: 1100px; }

#info { display: flex; flex-wrap: wrap; gap: 12px 40px; justify-content: center; align-items: flex-start; margin-bottom: 26px; }
#info #controls { margin: 0; }
#controls[hidden] { display: none; }

#board { min-width: 230px; text-align: left; font-size: 14px; }
#board-title { text-align: center; padding: 4px 0 8px; }
#board-rows { list-style: none; margin: 0; padding: 0; }
#board-rows li {
  display: grid;
  grid-template-columns: 2.2em 5.5em 1fr;
  gap: 8px;
  padding: 3px 8px;
  border-top: 1px solid rgba(110, 170, 200, 0.18);
  color: #a9cfe2;
}
#board-rows li span:first-child { color: #6fa8c8; }
#board-rows li span:last-child { text-align: right; }
#board-rows li.mine { color: #fff; background: rgba(47, 214, 255, 0.14); text-shadow: 0 0 8px #2fd6ff; }
#board-rows li.empty { display: block; text-align: center; color: #6fa8c8; }
#board-note { margin-top: 8px; font-size: 11px; text-align: center; color: #6fa8c8; }

#entry { margin: 0 0 24px; }
#entry[hidden] { display: none; }
#entry-slots { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
#entry-slots span {
  width: 54px;
  height: 66px;
  line-height: 62px;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  border-bottom: 4px solid rgba(110, 170, 200, 0.4);
  text-shadow: 0 0 12px #2fd6ff;
}
#entry-slots span.cursor { border-color: #ff4fa3; animation: pulse 0.9s ease-in-out infinite; }

h1 {
  margin: 0 0 8px;
  font-size: clamp(40px, 9vw, 96px);
  letter-spacing: 0.12em;
  color: #fff;
  text-shadow: 0 0 12px #2fd6ff, 0 0 40px #2f7bff;
}
h1 span { color: #ff4fa3; text-shadow: 0 0 12px #ff4fa3, 0 0 40px #c04dff; }

#subtitle { min-height: 1.4em; margin: 0 0 22px; font-size: 20px; color: #b6ff5c; }

#controls {
  margin: 0 auto 26px;
  border-collapse: collapse;
  font-size: 14px;
  color: #a9cfe2;
}
#controls th {
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #6fa8c8;
  padding: 4px 16px 8px;
}
#controls td { padding: 5px 16px; border-top: 1px solid rgba(110, 170, 200, 0.18); }
#controls td:first-child { color: #fff; text-align: right; }

#prompt {
  margin: 0;
  font-size: 18px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  animation: pulse 1.4s ease-in-out infinite;
}
.hint { margin: 14px 0 0; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: #6fa8c8; }
@keyframes pulse {
  50% { opacity: 0.35; }
}
