* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #010806;
  color: #d8fff0;
  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: none;
}
/* a microbe reticle while aiming with the mouse; it turns pink while firing */
#game.mouse-aim { cursor: url(cursors/aim.svg) 16 16, crosshair; }
#game.mouse-aim.firing { cursor: url(cursors/fire.svg) 16 16, 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, 255, 190, 0.8);
  letter-spacing: 0.08em;
}
#hud[hidden] { display: none; }

.label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: #6fc8a8;
}
.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: #6fc8a8;
  background: rgba(8, 30, 24, 0.6);
  border: 2px solid rgba(110, 200, 170, 0.3);
  cursor: pointer;
}
#modes button small {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: none;
  color: #6fc8a8;
}
#modes button.selected {
  color: #fff;
  border-color: #3affc0;
  box-shadow: 0 0 18px rgba(58, 255, 192, 0.6), inset 0 0 18px rgba(58, 255, 192, 0.15);
  text-shadow: 0 0 10px #3affc0;
}

#overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(1, 8, 6, 0.55), rgba(1, 8, 6, 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, 200, 170, 0.18);
  color: #a9e2cf;
}
#board-rows li span:first-child { color: #6fc8a8; }
#board-rows li span:last-child { text-align: right; }
#board-rows li.mine { color: #fff; background: rgba(58, 255, 192, 0.14); text-shadow: 0 0 8px #3affc0; }
#board-rows li.empty { display: block; text-align: center; color: #6fc8a8; }
#board-note { margin-top: 8px; font-size: 11px; text-align: center; color: #6fc8a8; }

#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, 200, 170, 0.4);
  text-shadow: 0 0 12px #3affc0;
}
#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 #3affc0, 0 0 40px #1fbf7a;
}
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: #a9e2cf;
}
#controls th {
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #6fc8a8;
  padding: 4px 16px 8px;
}
#controls td { padding: 5px 16px; border-top: 1px solid rgba(110, 200, 170, 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: #6fc8a8; }
@keyframes pulse {
  50% { opacity: 0.35; }
}

/* announcer text slammed across the middle of the screen */
#banner {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
  text-align: center;
  font-size: clamp(36px, 9vw, 120px);
  font-weight: 900;
  font-style: italic;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #ffd23a;
  text-shadow: 0 0 14px #ff8a00, 0 0 50px #ff2a2a, 0 6px 0 #7a1500;
  opacity: 0;
}
#banner[hidden] { display: none; }
#banner.slam { animation: slam 3s ease-out forwards; }
@keyframes slam {
  0% { opacity: 0; transform: scale(4) rotate(-6deg); }
  9% { opacity: 1; transform: scale(0.92) rotate(-3deg); }
  14% { transform: scale(1.06) rotate(-3deg); }
  20%, 78% { opacity: 1; transform: scale(1) rotate(-3deg); }
  100% { opacity: 0; transform: scale(1.25) rotate(-3deg); }
}

/* Matthew mode: everything louder */
body.matthew #game { filter: saturate(1.6) contrast(1.1); }
#hype {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: none;
  pointer-events: none;
  box-shadow: inset 0 0 110px 28px #ff2a2a, inset 0 0 30px 6px #ffe066;
  animation: hype 1.4s linear infinite;
}
body.matthew #hype { display: block; }
@keyframes hype { to { filter: hue-rotate(360deg); } }
body.matthew #banner { font-size: clamp(44px, 12vw, 170px); }
body.matthew #banner.slam { animation: slam 3s ease-out forwards, rattle 0.09s linear 12; }
@keyframes rattle {
  0%, 100% { translate: 0 0; }
  25% { translate: -14px 9px; }
  50% { translate: 12px -10px; }
  75% { translate: -8px -12px; }
}
#flash { position: fixed; inset: 0; z-index: 19; background: #fff; opacity: 0; pointer-events: none; }
#flash.go { animation: flash 0.8s ease-out; }
@keyframes flash { from { opacity: 0.95; } to { opacity: 0; } }
#pops { position: fixed; inset: 0; z-index: 6; overflow: hidden; pointer-events: none; }
.pop {
  position: absolute;
  font-size: clamp(18px, 3vw, 40px);
  font-weight: 900;
  font-style: italic;
  white-space: nowrap;
  text-shadow: 0 0 10px currentColor, 0 3px 0 #000;
  animation: pop 0.9s ease-out forwards;
}
@keyframes pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2) rotate(var(--lean)); }
  15% { opacity: 1; transform: translate(-50%, -80%) scale(1.3) rotate(var(--lean)); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1) rotate(var(--lean)); }
}
