/* Scoped to the game page; game/network dimensions remain 800x600. */
body.game-immersive { overflow: hidden; }
.gp-game .game-result-review { border: 1px solid #9288ab; border-radius: 8px; background: #211a3e; color: white; padding: 6px 10px; min-height: 44px; font: inherit; cursor: pointer; }
.gp-game .game-result-review:focus-visible { outline: 3px solid #80ffff; outline-offset: 3px; }
.game-review-place { font-size: 24px; color: #80ffff; }
.game-review-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.game-review-actions a { color: #80ffff; text-decoration: underline; display: inline-flex; align-items: center; min-height: 44px; }
.gp-game .game-learning {
  max-width: 1000px;
  margin: 20px auto 0;
  border: 1px solid #68558d;
  border-radius: 16px;
  background: #211a3e;
  color: #eee9ff;
  font-size: 15px;
  line-height: 1.6;
  text-align: left;
}
.gp-game .game-learning summary { padding: 12px 18px; min-height: 44px; box-sizing: border-box; cursor: pointer; font-weight: 600; }
.gp-game .game-learning-content { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 4px 20px 20px; }
.gp-game .game-learning h2, .gp-game .game-learning h3 { margin: 0 0 8px; color: white; font-size: 18px; line-height: 1.4; }
.gp-game .game-learning p { margin: 0 0 12px; }
.gp-game .game-learning a { color: #80ffff; text-decoration: underline; text-underline-offset: 3px; }
.gp-game .game-learning-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; }
.gp-game .game-learning-actions button { background: #ff3beb; color: #fff; border: 1px solid #ff3beb; border-radius: 9px; padding: 10px 14px; min-height: 44px; font: inherit; font-weight: 600; cursor: pointer; }
.gp-game .game-learning-actions button:disabled { opacity: .55; cursor: default; }
.gp-game .game-learning-actions a { display: inline-flex; align-items: center; min-height: 44px; }
.gp-game .game-learning-next summary { padding-left: 0; }
.gp-game .game-learning :focus-visible { outline: 3px solid #80ffff; outline-offset: 3px; }
@media (max-width: 700px) {
  .gp-game .game-learning-content { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
.gp-game #game-grand-parent {
  --game-side-rail: 88px;
  --game-bottom-rail: 64px;
  --game-safe-top: env(safe-area-inset-top, 0px);
  --game-safe-right: env(safe-area-inset-right, 0px);
  --game-safe-bottom: env(safe-area-inset-bottom, 0px);
  --game-safe-left: env(safe-area-inset-left, 0px);
  position: relative;
  padding: 0;
  background: #131326;
}
.gp-game #game-parent { width: 100%; height: 100%; position: relative; }
.gp-game #game-parent canvas { display: block; touch-action: none; }
.gp-game #game-grand-parent.game-field-immersive,
.gp-game #game-grand-parent:fullscreen {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: var(--game-viewport-width, 100vw);
  height: var(--game-viewport-height, 100vh);
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) var(--game-bottom-rail);
  padding: var(--game-safe-top) var(--game-safe-right) var(--game-safe-bottom) var(--game-safe-left) !important;
}
.gp-game .game-field-immersive #game-parent { grid-area: 1 / 1; min-width: 0; min-height: 0; }
.gp-game #game-grand-parent.game-field-immersive[data-tools-layout="sides"] {
  grid-template-columns: var(--game-side-rail) minmax(0, 1fr) var(--game-side-rail);
  grid-template-rows: minmax(0, 1fr);
}
.gp-game .game-field-immersive[data-tools-layout="sides"] #game-parent { grid-column: 2; }
.gp-game #game-grand-parent.game-field-rotated {
  --game-safe-top: env(safe-area-inset-left, 0px);
  --game-safe-right: env(safe-area-inset-top, 0px);
  --game-safe-bottom: env(safe-area-inset-right, 0px);
  --game-safe-left: env(safe-area-inset-bottom, 0px);
  width: var(--game-viewport-height, 100vh);
  height: var(--game-viewport-width, 100vw);
  top: var(--game-viewport-height, 100vh);
  transform: rotate(-90deg);
  transform-origin: left top;
}
.gp-game .game-disconnect {
  position: absolute;
  z-index: 4;
  inset: 0;
  margin: 0;
  padding: 20px;
  display: grid;
  place-content: center;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: #131326e6;
  line-height: 1.5;
}
.gp-game .game-captcha {
  position: absolute;
  z-index: 5;
  right: 0;
  bottom: 0;
  max-width: 100%;
  overflow: auto;
}

.game-controls-panel {
  display: flex;
  position: static;
}

/* Fullscreen HUD content needs to size its own panel. A fixed 125px panel
   allowed the 210px health row to overflow beyond the screen's right edge. */
.gp-game .game-controls-overlay {
  --controls-inset-right: max(env(safe-area-inset-right, 0px), min(100px, 4vw));
  position: absolute;
  z-index: 3;
  top: max(12px, env(safe-area-inset-top, 0px));
  right: var(--controls-inset-right);
  width: max-content;
  max-width: min(360px, calc(100% - var(--controls-inset-right) - 16px));
  overflow-wrap: anywhere;
  pointer-events: none;
}
.gp-game .game-controls-overlay :is(button, a, select, input) { pointer-events: auto; }

.gp-game .game-controls-overlay > #right {
  flex-direction: column;
  align-items: flex-end;
  max-width: 100%;
  gap: 6px;
}

.gp-game .game-controls-overlay .game-control-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 100%;
}

.gp-game .game-controls-overlay .game-control-actions:empty {
  display: none;
}

.gp-game .game-controls-overlay > #right > div,
.gp-game .game-controls-overlay .game-control-actions > div {
  min-width: 0;
  max-width: 100%;
}

.gp-game .game-controls-overlay button,
.gp-game .game-controls-overlay select {
  box-sizing: border-box;
  max-width: 100%;
  min-height: 44px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.gp-game .game-controls-overlay .game-health {
  box-sizing: border-box;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  width: auto !important;
  max-width: 100%;
  height: auto !important;
  min-height: 55px;
  margin-right: 0 !important;
}

.gp-game .game-controls-overlay .game-health > br {
  display: none;
}

.gp-game .game-controls-overlay .game-health button {
  white-space: normal !important;
  margin-right: 0 !important;
}

.gp-game .game-controls-overlay .game-health-warning {
  max-width: 250px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Safe-area edges rotate with the iPhone portrait-lock view. */
.gp-game .game-controls-overlay.game-controls-rotated {
  top: max(12px, env(safe-area-inset-left, 0px));
  right: max(12px, env(safe-area-inset-top, 0px));
  max-width: min(300px, calc(100% - 110px));
}
.gp-game .game-exit-rotated {
  position: absolute;
  z-index: 4;
  top: max(12px, env(safe-area-inset-top, 0px));
  left: max(12px, env(safe-area-inset-left, 0px));
  min-height: 44px;
  font-size: 16px;
}
.gp-game .game-field-rotated .game-exit-rotated {
  top: max(12px, env(safe-area-inset-left, 0px));
  left: max(12px, env(safe-area-inset-bottom, 0px));
}
.gp-game .game-controls-overlay button,
.gp-game .game-controls-overlay select { font-size: 16px !important; }
.gp-game .game-controls-overlay .game-health { padding: 4px 8px !important; min-height: 44px; }
.gp-game .game-controls-overlay .game-health > span { font-size: 24px !important; }
.gp-game .game-controls-overlay .game-health > img { width: 32px !important; height: 32px !important; }
.gp-game .game-controls-overlay .game-health-warning { font-size: 14px !important; margin-top: 0 !important; }

.game-navigation .game-menu-trigger {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
  padding: .3rem .75rem;
  white-space: nowrap;
  min-height: 36px;
  border-radius: 2rem;
}

.game-navigation .game-menu-trigger.cta-button-magenta {
  background: var(--magenta);
  padding-inline: 1.8rem;
}

.game-navigation .game-menu-trigger:hover,
.game-navigation .game-menu-trigger[aria-expanded="true"] {
  color: var(--cyan);
}

.game-navigation .game-menu > .sub-menu {
  top: 100%;
  margin-top: 0;
}

.game-navigation .game-menu-open > .sub-menu {
  max-height: min(70vh, 800px);
  overflow-y: auto;
}

.game-navigation #game-menu-events {
  min-width: 220px;
}

.game-navigation .game-menu-action {
  display: block;
  width: 100%;
  padding: .5rem 1rem;
  border: 0;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.game-navigation .game-menu-action:hover {
  color: var(--cyan);
}

.game-selector-toggle {
  border: 0;
  padding: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.gp-game .server > span.server-current {
  margin-right: .35rem;
}

.game-navigation button:focus-visible,
.game-navigation a:focus-visible,
.gp-game .game-selector-toggle:focus-visible,
.gp-game .server-select select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

.game-navigation .mobile-nav:focus-within {
  outline: 2px solid var(--cyan);
  outline-offset: 6px;
}

/* Keep the navigation on one row at intermediate desktop widths. */
@media (min-width: 769px) and (max-width: 1250px) {
  .game-navigation .game-menu {
    width: auto !important;
    margin-left: .25rem !important;
  }
  .game-navigation .game-menu-trigger {
    font-size: .9rem;
    padding-inline: .65rem;
  }
  .game-navigation .logo {
    min-width: 200px;
  }
  .game-navigation .logo img {
    width: 200px;
    height: auto;
  }
}

@media (min-width: 769px) and (max-width: 900px) {
  .game-navigation .logo {
    min-width: 160px;
  }
  .game-navigation .logo img {
    width: 160px;
  }
  .game-navigation .game-menu-trigger {
    padding-inline: .5rem;
  }
}

/* Fit the normal 800x600 desktop field and its controls on shorter windows.
   Scope the spacing to the outer grid, leaving component grids untouched. */
@media (min-width: 850px) and (max-height: 840px) {
  .game-navigation .logo {
    display: flex;
    align-items: center;
    padding-block: 4px;
    margin-top: 0;
  }
  .game-navigation ul.main-nav {
    margin-block: 4px;
  }
  .gp-game.game-page-windowed {
    padding-top: 0;
  }
  .game-page-windowed > .content-wrapper > .wrapper {
    row-gap: 6px;
  }
  .game-page-windowed .top-wrapper {
    margin-bottom: 0 !important;
  }
  .game-page-windowed .bottom.info {
    margin-top: -2px !important;
    padding-top: 0;
  }
  .game-page-windowed .game-controls-col {
    min-height: 44px !important;
  }
  .game-page-windowed .bottom-content {
    padding-bottom: 0;
  }
  .game-page-windowed .bottom.info #panel #right {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
  }
  .game-page-windowed .bottom.info #panel #right > div:empty {
    display: none;
  }
  .game-page-windowed .bottom.info .game-health {
    width: auto !important;
    padding: 0 !important;
  }
  .game-page-windowed .bottom.info .game-health-warning {
    max-width: 105px;
    margin-top: 0 !important;
    font-size: 13px !important;
    line-height: 1.25;
  }
  .game-page-windowed .bottom.info .game-health-warning img { width: 16px !important; height: 16px; vertical-align: middle; }
  .game-page-windowed .bottom.info .game-health > span { font-size: 24px !important; }
  .game-page-windowed .bottom.info .game-health > img { width: 28px !important; height: 28px !important; }
  .game-page-windowed .bottom.info .game-health-meter { width: 110px; min-width: 0; flex: 0 0 110px; margin: 0; }
  .game-page-windowed .bottom.info .game-health-meter small,
  .game-page-windowed .bottom.info .game-boost-hint { display: none; }
}

/* On short desktop windows, keep the field and primary controls above the fold.
   Secondary cards follow underneath, as they already do on narrower laptops. */
@media (min-width: 850px) and (max-height: 740px) {
  .game-page-windowed > .content-wrapper > .wrapper {
    width: min(810px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-self: center;
  }
  .game-page-windowed > .content-wrapper > .wrapper > .spacer { display: none; }
  .game-page-windowed > .content-wrapper > .wrapper > .top.info {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100% !important;
  }
  .game-page-windowed #game-grand-parent {
    grid-column: 1 / -1;
    grid-row: 2;
    width: min(800px, max(400px, calc((100vh - 180px) * 4 / 3)));
    height: auto;
    aspect-ratio: 4 / 3;
  }
  .game-page-windowed > .content-wrapper > .wrapper > .bottom.info {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .game-page-windowed > .content-wrapper > .wrapper > .card,
  .game-page-windowed > .content-wrapper > .wrapper > .flip-container { justify-self: center; }
}

/* Keep the outer page grid responsive without changing component-specific grids. */
@media (max-width: 849px) {
  .game-page .modal-header { flex-wrap: wrap; gap: 8px; padding: 16px; min-width: 0; }
  .game-page .modal-header > span { order: -1; width: 100%; overflow-wrap: anywhere; }
  .game-page .modal-header > div { padding: 0 !important; }
  .game-page .modal-body { min-height: 0; padding: 16px; }
  .gp-game { padding-top: 8px; }
  .gp-game > .content-wrapper { width: 100%; padding-inline: 12px; box-sizing: border-box; }
  .gp-game > .content-wrapper > .wrapper {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .gp-game > .content-wrapper > .wrapper > .col { min-width: 0; }
  .gp-game > .content-wrapper > .wrapper > .card,
  .gp-game > .content-wrapper > .wrapper > .flip-container { grid-row: auto !important; }
  .gp-game > .content-wrapper > .wrapper > .top.info {
    grid-column: 1 / -1;
    grid-row: 1;
    width: 100% !important;
  }
  .gp-game #game-grand-parent:not(.game-field-immersive) {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .gp-game > .content-wrapper > .wrapper > .bottom.info {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0 !important;
    padding: 0 !important;
  }
  .gp-game .wrapper .top .top-wrapper {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    margin: 0 !important;
  }
  .gp-game .top-wrapper > .col:first-child { grid-column: 1 / -1; }
  .gp-game .top-content, .gp-game .top-content.align-right { text-align: center; }
  .gp-game .top-content.server { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; padding: 0; gap: 4px; }
  .gp-game .top-content .server-current { font-size: 14px; }
  .gp-game .game-selector-toggle { min-height: 36px; }
  .gp-game .server-select select, .gp-game .bottom.info select { font-size: 16px; }
  .gp-game .top-content .player-name { overflow-wrap: anywhere; }
  .gp-game .top-content.prize, .gp-game .top-content .prize-first { font-size: 12px; }
  .gp-game .discord-button { font-size: 12px; white-space: normal; }
  .gp-game .wrapper .bottom-wrapper { width: 100%; grid-template-columns: 1fr; gap: 8px; }
  .gp-game .game-controls-col { min-height: 0 !important; }
  .gp-game .bottom-content { padding: 0; }
  .gp-game .bottom-content.game-info { text-align: center; }
  .gp-game .bottom.info .game-controls-panel { justify-content: center; max-width: 100%; }
  .gp-game .bottom.info .game-control-actions { display: flex; flex-wrap: wrap; justify-content: center; }
  .gp-game .bottom.info #right { max-width: 100%; min-width: 0; overflow-wrap: anywhere; }
  .gp-game .bottom.info button, .gp-game .bottom.info select { min-height: 44px; max-width: 100%; white-space: normal; }
  .gp-game .bottom.info .game-health {
    margin-inline: auto !important;
    max-width: 100%;
    width: auto !important;
    height: auto !important;
    flex-wrap: wrap;
    justify-content: center;
  }
  .gp-game .bottom.info .game-health button { white-space: normal !important; margin-right: 0 !important; }
  .gp-game .wrapper .wrapper.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gp-game .wrapper .wrapper.private-game-info { grid-template-columns: 35% 65%; }
  .gp-game .wrapper .wrapper.leaderboard { grid-template-columns: minmax(0, 1fr) auto; }
  .gp-game .tooltip-text, .gp-game .tooltip-text-below { max-width: min(250px, calc(100vw - 32px)); box-sizing: border-box; }
}
@media (max-width: 479px) {
  .gp-game > .content-wrapper > .wrapper { grid-template-columns: minmax(0, 1fr); }
  .gp-game > .content-wrapper > .wrapper > .card,
  .gp-game > .content-wrapper > .wrapper > .flip-container { justify-self: center; }
  .game-navigation .logo { min-width: 0; }
  .game-navigation .logo img { width: min(230px, 65vw); height: auto; }
  .gp-game .wrapper .top .top-wrapper { grid-template-columns: minmax(0, 1fr); }
  .gp-game .bottom.info .bottom-content.game-buttons { display: flex; justify-content: center; }
}
/* Utility controls live outside the playable canvas. In immersive views the
   reserved space stays fixed through countdown, play, and results. */
.gp-game .bottom-wrapper > .game-info-col { display: flex; flex-direction: row; align-items: center; align-self: start; gap: 8px; }
.gp-game .game-info-col .game-info { padding: 0; min-width: 0; font-size: 13px; line-height: 1.4; }
#game-tools-dock { display: flex; align-items: center; gap: 8px; max-width: 100%; }
.game-info-col:has(#game-tools-dock:empty) { gap: 0; }
@media (min-width: 850px) {
  #game-tools-dock { margin-left: auto; flex-shrink: 0; }
}
@media (max-width: 849px) {
  .gp-game .bottom-wrapper > .game-info-col { flex-direction: column; }
}
.game-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  min-width: 0;
}
.game-field-immersive .game-tools {
  position: absolute;
  z-index: 6;
  left: calc(var(--game-safe-left) + 8px);
  bottom: calc(var(--game-safe-bottom) + 10px);
  max-width: calc(100% - var(--game-safe-left) - var(--game-safe-right) - 96px);
}
.game-field-immersive[data-tools-layout="sides"] .game-tools {
  top: calc(var(--game-safe-top) + 8px);
  bottom: auto;
  width: calc(var(--game-side-rail) - 16px);
  flex-direction: column;
}
.game-field-immersive[data-tools-layout="sides"] .game-tools-buttons { flex-direction: column; }
.game-tools button { pointer-events: auto; }
.game-tools-buttons { display: flex; gap: 4px; flex-shrink: 0; }
.game-tools button, .game-status button, .game-dialog button {
  box-sizing: border-box;
  border: 1px solid #7380a0;
  border-radius: 8px;
  background: #19182eed;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  padding: 8px 12px;
}
.game-tools button { min-width: 44px; padding: 4px 8px; font-size: 18px; }
.game-tools button svg { display: block; margin: auto; }
.game-tools button:hover, .game-dialog button:hover, .game-status button:hover { background: #333451; }
.game-tools button:focus-visible, .game-dialog :focus-visible, .game-boost-button:focus-visible, .game-status button:focus-visible {
  outline: 3px solid #80ffff;
  outline-offset: 3px;
}
.game-remaining { color: white; padding: 4px; font-size: 13px; line-height: 1.3; min-width: 0; }
.game-field-immersive .game-remaining { text-align: center; }
.game-status {
  position: absolute;
  z-index: 6;
  bottom: max(10px, var(--game-safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  box-sizing: border-box;
  padding: 6px 10px;
  background: #131326ed;
  border: 1px solid #565c83;
  border-radius: 8px;
  color: white;
  font-size: 13px;
  line-height: 1.4;
  text-align: center;
  overflow-wrap: anywhere;
  pointer-events: none;
}
.game-status-error { border-color: #ff93ae; }
.game-status button { display: block; margin: 6px auto 0; font-size: 13px; pointer-events: auto; }
.game-field-immersive:not([data-tools-layout="sides"]) .game-status {
  bottom: calc(var(--game-safe-bottom) + var(--game-bottom-rail) + 8px);
}
.game-boost-button {
  flex-shrink: 0;
  width: 72px;
  height: 56px;
  border-radius: 24px;
  border: 2px solid #80ffff;
  background: #18263bea;
  color: white;
  font: bold 16px/1.2 sans-serif;
  touch-action: none;
  user-select: none;
}
.game-field-immersive .game-boost-button {
  position: absolute;
  z-index: 5;
  right: calc(var(--game-safe-right) + 8px);
  bottom: calc(var(--game-safe-bottom) + 4px);
}
.game-field-immersive[data-tools-layout="sides"] .game-boost-button { bottom: calc(var(--game-safe-bottom) + 8px); }
.game-boost-held { background: #345777; }
.game-boost-button:disabled { opacity: 0.6; border-color: #9397ab; }
.game-field-rotated .game-status { max-width: calc(100% - var(--game-safe-left) - var(--game-safe-right) - 24px); }
.game-health-meter { width: 100%; min-width: 120px; max-width: 260px; margin: 6px 0 0 auto; text-align: right; font: 12px/1.35 sans-serif; color: white; }
.game-health-track { height: 8px; background: #0a0d20; border: 1px solid #8e94af; border-radius: 8px; position: relative; overflow: hidden; margin-bottom: 4px; }
.game-health-track span { display: block; height: 100%; background: #80ffff; transition: width 100ms linear; }
.game-health-track i { position: absolute; top: 0; height: 100%; border-left: 2px solid #ff3beb; }
.game-health-critical .game-health-track span { background: #ff93ae; }
.game-health-meter small { display: block; font-size: 11px; color: #c6cbe3; }
.game-personal-result { margin: 0 0 8px; font: 14px/1.45 sans-serif; text-align: right; color: white; }
.game-personal-result strong, .game-personal-result span { display: block; }
.game-personal-result strong { color: #80ffff; }
.game-personal-result span { font-size: 12px; }
.game-ready-confirmation { color: #80ffff; font-weight: bold; margin: 8px 0; }
.game-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 12000;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  box-sizing: border-box;
  background: #090c20bf;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font: 15px/1.5 sans-serif;
}
.game-field-immersive > .game-dialog-backdrop { position: absolute; }
.game-field-rotated > .game-dialog-backdrop { padding: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)); }
.game-dialog {
  background: #1c1c35;
  border: 1px solid #7984ab;
  border-radius: 14px;
  width: 560px;
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  padding: 16px;
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 12px 48px #0008;
  text-align: left;
}
.game-dialog header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.game-dialog h2 { margin: 0; color: white; font: bold 21px/1.3 sans-serif; }
.game-dialog p { margin: 10px 0; }
.game-dialog .game-dialog-note { color: #c6cbe3; font-size: 13px; }
.game-dialog label { display: flex; align-items: center; gap: 8px; margin: 10px 0; min-height: 32px; color: white; }
.game-dialog input[type=checkbox] { width: 20px; height: 20px; accent-color: #80ffff; flex-shrink: 0; }
.game-dialog select { color: white; background: #101426; padding: 8px; border: 1px solid #9397ab; border-radius: 6px; margin-left: auto; min-height: 44px; font: inherit; }
.game-dialog input[type=range] { min-width: 80px; flex: 1; accent-color: #80ffff; }
.game-dialog button:disabled { opacity: 0.55; cursor: default; }
.game-dialog fieldset { border: 1px solid #5c6288; border-radius: 8px; margin: 16px 0 0; padding: 8px 12px; min-width: 0; }
.game-dialog legend { color: #80ffff; font-weight: bold; }
.game-dialog dl { margin: 12px 0; }
.game-dialog dt { color: #80ffff; font-weight: bold; margin-top: 12px; }
.game-dialog dd { margin: 2px 0 0; }
.game-colour-rules span { display: block; }
.game-colour-rules span:nth-child(1) { color: #80ffff; }
.game-colour-rules span:nth-child(2) { color: #ff93f3; }
.game-colour-rules span:nth-child(3) { color: #ffff80; }
.game-practice-steps { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-left: 22px; font-size: 12px; }
.game-practice-steps li { margin-right: 12px; }
.game-practice-steps [aria-current=step] { font-weight: bold; color: #80ffff; }
.game-practice-steps .complete { color: #a7d2c2; }
.game-practice-prompt { min-height: 3em; }
.game-practice-arena { display: block; width: 100%; aspect-ratio: 2; border-radius: 12px; background: #0f1227; touch-action: none; }
.game-practice-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) { .game-health-track span { transition: none; } }
