    html,
    body {
      margin: 0;
      width: 100%;
      height: 100%;
      overflow: hidden;
      background: #15191f;
      color: #eef2f6;
      font-family: system-ui, sans-serif;
    }

    canvas {
      display: block;
      width: 100%;
      height: 100%;
    }

    .room-panel {
      position: fixed;
      inset: 0;
      box-sizing: border-box;
      display: grid;
      align-items: center;
      justify-items: center;
      padding: 24px;
      overflow-y: auto;
      background: rgba(10, 16, 24, 0.28);
      z-index: 2;
    }

    .menu-shell {
      width: min(720px, 100%);
    }

    .menu-header {
      margin-bottom: 20px;
      padding: 0 8px;
      text-shadow: 0 2px 8px #000;
    }

    .menu-header h1 {
      margin: 0;
      font-size: clamp(40px, 7vw, 64px);
      letter-spacing: -2px;
    }

    .menu-header p {
      margin: 8px 0;
    }

    .menu-grid {
      display: grid;
      grid-template-columns: 1.2fr 1fr;
      gap: 16px;
    }

    .menu-card {
      min-width: 0;
      padding: 24px;
      border: 1px solid #526172;
      border-radius: 16px;
      background: rgba(21, 29, 39, 0.96);
      box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
    }

    .menu-card h2 {
      margin: 0 0 12px;
    }

    .menu-card p {
      line-height: 1.5;
      color: #c1ccd7;
    }

    .menu-card button {
      width: 100%;
    }

    .secondary-button {
      background: #334455;
      color: #eef2f6;
    }

    button:focus-visible,
    input:focus-visible {
      outline: 3px solid #ffd19b;
      outline-offset: 3px;
    }

    @media (max-width: 600px) {
      .menu-grid {
        grid-template-columns: 1fr;
      }

      .room-panel {
        padding: 16px;
      }
    }

    button {
      padding: 12px 20px;
      border: 0;
      border-radius: 6px;
      background: #e98b3c;
      color: #15191f;
      font: inherit;
      cursor: pointer;
    }

    button:disabled {
      opacity: 0.5;
      cursor: wait;
    }

    input {
      display: block;
      box-sizing: border-box;
      width: 100%;
      margin: 8px 0 16px;
      padding: 10px;
      border: 1px solid #617487;
      border-radius: 6px;
      background: #263442;
      color: #eef2f6;
      font: inherit;
    }

    [hidden] {
      display: none !important;
    }

    #room-controls {
      position: fixed;
      top: 16px;
      right: 16px;
      max-width: calc(100vw - 32px);
      z-index: 3;
      pointer-events: none;
    }


    #join-form {
      margin: 0;
    }

    #join-status {
      margin: 12px 0 0;
      text-align: left;
      color: #ffd19b;
    }

    #join-status:empty {
      display: none;
    }

    #nameplates {
      position: fixed;
      inset: 0;
      overflow: hidden;
      pointer-events: none;
      z-index: 1;
    }

    .nameplate {
      position: absolute;
      left: 0;
      top: 0;
      transform: translate(-50%, -100%);
      max-width: 220px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      padding: 4px 10px;
      border-radius: 999px;
      background: rgba(15, 20, 30, 0.65);
      color: #fff3c4;
      font-size: 15px;
      font-weight: 600;
      text-shadow: 0 1px 4px black;
      user-select: none;
    }

    #leaderboard {
      box-sizing: border-box;
      width: 244px;
      max-width: calc(100vw - 32px);
      contain: layout paint;
      padding: 12px;
      border-radius: 8px;
      background: #0f141c;
      color: #eef2f6;
      pointer-events: none;
    }

    #leaderboard h2 {
      margin: 0 0 8px;
      font-size: 16px;
    }

    #leaderboard-list {
      margin: 0;
      padding-left: 28px;
    }

    #room-hud {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-end;
      align-items: flex-start;
      gap: 12px;
    }

    #room-actions {
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 12px;
      pointer-events: auto;
    }

    #leaderboard-list li {
      overflow-wrap: anywhere;
      font-variant-numeric: tabular-nums;
      line-height: 1.5;
    }

    .leaderboard-own {
      color: #ffd19b;
      font-weight: 600;
    }

    .leaderboard-extra {
      margin-top: 8px;
      padding-top: 8px;
      border-top: 1px solid #526172;
    }

    [x-cloak] {
      display: none !important;
    }

    .menu-navigation {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-bottom: 16px;
    }

    .room-panel {
      padding: clamp(28px, 6vw, 96px);
      justify-items: start;
      background: linear-gradient(90deg,
          rgba(10, 14, 20, 0.94) 0%,
          rgba(10, 14, 20, 0.72) 38%,
          rgba(10, 14, 20, 0.12) 75%,
          transparent 100%);
    }

    .menu-shell {
      width: min(880px, 100%);
      display: grid;
      grid-template-columns: 220px minmax(0, 440px);
      gap: 32px 64px;
      align-items: start;
    }

    .menu-header {
      grid-column: 1 / -1;
      margin: 0;
    padding: 0;
    align-self: end;
    }

    .menu-header h1 {
      font-size: clamp(72px, 12vw, 144px);
      font-weight: 800;
      line-height: 0.95;
      letter-spacing: -0.07em;
    }

    .menu-header p {
      font-size: 13px;
      color: #aab5c2;
    }

    .menu-navigation {
      display: flex;
      flex-direction: column;
      align-items: stretch;
      gap: 4px;
      margin: 0;
    }

    .menu-navigation button {
      padding: 10px 0;
      border-radius: 0;
      background: transparent;
      color: #aab5c2;
      font-size: 22px;
      text-align: left;
      transition: color 120ms ease;
    }

    .menu-navigation .menu-play {
      margin-bottom: 8px;
      color: #fff3df;
      font-size: 40px;
      font-weight: 700;
    }

    .menu-navigation button:hover:not(:disabled),
    .menu-navigation button[aria-current="page"] {
      color: #ffb66e;
    }

    .menu-grid,
    .menu-shell>.menu-card {
      grid-column: 2;
      grid-row: 2;
    }

    .menu-grid {
      display: block;
    }

    .menu-card {
      padding: 8px 0 8px 28px;
      border: 0;
      border-left: 1px solid rgba(255, 255, 255, 0.18);
      border-radius: 0;
      background: transparent;
      box-shadow: none;
    }

    .menu-card .secondary-button {
      width: auto;
      margin-top: 16px;
      padding-left: 0;
      background: transparent;
      color: #aab5c2;
    }

    @media (max-width: 700px) {
      .menu-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
      }

      .menu-grid,
      .menu-shell>.menu-card {
        grid-column: 1;
        grid-row: auto;
      }

      .menu-card {
        padding: 20px 0 0;
        border-left: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.18);
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .menu-navigation button {
        transition: none;
      }
    }

    .account-menu-button {
      position: fixed;
      top: 24px;
      right: clamp(24px, 4vw, 64px);
      padding: 8px 0;
      border-radius: 0;
      background: transparent;
      color: #aab5c2;
      font-size: 14px;
      letter-spacing: 0.03em;
    }

    .account-menu-button:hover,
    .account-menu-button[aria-current="page"] {
      color: #ffb66e;
    }

    .menu-card button,
