* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

body {
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  padding:
    max(8px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(10px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

.top {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 6px;
  margin-bottom: 8px;
}

.top h1 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h1 {
  margin: 0;
  font-size: clamp(0.95rem, 3.4vw, 1.35rem);
}

.taper { margin-bottom: 8px; }

/* Arcade menu only. One 3px line, color steps along its length, then dots no taller than the line. */
.taper-rainbow {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='14' viewBox='0 0 360 14'%3E%3Cg shape-rendering='crispEdges'%3E%3Crect x='0' y='5' width='22' height='3' fill='%23ff5555'/%3E%3Crect x='22' y='5' width='22' height='3' fill='%23770000'/%3E%3Crect x='44' y='5' width='22' height='3' fill='%23ffaa44'/%3E%3Crect x='66' y='5' width='22' height='3' fill='%23aa5500'/%3E%3Crect x='88' y='5' width='22' height='3' fill='%23ffff55'/%3E%3Crect x='110' y='5' width='22' height='3' fill='%23555500'/%3E%3Crect x='132' y='5' width='22' height='3' fill='%2381c784'/%3E%3Crect x='154' y='5' width='22' height='3' fill='%231b5e20'/%3E%3Crect x='176' y='5' width='22' height='3' fill='%237ec8ff'/%3E%3Crect x='198' y='5' width='22' height='3' fill='%230a2a66'/%3E%3Crect x='220' y='5' width='22' height='3' fill='%23e090ff'/%3E%3Crect x='242' y='5' width='22' height='3' fill='%234a1068'/%3E%3C/g%3E%3Cg shape-rendering='geometricPrecision'%3E%3Ccircle cx='278' cy='6.5' r='1.5' fill='%23ff5555'/%3E%3Ccircle cx='290' cy='6.5' r='1.15' fill='%23ffff55'/%3E%3Ccircle cx='300' cy='6.5' r='0.85' fill='%2381c784'/%3E%3Ccircle cx='308' cy='6.5' r='0.6' fill='%237ec8ff'/%3E%3Ccircle cx='315' cy='6.5' r='0.4' fill='%23e090ff'/%3E%3Ccircle cx='321' cy='6.5' r='0.25' fill='%23aa5500'/%3E%3C/g%3E%3C/svg%3E") left center / auto 14px no-repeat;
}

.taper-rainbow::before {
  top: 5px;
  height: 3px;
}

/* The rainbow rule draws its own dots. */
.taper-rainbow::after { display: none; }

.game-btn:not(.empty)::after {
  background: linear-gradient(
    var(--white) 0 25%,
    var(--green-bright) 25% 50%,
    var(--green) 50% 75%,
    var(--green-deep) 75% 100%
  );
}


/* Square slots, centered in whatever room the header and footer leave. */
.game-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), var(--cell, minmax(0, 1fr)));
  grid-template-rows: repeat(var(--rows, 3), var(--cell, minmax(0, 1fr)));
  justify-content: center;
  align-content: center;
  gap: 8px;
  min-height: 0;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

.game-btn {
  min-height: 0;
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 4px;
  padding: 8px;
  color: var(--ink-bright);
  font: inherit;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.game-btn:active { background: var(--amber-deep); }

.game-ico {
  font-size: clamp(1.4rem, calc(var(--cell, 18dvh) * 0.42), 6rem);
  line-height: 1;
}

.game-ico.mascot-ico {
  width: auto;
  height: clamp(2.4rem, calc(var(--cell, 18dvh) * 0.42), 5.5rem);
  object-fit: contain;
  font-size: 0;
}

.game-btn h2 {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--ink-bright);
  font-size: clamp(0.62rem, calc(var(--cell, 12dvh) * 0.11), 1.15rem);
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.game-btn.empty {
  cursor: default;
  pointer-events: none;
  background-image: none;
  background-color: transparent;
  box-shadow: none;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.game-btn.empty:hover,
.game-btn.empty:active,
.game-btn.empty:focus {
  background: transparent;
  background-color: transparent;
  box-shadow: none;
}

.game-btn.empty::before,
.game-btn.empty::after { display: none; }
