:root {
  --ink: #12082f;
  --muted: #5d5578;
  --paper: #fbf6ff;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-strong: #ffffff;
  --line: rgba(114, 91, 166, 0.28);
  --line-strong: #7d64dd;
  --accent: #ff4fa3;
  --accent-2: #8d62ff;
  --accent-3: #4ddde7;
  --good: #ffd76b;
  --chip: #eefcff;
  --shadow: 0 24px 70px rgba(114, 91, 166, 0.24);
  --button-shadow: 0 6px 0 rgba(97, 70, 172, 0.34);
}

body[data-theme="boy"] {
  --ink: #f6fbff;
  --muted: #a8bfd3;
  --paper: #03101d;
  --panel: rgba(8, 24, 40, 0.9);
  --panel-strong: #071522;
  --line: rgba(66, 207, 255, 0.34);
  --line-strong: #0aa7ff;
  --accent: #0b8cff;
  --accent-2: #22d9ff;
  --accent-3: #b7ff38;
  --good: #b7ff38;
  --chip: #071c2d;
  --shadow: 0 22px 80px rgba(0, 152, 255, 0.18);
  --button-shadow: 0 6px 0 rgba(0, 112, 255, 0.55);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% -8%, rgba(255, 255, 255, 0.95) 0 8%, rgba(202, 144, 255, 0.22) 9%, transparent 22%),
    radial-gradient(ellipse at 96% 94%, rgba(111, 233, 255, 0.55) 0 9%, rgba(255, 151, 216, 0.26) 10%, transparent 24%),
    radial-gradient(ellipse at 6% 96%, rgba(255, 215, 107, 0.48) 0 8%, rgba(255, 79, 163, 0.18) 9%, transparent 23%),
    radial-gradient(circle at 92% 8%, rgba(77, 221, 231, 0.42), transparent 13rem),
    radial-gradient(circle at 8% 88%, rgba(255, 79, 163, 0.28), transparent 16rem),
    linear-gradient(90deg, rgba(125, 100, 221, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(77, 221, 231, 0.09) 1px, transparent 1px),
    var(--paper);
  background-size:
    auto,
    auto,
    auto,
    auto,
    auto,
    56px 56px,
    56px 56px,
    auto;
  color: var(--ink);
  font-family: Verdana, Arial, Helvetica, sans-serif;
}