.menu-card .secondary-button,
#room-actions button,
.account-menu-button {
  width: auto;
  padding: 10px 18px;
  border: 1px solid rgba(206, 220, 238, 0.16);
  border-radius: 10px;
  background: rgba(27, 37, 49, 0.88);
  color: #dce5ef;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    transform 140ms ease;
}

.menu-card button:hover:not(:disabled),
#room-actions button:hover:not(:disabled),
.account-menu-button:hover:not(:disabled) {
  background: #2a394a;
  border-color: rgba(206, 220, 238, 0.35);
  color: #ffffff;
}

.menu-card button:active:not(:disabled),
#room-actions button:active:not(:disabled),
.account-menu-button:active:not(:disabled) {
  transform: translateY(1px);
}

.account-menu-button[aria-current="page"] {
  border-color: #dba66e;
  color: #ffd6a8;
    }

  #join-game {
  width: 100%;
  padding: 13px 20px;
  border: 1px solid #f2c18d;
  border-radius: 10px;
  background: linear-gradient(180deg, #f6c491, #e9a568);
  color: #291b10;
  font-size: 16px;
  font-weight: 700;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 14px rgba(0, 0, 0, 0.16);
}

#join-game:hover:not(:disabled) {
  background: linear-gradient(180deg, #ffdab0, #f1b57c);
  border-color: #ffe0bc;
  color: #291b10;
}

