/* Tide Ring inspired shell shared by every game landing screen.
   Rules and game boards keep their own visual language; this file only aligns
   the public header, intro, and match setup surfaces. */

.tide-ui {
  --tide-bg: #080d18;
  --tide-panel: #101827;
  --tide-panel-soft: #121d2e;
  --tide-water: #17243a;
  --tide-line: #35445f;
  --tide-line-strong: #526886;
  --tide-text: #edf4ff;
  --tide-muted: #b8c5d9;
  --tide-faint: #8292ab;
  --tide-gold: #f1d38e;
  --tide-blue: #8fc6ee;
  min-width: 320px;
  min-height: 100vh;
  color: var(--tide-text);
  background:
    radial-gradient(circle at 84% -8%, rgba(143, 198, 238, .12), transparent 32%),
    radial-gradient(circle at 10% 82%, rgba(241, 211, 142, .06), transparent 28%),
    var(--tide-bg);
  font-family: system-ui, "Yu Gothic", "Noto Sans JP", sans-serif;
}

.tide-ui button,
.tide-ui select { font-family: inherit; }

/* Shared duel shell ----------------------------------------------------- */
.tide-ui .duel-app {
  min-height: 100vh;
  color: var(--tide-text);
  background: transparent;
}

.tide-ui .duel-app .site-nav {
  width: min(1340px, calc(100% - 48px));
  max-width: none;
  margin: 0 auto;
  padding: 22px 0;
  border-bottom: 1px solid var(--tide-line);
}

.tide-ui .duel-app .back-link {
  color: var(--tide-muted);
  font-size: 13px;
}

.tide-ui .duel-app .back-link:hover,
.tide-ui .duel-app .nav-button:hover,
.tide-ui .duel-app .link-button:hover { color: var(--tide-text); }

.tide-ui .duel-app .nav-title strong {
  color: var(--tide-text);
  font-size: 16px;
}

.tide-ui .duel-app .nav-title small {
  color: var(--tide-muted);
  font-size: 11px;
}

.tide-ui .duel-app .nav-mark {
  width: 31px;
  height: 31px;
  border: 1px solid var(--tide-gold) !important;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--tide-gold) 0 48%, var(--tide-water) 49% 100%) !important;
  color: #182238 !important;
  transform: none !important;
  box-shadow: 0 0 0 3px rgba(241, 211, 142, .08);
}

.tide-ui .duel-app .nav-mark span { transform: none !important; }

.tide-ui .duel-app .nav-button,
.tide-ui .duel-app .link-button {
  min-height: 42px;
  border-color: var(--tide-line);
  border-radius: 7px;
  background: transparent;
  color: var(--tide-muted);
}

.tide-ui .duel-app .page {
  width: min(1260px, calc(100% - 48px));
  max-width: 1260px;
  padding-top: 34px;
}

.tide-ui .duel-app .home-screen { padding-top: 18px; }
.tide-ui .duel-app .home-screen { min-height: 0 !important; height: auto !important; }
.tide-ui .duel-app .home-hero { min-height: 0 !important; }

.tide-ui .duel-app .home-copy h1,
.tide-ui .duel-app .home-copy h1 em {
  color: var(--tide-text) !important;
}

.tide-ui .duel-app .home-copy .lead,
.tide-ui .duel-app .definition-card p,
.tide-ui .duel-app .home-foot { color: var(--tide-muted) !important; }

.tide-ui .duel-app .eyebrow { color: var(--tide-gold) !important; }

.tide-ui .duel-app .hero-badges span,
.tide-ui .duel-app .rule-tags span {
  border-color: var(--tide-line);
  border-radius: 5px;
  background: rgba(143, 198, 238, .07);
  color: var(--tide-muted);
}

.tide-ui .duel-app .setup-panel {
  margin-top: 48px;
  padding: 22px;
  border: 1px solid var(--tide-line);
  border-radius: 12px;
  background: var(--tide-panel);
  gap: 22px;
}

.tide-ui .duel-app .setup-card,
.tide-ui .duel-app .definition-card {
  border-color: transparent !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}

.tide-ui .duel-app .setup-card { padding: 2px 0; }

.tide-ui .duel-app .setup-card h2,
.tide-ui .duel-app .definition-card h2 {
  color: var(--tide-text);
}

