/* Elder Grid V6 — huge type, labeled tiles, near-zero decoration */
:root {
  --ink: #111111;
  --cream: #FFF8F0;
  --gold: #D4A017;
  --danger: #C62828;
  --body: 23px;
  --cta: 27px;
  --tile: 28px;
  --giant: 34px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--cream);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: var(--body);
  line-height: 1.25;
  -webkit-text-size-adjust: 100%;
}

button,
a {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: none;
  background: none;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

#floor {
  height: 100dvh;
  max-height: 100dvh;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: calc(8px + var(--safe-top)) 14px calc(10px + var(--safe-bot));
  background: var(--cream);
  position: relative;
}

.band {
  flex: 0 0 auto;
  background: var(--ink);
  color: var(--cream);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  padding: 8px 10px;
  border-radius: 6px;
  line-height: 1.3;
}

.brand {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 10px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  flex: 0 0 auto;
}

.word {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.grid {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1.35fr 1fr;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  padding: 18px 16px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--cream);
  text-align: left;
  border: 3px solid var(--ink);
}

.tile-wide {
  grid-column: 1 / -1;
  background: var(--gold);
  color: var(--ink);
  border-color: var(--ink);
}

.tile-en {
  font-size: var(--tile);
  font-weight: 800;
  line-height: 1.1;
}

.tile-hi {
  font-size: 20px;
  font-weight: 600;
  opacity: 0.92;
}

.foot {
  flex: 0 0 auto;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  opacity: 0.7;
  text-align: center;
}

/* overlays share the floor — no page scroll */
.panel {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: calc(8px + var(--safe-top)) 14px calc(10px + var(--safe-bot));
  background: var(--cream);
  z-index: 4;
}

.panel[hidden],
.veil[hidden] {
  display: none !important;
}

.panel-head {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 12px;
}

.chips {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  border: 3px solid var(--ink);
  text-align: left;
}

.chip.is-on {
  background: var(--gold);
  color: var(--ink);
}

.chip-en {
  font-size: 20px;
  font-weight: 800;
}

.chip-hi {
  font-size: 16px;
  font-weight: 600;
}

.panel .band {
  margin-bottom: 10px;
}

.back {
  flex: 0 0 auto;
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--cream);
  color: var(--ink);
  border: 3px solid var(--ink);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.calm-list {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  flex: 0 0 auto;
}

.calm-list li {
  font-size: 18px;
  font-weight: 600;
  padding: 4px 0;
  border-bottom: 2px solid rgba(17, 17, 17, 0.12);
}

.calm-list li:last-child {
  border-bottom: none;
}

.giant-112 {
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
  padding: 18px 16px;
  border-radius: 14px;
  background: var(--danger);
  color: #ffffff;
  font-size: var(--giant);
  font-weight: 900;
  text-align: center;
  border: 3px solid var(--ink);
  margin-bottom: 12px;
}

.exit-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  flex: 0 0 auto;
}

.exit {
  padding: 16px 10px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  border: 3px solid var(--ink);
  line-height: 1.2;
}

.slip-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  min-height: 0;
}

.slip-en {
  font-size: 30px;
  font-weight: 800;
}

.slip-hi {
  font-size: 24px;
  font-weight: 600;
}

.veil {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: rgba(17, 17, 17, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
}

.veil-box {
  width: 100%;
  max-width: 360px;
  background: var(--cream);
  color: var(--ink);
  border-radius: 14px;
  border: 3px solid var(--ink);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.veil-en {
  font-size: 22px;
  font-weight: 800;
}

.veil-hi {
  font-size: 18px;
  font-weight: 600;
}

.veil-dial {
  display: block;
  padding: 20px 14px;
  border-radius: 12px;
  background: var(--danger);
  color: #ffffff;
  font-size: var(--cta);
  font-weight: 900;
  text-align: center;
  border: 3px solid var(--ink);
}

.veil-stay {
  padding: 14px;
  border-radius: 12px;
  background: var(--ink);
  color: var(--cream);
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  border: 3px solid var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