#join-game:disabled {
  background: #303944;
  border-color: #46515e;
  color: #9ca8b5;
  box-shadow: none;
  opacity: 1;
    }

    .menu-navigation button {
  position: relative;
  padding: 10px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #aab5c2;
  font-weight: 500;
  box-shadow: none;
  transition:
    color 140ms ease,
    transform 140ms ease;
}

.menu-navigation .menu-play {
  color: #fff0dd;
  font-weight: 700;
}

.menu-navigation button::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 3px;
  background: #f2b77e;
  opacity: 0;
  transform: translateY(-50%);
}

.menu-navigation button:hover:not(:disabled) {
  color: #fff0dd;
  transform: translateX(3px);
}

.menu-navigation button[aria-current="page"] {
  color: #f2b77e;
}

.menu-navigation button[aria-current="page"]::before {
  opacity: 1;
}

button:focus-visible {
  outline: 2px solid #ffd6a8;
  outline-offset: 5px;
}

button:disabled {
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  button {
    transition: none !important;
    transform: none !important;
  }
    }

    .room-panel {
  display: block;
  padding: 0;
}

.menu-shell {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  grid-template-rows: 1fr auto;
  gap: 0;
}

/* Title and navigation occupy the left column. */
.menu-header {
  grid-column: 1;
  grid-row: 1;
  padding: 80px clamp(24px, 3vw, 56px) 24px;
}

.menu-header h1 {
  font-size: clamp(48px, 7vw, 112px);
}

.menu-navigation {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  padding: 8px clamp(24px, 3vw, 56px) 40px;
}

/* Every activity fills the entire right column. */
.menu-grid,
.menu-shell > .menu-card {
  grid-column: 2;
  grid-row: 1 / -1;
  align-self: stretch;
  box-sizing: border-box;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 88px clamp(28px, 5vw, 80px) 40px;
  overflow-y: auto;
  border: 0;
  border-left: 1px solid rgba(206, 220, 238, 0.12);
  border-radius: 0;
  background: rgba(15, 22, 31, 0.94);
  box-shadow: none;
}

