:root {
  color: #111814;
  background: #2d342f;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #2d342f;
  background-size: 34px 34px;
}

button {
  font: inherit;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 18px;
  flex-direction: column;
  gap: 14px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: #b8c4ae;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: #f1efe6;
  font-size: 1.8rem;
  line-height: 1;
}

.icon-button,
.primary-button {
  display: grid;
  place-items: center;
  border: 0;
  color: #f4f1e7;
  background: #171d1a;
  box-shadow: 0 8px 0 #080b09;
}

.icon-button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.4rem;
}

.primary-button {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 900;
}

.hud-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.hud-cell {
  min-height: 54px;
  padding: 8px 10px;
  border: 2px solid #111814;
  background: #70786d;
  box-shadow: inset 0 0 0 2px rgba(226, 223, 211, 0.12);
}

.hud-cell span {
  display: block;
  color: #d6d2c8;
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hud-cell strong {
  display: block;
  color: #fff8e8;
  font-size: 1.32rem;
  line-height: 1.05;
}

.status-panel {
  min-height: 46px;
  padding: 12px 14px;
  border: 2px solid #111814;
  background: #b7b1a4;
}

.status-panel p {
  margin: 0;
  color: #151c18;
  font-weight: 800;
}

.board-wrap {
  overflow: hidden;
  border: 3px solid #111814;
  background: #d6d2c8;
  box-shadow:
    inset 0 0 0 3px rgba(63, 71, 62, 0.22),
    0 10px 0 #171d1a;
}

#game-board {
  display: block;
  width: 100%;
  aspect-ratio: 360 / 520;
  cursor: pointer;
  touch-action: none;
}

.icon-button:active {
  transform: translateY(5px);
  box-shadow: 0 3px 0 #0f1115;
}

.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 20, 0.72);
}

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(100%, 330px);
  padding: 24px;
  border: 3px solid #111814;
  background: #d6d2c8;
  text-align: center;
}

.modal-panel h2 {
  margin: 0 0 8px;
  font-size: 1.7rem;
}

.modal-panel p {
  margin: 0 0 20px;
  font-weight: 800;
}

.modal-actions {
  display: grid;
  gap: 10px;
}