.tide-ui .duel-app .setup-section + .setup-section {
  border-top-color: var(--tide-line);
}

.tide-ui .duel-app .setup-label { color: var(--tide-muted); }

.tide-ui .duel-app .choice {
  border-color: var(--tide-line-strong) !important;
  border-radius: 7px;
  background: rgba(8, 13, 24, .55) !important;
  color: var(--tide-muted) !important;
}

.tide-ui .duel-app .choice:hover {
  border-color: var(--tide-blue) !important;
  background: rgba(143, 198, 238, .10) !important;
}

.tide-ui .duel-app .choice.selected {
  border-color: var(--tide-gold) !important;
  background: rgba(241, 211, 142, .14) !important;
  color: var(--tide-text) !important;
}

.tide-ui .duel-app .choice.selected small { color: var(--tide-gold); }

.tide-ui .duel-app .primary-button {
  min-height: 44px;
  border-color: var(--tide-gold);
  border-radius: 7px;
  background: var(--tide-gold);
  color: #101827;
}

.tide-ui .duel-app .secondary-button {
  min-height: 44px;
  border-color: var(--tide-line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--tide-text);
}

.tide-ui .duel-app .secondary-button:hover { border-color: var(--tide-gold); }

.tide-ui .result-home-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 2px 9px;
  border: 0;
  background: transparent;
  color: var(--tide-muted);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tide-ui .result-home-button:hover {
  color: var(--tide-gold);
}

.tide-ui .duel-app .result-actions .result-home-button {
  flex: 0 0 100%;
  margin-top: -2px;
}

.tide-ui .result-actions { flex-wrap: wrap; }
.tide-ui .result-actions .result-home-button {
  flex: 0 0 100%;
  margin-top: -2px;
}

.tide-ui #result-actions .result-home-button {
  display: flex;
  width: fit-content;
  margin: 7px 0 0;
}

.tide-ui .duel-app .definition-card {
  padding: 20px 0 20px 22px;
  border-left: 1px solid var(--tide-line);
  background: linear-gradient(145deg, rgba(143, 198, 238, .08), transparent);
}

.tide-ui .duel-app .home-foot { border-top-color: var(--tide-line); }

/* Star Crown uses a standalone, select-based landing screen. */
.tide-ui > header,
.tide-ui > main,
.tide-ui > footer {
  max-width: 1340px;
}

.tide-ui > header { padding: 22px 40px; }

.tide-ui > header > a { color: var(--tide-gold); }
.tide-ui > header > a span { color: var(--tide-text); }

.tide-ui > main { padding: 28px 40px 48px; }

.tide-ui > main > .hero {
  margin-bottom: 36px;
}

.tide-ui > main > .hero h1 {
  color: var(--tide-text);
}

.tide-ui > main > .hero .lead { color: var(--tide-text); }

.tide-ui > main > .hero-note {
  color: var(--tide-muted);
  border-left-color: var(--tide-line);
}

.tide-ui > main > .setup {
  padding: 22px;
  border-color: var(--tide-line);
  border-radius: 12px;
  background: var(--tide-panel);
}

.tide-ui > main > .setup label { color: var(--tide-muted); }

.tide-ui > main > .setup select {
  border-color: var(--tide-line);
  border-radius: 7px;
  background: var(--tide-bg);
  color: var(--tide-text);
}

.tide-ui > main > .setup p { color: var(--tide-muted); }

.tide-ui > main > .setup .primary {
  border-color: var(--tide-gold);
  border-radius: 7px;
  background: var(--tide-gold);
  color: #101827;
}

.tide-ui > main > .setup .secondary {
  border-color: var(--tide-line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--tide-text);
}