/* Play already has a panel wrapper; flatten its inner card. */
.menu-grid > .menu-card {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* Keep Account above the panel surface. */
.account-menu-button {
  z-index: 1;
}

/* Stack the navigation and content on narrow screens. */
@media (max-width: 700px) {
  .menu-shell {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
  }

  .menu-header {
    padding: 72px 24px 24px;
  }

  .menu-navigation {
    padding: 0 24px 32px;
    }

    .menu-navigation {
  grid-column: 1;
  grid-row: 2;
  align-self: end;
  padding: 8px clamp(24px, 3vw, 56px) 30dvh;
}

  .menu-grid,
  .menu-shell > .menu-card {
    grid-column: 1;
    grid-row: 3;
    min-height: 50dvh;
    padding: 32px 24px;
    overflow-y: visible;
    border-left: 0;
    border-top: 1px solid rgba(206, 220, 238, 0.12);
  }
    }

    @media (min-width: 701px) {
  .menu-shell {
    grid-template-rows: minmax(0, 1fr) auto 25dvh;
  }

  .menu-header {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
  }

  .menu-navigation {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    padding-bottom: 0;
  }

  .menu-grid,
  .menu-shell > .menu-card {
    grid-column: 2;
    grid-row: 1 / -1;
  }
}

    .menu-back-button {
  position: fixed;
  top: 24px;
  left: calc(30vw + clamp(28px, 5vw, 80px));
  z-index: 1;

  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  padding: 0;

  border: 1px solid rgba(206, 220, 238, 0.16);
  border-radius: 10px;
  background: rgba(27, 37, 49, 0.88);
  color: #dce5ef;
  font-size: 24px;
  line-height: 1;

  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.menu-back-button:hover {
  background: #2a394a;
  border-color: rgba(206, 220, 238, 0.35);
  color: #ffffff;
}

.account-menu-button {
  top: 24px;
  box-sizing: border-box;
  height: 42px;
}

@media (max-width: 700px) {
  .menu-back-button {
    left: 24px;
  }
}

.settings-list {
  margin-top: 32px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 16px 0;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(206, 220, 238, 0.1);
  color: #dce5ef;
}

.settings-control {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.settings-value {
  min-width: 44px;
  color: #aab5c2;
  font-size: 14px;
  text-align: right;
}

.settings-select {
  min-width: 0;
  max-width: 60%;
  padding: 11px 14px;
  border: 1px solid rgba(206, 220, 238, 0.2);
  border-radius: 10px;
  background: #1b2531;
  color: #dce5ef;
  font: inherit;
  font-size: 14px;
  color-scheme: dark;
  cursor: pointer;
}

.settings-select:focus-visible {
  outline: 2px solid #ffd6a8;
  outline-offset: 4px;
}

.settings-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.settings-switch input {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.settings-switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid #536172;
  border-radius: 999px;
  background: #303b49;
  pointer-events: none;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.settings-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e5ebf2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 160ms ease;
}

.settings-switch input:checked + .settings-switch-track {
  border-color: #f2c18d;
  background: #dfa16a;
}

.settings-switch input:checked + .settings-switch-track::after {
  transform: translateX(22px);
  background: #fff5e9;
}

.settings-switch input:focus-visible + .settings-switch-track {
  outline: 2px solid #ffd6a8;
  outline-offset: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .settings-switch-track,
  .settings-switch-track::after {
    transition: none;
  }
}

.skins-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 28px 20px;
  margin-top: 32px;
}

.skin-preview {
  min-width: 0;
  margin: 0;
}

.skin-preview img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  aspect-ratio: 1;
  padding: 16px;
  object-fit: contain;
  border: 1px solid rgba(206, 220, 238, 0.1);
  border-radius: 60%;
  padding: 0;
  object-fit: cover,
  background: rgba(255, 255, 255, 0.035);
}

.skin-preview figcaption {
  margin-top: 10px;
  color: #b8c5d3;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
}
/* Equal space above and below keeps the form centered. */
.menu-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 0;
  padding: 88px clamp(28px, 5vw, 80px);
}

.menu-grid > .menu-card {
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
  align-self: center;
  width: min(420px, 100%);
  box-sizing: border-box;
}

.menu-grid > .menu-card h2 {
  text-align: center;
}

.play-results {
  grid-column: 1;
  grid-row: 1;
  justify-self: center;
  align-self: end;
  width: min(420px, 100%);
  margin-bottom: 28px;
  text-align: center;
}

.play-results h3 {
  margin: 0 0 8px;
  color: #f2b77e;
  font-size: 16px;
  font-weight: 600;
}

.play-results p {
  margin: 0;
  color: #aab5c2;
  font-size: 14px;
  line-height: 1.5;
}

/* Let content flow and scroll when space is limited. */
@media (max-width: 700px), (max-height: 700px) {
  .menu-grid {
    grid-template-rows: auto auto;
    align-content: start;
    row-gap: 24px;
  }

  .play-results {
    margin-bottom: 0;
  }
}


    /* Tabular numbers for clean right-aligned alignment */
    .tabular-nums {
      font-variant-numeric: tabular-nums;
    }

    /* Menu Panel Shell */
    .ehaka-menu-panel {
      background-color: var(--ehaka-menu-surface);
      border: 1px solid var(--ehaka-divider);
      border-radius: 8px;
    }

    /* Key-Value Summary Table */
    .ehaka-summary-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
    }

    .ehaka-summary-table tr {
      border-bottom: 1px solid var(--ehaka-divider);
    }

    .ehaka-summary-table tr:last-child {
      border-bottom: none;
    }

    .ehaka-summary-table td {
      padding: 14px 18px;
    }

    .ehaka-summary-label {
      color: var(--ehaka-text-secondary);
      font-size: 15px;
      font-weight: 500;
      text-align: left;
    }

    .ehaka-summary-value {
      color: var(--ehaka-highlight);
      font-weight: 700;
      text-align: right;
    }

    /* Primary CTA Button */
    .ehaka-btn-primary {
      background-color: var(--ehaka-button-bg);
      color: #0f141c;
      font-weight: 700;
      font-size: 14px;
      padding: 12px 24px;
      border-radius: 6px;
      transition: background-color 0.15s ease, transform 0.1s ease;
      text-transform: uppercase;
      letter-spacing: 0.05em;
    }

    .ehaka-btn-primary:hover {
      background-color: var(--ehaka-accent);
    }

    .ehaka-btn-primary:active {
      transform: translateY(1px);
    }

    .entry-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.menu-header .entry-status-row p {
  margin: 0;
}

