/* Shared look for game.rohitmundhra.com: dark neon arcade. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;800&family=Press+Start+2P&display=swap");

:root {
  --bg: #0b0714;
  --panel: #161022;
  --panel-2: #1f1730;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f3eefc;
  --muted: #a99fbd;
  --cyan: #2de2ff;
  --magenta: #ff3fb4;
  --violet: #8b5cff;
  --green: #3ecf6a;
  --yellow: #e8b829;
  --gray: #3a3348;
  --radius: 14px;
  --pixel: "Press Start 2P", ui-monospace, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(60% 40% at 10% 0%, rgba(139, 92, 255, 0.18), transparent 70%),
    radial-gradient(50% 40% at 90% 0%, rgba(45, 226, 255, 0.12), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.5;
}
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* Top bar */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
}
.logo {
  font-family: var(--pixel);
  font-size: 13px;
  text-decoration: none;
  color: var(--text);
  letter-spacing: 0.04em;
}
.logo span { color: var(--magenta); }
.bar-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
}
.bar-link:hover { color: var(--text); }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }

/* Game page header */
.game-head { text-align: center; margin: 8px 0 20px; }
.game-title {
  margin: 0;
  font-family: var(--pixel);
  font-size: clamp(18px, 4vw, 28px);
  line-height: 1.4;
  text-shadow: 0 0 18px rgba(255, 63, 180, 0.45);
}
.game-sub { margin: 8px 0 0; color: var(--muted); }

/* Buttons and pills */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--magenta), var(--violet));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s, filter 0.15s;
}
.btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.btn-ghost { background: var(--panel-2); border: 1px solid var(--line); }

.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.seg button {
  padding: 7px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }

.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 18px; }

.status {
  min-height: 1.6em;
  margin: 14px 0;
  text-align: center;
  font-weight: 700;
  font-size: 17px;
}

/* Small toast used by the word games */
.toast {
  position: fixed;
  left: 50%;
  top: 76px;
  z-index: 50;
  transform: translate(-50%, -10px);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.foot { padding: 24px 16px 32px; text-align: center; color: var(--muted); font-size: 13px; }
.foot a { color: var(--text); }

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

/* Game pages fill exactly one screen: no scrolling, the board takes the space left over. */
body.game-page {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  display: flex;
  flex-direction: column;
}
.game-page .bar { flex: none; width: 100%; padding: 10px 16px; }
.play {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.play > * { flex: none; }
.game-page .game-head { margin: 0; }
.game-page .game-title { font-size: clamp(16px, 3vw, 24px); }
.game-page .game-sub { margin-top: 4px; font-size: 14px; }
.game-page .controls { margin: 0; }
.game-page .status { margin: 0; }

/* Square board that grows to the largest size the leftover space allows. */
.fit {
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  container-type: size;
  display: grid;
  place-items: center;
}
.fit > * { width: min(100cqw, 100cqh); aspect-ratio: 1; }

@media (max-height: 640px) {
  .game-page .game-sub { display: none; }
}