/* Sanjinsen and Keypoint Clash use the same home topbar vocabulary. */
.tide-ui > nav {
  width: min(1340px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 0;
}

.tide-ui > nav > a {
  color: var(--tide-muted);
  font-size: 13px;
}

.tide-ui .topbar {
  width: min(1340px, calc(100% - 48px));
  max-width: none;
  margin: 0 auto;
  padding: 22px 0;
  border-bottom: 1px solid var(--tide-line);
}

.tide-ui .home-topbar { margin-bottom: 50px; }

.tide-ui .brand-mark {
  width: 31px !important;
  height: 31px !important;
  border-color: var(--tide-gold) !important;
  border-radius: 50%;
  background: linear-gradient(180deg, var(--tide-gold) 0 48%, var(--tide-water) 49% 100%) !important;
  color: #182238 !important;
  transform: none !important;
  box-shadow: 0 0 0 3px rgba(241, 211, 142, .08);
}

.tide-ui .brand-lockup h1 { color: var(--tide-text); }
.tide-ui .brand-lockup h1 span { color: var(--tide-muted); }
.tide-ui .home-top-note,
.tide-ui .definition-pill { color: var(--tide-muted); }

.tide-ui .home-main {
  width: min(1260px, calc(100% - 48px));
  max-width: 1260px;
  padding-top: 0;
}

.tide-ui .home-hero .hero-lead { color: var(--tide-muted); }

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--tide-line);
  border-radius: 12px;
  background: var(--tide-panel);
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-select,
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .difficulty-select,
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .first-player-select {
  display: grid;
  grid-template-columns: 92px repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  margin: 0;
  padding: 8px 0;
  border-top: 1px solid var(--tide-line);
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-select { border-top: 0; }

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-select-label {
  align-self: center;
  margin: 0;
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-choice,
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .difficulty-choice,
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .first-player-choice {
  min-width: 0;
  margin: 0;
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .home-actions,
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .hero-actions {
  order: 4;
  grid-column: 1 / -1;
  margin-top: 7px;
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .condition-row {
  order: 5;
  grid-column: 1 / -1;
  border-top: 1px solid var(--tide-line);
  padding-top: 10px;
}

.tide-ui .mode-select,
.tide-ui .difficulty-select,
.tide-ui .first-player-select {
  padding: 11px 0;
  border-top: 1px solid var(--tide-line);
}

.tide-ui .mode-select-label { color: var(--tide-muted); }

.tide-ui .mode-choice,
.tide-ui .difficulty-choice,
.tide-ui .first-player-choice {
  border-color: var(--tide-line-strong);
  border-radius: 7px;
  background: rgba(8, 13, 24, .55);
  color: var(--tide-muted);
}

.tide-ui .mode-choice:hover,
.tide-ui .mode-choice.selected,
.tide-ui .difficulty-choice:hover,
.tide-ui .difficulty-choice.selected,
.tide-ui .first-player-choice:hover,
.tide-ui .first-player-choice.selected {
  border-color: var(--tide-gold);
  background: rgba(241, 211, 142, .14);
  color: var(--tide-text);
}

.tide-ui .mode-choice small,
.tide-ui .difficulty-choice small,
.tide-ui .first-player-choice small { color: var(--tide-faint); }

.tide-ui .mode-choice.selected small,
.tide-ui .difficulty-choice.selected small,
.tide-ui .first-player-choice.selected small { color: var(--tide-gold); }

.tide-ui .home-lower,
.tide-ui .home-panels { margin-top: 34px; }

.tide-ui .home-panel,
.tide-ui .info-panel {
  border-color: var(--tide-line);
  border-radius: 10px;
  background: var(--tide-panel);
}

.tide-ui .primary-button,
.tide-ui .tide-primary,
.tide-ui .home-actions .primary-button,
.tide-ui .hero-actions .primary-button {
  border-color: var(--tide-gold);
  border-radius: 7px;
  background: var(--tide-gold);
  color: #101827;
}

.tide-ui .ghost-button,
.tide-ui .secondary-button {
  border-color: var(--tide-line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--tide-text);
}

/* The home screen should remain comfortable on a phone. */
@media (max-width: 700px) {
  .tide-ui .duel-app .site-nav,
  .tide-ui .topbar,
  .tide-ui > nav {
    width: calc(100% - 28px);
  }

  .tide-ui .duel-app .page,
  .tide-ui .home-main { width: calc(100% - 28px); }

  .tide-ui .duel-app .setup-panel {
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .tide-ui .duel-app .definition-card {
    padding: 19px 0 0;
    border-top: 1px solid var(--tide-line);
    border-left: 0;
  }

  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel { padding: 12px; }
  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-select,
  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel .difficulty-select,
  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel .first-player-select {
    display: flex;
    flex-wrap: wrap;
  }
  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-select-label {
    flex: 0 0 100%;
    padding-bottom: 2px;
  }
  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-choice,
  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel .difficulty-choice,
  .tide-ui :is(.home-copy, .hero-copy) > .setup-panel .first-player-choice { flex: 1 1 110px; }

  .tide-ui > header { padding: 16px 20px; }
  .tide-ui > main { padding: 18px 16px 34px; }
  .tide-ui > main > .hero h1 { font-size: 50px; }
  .tide-ui > main > .setup { grid-template-columns: 1fr 1fr; padding: 16px; }
  .tide-ui .brand-lockup h1 { font-size: 18px; }
  .tide-ui .brand-lockup h1 span { display: none; }
}

/* The two bespoke duel pages use the same select rows once their legacy
   choice buttons are adapted by luna-controls.js. */
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .luna-select-section {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .luna-select-field {
  display: grid;
  gap: 7px;
  margin: 0;
  color: var(--tide-muted);
  font-size: 13px;
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .luna-choice-row,
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .mode-select-label {
  display: none !important;
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .luna-select-section > [data-mode],
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .luna-select-section > [data-difficulty],
.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .luna-select-section > [data-first-player] {
  display: none !important;
}

.tide-ui :is(.home-copy, .hero-copy) > .setup-panel .luna-select-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--tide-line-strong);
  border-radius: 7px;
  background: var(--tide-bg);
  color: var(--tide-text);
  font: inherit;
}

/* Once the board is part of the landing flow, the old pre-match explainer
   panels only push the playable surface out of view. Their content remains
   available through the rule/tutorial views. */
.tide-ui .home-lower,
.tide-ui .home-panels { display: none; }

/* The landing view keeps the playable surface immediately after the
   settings card, like Tide Ring and Star Crown. The short idea copy is
   already present in the hero and remains available from the rules view. */
.tide-ui .duel-app .home-screen .definition-card,
.tide-ui .duel-app .home-screen .home-foot { display: none; }

/* One public shell for every game -------------------------------------- */
.tide-ui .luna-global-nav,
.tide-ui > .luna-global-header {
  width: min(1340px, calc(100% - 48px));
  max-width: none;
  margin: 0 auto;
  min-height: 72px;
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--tide-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.tide-ui .luna-brand,
.tide-ui > .luna-global-header > a:first-child {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--tide-text);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.tide-ui .luna-brand-mark {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--tide-gold);
  border-radius: 50%;
  background: linear-gradient(180deg, var(--tide-gold) 0 48%, var(--tide-water) 49% 100%);
  color: #182238;
  font-size: 17px;
  line-height: 1;
}

.tide-ui .luna-global-nav .nav-title { display: none; }
.tide-ui .luna-global-nav .back-link { display: none; }
.tide-ui .luna-global-nav .nav-actions { margin-left: auto; }
.tide-ui .luna-global-nav #homeButton { display: none; }
.tide-ui .luna-global-nav #rulesButton,
.tide-ui .luna-help {
  min-height: 0 !important;
  padding: 2px 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: var(--tide-blue);
  font-size: 13px;
  text-decoration: none;
}

.tide-ui .luna-global-nav #rulesButton:hover,
.tide-ui .luna-help:hover { color: var(--tide-text); }

.tide-ui .luna-global-header > .luna-help { color: var(--tide-blue); }

/* Shared settings are native selects, matching Tide Ring and Star Crown. */
.tide-ui .duel-app .setup-panel {
  grid-template-columns: 1fr;
  gap: 0;
}

.tide-ui .duel-app .setup-card {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 14px;
  padding: 0;
}

.tide-ui .duel-app .setup-card > .eyebrow,
.tide-ui .duel-app .setup-card > h2,
.tide-ui .duel-app .setup-card > .setup-actions {
  grid-column: 1 / -1;
}

.tide-ui .duel-app .setup-card > .eyebrow { margin-bottom: -7px; }
.tide-ui .duel-app .setup-card > h2 { margin: 0 0 2px; }
.tide-ui .duel-app .setup-section,
.tide-ui .duel-app .setup-section + .setup-section {
  margin: 0;
  padding: 0;
  border-top: 0;
}

.tide-ui .luna-select-section .setup-label,
.tide-ui .luna-choice-row { display: none !important; }

.tide-ui .luna-select-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  color: var(--tide-muted);
  font-size: 13px;
}

.tide-ui .luna-select-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--tide-line-strong);
  border-radius: 7px;
  background: var(--tide-bg);
  color: var(--tide-text);
  font: inherit;
}

.tide-ui .luna-select-field select:focus-visible {
  outline: 2px solid var(--tide-gold);
  outline-offset: 2px;
}

.tide-ui .duel-app .setup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid var(--tide-line);
}

.tide-ui .duel-app .definition-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 20px;
  margin-top: 18px;
  padding: 17px 0 0;
  border-top: 1px solid var(--tide-line) !important;
  border-left: 0;
}

.tide-ui .duel-app .definition-card > .eyebrow,
.tide-ui .duel-app .definition-card > h2,
.tide-ui .duel-app .definition-card > p { grid-column: 1; }
.tide-ui .duel-app .definition-card > .rule-tags { grid-column: 2; grid-row: 1 / span 3; align-self: center; }

/* The live board is part of the landing flow, directly below settings. */
.tide-ui .duel-app .game-screen {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--tide-line);
}