.menu-header .reload-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #aab5c2;
  cursor: pointer;
}

.menu-header .reload-button:hover {
  color: #ffb66e;
  background: rgba(255, 255, 255, 0.06);
}
.menu-header h1 {
  color: #ffb66e;
  background: linear-gradient(
    90deg,
    #ff6262 0%,
    #ffad55 17%,
    #75df91 50%,
    #69baff 67%,
    #e38bff 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  width: fit-content;
  text-shadow: none;
}

#status-halo {
  position: fixed;
  left: 0;
  top: 0;
  box-sizing: border-box;
  border: 2px solid rgba(105, 232, 226, 0.8);
  border-radius: 50%;
  box-shadow:
    0 0 12px rgba(105, 232, 226, 0.35),
    inset 0 0 8px rgba(105, 232, 226, 0.12);
  pointer-events: none;
  z-index: 1;
}

.status-halo-icon {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #69e8e2;
  border-radius: 50%;
  background: #15191f;
  color: #a9fff6;
  box-shadow: 0 0 10px rgba(105, 232, 226, 0.35);
  transform: translate(35%, 35%);
}

.status-halo-icon svg {
  width: 20px;
  height: 20px;
}

#status-halo[data-merge="merging"] {
  border-color: #ffbd69;
  box-shadow:
    0 0 12px rgba(255, 189, 105, 0.35),
    inset 0 0 8px rgba(255, 189, 105, 0.12);
}

#status-halo[data-merge="merging"] .status-halo-icon {
  border-color: #ffbd69;
  color: #ffdaaa;
  box-shadow: 0 0 10px rgba(255, 189, 105, 0.35);
}

.status-halo-icon .merge-lock-icon {
  display: none;
}

#status-halo[data-merge="locked"] {
  border-color: #ff737b;
  box-shadow:
    0 0 12px rgba(255, 115, 123, 0.4),
    inset 0 0 8px rgba(255, 115, 123, 0.15);
}

#status-halo[data-merge="locked"] .status-halo-icon {
  border-color: #ff737b;
  color: #ffc1c5;
  box-shadow: 0 0 10px rgba(255, 115, 123, 0.4);
}

#status-halo[data-merge="locked"] .status-halo-icon svg {
  display: none;
}

#status-halo[data-merge="locked"] .status-halo-icon .merge-lock-icon {
  display: block;
}

.game-title {
  color: #a78bfa;
}

.game-title > span,
.game-title > span > span {
  display: inline-block;
}

.game-title > span > span {
  pointer-events: none;
  transition: transform 180ms ease-out, color 180ms ease-out;
}

.game-title > span:hover > span {
  transform: translateY(-10px);
  color: white;
}

@media (prefers-reduced-motion: reduce) {
  .game-title > span > span {
    transition: none;
  }

  .game-title > span:hover > span {
    transform: none;
  }
}

.menu-card h2 {
  margin: 0 0 0.6rem;
  font-size: 1.5rem;
  line-height: 1.2;
}

.menu-card p {
  margin: 0 0 0.75rem;
  color: #cbd5e1;
  line-height: 1.6;
}

.menu-card .rule-container :is(ul, ol) {
  margin: 0.75rem 0 0;
  padding-inline-start: 1.75rem;
}

.menu-card .rule-container li {
  margin-block: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0 0.4rem 0.4rem 0;
  color: #eef2f6;
  line-height: 1.5;
}

.menu-card .rule-container li::marker {
  color: #c4b5fd;
  font-weight: 700;
}
