[hidden] { display: none !important; }
#timeout-dialog { width: min(440px,calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; box-sizing: border-box; padding: 24px; border: 1px solid #b79851; border-radius: 18px; background: #211e43; color: #fff6df; }
#timeout-dialog h2 { margin: 0 0 10px; font-size: 25px; }
#timeout-dialog p { font-family: "Avenir Next", "Trebuchet MS", sans-serif; line-height: 1.5; }
.timeout-actions { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
#timeout-penalty-button { padding: 12px 16px; border-radius: 12px; font-weight: 750; }
#timeout-help-button { width: 40px; min-height: 40px; flex-basis: 40px; }
#timeout-help-copy { padding: 12px; border-radius: 10px; background: #34304c; font-size: 14px; }
#timeout-countdown { color: #ffd166; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 0; }
.session-banner.is-turn-warning { color: #fff0c4; background: #393045; border: 1px solid #b79851; border-radius: 10px; padding: 7px 10px; }
.dice-strip.is-opponent-turn { grid-template-columns: minmax(0,1fr) 124px; }
.dice-strip.is-opponent-turn .roll-button { font-size: .74rem; }
.dice-strip.is-opponent-turn .dice-grid { display: grid; }
.dice-strip.is-opponent-turn .die:disabled { opacity: .85; cursor: default; }
.score-button.is-pending-score { background: #f6e4ac; color: #28213f; border-color: #ffd166; box-shadow: 0 0 0 2px rgba(255,209,102,.38); }
.total-label { display: inline-flex; align-items: center; gap: 3px; }
.score-info { display: inline-flex; flex: 0 0 28px; align-items: center; justify-content: center; width: 28px; min-height: 28px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #e7dfc6; cursor: pointer; }
.score-info span { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border: 1.4px solid currentColor; border-radius: 50%; font: bold 12px/1 Georgia, serif; }
.score-info:hover, .score-info:focus-visible { color: #ffd166; outline: 2px solid #ffd166; outline-offset: 1px; }
#score-help-dialog { color: var(--text); background: #211e43; border: 1px solid #655d80; border-radius: 18px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); box-sizing: border-box; padding: 20px; }
#score-help-dialog h2 { font-size: 20px; margin: 0; }
#score-help-copy { color: #fff6df; font-family: "Avenir Next", "Trebuchet MS", sans-serif; font-size: 16px; line-height: 1.6; margin-bottom: 0; }
#score-help-close { color: var(--text); background: #343057; border: 1px solid #80769d; border-radius: 9px; min-height: 40px; padding: 7px 12px; cursor: pointer; }
#score-help-close:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#opponent-dialog, #requests-dialog { color: var(--text); background: #15132e; border: 1px solid var(--line); border-radius: 22px; width: min(880px, calc(100vw - 24px)); max-height: calc(100dvh - 28px); padding: clamp(18px, 4vw, 36px); overflow: auto; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(5, 3, 19, .84); backdrop-filter: blur(7px); }
#opponent-dialog h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -.04em; margin: 25px 0 8px; }
.mode-eyebrow { color: var(--sky); font-size: 12px; letter-spacing: .16em; font-weight: bold; }
.mode-intro, .mode-footnote { color: var(--muted); line-height: 1.5; }
.mode-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 28px 0 18px; }
.mode-card { color: var(--text); background: #211e43; border: 1px solid #4c4669; border-radius: 16px; padding: 22px 18px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 14px; }
.mode-card:hover, .mode-card:focus-visible { border-color: var(--sky); background: #2d2855; }
.mode-card strong { font-size: 19px; }
.mode-card > span:not([class]) { color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.mode-card b { color: var(--sky); font-size: 14px; margin-top: 10px; }
.mode-icon { font-size: 34px; line-height: 1; color: var(--gold); }
.mode-icon svg { display: block; width: 1em; height: 1em; }
#requests-dialog { max-width: 560px; }
#requests-dialog p { line-height: 1.5; color: var(--muted); }
#invite-form { display: grid; gap: 12px; margin: 24px 0 12px; }
#invite-form label { display: grid; gap: 8px; }
#invite-username { color: var(--text); background: #241f43; padding: 12px; border: 1px solid #655d80; border-radius: 9px; min-width: 0; width: 100%; }
.request-card { background: #211e43; padding: 16px; margin-top: 12px; border-radius: 12px; border: 1px solid var(--line); }
.request-card p { margin: 8px 0 12px; }
#requests-count:not(:empty) { background: var(--sky); color: #101322; border-radius: 20px; padding: 1px 6px; font-weight: bold; }
.account-toolbar { flex-wrap: wrap; }
.app-shell { grid-template-rows: auto auto auto auto auto minmax(0, 1fr); }
.session-banner { font-size: 12px; }
@media (max-width: 620px) {
  .mode-choices { grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }
  .mode-card { padding: 16px; gap: 7px; display: grid; grid-template-columns: 36px 1fr; }
  .mode-icon { grid-row: 1 / 4; font-size: 30px; }
  .mode-card b { margin: 4px 0 0; grid-column: 2; }
  .mode-card strong { font-size: 18px; }
  #opponent-dialog h1 { margin-top: 16px; }
  .account-toolbar { font-size: 11px; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.mode-card { position: relative; overflow: hidden; }
.mode-card--free strong { padding-right: 30px; }
.mode-card > .mode-ribbon { position: absolute; top: 14px; right: -35px; width: 122px; height: 24px; transform: rotate(45deg); background: var(--green); color: #16395d; text-align: center; font-size: 12px; font-weight: 800; line-height: 24px; letter-spacing: .04em; flex: none; pointer-events: none; }
.mode-card > .mode-access, .mode-card > .mode-stats { flex: none; font-size: 12px; line-height: 1.4; }
.mode-card > .mode-access { color: var(--gold); }
.mode-card > .mode-stats { display: flex; flex-wrap: wrap; gap: 3px 12px; color: var(--green); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .025em; line-height: 1.65; }
.mode-stats > span { white-space: nowrap; }
.mode-stats:empty { display: none; }
@media (max-width: 620px) { .mode-card > .mode-access, .mode-card > .mode-stats { grid-column: 2; } }

/* Attention batch 001: equal cards, one-line record and consistent vector icons. */
#opponent-dialog h1 { margin-bottom: 0; }
.mode-intro { margin-top: 4px; }
.mode-choices { grid-auto-rows: 1fr; margin-top: 18px; }
.mode-card { height: 100%; box-sizing: border-box; }
.mode-card > .mode-stats { flex-wrap: nowrap; justify-content: space-between; gap: 5px; letter-spacing: 0; font-family: "Avenir Next Condensed", "Arial Narrow", "Trebuchet MS", sans-serif; font-size: 11px; font-weight: 700; }
.mode-card b { margin-top: auto; }
.player-chip, .player-chip.is-awaiting-name, .player-chip.is-active {
  background: #292641; border-color: rgba(255,255,255,.18); box-shadow: none; animation: none;
}
.player-chip.is-active { border-color: #a99bdb; }
.player-name, .player-chip input, .player-chip.is-awaiting-name input, .player-chip.is-awaiting-name strong, .player-chip.is-awaiting-name .player-slot {
  color: #fff6df; opacity: 1; -webkit-text-fill-color: #fff6df;
}
.player-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 750; font-size: 1rem; white-space: nowrap; }
.player-chip { cursor: default; }
.player-chip .player-name { cursor: default; }
.app-shell.is-waiting-focus #player-two-chip { opacity: 1; filter: none; }
#new-game-button { background: linear-gradient(180deg,#bff2b7,#8fdc8a 58%,#4ca86f); color: #16395d; }
#lobby-panel { background: transparent; border: 0; padding: 2px 4px; }
.waiting-status { display: inline-block; margin: 2px 0; padding: 5px 12px; color: #fff; background: #5b5d68; border: 1px solid #858692; border-radius: 22px; font-weight: 700; }
.match-notice { padding: 10px 14px; }
.match-notice p { margin: 0 0 8px; }
.app-shell { grid-template-rows: auto auto auto auto auto auto auto minmax(0, 1fr); }
.match-notice .account-actions button, .winner-banner .account-actions button { padding: 9px 12px; border-radius: 10px; }
@media (max-width:620px) {
  .mode-icon { grid-column: 1; grid-row: 1 / 3; }
  .mode-card { grid-template-rows: auto 1fr auto auto; }
  .mode-card > strong { grid-column: 2; grid-row: 1; }
  .mode-card > span:not([class]) { grid-column: 2; grid-row: 2; }
  .mode-card > .mode-access { grid-column: 2; grid-row: 3; }
  .mode-card > .mode-stats { grid-column: 1 / -1; grid-row: 3; }
  .mode-card > b { grid-row: 4; align-self: end; }
}
