* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(rgba(5, 12, 9, 0.1), rgba(5, 12, 9, 0.26)),
    url("signal-grid-table-bg.webp") center / cover fixed no-repeat,
    #111d25;
  color: #f6f1e6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.signalGrid {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: 620px;
  min-height: 100vh;
  padding: 16px;
}

.topBar {
  align-items: center;
  background: rgba(8, 15, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

h1 {
  font-size: 32px;
  line-height: 1;
  margin: 0;
}

.seed {
  color: #c4d6d3;
  font-size: 13px;
  margin: 3px 0 0;
}

.status {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  color: #e8efe9;
  line-height: 1.35;
  margin: 0;
  min-height: 48px;
  padding: 10px 12px;
}

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

.score {
  background: rgba(8, 15, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  min-height: 68px;
  padding: 10px;
}

.score strong {
  display: block;
  font-size: 24px;
  line-height: 1.1;
}

.score span {
  color: #c4d6d3;
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.board {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.tile {
  align-items: center;
  background: #f0e2bd;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  color: #263136;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  line-height: 1.05;
  min-height: 66px;
  overflow-wrap: anywhere;
  padding: 7px;
  text-align: center;
  text-transform: uppercase;
}

.tile:disabled {
  cursor: default;
}

.tile.isKey.teamWave,
.tile.revealed.teamWave {
  background: #2563eb;
  color: #eff6ff;
}

.tile.isKey.teamEmber,
.tile.revealed.teamEmber {
  background: #dc4c35;
  color: #fff5f0;
}

.tile.isKey.neutral,
.tile.revealed.neutral {
  background: #c6b89a;
  color: #28231b;
}

.tile.isKey.hazard,
.tile.revealed.hazard {
  background: #151716;
  color: #f7efe0;
}

.actions {
  background: rgba(8, 15, 12, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
}

.actionButton {
  border: 0;
  border-radius: 8px;
  color: #152029;
  cursor: pointer;
  font-weight: 800;
  min-height: 50px;
  padding: 10px;
}

.primary {
  background: #ffd166;
}

.secondary {
  background: #d9ece6;
}

.wide {
  grid-column: 1 / -1;
}

@media (max-width: 430px) {
  .signalGrid {
    padding: 12px;
  }

  h1 {
    font-size: 28px;
  }

  .scoreboard {
    grid-template-columns: 1fr;
  }

  .board {
    gap: 6px;
  }

  .tile {
    font-size: 11px;
    min-height: 54px;
    padding: 5px;
  }
}
