/* A quieter entry screen and stable mobile battle/result surface. */
body {min-width:0;}
body.playing .hero {display:none;}
.practice-button {width:100%;min-height:48px;margin-top:10px;}
@media(min-width:701px){#game .board{max-width:min(100%,58dvh);margin:auto;}#game .targets{max-height:52dvh;overflow-y:auto;}}
dialog.shop-modal, dialog.victory-pot {width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;color:inherit;}
dialog::backdrop {background:#050812b8;}
.presence-user {display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid #344360;padding:10px 0;margin:0;}
#duel {position:relative;}
body.in-duel #presenceOpen,body.in-duel #rankingsOpen,body.in-duel #inviteTop,body.in-duel #utilityMenu {display:none!important;}
#statsDialog {width:min(760px,calc(100% - 24px));max-height:92dvh;border:1px solid #45607e;border-radius:20px;background:#101b2e;color:#edf4ff;padding:20px;overflow:auto;}
.stats-panel header {display:flex;justify-content:space-between;align-items:center;gap:12px;}
.stats-panel h2 {font-size:22px;margin:0;}
.stats-panel nav {display:flex;gap:8px;margin:16px 0;}
.stats-panel nav button[aria-pressed=true] {border-color:#9ffbd2;color:#9ffbd2;}
.stats-panel h3 {margin:22px 0 12px;}
.stat-grid {display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;}
.stat-grid>div {padding:14px 8px;background:#192a43;border:1px solid #344863;border-radius:12px;text-align:center;}
.stat-grid strong,.stat-grid span {display:block;}
.stat-grid strong {font-size:25px;color:#9ffbd2;}
.stat-grid span {font-size:13px;}
.standings-scroll {overflow-x:auto;}
.standings-mobile-detail {display:none;}
.my-standing {display:flex;flex-wrap:wrap;justify-content:space-between;gap:6px 16px;padding:12px 14px;border:1px solid #4d9f8d;border-radius:12px;background:#123337;margin-block:12px;}
.my-standing span {color:#c5d9e5;}
.standings-scroll tr.is-me td,.standings-scroll tr.is-me th {background:#123b38;}
#resultActions {display:grid;gap:9px;margin-top:16px;}
#resultActions[hidden],#resultActions.hidden {display:none;}
#resultActions button {width:100%;min-height:48px;}
#winner .result-detail {display:block;font-size:15px;font-weight:500;margin-top:10px;color:#c4d4df;}
#duel[data-result="loss"] #winner,#duel[data-result="draw"] #winner,#duel[data-result="spectator"] #winner {color:#e4edf5;}
#duel[data-result="loss"] #phase,#duel[data-result="draw"] #phase,#duel[data-result="spectator"] #phase {background:#1a2c40;border-color:#536c82;color:#e4edf5;}
#duel[data-result="win"] #winner {color:#b0ffe4;}
#duel:is([data-result="win"],[data-result="loss"],[data-result="draw"],[data-result="spectator"]) .clock-box.active {background:#0a1828;border-color:#405c72;box-shadow:none;}
#duel:is([data-result="win"],[data-result="loss"],[data-result="draw"],[data-result="spectator"]) .clock-box.active strong {color:#d9e4ef;}
/* Reserve the short supplementary-topic line, even when its text is empty. */
body.in-duel #duel #questionTopic {min-height:1.6em;line-height:1.6;margin:4px 0 0;flex-shrink:0;}
body.in-duel #duel #questionTopic.hidden {display:block!important;visibility:hidden;}

.standings-scroll table {width:100%;border-collapse:collapse;white-space:nowrap;text-align:right;font-size:14px;}
.standings-scroll th,.standings-scroll td {padding:12px 9px;border-bottom:1px solid #344863;}
.recent-duels p,.recent-rivalries p {display:flex;justify-content:space-between;gap:12px;padding:10px 0;border-bottom:1px solid #344863;}
@media(max-width:700px){.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}body .topbar .top-actions{flex-wrap:wrap}#rankingsOpen{min-height:44px;padding:8px;font-size:12px}#statsDialog{padding:16px}}
@media(max-width:700px){#targetCard>.message{display:none}#game #targets button{min-height:64px;padding:10px 12px}#game .target-info strong{font-size:17px}#game .target-info small{font-size:13px}#targetCard .action-title{margin-bottom:12px}.stats-panel .stat-grid>div{padding:10px 8px}}
.connection-notice[hidden] {display:none!important;}
body.in-duel .connection-notice,body.watching .connection-notice {position:fixed;bottom:12px;inset-inline:12px;z-index:80;margin:0!important;}
main > .economy-banner,
main > .growth-strip,
body.playing .growth-in-game,
body.playing .parallel-note {
  display: none;
}

.hero { padding: 20px 0 16px; }
.hero h1 { font-size: clamp(27px, 3.5vw, 38px); }
.hero .eyebrow, .hero-chip { display: none; }
#entry .entry-primary { margin-top: 14px; }
#entry .entry-primary .mode-card {
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  min-height: 96px;
  padding-inline-end: 42px;
}
#entry .entry-primary .mode-card strong { margin-top: 0; }
#entry .entry-primary .mode-card .mode-arrow { bottom: auto; }

#utilityMenu { position: relative; flex-shrink: 0; }
#utilityMenu > summary {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  border: 1px solid #455974;
  border-radius: 12px;
  background: #14223b;
  color: #edf4ff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  list-style: none;
}
#utilityMenu > summary::-webkit-details-marker { display: none; }
#utilityMenu > summary:focus-visible {
  outline: 3px solid var(--mint, #9ffbd2);
  outline-offset: 3px;
}
#utilityMenu[open] > summary { border-color: #9ffbd2; }
#utilityMenu .utility-menu-panel {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 8px);
  z-index: 40;
  display: grid;
  gap: 8px;
  width: min(280px, calc(100vw - 32px));
  max-height: min(70dvh, 500px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid #536b89;
  border-radius: 16px;
  background: #132139;
  box-shadow: 0 14px 36px #0008;
}
#utilityMenu .utility-menu-panel > * { width: 100%; margin: 0; }
#utilityMenu .utility-menu-panel button,
#utilityMenu .utility-menu-panel a {
  min-height: 44px;
  justify-content: center;
  text-align: center;
}
#utilityMenu .wallet-label, body.playing #utilityMenu .home-link { display: inline; }
#utilityMenu .connection-pill { text-align: center; }
#duelSoundToggle {
  position: absolute;
  inset-inline-end: 14px;
  top: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  z-index: 2;
}
#duel #category { padding-inline: 48px; }
#duel .answers button, #watchOptions > div { overflow-wrap: anywhere; }

@media (max-width: 700px) {
  /* Override both the original playing header and late social styles. */
  body .topbar, body.playing .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
  }
  body .topbar .top-actions {
    width: auto;
    margin-inline-start: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 6px;
  }
  body .topbar #presenceOpen { min-height: 44px; font-size: 12px; padding: 8px; }
  body .topbar #inviteTop { min-width: 44px; min-height: 44px !important; }
  .hero { padding: 12px 0; }
  .hero h1 { font-size: 27px; margin: 0 0 6px; }
  .hero p { font-size: 14px; line-height: 1.5; }
  #entry > .card > .ribbon { display: none; }
  #entry > .card > h2 { font-size: 23px !important; margin-top: 0 !important; }
  #entry .entry-primary .mode-card { min-height: 86px; }
  #entry .entry-primary .mode-card strong { font-size: 19px; }
  #entry .entry-primary .mode-card small { font-size: 13px; }
  #entry .quiet-options summary { font-size: 16px; min-height: 50px; }
  #lobby .how-lobby { display: block; font-size: 13px; }
  #lobby .lobby-top { flex-wrap: wrap; }

  body.duel-result { overflow: hidden; }
  body.duel-result .topbar,
  body.duel-result #game > .scorebar,
  body.duel-result #game > .pot-card,
  body.duel-result .mobile-nav,
  body.duel-result .map-column,
  body.duel-result .capture-flash,
  body.duel-result .action-column > .card:not(#duel) { display: none !important; }
  body.duel-result #game #duel {
    display: flex !important;
    position: fixed;
    inset: 0;
    z-index: 50;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: calc(12px + env(safe-area-inset-top)) 16px calc(12px + env(safe-area-inset-bottom));
    flex-direction: column;
    overflow-y: auto;
    background: #101b2e;
    box-shadow: none;
  }
  body.duel-result #duel .duel-kicker,
  body.duel-result #duel > .micro,
  body.duel-result #duel #question:empty,
  body.duel-result #duel #answers:empty { display: none; }
  body.duel-result #game #duel h2 {
    font-size: 17px;
    text-align: center;
    min-height: 44px;
    margin: 0 0 10px;
    flex-shrink: 0;
  }
  body.duel-result #duel #winner {
    display: block;
    order: 1;
    margin: 16px 0 8px;
    padding: 20px 8px;
    font-size: 24px;
    line-height: 1.5;
    text-align: center;
    overflow-wrap: anywhere;
  }
  body.duel-result #duel > .btnrow {
    order: 2;
    flex-shrink: 0;
    margin-top: 16px !important;
  }
  body.duel-result #duel #next { width: 100%; min-height: 48px; }
  body.duel-result #duel #resultActions {order:3;flex-shrink:0;margin-top:12px;}
  body.duel-result #duel > .btnrow:has(#next.hidden):not(:has(button:not(.hidden))) {display:none;}
  .stats-panel header {align-items:flex-start;}
  .stats-panel h2 {font-size:19px;}
  .stats-panel nav {display:grid;grid-template-columns:1fr 1fr;gap:8px;}
  .stats-panel nav button {min-width:0;padding:9px 5px;font-size:14px;}
  .standings-scroll {overflow-x:visible;}
  .standings-scroll table {table-layout:fixed;white-space:normal;font-size:14px;}
  .standings-scroll th,.standings-scroll td {padding:11px 5px;}
  .standings-scroll th:first-child,.standings-scroll td:first-child {width:44px;text-align:center;}
  .standings-scroll th:nth-child(3),.standings-scroll td:nth-child(3) {width:58px;text-align:center;font-variant-numeric:tabular-nums;}
  .standings-scroll tbody th {overflow-wrap:anywhere;}
  .standings-scroll .standings-detail {display:none;}
  .standings-mobile-detail {display:block;font-size:11px;font-weight:400;color:#b9c8d8;line-height:1.6;margin-top:3px;}
  .recent-duels p,.recent-rivalries p {flex-wrap:wrap;}
  .stat-grid strong {overflow-wrap:anywhere;}
  #statsDialog {scrollbar-gutter:stable;}

  body.in-duel #game #duel #category { min-height: 44px; margin-bottom: 8px; }
  body.in-duel #game #duel #question {
    min-height: 96px;
    font-size: 20px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }
  body.in-duel #game #duel #answers button { font-size: 17px; line-height: 1.4; }
  body.in-duel #duelSoundToggle,
  body.duel-result #duelSoundToggle { top: calc(10px + env(safe-area-inset-top)); }
}

/* Keep a single scroll surface. Normal questions share a stable minimum area;
   long text and enlarged fonts may grow it, rather than clipping or nested scrolling. */
@media (max-width:700px) {
  body.in-duel #game #duel #question {max-height:none;overflow:visible;flex:1 0 auto;}
  body.in-duel #game #duel #answers {grid-auto-rows:minmax(48px,auto);}
  body.in-duel #game #duel #answers button {height:auto;white-space:normal;}
  body.duel-result #duel #resultDetails {order:2;flex-shrink:0;margin:8px 0;}
  body.duel-result #duel #rematchStatus {order:2;flex-shrink:0;font-size:14px;margin:6px 0;}
}
@media (max-height: 690px) and (max-width: 700px) {
  body.in-duel #game #duel #question { min-height: 88px; font-size: 18px; padding: 12px 0; }
  body.in-duel #game #duel #answers button { min-height: 48px; padding: 9px 12px; }
}