body[data-theme="boy"] {
  background:
    linear-gradient(160deg, transparent 0 15%, rgba(0, 132, 255, 0.34) 15% 18%, transparent 18% 100%),
    linear-gradient(25deg, transparent 0 78%, rgba(183, 255, 56, 0.24) 78% 80%, transparent 80%),
    radial-gradient(circle at 92% 12%, rgba(0, 124, 255, 0.55), transparent 9rem),
    radial-gradient(circle at 78% 14%, rgba(0, 146, 255, 0.35), transparent 18rem),
    radial-gradient(circle at 16% 84%, rgba(183, 255, 56, 0.18), transparent 15rem),
    linear-gradient(135deg, rgba(0, 174, 255, 0.16) 0 2px, transparent 2px 90px),
    linear-gradient(90deg, rgba(66, 207, 255, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(66, 207, 255, 0.06) 1px, transparent 1px),
    #03101d;
  background-size:
    auto,
    auto,
    auto,
    auto,
    auto,
    132px 132px,
    36px 36px,
    36px 36px,
    auto;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  content: "";
}

body::before {
  inset: 0;
  background:
    radial-gradient(circle at 93% 9%, rgba(255, 255, 255, 0.8) 0 2px, transparent 3px),
    radial-gradient(circle at 90% 12%, rgba(141, 98, 255, 0.42) 0 5px, transparent 6px),
    linear-gradient(45deg, transparent 0 49%, rgba(255, 79, 163, 0.3) 49% 51%, transparent 51%),
    linear-gradient(-35deg, transparent 0 49%, rgba(141, 98, 255, 0.25) 49% 51%, transparent 51%),
    radial-gradient(circle at 8% 11%, rgba(255, 255, 255, 0.85) 0 6px, transparent 7px),
    radial-gradient(circle at 13% 16%, rgba(141, 98, 255, 0.24) 0 12px, transparent 13px),
    radial-gradient(circle at 83% 86%, rgba(255, 79, 163, 0.2) 0 22px, transparent 23px);
}

body::after {
  right: -80px;
  bottom: -50px;
  width: 380px;
  height: 180px;
  border: 2px solid rgba(77, 221, 231, 0.4);
  border-radius: 50%;
  filter: blur(1px);
  transform: rotate(-17deg);
}

body:not([data-theme="boy"]) {
  background:
    radial-gradient(circle at 86% 18%, rgba(255, 255, 255, 0.78) 0 34px, transparent 35px),
    radial-gradient(circle at 90% 18%, rgba(77, 221, 231, 0.34) 0 48px, transparent 49px),
    radial-gradient(circle at 8% 82%, rgba(255, 255, 255, 0.88) 0 32px, transparent 33px),
    radial-gradient(ellipse at 50% -8%, rgba(255, 255, 255, 0.95) 0 8%, rgba(202, 144, 255, 0.22) 9%, transparent 22%),
    radial-gradient(ellipse at 96% 94%, rgba(111, 233, 255, 0.55) 0 9%, rgba(255, 151, 216, 0.26) 10%, transparent 24%),
    radial-gradient(ellipse at 6% 96%, rgba(255, 215, 107, 0.48) 0 8%, rgba(255, 79, 163, 0.18) 9%, transparent 23%),
    radial-gradient(circle at 92% 8%, rgba(77, 221, 231, 0.42), transparent 13rem),
    radial-gradient(circle at 8% 88%, rgba(255, 79, 163, 0.28), transparent 16rem),
    linear-gradient(90deg, rgba(125, 100, 221, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(77, 221, 231, 0.09) 1px, transparent 1px),
    var(--paper);
}

body[data-theme="boy"]::before {
  background:
    linear-gradient(135deg, transparent 0 10%, rgba(0, 153, 255, 0.42) 10% 11.5%, transparent 11.5%),
    linear-gradient(160deg, transparent 0 74%, rgba(183, 255, 56, 0.3) 74% 76%, transparent 76%),
    linear-gradient(125deg, transparent 0 42%, rgba(0, 153, 255, 0.22) 42% 44%, transparent 44%),
    linear-gradient(25deg, transparent 0 70%, rgba(183, 255, 56, 0.16) 70% 72%, transparent 72%);
}

body[data-theme="boy"]::after {
  border-color: transparent;
  background:
    linear-gradient(135deg, transparent 0 30%, rgba(0, 153, 255, 0.32) 30% 36%, transparent 36%),
    linear-gradient(45deg, transparent 0 54%, rgba(183, 255, 56, 0.26) 54% 60%, transparent 60%);
  filter: none;
}

button,
input {
  font: inherit;
}

button {
  min-height: 50px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
  box-shadow: var(--button-shadow);
  transition:
    transform 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease;
}

button:hover:not(:disabled) {
  filter: brightness(1.04);
  transform: translateY(2px);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--line-strong), #000 18%);
}

button:active:not(:disabled) {
  transform: translateY(5px);
  box-shadow: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

[hidden] {
  display: none !important;
}

.theme-gate {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 79, 163, 0.28), transparent 18rem),
    radial-gradient(circle at 82% 26%, rgba(0, 153, 255, 0.32), transparent 17rem),
    rgba(6, 8, 24, 0.72);
  backdrop-filter: blur(12px);
}

.theme-gate-card {
  width: min(820px, 100%);
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  background:
    radial-gradient(circle at 90% 10%, rgba(77, 221, 231, 0.28), transparent 9rem),
    radial-gradient(circle at 10% 100%, rgba(255, 79, 163, 0.22), transparent 10rem),
    rgba(255, 255, 255, 0.92);
  color: #12082f;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.theme-gate-card h1 {
  margin-bottom: 18px;
}

.theme-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.theme-choice {
  display: grid;
  min-height: 190px;
  align-content: end;
  gap: 8px;
  padding: 18px;
  text-align: left;
}

.theme-choice span {
  font-size: 2.2rem;
  font-weight: 950;
}

.theme-choice strong {
  font-size: 1rem;
}