.tide-ui .duel-app .game-toolbar { display: none; }

.tide-ui .duel-app .game-screen .game-stats,
.tide-ui .duel-app .game-screen .play-layout { margin-top: 0; }

.tide-ui .duel-app .game-screen .game-stats { margin-bottom: 16px; }

@media (max-width: 700px) {
  .tide-ui .luna-global-nav,
  .tide-ui > .luna-global-header { width: calc(100% - 28px); min-height: 62px; padding: 16px 0 13px; }
  .tide-ui .luna-brand,
  .tide-ui > .luna-global-header > a:first-child { font-size: 15px; }
  .tide-ui .duel-app .setup-card { grid-template-columns: 1fr; gap: 11px; }
  .tide-ui .duel-app .setup-card > .eyebrow,
  .tide-ui .duel-app .setup-card > h2,
  .tide-ui .duel-app .setup-card > .setup-actions { grid-column: auto; }
  .tide-ui .duel-app .setup-actions { flex-wrap: wrap; }
  .tide-ui .duel-app .setup-actions button { flex: 1 1 150px; }
  .tide-ui .duel-app .definition-card { grid-template-columns: 1fr; }
  .tide-ui .duel-app .definition-card > .rule-tags { grid-column: auto; grid-row: auto; }
  .tide-ui .duel-app .game-screen { margin-top: 24px; }
}