.theme-choice-girl {
  border-color: #ff75bd;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 255, 255, 0.92) 0 16px, transparent 17px),
    radial-gradient(circle at 16% 22%, rgba(255, 255, 255, 0.7) 0 4px, transparent 5px),
    radial-gradient(circle at 82% 18%, rgba(77, 221, 231, 0.58), transparent 4rem),
    radial-gradient(circle at 18% 72%, rgba(255, 79, 163, 0.42), transparent 5rem),
    linear-gradient(135deg, #fff7ff, #f3e8ff 48%, #eaffff);
  color: #12082f;
}

.theme-choice-boy {
  border-color: #0aa7ff;
  background:
    linear-gradient(150deg, transparent 0 52%, rgba(0, 200, 255, 0.62) 52% 57%, transparent 57%),
    linear-gradient(18deg, transparent 0 36%, rgba(183, 255, 56, 0.45) 36% 39%, transparent 39%),
    linear-gradient(135deg, rgba(0, 140, 255, 0.7), transparent 34%),
    linear-gradient(45deg, transparent 0 62%, rgba(183, 255, 56, 0.6) 62% 68%, transparent 68%),
    #061522;
  color: white;
}

.page-shell {
  width: min(1180px, calc(100% - 28px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 36px;
}

.game-header {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: flex-start;
  gap: 16px;
  padding: 16px 0 18px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  position: relative;
  max-width: 820px;
  margin-bottom: 0;
  font-size: 4.8rem;
  font-weight: 950;
  line-height: 0.94;
  text-shadow:
    0 2px 0 rgba(255, 255, 255, 0.75),
    0 0 22px rgba(255, 255, 255, 0.7);
}

body:not([data-theme="boy"]) h1::after {
  display: block;
  width: min(340px, 64vw);
  height: 8px;
  margin: 8px 0 0 30%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ff4fa3 18%, #ff4fa3 74%, transparent);
  content: "";
  transform: rotate(-1.5deg);
}

body:not([data-theme="boy"]) .game-header::before,
body:not([data-theme="boy"]) .game-header::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  font-size: 2rem;
  font-weight: 950;
  content: "✦";
}

body:not([data-theme="boy"]) .game-header::before {
  left: 8px;
  top: 22px;
  color: #9b7dff;
}

body:not([data-theme="boy"]) .game-header::after {
  right: 18%;
  top: 32px;
  color: #ff4fa3;
  content: "♡";
}

.game-header > * {
  position: relative;
  z-index: 1;
}

body[data-theme="boy"] h1 {
  color: #f6fbff;
  font-style: italic;
  text-transform: uppercase;
  text-shadow:
    0 4px 0 #0a74e8,
    3px 0 0 rgba(34, 217, 255, 0.55),
    0 0 28px rgba(0, 153, 255, 0.3);
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(310px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.stage-panel,
.name-panel {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.stage-panel::before,
.name-panel::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.stage-panel::before {
  background:
    radial-gradient(circle at 88% 26%, rgba(255, 255, 255, 0.86) 0 24px, rgba(141, 98, 255, 0.2) 25px 38px, transparent 39px),
    radial-gradient(circle at 11% 63%, rgba(255, 255, 255, 0.9) 0 18px, transparent 19px),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.64) 0 24px, transparent 25px),
    linear-gradient(130deg, transparent 0 78%, rgba(77, 221, 231, 0.18) 78% 81%, transparent 81%);
}

.name-panel::before {
  background:
    radial-gradient(circle at 91% 46%, rgba(255, 255, 255, 0.95) 0 17px, rgba(177, 130, 255, 0.5) 18px 30px, transparent 31px),
    radial-gradient(circle at 91% 46%, #ffd76b 0 5px, transparent 6px),
    radial-gradient(circle at 92% 38%, rgba(255, 79, 163, 0.18) 0 30px, transparent 31px),
    linear-gradient(160deg, transparent 0 70%, rgba(255, 215, 107, 0.16) 70% 73%, transparent 73%);
}

body[data-theme="boy"] .stage-panel::before {
  background:
    linear-gradient(132deg, transparent 0 58%, rgba(0, 153, 255, 0.22) 58% 66%, transparent 66%),
    linear-gradient(45deg, transparent 0 85%, rgba(183, 255, 56, 0.2) 85% 88%, transparent 88%);
}

body[data-theme="boy"] .name-panel::before {
  background:
    linear-gradient(145deg, transparent 0 78%, rgba(0, 153, 255, 0.16) 78% 82%, transparent 82%);
}

.stage-panel > *,
.name-panel > * {
  position: relative;
  z-index: 1;
}

.stage-panel {
  min-height: 630px;
  padding: 20px;
}

body[data-theme="boy"] .stage-panel,
body[data-theme="boy"] .name-panel {
  background:
    linear-gradient(135deg, rgba(0, 154, 255, 0.11), transparent 34%),
    var(--panel);
}

.round-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.98rem;
  font-weight: 900;
}

.round-line span {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--chip);
}

.round-line span:last-child {
  background: color-mix(in srgb, var(--accent), white 82%);
  color: color-mix(in srgb, var(--accent), #000 45%);
}

body[data-theme="boy"] .round-line span:last-child {
  color: var(--accent-3);
  background: #071522;
}

.word-display {
  position: relative;
  display: grid;
  min-height: 290px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 90% 22%, rgba(255, 255, 255, 0.85) 0 34px, transparent 35px),
    radial-gradient(circle at 9% 24%, rgba(255, 255, 255, 0.65) 0 10px, transparent 11px),
    radial-gradient(circle at 84% 18%, rgba(255, 255, 255, 0.72), transparent 4rem),
    radial-gradient(circle at 16% 78%, rgba(255, 79, 163, 0.18), transparent 7rem),
    linear-gradient(135deg, #ffeab0, #fff5fa 48%, #f0e8ff);
  padding: 24px;
  text-align: center;
}

body:not([data-theme="boy"]) .word-display::before {
  position: absolute;
  right: 22px;
  top: 22px;
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.9), transparent 22%),
    linear-gradient(135deg, #90efff, #9f73ff);
  color: #12082f;
  content: "☺";
  font-size: 2.15rem;
  font-weight: 950;
  box-shadow:
    0 6px 0 rgba(97, 70, 172, 0.28),
    0 0 24px rgba(141, 98, 255, 0.38);
}

body:not([data-theme="boy"]) .word-display::after {
  position: absolute;
  left: 22px;
  bottom: 28px;
  color: #ffd76b;
  content: "✧";
  font-size: 4rem;
  font-weight: 950;
  text-shadow:
    0 0 0 #7d64dd,
    0 4px 12px rgba(125, 100, 221, 0.26);
}

body[data-theme="boy"] .word-display {
  background:
    linear-gradient(126deg, transparent 0 76%, rgba(0, 153, 255, 0.58) 76% 82%, transparent 82%),
    linear-gradient(18deg, transparent 0 18%, rgba(0, 200, 255, 0.22) 18% 20%, transparent 20%),
    linear-gradient(135deg, transparent 0 74%, rgba(0, 140, 255, 0.42) 74% 84%, transparent 84%),
    linear-gradient(45deg, rgba(0, 140, 255, 0.28), transparent 30%),
    #061321;
}

.word-kind {
  margin-bottom: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  padding: 7px 14px;
  background: var(--panel-strong);
  color: var(--accent-2);
  font-size: 1rem;
  font-weight: 950;
  text-transform: uppercase;
}

body[data-theme="boy"] .word-kind {
  color: var(--accent-3);
  background: #071522;
}

.word-display h2 {
  max-width: 100%;
  margin-bottom: 0;
  overflow-wrap: break-word;
  font-size: 3.75rem;
  font-weight: 950;
  hyphens: auto;
  line-height: 1.08;
}

.word-display h2 u {
  text-decoration-color: var(--accent);
  text-decoration-thickness: 0.12em;
  text-underline-offset: 0.12em;
}

body[data-theme="boy"] .word-display h2 {
  color: #f6fbff;
  font-style: italic;
  text-shadow: 0 3px 0 rgba(10, 116, 232, 0.55);
}

.word-display h2.is-long {
  font-size: 3.05rem;
}

.word-display h2.is-very-long {
  font-size: 2.45rem;
}

.main-actions {
  display: grid;
  grid-template-columns: 1.25fr 0.8fr 0.8fr;
  gap: 10px;
  margin-top: 16px;
}

.draw-button {
  background:
    radial-gradient(circle at 88% 10%, rgba(255, 255, 255, 0.75), transparent 20px),
    linear-gradient(135deg, var(--accent), #ff86c5);
  color: white;
  font-size: 1.35rem;
}

body[data-theme="boy"] .draw-button {
  background:
    linear-gradient(140deg, transparent 0 75%, rgba(183, 255, 56, 0.6) 75% 82%, transparent 82%),
    linear-gradient(135deg, #006dff, #00c8ff);
  color: white;
  text-transform: uppercase;
}

.tool-button {
  background: var(--panel-strong);
}

.tool-button:nth-child(2) {
  background: color-mix(in srgb, var(--accent-3), white 75%);
  color: color-mix(in srgb, var(--accent-3), #000 55%);
}

.tool-button:nth-child(3) {
  background: color-mix(in srgb, var(--good), white 20%);
  color: color-mix(in srgb, var(--good), #000 65%);
}

body[data-theme="boy"] .tool-button {
  background: #071522;
  color: var(--accent-2);
}

body[data-theme="boy"] .tool-button:nth-child(3) {
  color: var(--accent-3);
}

.history-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.history-strip span {
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--panel-strong);
  color: var(--ink);
  font-weight: 800;
}

.name-panel {
  padding: 20px;
}

body:not([data-theme="boy"]) .name-panel::after {
  position: absolute;
  right: 34px;
  bottom: 30px;
  width: 92px;
  height: 72px;
  border: 1px solid rgba(125, 100, 221, 0.28);
  background:
    linear-gradient(rgba(125, 100, 221, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 100, 221, 0.18) 1px, transparent 1px),
    #fff8df;
  background-size: 22px 22px;
  content: "";
  opacity: 0.85;
  pointer-events: none;
  transform: rotate(-13deg);
}

.panel-title p {
  width: fit-content;
  margin-bottom: 10px;
  border: 2px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 11px;
  background: linear-gradient(135deg, var(--accent-2), #a885ff);
  color: white;
  font-weight: 950;
}

body[data-theme="boy"] .panel-title p {
  background: linear-gradient(135deg, #006dff, #00c8ff);
  text-transform: uppercase;
}

.panel-title h2 {
  margin-bottom: 18px;
  font-size: 1.9rem;
  line-height: 1.08;
}

body[data-theme="boy"] .panel-title h2 {
  font-style: italic;
  text-transform: uppercase;
}

.entry-form label {
  display: block;
  margin-bottom: 7px;
  font-weight: 900;
}

.entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(82px, auto);
  gap: 8px;
}

.entry-row input {
  min-width: 0;
  min-height: 50px;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 1rem;
}

.entry-row input::placeholder {
  color: var(--muted);
}

.entry-row button {
  background: linear-gradient(135deg, var(--accent-2), #a885ff);
  color: white;
}

body[data-theme="boy"] .entry-row button {
  background: linear-gradient(135deg, #006dff, #00c8ff);
}

.message,
.empty-list {
  margin: 12px 0 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 11px;
  background: var(--panel-strong);
  font-weight: 800;
}

.lottery-meter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--chip);
}

.lottery-meter span {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--panel-strong);
  color: var(--ink);
  font-size: 1.55rem;
  font-weight: 950;
}

.lottery-meter p {
  margin-bottom: 0;
  font-weight: 900;
}

.entry-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  border: 2px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--panel-strong);
}

.entry-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 900;
}

.entry-list button {
  min-height: 40px;
  border-color: var(--line);
  background: transparent;
  box-shadow: none;
  font-size: 0.9rem;
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 18px, 720px);
    padding-top: 12px;
  }

  .game-header {
    align-items: center;
  }

  h1 {
    font-size: 2.8rem;
  }

  .game-grid,
  .theme-choice-grid {
    grid-template-columns: 1fr;
  }

  .stage-panel {
    min-height: auto;
    padding: 12px;
  }

  .word-display {
    min-height: 230px;
  }

  .word-display h2 {
    font-size: 2.7rem;
  }

  .word-display h2.is-long {
    font-size: 2.25rem;
  }

  .word-display h2.is-very-long {
    font-size: 1.9rem;
  }

  .main-actions {
    grid-template-columns: 1fr 1fr;
  }

  .draw-button {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .theme-gate {
    align-items: start;
    padding-top: 12px;
  }

  .theme-gate-card {
    padding: 16px;
  }

  .theme-choice {
    min-height: 138px;
  }

  .game-header {
    align-items: start;
  }

  h1 {
    font-size: 2.35rem;
  }

  body:not([data-theme="boy"]) h1::after {
    width: min(260px, 58vw);
    margin-left: 26%;
  }

  body:not([data-theme="boy"]) .game-header::after {
    right: 28px;
    top: 24px;
  }

  .round-line {
    align-items: stretch;
    flex-direction: column;
  }

  .word-display h2 {
    font-size: 2.05rem;
  }

  .word-display h2.is-long {
    font-size: 1.75rem;
  }

  .word-display h2.is-very-long {
    font-size: 1.5rem;
  }

  .main-actions,
  .entry-row {
    grid-template-columns: 1fr;
  }

  .tool-button,
  .draw-button,
  .entry-row button {
    width: 100%;
  }
}


.home-gate {
  position: fixed;
  inset: 0;
  z-index: 11;
  display: grid;
  place-items: center;
  padding: 24px 18px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 16% 16%, rgba(255, 79, 163, 0.26), transparent 18rem),
    radial-gradient(circle at 82% 24%, rgba(0, 153, 255, 0.32), transparent 17rem),
    linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(8, 12, 32, 0.78));
  backdrop-filter: blur(12px);
}

.home-gate-card {
  width: min(980px, 100%);
  border: 2px solid rgba(255, 255, 255, 0.46);
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
  background:
    radial-gradient(circle at 92% 12%, rgba(77, 221, 231, 0.28), transparent 10rem),
    radial-gradient(circle at 6% 100%, rgba(255, 79, 163, 0.22), transparent 12rem),
    rgba(255, 255, 255, 0.92);
  color: #12082f;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.28);
}

.gate-kicker {
  width: fit-content;
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 2px solid rgba(141, 98, 255, 0.32);
  border-radius: 8px;
  background: rgba(238, 252, 255, 0.84);
  color: #563ac7;
  font-weight: 900;
}

.home-gate-card h1 {
  max-width: 820px;
  margin: 0 0 14px;
  font-size: clamp(2.25rem, 7vw, 5rem);
  line-height: 0.96;
}

.index-copy {
  max-width: 820px;
  margin: 0 0 20px;
  color: rgba(18, 8, 47, 0.78);
  font-size: clamp(1rem, 2.8vw, 1.2rem);
  font-weight: 760;
  line-height: 1.45;
}

.index-copy p {
  margin: 0 0 14px;
}

.index-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.index-list li {
  padding: 10px 12px;
  border: 2px solid rgba(141, 98, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.index-actions-title {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.05;
}

.game-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.game-choice {
  display: grid;
  min-height: 220px;
  align-content: end;
  gap: 8px;
  padding: 18px;
  text-align: left;
}

.game-choice span {
  width: fit-content;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #563ac7;
  font-size: 1rem;
  font-weight: 950;
}

.game-choice strong {
  font-size: clamp(1.8rem, 5vw, 3.1rem);
  line-height: 0.98;
}

.game-choice small {
  max-width: 18rem;
  font-size: 1rem;
  font-weight: 800;
  color: rgba(18, 8, 47, 0.72);
}

.game-choice-charades {
  border-color: #ff75bd;
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 255, 255, 0.92) 0 16px, transparent 17px),
    radial-gradient(circle at 82% 18%, rgba(77, 221, 231, 0.58), transparent 4rem),
    radial-gradient(circle at 18% 72%, rgba(255, 79, 163, 0.42), transparent 5rem),
    linear-gradient(135deg, #fff7ff, #f3e8ff 48%, #eaffff);
}

.game-choice-talk {
  border-color: #0aa7ff;
  background:
    linear-gradient(150deg, transparent 0 52%, rgba(0, 200, 255, 0.62) 52% 57%, transparent 57%),
    radial-gradient(circle at 80% 18%, rgba(183, 255, 56, 0.55), transparent 4rem),
    linear-gradient(135deg, #061528, #0b2440 54%, #03101d);
  color: #f6fbff;
}

.game-choice-talk span {
  background: rgba(0, 132, 255, 0.88);
  color: #fff;
}

.game-choice-talk small {
  color: rgba(246, 251, 255, 0.76);
}

.back-button {
  min-height: 38px;
  margin-bottom: 12px;
  padding: 8px 12px;
  font-size: 0.9rem;
  box-shadow: none;
}

.follow-up {
  width: min(760px, 100%);
  margin: 18px auto 0;
  padding: 14px 16px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font-size: clamp(1.05rem, 3vw, 1.4rem);
  font-weight: 850;
  line-height: 1.35;
}

body[data-game="conversation"] .game-grid {
  grid-template-columns: minmax(0, 1fr);
}

body[data-game="conversation"] .stage-panel {
  min-height: 64vh;
}

body[data-game="conversation"] .name-panel,
body[data-game="conversation"] .history-strip {
  display: none;
}

body[data-game="conversation"] .word-display {
  min-height: 390px;
}

body[data-game="conversation"] .word-display h2 {
  max-width: 860px;
  font-size: clamp(2rem, 5.5vw, 4.4rem);
  line-height: 1.08;
}

body[data-game="conversation"] .main-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.55fr);
}

body[data-game="conversation"] #speak-button {
  display: none;
}

@media (max-width: 720px) {
  .game-choice-grid,
  .theme-choice-grid {
    grid-template-columns: 1fr;
  }

  .game-choice {
    min-height: 168px;
  }

  .home-gate-card,
  .theme-gate-card {
    padding: 18px;
  }

  body[data-game="conversation"] .main-actions {
    grid-template-columns: 1fr;
  }

  body[data-game="conversation"] .word-display {
    min-height: 330px;
  }
}