/* Legacy bespoke duel shells now follow the same landing flow as Tide Ring
   and Star Crown. The engines keep their original markup and IDs; this pass
   only removes the duplicate game chrome and rearranges the presentation. */
.tide-ui > .screen.home-screen {
  width: min(1260px, calc(100% - 48px));
  min-height: 0 !important;
  height: auto !important;
  margin: 0 auto;
  padding: 0 0 24px;
  background: transparent !important;
}

.tide-ui > .screen.home-screen > .home-topbar,
.tide-ui > .screen.home-screen .hero-board,
.tide-ui > .screen.home-screen .hero-visual,
.tide-ui > .screen.home-screen .home-panels,
.tide-ui > .screen.home-screen .home-lower,
.tide-ui > .screen.home-screen > .footer-note { display: none !important; }

.tide-ui > .screen.home-screen .home-main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 40px 0 0;
}

.tide-ui > .screen.home-screen :is(.hero, .home-hero) {
  display: block !important;
  min-height: 0 !important;
  padding: 0;
  background: transparent;
}

.tide-ui > .screen.home-screen .hero-copy {
  width: 100%;
  max-width: none;
}

.tide-ui > .screen.home-screen :is(.hero h2, .hero-copy h2) {
  max-width: 1050px;
  margin: 17px 0 16px;
  color: var(--tide-text) !important;
  font-size: clamp(36px, 4vw, 56px) !important;
  line-height: 1.04;
  letter-spacing: -.055em;
}

.tide-ui > .screen.home-screen :is(.hero h2 em, .hero-copy h2 em) {
  color: var(--tide-gold) !important;
  font-style: normal;
}

.tide-ui > .screen.home-screen .hero-lead {
  max-width: 780px;
  margin: 0;
  color: var(--tide-muted) !important;
  font-size: 15px;
  line-height: 1.9;
}

.tide-ui > .screen.home-screen .home-status-tags {
  margin-top: 17px;
}

.tide-ui > .screen.home-screen .setup-panel {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 18px 20px;
  margin-top: 34px;
  padding: 21px 24px 19px;
  border: 1px solid var(--tide-line);
  border-radius: 12px;
  background: var(--tide-panel);
  box-shadow: none;
}

.tide-ui > .screen.home-screen .setup-panel > :is(.mode-select, .difficulty-select, .first-player-select) {
  display: block !important;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tide-ui > .screen.home-screen .setup-panel > .mode-select { order: 1; }
.tide-ui > .screen.home-screen .setup-panel > .difficulty-select { order: 2; }
.tide-ui > .screen.home-screen .setup-panel > .first-player-select { order: 3; }

.tide-ui > .screen.home-screen .setup-panel :is(.mode-select-label, .setup-label) {
  display: none !important;
}

.tide-ui > .screen.home-screen .setup-panel .luna-select-section {
  display: block !important;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.tide-ui > .screen.home-screen .setup-panel .luna-select-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  margin: 0;
  color: var(--tide-muted);
  font-size: 13px;
}

.tide-ui > .screen.home-screen .setup-panel .luna-select-field select {
  width: 100%;
  min-height: 44px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--tide-line-strong);
  border-radius: 7px;
  background: var(--tide-bg);
  color: var(--tide-text);
  font: inherit;
}

.tide-ui > .screen.home-screen .setup-panel .luna-choice-row,
.tide-ui > .screen.home-screen .setup-panel > :is(.mode-select, .difficulty-select, .first-player-select) > [data-mode],
.tide-ui > .screen.home-screen .setup-panel > :is(.mode-select, .difficulty-select, .first-player-select) > [data-difficulty],
.tide-ui > .screen.home-screen .setup-panel > :is(.mode-select, .difficulty-select, .first-player-select) > [data-first-player] {
  display: none !important;
}

.tide-ui > .screen.home-screen .setup-panel > :is(.home-actions, .hero-actions) {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 10px;
  margin: 2px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--tide-line);
  order: 4;
}

.tide-ui > .screen.home-screen .setup-panel > .condition-row {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 22px;
  margin: 0;
  padding-top: 2px;
  color: var(--tide-muted);
  font-size: 12px;
  order: 5;
}

.tide-ui > .screen.home-screen .setup-panel > .condition-row b { color: var(--tide-text); }
.tide-ui > .screen.home-screen .setup-panel :is(.primary-button, .large-button) {
  min-height: 44px;
  border-color: var(--tide-gold);
  border-radius: 7px;
  background: var(--tide-gold);
  color: #101827;
}

.tide-ui > .screen.home-screen .setup-panel :is(.secondary-button, .ghost-button) {
  min-height: 44px;
  border-color: var(--tide-line-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--tide-text);
}

.tide-ui > .screen.game-screen {
  width: min(1260px, calc(100% - 48px));
  min-height: 0 !important;
  margin: 34px auto 0;
  padding: 0 0 36px;
  background: transparent !important;
}

.tide-ui > .screen.game-screen > .app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 26px 0 0;
  border-top: 1px solid var(--tide-line);
}

.tide-ui > .screen.game-screen > .app-shell > .topbar,
.tide-ui > .screen.game-screen > .app-shell > .footer-note { display: none !important; }

.tide-ui > .screen.game-screen .game-main,
.tide-ui > .screen.game-screen > .app-shell > main {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 760px) {
  .tide-ui > .screen.home-screen,
  .tide-ui > .screen.game-screen { width: calc(100% - 28px); }
  .tide-ui > .screen.home-screen .home-main { padding-top: 30px; }
  .tide-ui > .screen.home-screen :is(.hero h2, .hero-copy h2) { font-size: 42px; }
  .tide-ui > .screen.home-screen .setup-panel {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px;
  }
  .tide-ui > .screen.home-screen .setup-panel > :is(.mode-select, .difficulty-select, .first-player-select) { grid-column: 1; }
  .tide-ui > .screen.home-screen .setup-panel > :is(.home-actions, .hero-actions) {
    grid-column: 1;
    grid-row: auto;
    flex-wrap: wrap;
  }
  .tide-ui > .screen.home-screen .setup-panel > .condition-row { grid-column: 1; grid-row: auto; flex-wrap: wrap; gap: 12px; }
}
