:root {
  --bg: #f2f6f4;
  --bg-accent: #dcebe6;
  --panel: rgba(251, 254, 252, 0.9);
  --panel-strong: #fbfefc;
  --text: #244046;
  --muted: #68827a;
  --line: rgba(89, 118, 114, 0.14);
  --brand: #6fa8a1;
  --brand-dark: #3b6a6f;
  --brand-soft: #e4f2ef;
  --banana: #d8ebe7;
  --banana-deep: #c7e0db;
  --danger: #b16178;
  --danger-dark: #97384b;
  --tile: #f8fcfb;
  --tile-edge: #bfd4d0;
  --shadow: 0 22px 54px rgba(74, 104, 102, 0.16);
  --radius: 28px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.78), transparent 22%),
    radial-gradient(circle at 85% 12%, rgba(216, 235, 231, 0.76), transparent 18%),
    radial-gradient(circle at bottom right, rgba(199, 224, 219, 0.44), transparent 26%),
    linear-gradient(140deg, var(--bg), var(--bg-accent));
  padding-bottom: env(safe-area-inset-bottom);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 999px;
  min-height: 48px;
  padding: 0.85rem 1.2rem;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
  touch-action: manipulation;
}

button:hover {
  transform: translateY(-1px);
  background: var(--brand-dark);
}

button.secondary {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

button.ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--line);
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: var(--danger-dark);
}

button.selected {
  box-shadow: inset 0 0 0 2px rgba(31, 28, 23, 0.18);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

input,
select {
  width: 100%;
  min-height: 54px;
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  font-size: 16px;
}

select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 3rem;
  border-color: var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 251, 0.98)),
    linear-gradient(135deg, transparent 50%, rgba(59, 106, 111, 0.9) 50%),
    linear-gradient(45deg, rgba(59, 106, 111, 0.9) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: auto, 10px 10px, 10px 10px;
  background-position: 0 0, calc(100% - 1.1rem) 50%, calc(100% - 0.75rem) 50%;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: inset 0 -1px 0 rgba(59, 106, 111, 0.04);
}

select:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(244, 250, 248, 1)),
    linear-gradient(135deg, transparent 50%, rgba(59, 106, 111, 0.96) 50%),
    linear-gradient(45deg, rgba(59, 106, 111, 0.96) 50%, transparent 50%);
  background-repeat: no-repeat;
  background-size: auto, 10px 10px, 10px 10px;
  background-position: 0 0, calc(100% - 1.1rem) 50%, calc(100% - 0.75rem) 50%;
}

select:focus {
  outline: none;
  border-color: rgba(111, 168, 161, 0.58);
  box-shadow:
    0 0 0 4px rgba(111, 168, 161, 0.14),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08);
}

select option {
  background: #31595d;
  color: rgba(255, 255, 255, 0.96);
}

.native-select-hidden {
  display: none;
}

.custom-select {
  position: relative;
}

.lobby-code-field.select-open {
  z-index: 18;
}

.custom-select-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  position: relative;
  min-height: 54px;
  padding: 0.9rem 3rem 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  font-weight: 600;
  box-shadow: inset 0 -1px 0 rgba(59, 106, 111, 0.04);
}

.custom-select-trigger::after {
  content: "";
  position: absolute;
  right: 1rem;
  top: 50%;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(59, 106, 111, 0.9);
  border-bottom: 2px solid rgba(59, 106, 111, 0.9);
  transform: translateY(-60%) rotate(45deg);
}

.custom-select-trigger:hover {
  background: rgba(244, 250, 248, 1);
  color: var(--text);
  transform: none;
}

.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  outline: none;
  border-color: rgba(111, 168, 161, 0.58);
  box-shadow: 0 0 0 4px rgba(111, 168, 161, 0.14);
}

.custom-select.disabled .custom-select-trigger {
  opacity: 0.45;
  cursor: not-allowed;
}

.custom-select-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  display: grid;
  gap: 0;
  padding: 0.35rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(111, 168, 161, 0.2);
  box-shadow: 0 18px 34px rgba(74, 104, 102, 0.16);
  z-index: 30;
}

.custom-select-option {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  min-height: 48px;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font-weight: 600;
}

.custom-select-option:hover,
.custom-select-option.selected {
  background: rgba(111, 168, 161, 0.12);
  color: var(--brand-dark);
  transform: none;
}

/* Keep lobby menus usable on short screens and mobile viewports. */
.custom-select-menu {
  max-height: min(18rem, var(--custom-select-menu-max-height, 18rem));
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.custom-select.open-upward .custom-select-menu {
  top: auto;
  bottom: calc(100% + 0.45rem);
}

label {
  display: grid;
  gap: 0.35rem;
}

label span,
.label,
.eyebrow,
.hint {
  color: var(--muted);
}

.page-shell {
  width: min(1180px, calc(100vw - 2rem));
  margin: 0 auto;
  padding: 0.7rem 0 4rem;
  max-width: 100%;
  overflow-x: hidden;
}

.hero {
  position: relative;
  margin-bottom: 0.35rem;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.3rem;
  align-items: start;
  overflow: visible;
}

.hero-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.45rem 0.95rem;
  background: rgba(251, 254, 252, 0.92);
  color: var(--text);
  border: 1px solid rgba(89, 118, 114, 0.14);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(74, 104, 102, 0.1);
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  margin: 0;
  text-align: left;
}

.hero-heading-row {
  display: grid;
  grid-template-columns: max-content max-content;
  align-items: start;
  justify-content: space-between;
  width: 100%;
  gap: 0.55rem;
}

.hero-game-actions {
  display: none;
}

.hero-help-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  align-self: start;
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0.45rem 0.95rem;
  border: 1px solid rgba(89, 118, 114, 0.14);
  background: rgba(251, 254, 252, 0.92);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(74, 104, 102, 0.1);
}

.hero-help-button:hover {
  background: rgba(244, 250, 248, 0.98);
  color: var(--brand-dark);
}

.hero-home:hover {
  background: rgba(244, 250, 248, 0.98);
  color: var(--brand-dark);
  transform: none;
}

.hero-home:focus-visible {
  outline: 2px solid rgba(111, 168, 161, 0.35);
  outline-offset: 6px;
}

.hero-copy {
  display: grid;
  gap: 0.3rem;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero-banana {
  display: none;
}

.hero-eyebrow {
  display: none;
}

.hero-heading-row > .hero-game-actions {
  display: none !important;
}

body.game-active .page-shell,
body:has(#game-panel:not(.hidden)) .page-shell {
  padding-top: 0.85rem;
}

body.game-active .hero,
body:has(#game-panel:not(.hidden)) .hero {
  grid-template-columns: 1fr;
  gap: 0;
  margin-bottom: 0.85rem;
  padding-top: 0;
}

body.game-active .hero-copy,
body:has(#game-panel:not(.hidden)) .hero-copy {
  display: block;
  width: 100%;
}

body.game-active .hero-eyebrow,
body.game-active .hero-lede,
body.game-active .hero-help-button,
body.game-active .hero-banana,
body:has(#game-panel:not(.hidden)) .hero-eyebrow,
body:has(#game-panel:not(.hidden)) .hero-lede,
body:has(#game-panel:not(.hidden)) .hero-help-button,
body:has(#game-panel:not(.hidden)) .hero-banana {
  display: none;
}

body.game-active .hero-heading-row,
body:has(#game-panel:not(.hidden)) .hero-heading-row {
  display: block;
  position: relative;
  width: 100%;
  max-width: none;
  min-height: 3rem;
  gap: 0.65rem;
}

body.game-active .hero-heading-row > .hero-game-actions,
body:has(#game-panel:not(.hidden)) .hero-heading-row > .hero-game-actions {
  display: flex !important;
  position: absolute;
  top: 0;
  right: 0;
  margin-left: 0;
}

body.game-active .hero-home,
body:has(#game-panel:not(.hidden)) .hero-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  min-height: 3rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgba(251, 254, 252, 0.92);
  border: 1px solid rgba(89, 118, 114, 0.14);
  box-shadow: 0 12px 28px rgba(74, 104, 102, 0.1);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

body.game-active .hero-home:hover,
body:has(#game-panel:not(.hidden)) .hero-home:hover {
  background: rgba(244, 250, 248, 0.98);
}

body.game-active #room-code,
body:has(#game-panel:not(.hidden)) #room-code {
  margin: 0;
  font-size: clamp(1.25rem, 2.3vw, 1.8rem);
  line-height: 1;
}

body.game-active .hero-game-actions .top-bar-menu-toggle,
body:has(#game-panel:not(.hidden)) .hero-game-actions .top-bar-menu-toggle {
  min-height: 3rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgba(251, 254, 252, 0.92);
  border: 1px solid rgba(89, 118, 114, 0.14);
  box-shadow: 0 12px 28px rgba(74, 104, 102, 0.1);
  color: var(--text);
}

body.game-active .hero-game-actions .top-bar-menu-toggle:hover,
body:has(#game-panel:not(.hidden)) .hero-game-actions .top-bar-menu-toggle:hover {
  background: rgba(244, 250, 248, 0.98);
  color: var(--brand-dark);
}

/* Let the compact header meet the game surface without a stray contrasting rule. */
body.game-active #game-panel,
body:has(#game-panel:not(.hidden)) #game-panel {
  border-top-color: transparent;
}

.room-code-hidden {
  display: none;
}

.eyebrow {
  margin: 0 0 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.72rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h2,
h3 {
  text-wrap: balance;
}

.lede {
  max-width: 26rem;
  margin-bottom: 0;
  font-size: 1.08rem;
  line-height: 1.4;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.panel.inset {
  padding: 1.25rem;
  background: var(--panel-strong);
  box-shadow: none;
}

#lobby-panel,
#game-panel {
  padding: 1.5rem;
}

#game-panel:not(.hidden) {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel-header,
.section-header,
.top-bar,
.status-strip,
.final-panel,
.vote-actions {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.panel-header {
  align-items: start;
}

.top-bar-actions,
.inline-form,
.split-form {
  display: flex;
  gap: 0.75rem;
}

.game-chrome {
  display: grid;
  gap: 1rem;
}

.top-bar-actions {
  position: relative;
}

.hero-heading-row > .hero-game-actions {
  display: none;
}

.top-bar-menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.top-bar-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  display: grid;
  gap: 0.55rem;
  width: min(18rem, calc(100vw - 2rem));
  padding: 0.8rem;
  border-radius: 22px;
  background: rgba(251, 254, 252, 0.98);
  border: 1px solid rgba(31, 28, 23, 0.08);
  box-shadow: 0 18px 34px rgba(31, 28, 23, 0.14);
  z-index: 20;
}

.top-bar-requests-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  background: linear-gradient(180deg, #f1b14c, #db8642);
  color: #fff;
  box-shadow: 0 12px 26px rgba(219, 134, 66, 0.26);
}

.top-bar-requests-toggle:hover {
  background: linear-gradient(180deg, #e5a43f, #cf7835);
  color: #fff;
}

.top-bar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.6rem;
  height: 1.6rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
}

.join-requests-popover {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: calc(100% + 0.6rem);
  width: min(24rem, calc(100vw - 2rem));
  padding: 0.9rem;
  border-radius: 24px;
  background: rgba(251, 254, 252, 0.98);
  border: 1px solid rgba(31, 28, 23, 0.08);
  box-shadow: 0 18px 34px rgba(31, 28, 23, 0.14);
  z-index: 21;
}

.join-requests-popover-header {
  margin-bottom: 0.75rem;
}

.join-requests-list {
  display: grid;
  gap: 0.7rem;
  max-height: min(18rem, 55vh);
  overflow-y: auto;
}

.join-request-row {
  display: grid;
  gap: 0.7rem;
  padding: 0.85rem;
  border-radius: 18px;
  background: rgba(244, 250, 248, 0.98);
  border: 1px solid rgba(89, 118, 114, 0.12);
}

.join-request-row strong,
.live-room-card h4 {
  font-size: 1.05rem;
}

.join-request-row .hint,
.live-room-card .hint {
  margin-bottom: 0;
}

.join-request-actions {
  display: flex;
  gap: 0.6rem;
}

.join-request-actions button {
  flex: 1 1 0;
}

.play-submit-button {
  background: linear-gradient(180deg, #325c63, #203a42);
  box-shadow: 0 14px 28px rgba(36, 64, 70, 0.18);
}

.play-submit-button:hover {
  background: linear-gradient(180deg, #284c52, #182e35);
}

.top-bar-menu button {
  width: 100%;
}

.top-bar-select {
  width: auto;
  min-width: 150px;
}

.stacked-form {
  display: grid;
  gap: 1rem;
}

.stacked-form.compact {
  gap: 0.8rem;
}

.hero-copy {
  position: relative;
  z-index: 1;
}

.hero-banana {
  display: none;
  min-height: 0;
}

.banana-arc {
  position: absolute;
  border-radius: 999px;
  border: 18px solid transparent;
  border-top-color: var(--banana);
  border-right-color: var(--banana);
  background: transparent;
  transform: rotate(26deg);
  filter: drop-shadow(0 18px 24px rgba(121, 147, 175, 0.18));
}

.banana-arc-one {
  width: 190px;
  height: 190px;
  right: 70px;
  top: 8px;
}

.banana-arc-two {
  width: 150px;
  height: 150px;
  right: 0;
  top: 64px;
  border-width: 14px;
  border-top-color: var(--banana-deep);
  border-right-color: var(--banana-deep);
  opacity: 0.92;
  transform: rotate(-18deg);
}

.banana-spot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: rgba(111, 123, 136, 0.18);
}

.banana-spot-one {
  right: 88px;
  top: 60px;
}

.banana-spot-two {
  right: 126px;
  top: 122px;
}

.banana-spot-three {
  right: 44px;
  top: 144px;
}

.lobby-shell {
  overflow: visible;
  padding: 2rem;
  margin-top: 0;
  background:
    linear-gradient(180deg, rgba(251, 254, 252, 0.98), rgba(244, 249, 247, 0.96)),
    radial-gradient(circle at top right, rgba(216, 235, 231, 0.46), transparent 28%);
}

.lobby-header {
  margin-bottom: 1rem;
  align-items: start;
}

.lobby-header h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 3vw, 2.8rem);
  letter-spacing: -0.03em;
}

.lobby-header p {
  max-width: 18rem;
  line-height: 1.35;
}

.lobby-form {
  display: grid;
  gap: 1.25rem;
  max-width: 760px;
}

.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(89, 118, 114, 0.08);
}

.mode-slider {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  width: calc((100% - 0.7rem) / 3);
  height: calc(100% - 0.7rem);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(111, 168, 161, 0.96), rgba(59, 106, 111, 0.94));
  box-shadow: 0 12px 22px rgba(59, 106, 111, 0.18);
  transition: transform 180ms ease;
}

.mode-switch[data-mode="join"] .mode-slider {
  transform: translateX(calc(100% + 0.35rem));
}

.mode-switch[data-mode="practice"] .mode-slider {
  transform: translateX(calc(200% + 0.7rem));
}

.mode-option {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0.9rem 0.8rem;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  text-align: center;
}

.mode-option:hover,
.mode-option.active {
  background: transparent;
  color: var(--text);
  transform: none;
}

.mode-option.active {
  color: #f7fffd;
}

.lobby-shell.invite-only .mode-switch {
  display: none;
}

.lobby-hint {
  margin: 0;
  min-height: 1.5em;
  color: var(--muted);
  font-size: 0.98rem;
}

.daily-heist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.2rem;
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(251, 229, 151, 0.72), rgba(255, 248, 222, 0.88)),
    rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(166, 113, 35, 0.18);
}

.daily-heist-card h3 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.1rem;
}

.daily-heist-card .hint {
  margin-bottom: 0;
}

.lobby-fields {
  display: grid;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.lobby-name-field,
.lobby-code-field {
  padding: 1.05rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(77, 61, 21, 0.08);
  position: relative;
  z-index: 1;
}

#bot-enabled-field:not(.hidden) {
  display: grid;
}

.lobby-submit {
  min-height: 58px;
  padding-inline: 1.6rem;
  justify-self: start;
}

.live-room-browser {
  display: grid;
  gap: 1rem;
  padding: 1.2rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(77, 61, 21, 0.08);
}

.live-room-browser-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
}

.live-room-browser-header h3 {
  margin-bottom: 0;
}

.live-room-list {
  display: grid;
  gap: 0.85rem;
}

.live-room-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 22px;
  background: rgba(251, 254, 252, 0.98);
  border: 1px solid rgba(89, 118, 114, 0.12);
}

.live-room-card.pending {
  background: rgba(239, 247, 244, 0.98);
  border-color: rgba(111, 168, 161, 0.28);
}

.live-room-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.8rem;
}

.live-room-card-head h4,
.live-room-names {
  margin-bottom: 0;
}

.live-room-meta {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(111, 168, 161, 0.12);
  color: var(--brand-dark);
  font-size: 0.82rem;
  font-weight: 700;
}

.live-room-names {
  font-weight: 700;
  line-height: 1.35;
}

.status-strip {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background: rgba(111, 168, 161, 0.1);
}

.mode-option,
.lobby-submit {
  width: 100%;
}

.chat-panel {
  padding: 0.9rem 1rem;
}

.turn-order-panel .section-header {
  align-items: baseline;
}

.turn-order-panel h3,
.turn-order-panel .hint {
  margin-bottom: 0;
}

.turn-order-track {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.turn-order-chip {
  min-width: 110px;
  padding: 0.7rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 28, 23, 0.08);
}

.turn-order-chip.owner-tint {
  background: linear-gradient(180deg, var(--owner-card), var(--owner-card));
  border-color: var(--owner-border);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.32),
    0 10px 18px rgba(255, 255, 255, 0.24);
}

.turn-order-chip.current {
  background: rgba(111, 168, 161, 0.12);
  border-color: rgba(111, 168, 161, 0.34);
}

.turn-order-chip.owner-tint.current {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.08)),
    linear-gradient(180deg, var(--owner-card), var(--owner-card));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.38),
    0 0 0 2px rgba(111, 168, 161, 0.16);
}

.turn-order-chip.you {
  box-shadow: inset 0 0 0 1px rgba(147, 173, 201, 0.4);
}

.turn-order-chip.paused {
  background: rgba(121, 112, 94, 0.08);
  border-color: rgba(121, 112, 94, 0.16);
  color: var(--muted);
}

.turn-order-chip.paused strong {
  color: var(--muted);
}

.turn-order-chip.paused .turn-order-owner-dot {
  opacity: 0.55;
}

.turn-order-chip strong,
.turn-order-slot {
  display: block;
}

.turn-order-name {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.turn-order-name.owner-tint {
  color: var(--owner-text, var(--text));
}

.turn-order-owner-dot {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 999px;
  background: var(--owner-dot, rgba(111, 168, 161, 0.7));
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.82),
    0 1px 6px var(--owner-shadow, rgba(0, 0, 0, 0.12));
  flex: 0 0 auto;
}

.turn-order-slot {
  margin-bottom: 0.2rem;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.turn-order-chip.owner-tint .turn-order-slot {
  color: var(--owner-muted, var(--muted));
}

.chat-form {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.chat-form input {
  flex: 1 1 auto;
}

.chat-form button {
  flex: 0 0 auto;
}

.status-strip > div {
  min-width: 0;
}

.status-strip strong {
  display: block;
}

#last-action {
  max-width: 56ch;
}

.vote-panel {
  display: grid;
  gap: 1rem;
  border: 1px solid rgba(111, 168, 161, 0.2);
  background: linear-gradient(180deg, rgba(243, 250, 248, 0.98), rgba(251, 254, 252, 0.98));
  scroll-margin-top: calc(0.75rem + env(safe-area-inset-top));
}

#presence-panel {
  scroll-margin-top: calc(0.75rem + env(safe-area-inset-top));
}

.vote-modal {
  z-index: 35;
}

.vote-modal-card {
  width: min(100%, 520px);
  padding: 1.35rem;
  border-radius: 28px;
  box-shadow: var(--shadow);
  background:
    radial-gradient(circle at top right, rgba(216, 235, 231, 0.52), transparent 28%),
    linear-gradient(180deg, rgba(251, 254, 252, 0.98), rgba(241, 248, 246, 0.98));
  border: 1px solid rgba(111, 168, 161, 0.18);
}

.vote-modal-topbar {
  margin-bottom: 0.65rem;
}

.vote-copy p,
.vote-copy h3 {
  margin-bottom: 0.35rem;
}

.vote-timer {
  margin: 0;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--danger-dark);
}

.vote-list {
  display: grid;
  gap: 0.5rem;
}

.vote-chat-form {
  margin-top: 0.2rem;
}

.vote-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(31, 28, 23, 0.08);
}

.vote-row.pending strong {
  color: var(--muted);
}

.vote-row.voted strong {
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.board {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1rem;
  align-items: start;
  scroll-margin-top: calc(0.75rem + env(safe-area-inset-top));
}

.play-panel {
  align-self: start;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.play-review {
  min-height: 0;
}

.practice-opportunities-shell {
  display: grid;
  gap: 0.8rem;
}

.practice-opportunities-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.practice-opportunities-close {
  min-height: 42px;
  padding: 0.65rem 0.95rem;
}

.middle-panel {
  overflow: visible;
  position: relative;
  display: grid;
  gap: 0.9rem;
  align-content: start;
}

.play-actions {
  display: grid;
  gap: 0.75rem;
  justify-items: stretch;
}

.flip-action-button {
  width: 100%;
}

.practice-opportunities-trigger {
  width: auto;
  min-height: 42px;
  padding: 0.72rem 1rem;
  justify-self: start;
}

.flip-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  background: linear-gradient(180deg, #dc885d, #c86648);
  box-shadow: 0 14px 28px rgba(200, 102, 72, 0.22);
}

.flip-action-button:hover {
  background: linear-gradient(180deg, #cf7c53, #bb593d);
}

.flip-action-label {
  min-width: 0;
}

.flip-action-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.flip-action-status-label {
  color: rgba(255, 247, 240, 0.84);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.flip-action-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.55rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.middle-turn-state {
  display: inline-flex;
  align-items: center;
  margin: 0;
  width: fit-content;
  max-width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  background: rgba(111, 168, 161, 0.12);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.2;
}

.middle-turn-state.is-active {
  background: rgba(111, 168, 161, 0.18);
  color: var(--text);
}

.compact-word-strip {
  margin: 0;
  position: relative;
}

.steal-receipt {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  padding: 0.65rem 0.8rem;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  border-radius: 16px;
  background: rgba(228, 242, 239, 0.92);
  border: 1px solid rgba(111, 168, 161, 0.2);
  box-shadow: 0 12px 28px rgba(74, 104, 102, 0.16);
  position: fixed;
  left: 50%;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100vw - 2rem), 24rem);
  z-index: 110;
  pointer-events: none;
}

.steal-receipt-copy,
.steal-receipt-words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.steal-receipt-copy strong,
.steal-receipt-words span {
  overflow-wrap: anywhere;
}

.steal-receipt-label {
  margin-right: 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.steal-receipt-arrow {
  color: var(--muted);
}

.steal-receipt-old {
  color: var(--danger);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.steal-receipt-new {
  color: var(--brand-dark);
  font-weight: 700;
}

.compact-words {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: flex-start;
  padding-top: 0.1rem;
}

.compact-word-group {
  display: grid;
  gap: 0.6rem;
  padding: 0.8rem 0.85rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(31, 28, 23, 0.08);
}

.compact-word-group.owner-tint {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.74)),
    linear-gradient(180deg, var(--owner-soft), var(--owner-soft));
  border-color: var(--owner-border);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.compact-word-group-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(31, 28, 23, 0.08);
}

.compact-word-group.owner-tint .compact-word-group-header {
  border-bottom-color: var(--owner-border);
}

.compact-word-group-identity {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.compact-word-group-title-block {
  min-width: 0;
}

.compact-word-group-kicker,
.compact-word-group-name {
  margin: 0;
}

.compact-word-group-kicker {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.compact-word-group.owner-tint .compact-word-group-kicker {
  color: var(--owner-muted);
}

.compact-word-group-name {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.15;
  text-wrap: balance;
}

.compact-word-group.owner-tint .compact-word-group-name {
  color: var(--owner-text);
}

.compact-word-group-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9rem;
  min-height: 1.9rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(31, 28, 23, 0.06);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  flex: 0 0 auto;
}

.compact-word-group.owner-tint .compact-word-group-count {
  background: rgba(255, 255, 255, 0.42);
  color: var(--owner-text);
}

.compact-word-owner-run {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding-right: 0.4rem;
  margin-right: 0.2rem;
  border-right: 1px solid rgba(31, 28, 23, 0.08);
}

.compact-word-owner-run:last-child {
  padding-right: 0;
  margin-right: 0;
  border-right: 0;
}

.compact-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.52rem;
  min-height: 0;
  padding: 0.34rem 0.68rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid rgba(31, 28, 23, 0.1);
  font-size: 0.68rem;
  font-weight: 600;
}

.compact-word-chip.owner-tint {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.86)),
    linear-gradient(180deg, var(--owner-soft), var(--owner-soft));
  border-color: var(--owner-border);
  box-shadow: inset 0 0 0 1px var(--owner-shadow);
}

.compact-word-owner-dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  background: var(--owner-dot, rgba(111, 168, 161, 0.7));
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.78),
    0 1px 6px var(--owner-shadow, rgba(0, 0, 0, 0.1));
  flex: 0 0 auto;
}

.compact-word-owner-dot-label {
  width: 0.82rem;
  height: 0.82rem;
}

.compact-word-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.compact-word-chip.challengeable {
  cursor: pointer;
}

.compact-word-chip.challengeable:hover {
  background: rgba(111, 168, 161, 0.08);
  border-color: rgba(111, 168, 161, 0.24);
}

.compact-word-chip.challengeable.owner-tint:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88)),
    linear-gradient(180deg, var(--owner-soft), var(--owner-soft));
  border-color: var(--owner-border);
  box-shadow:
    inset 0 0 0 1px var(--owner-shadow),
    0 0 0 3px rgba(111, 168, 161, 0.08);
}

.compact-word-chip.selected,
.selectable-word.selected {
  background: rgba(111, 168, 161, 0.15);
  border-color: rgba(111, 168, 161, 0.38);
  box-shadow: inset 0 0 0 1px rgba(111, 168, 161, 0.16);
}

.compact-word-chip.fresh {
  animation: chip-flash 900ms ease-out;
}

.steal-reveal {
  position: relative;
  overflow: hidden;
}

.steal-text {
  position: relative;
  display: inline-grid;
  min-width: 0;
}

.steal-old,
.steal-new {
  grid-area: 1 / 1;
  white-space: nowrap;
}

.steal-old {
  color: var(--danger);
  animation: steal-old-fade 1200ms ease forwards;
}

.steal-new {
  opacity: 0;
  animation: steal-new-rise 1200ms ease forwards;
}

.added-letter {
  display: inline-block;
  color: var(--danger-dark);
  text-shadow: 0 0 18px rgba(177, 97, 120, 0.28);
  animation: added-letter-pop 1100ms ease forwards;
}

@keyframes steal-old-fade {
  0%, 42% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-50%);
  }
}

@keyframes steal-new-rise {
  0%, 42% {
    opacity: 0;
    transform: translateY(45%);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chip-flash {
  0% {
    background: #dff0ec;
    border-color: rgba(111, 168, 161, 0.46);
    transform: translateY(-1px) scale(1.03);
  }
  100% {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(31, 28, 23, 0.1);
    transform: translateY(0) scale(1);
  }
}

@keyframes added-letter-pop {
  0%, 35% {
    transform: translateY(12%) scale(0.88);
    background: rgba(184, 216, 239, 0.9);
    box-shadow: 0 0 0 0 rgba(184, 216, 239, 0.34);
  }

  60% {
    transform: translateY(0) scale(1.08);
    background: rgba(184, 216, 239, 0.34);
    box-shadow: 0 0 0 8px rgba(184, 216, 239, 0);
  }

  100% {
    transform: translateY(0) scale(1);
    background: transparent;
    box-shadow: none;
  }
}

.tile-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  min-height: 96px;
  align-items: center;
}

.tile-rack.empty {
  min-height: 0;
  color: var(--muted);
}

.tile {
  width: 56px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff, var(--tile));
  border: 2px solid var(--tile-edge);
  box-shadow: 0 10px 18px rgba(103, 117, 139, 0.16);
  font-size: 1.7rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.player-card {
  padding: 1.1rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
}

.player-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.player-head h3 {
  margin-bottom: 0.2rem;
}

.player-name-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.player-name-row.owner-tint {
  width: fit-content;
  padding: 0.24rem 0.58rem;
  border-radius: 999px;
  background: var(--owner-soft);
  border: 1px solid var(--owner-border);
  color: var(--owner-text);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.player-owner-dot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 999px;
  background: var(--owner-dot, rgba(111, 168, 161, 0.7));
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.82),
    0 1px 6px var(--owner-shadow, rgba(0, 0, 0, 0.12));
  flex: 0 0 auto;
}

.player-score {
  font-size: 1.9rem;
  font-weight: 700;
  flex: 0 0 auto;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

.word-pill {
  border-radius: 18px;
  background: #edf1f5;
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
  flex-wrap: wrap;
  padding: 0.4rem;
}

.word-pick {
  min-height: 0;
  flex: 1 1 160px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: 14px;
  background: transparent;
  color: var(--text);
}

.word-pick strong {
  letter-spacing: 0.04em;
}

.pill-action {
  min-height: 36px;
  padding: 0.32rem 0.7rem;
  background: #f6dfd7;
  color: #9d4836;
  font-size: 0.8rem;
}

.pill-action:hover {
  background: #efcfc3;
}

.final-panel {
  margin-top: 1rem;
  padding: 1.1rem 1.25rem;
  flex-wrap: wrap;
  align-items: start;
}

.final-copy-block {
  min-width: 0;
}

.final-actions {
  margin-top: 0.9rem;
}

.endgame-opportunities-slot {
  margin-top: 1rem;
}

.final-timer {
  margin: 0.45rem 0 0;
  font-size: 0.84rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-dark);
}

.final-visual {
  flex: 1 1 100%;
  margin-top: 1rem;
  padding: 1rem 1rem 0.2rem;
  border-radius: 20px;
  background:
    radial-gradient(circle at top center, rgba(216, 235, 231, 0.56), transparent 35%),
    linear-gradient(180deg, rgba(251, 254, 252, 0.96), rgba(239, 247, 244, 0.92));
  border: 1px solid rgba(147, 173, 201, 0.18);
}

.podium-burst {
  text-align: center;
  color: var(--brand);
  letter-spacing: 0.35rem;
  margin-bottom: 0.55rem;
}

.podium {
  display: flex;
  justify-content: center;
  align-items: end;
  gap: 0.75rem;
  position: relative;
}

.podium-slot {
  min-width: 92px;
  text-align: center;
  color: var(--text);
  position: relative;
  transition: transform 420ms ease, opacity 420ms ease, filter 420ms ease;
}

.podium-rank {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.podium-name {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.podium-score {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.55rem;
}

.podium-step {
  border-radius: 18px 18px 0 0;
  background: linear-gradient(180deg, #dfeeea, #a9c9c1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.podium-slot.top .podium-step {
  height: 132px;
}

.podium-slot.mid .podium-step {
  height: 104px;
}

.podium-slot.low .podium-step {
  height: 82px;
}

.podium-slot.winner .podium-rank,
.podium-slot.winner .podium-name {
  color: var(--brand-dark);
}

.podium-slot.tied .podium-rank {
  color: var(--brand-dark);
}

.animated-burst {
  opacity: 0.35;
  transform: scale(0.96);
}

.animated-podium {
  padding-top: 0.5rem;
}

.podium-slot-hidden {
  opacity: 0;
  transform: translateY(36px) scale(0.88);
  filter: blur(3px);
}

.podium-slot.revealed {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.podium-slot.winner-celebration {
  animation: winner-bounce 900ms ease 1;
}

.podium-sparks {
  position: absolute;
  inset: -26px -12px auto;
  height: 88px;
  pointer-events: none;
}

.podium-sparks span,
.podium-fireworks span {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ffd764;
  opacity: 0;
  transform: scale(0.2);
}

.podium-sparks span:nth-child(1) {
  left: 12%;
  top: 54%;
  background: #ffd764;
}

.podium-sparks span:nth-child(2) {
  left: 28%;
  top: 16%;
  background: #ff9f5a;
}

.podium-sparks span:nth-child(3) {
  left: 50%;
  top: 6%;
  background: #fff0a5;
}

.podium-sparks span:nth-child(4) {
  right: 28%;
  top: 18%;
  background: #74d9b1;
}

.podium-sparks span:nth-child(5) {
  right: 12%;
  top: 48%;
  background: #ffd764;
}

.podium-sparks span:nth-child(6) {
  left: 46%;
  top: 34%;
  background: #ffffff;
}

.podium-slot.revealed .podium-sparks span {
  animation: podium-spark 700ms ease forwards;
}

.podium-slot.revealed .podium-sparks span:nth-child(2) {
  animation-delay: 40ms;
}

.podium-slot.revealed .podium-sparks span:nth-child(3) {
  animation-delay: 90ms;
}

.podium-slot.revealed .podium-sparks span:nth-child(4) {
  animation-delay: 130ms;
}

.podium-slot.revealed .podium-sparks span:nth-child(5) {
  animation-delay: 170ms;
}

.podium-slot.revealed .podium-sparks span:nth-child(6) {
  animation-delay: 210ms;
}

.podium-fireworks {
  position: absolute;
  inset: -6px 0 auto;
  height: 180px;
  pointer-events: none;
  opacity: 0;
}

.podium-fireworks.is-live {
  opacity: 1;
}

.podium-fireworks span:nth-child(1) {
  left: 14%;
  top: 28%;
  background: #ffd764;
}

.podium-fireworks span:nth-child(2) {
  left: 26%;
  top: 8%;
  background: #ff8d52;
}

.podium-fireworks span:nth-child(3) {
  left: 50%;
  top: 18%;
  background: #fff4b0;
}

.podium-fireworks span:nth-child(4) {
  right: 26%;
  top: 12%;
  background: #74d9b1;
}

.podium-fireworks span:nth-child(5) {
  right: 15%;
  top: 30%;
  background: #ffd764;
}

.podium-fireworks span:nth-child(6) {
  left: 50%;
  top: 0;
  background: #ffffff;
}

.podium-fireworks.is-live span {
  animation: podium-firework 1150ms ease-out forwards;
}

.podium-fireworks.is-live span:nth-child(2) {
  animation-delay: 70ms;
}

.podium-fireworks.is-live span:nth-child(3) {
  animation-delay: 120ms;
}

.podium-fireworks.is-live span:nth-child(4) {
  animation-delay: 170ms;
}

.podium-fireworks.is-live span:nth-child(5) {
  animation-delay: 220ms;
}

.podium-fireworks.is-live span:nth-child(6) {
  animation-delay: 260ms;
}

@keyframes podium-spark {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.2);
  }

  35% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }

  100% {
    opacity: 0;
    transform: translateY(-22px) scale(0.4);
  }
}

@keyframes podium-firework {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(0.2);
  }

  18% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }

  100% {
    opacity: 0;
    transform: translate(var(--fx, 0), var(--fy, -54px)) scale(0.35);
  }
}

.podium-fireworks span:nth-child(1) { --fx: -22px; --fy: -42px; }
.podium-fireworks span:nth-child(2) { --fx: -38px; --fy: -60px; }
.podium-fireworks span:nth-child(3) { --fx: 0; --fy: -72px; }
.podium-fireworks span:nth-child(4) { --fx: 38px; --fy: -62px; }
.podium-fireworks span:nth-child(5) { --fx: 24px; --fy: -44px; }
.podium-fireworks span:nth-child(6) { --fx: 0; --fy: -86px; }

@keyframes winner-bounce {
  0% {
    transform: translateY(0) scale(1);
  }

  28% {
    transform: translateY(-10px) scale(1.03);
  }

  55% {
    transform: translateY(0) scale(1);
  }

  72% {
    transform: translateY(-4px) scale(1.015);
  }

  100% {
    transform: translateY(0) scale(1);
  }
}

.hidden {
  display: none;
}

.site-footer {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
  padding: 1.2rem 0 0.5rem;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.site-beta-notice {
  width: min(760px, 100%);
  margin-inline: auto !important;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(232, 86, 63, 0.13);
  border-radius: 16px;
  color: #626a7c;
  background: rgba(255, 248, 241, 0.72);
}

.site-beta-notice strong {
  color: var(--navy);
}

.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1rem;
}

.site-footer-links a,
.site-footer-links button {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: var(--brand-dark);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.site-footer-links a:hover,
.site-footer-links button:hover {
  color: var(--coral);
  background: transparent;
  box-shadow: none;
  transform: none;
}

.account-legal {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  line-height: 1.5;
}

.account-legal a {
  color: #fff;
  text-underline-offset: 0.18em;
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(31, 28, 23, 0.58);
  backdrop-filter: blur(10px);
  z-index: 120;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-backdrop.hidden {
  display: none;
}

.message-modal-card {
  width: min(100%, 420px);
  padding: 1.35rem;
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(255, 186, 204, 0.55), transparent 30%),
    radial-gradient(circle at bottom left, rgba(219, 232, 244, 0.72), transparent 34%),
    linear-gradient(180deg, #fff9fb, #f8f5f7);
  border: 1px solid rgba(111, 168, 161, 0.14);
  box-shadow: var(--shadow);
  text-align: center;
}

.message-modal-card,
.vote-modal-card,
.end-modal-card,
.how-to-play-modal-card,
.feedback-modal-card,
.profile-modal-card {
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.end-modal-card {
  position: relative;
  width: min(100%, 560px);
  padding: 1.5rem;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(219, 232, 244, 0.56), transparent 30%),
    linear-gradient(180deg, #fffdfa, #f7f3ee);
  border: 1px solid rgba(147, 173, 201, 0.18);
  box-shadow: var(--shadow);
  text-align: center;
}

.end-modal-review-sticky {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: flex-end;
  margin: -0.25rem -0.25rem 0.7rem;
  padding: 0 0 0.55rem;
  background: linear-gradient(180deg, rgba(247, 243, 238, 0.98), rgba(247, 243, 238, 0.82), rgba(247, 243, 238, 0));
}

.end-modal-review-fab {
  border: 0;
  border-radius: 999px;
  padding: 0.75rem 1rem;
  background: linear-gradient(180deg, #ff9b61, #ef6f43);
  color: #fffdfa;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow:
    0 12px 26px rgba(239, 111, 67, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.24) inset;
  animation: end-modal-review-pulse 1800ms ease-in-out infinite;
}

.end-modal-review-fab:hover {
  background: linear-gradient(180deg, #ff9355, #e96638);
}

@keyframes end-modal-review-pulse {
  0%, 100% {
    transform: translateY(0) scale(1);
    box-shadow:
      0 12px 26px rgba(239, 111, 67, 0.28),
      0 0 0 1px rgba(255, 255, 255, 0.24) inset;
  }
  50% {
    transform: translateY(-1px) scale(1.03);
    box-shadow:
      0 16px 32px rgba(239, 111, 67, 0.34),
      0 0 0 1px rgba(255, 255, 255, 0.28) inset,
      0 0 0 10px rgba(255, 155, 97, 0.08);
  }
}

.switch-device-modal-card {
  width: min(100%, 560px);
  padding: 1.5rem;
  border-radius: 30px;
  background:
    radial-gradient(circle at top right, rgba(219, 232, 244, 0.48), transparent 32%),
    linear-gradient(180deg, #fffdfa, #f1f5f8);
  border: 1px solid rgba(147, 173, 201, 0.2);
  box-shadow: var(--shadow);
  text-align: left;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.feedback-modal-card {
  width: min(100%, 560px);
  padding: 1.5rem;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(199, 224, 219, 0.42), transparent 30%),
    linear-gradient(180deg, #fffdfa, #f4f8f6);
  border: 1px solid rgba(89, 118, 114, 0.18);
  box-shadow: var(--shadow);
  text-align: left;
}

.profile-modal-card {
  width: min(100%, 560px);
  padding: 1.5rem;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(251, 229, 151, 0.44), transparent 32%),
    linear-gradient(180deg, #fffefa, #f9f7ef);
  border: 1px solid rgba(166, 113, 35, 0.18);
  box-shadow: var(--shadow);
  text-align: left;
}

.profile-modal-card h3 {
  margin-bottom: 0.45rem;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.profile-stat-card {
  display: grid;
  gap: 0.25rem;
  min-height: 86px;
  padding: 0.85rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(77, 61, 21, 0.09);
}

.profile-stat-card strong {
  color: var(--brand-dark);
  font-size: 1.2rem;
}

.profile-stat-card span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.feedback-modal-card h3 {
  margin-bottom: 0.45rem;
}

.feedback-copy {
  margin-bottom: 1rem;
  color: var(--muted);
  line-height: 1.5;
}

.feedback-form {
  display: grid;
  gap: 0.9rem;
}

.feedback-form label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.feedback-form select,
.feedback-form input,
.feedback-form textarea {
  width: 100%;
}

.feedback-form textarea {
  min-height: 8rem;
  resize: vertical;
}

.feedback-status {
  min-height: 1.2rem;
  margin-bottom: 0;
}

.how-to-play-modal-card {
  position: relative;
  width: min(100%, 920px);
  padding: 1.5rem;
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(219, 232, 244, 0.34), transparent 28%),
    radial-gradient(circle at bottom left, rgba(199, 224, 219, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(251, 254, 252, 0.99), rgba(244, 249, 247, 0.99));
  border: 1px solid rgba(147, 173, 201, 0.18);
  box-shadow: 0 28px 80px rgba(31, 28, 23, 0.28);
  text-align: left;
}

.how-to-play-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.how-to-play-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  padding: 0;
  border-radius: 999px;
  background: rgba(31, 28, 23, 0.08);
  color: var(--text);
  border: 1px solid rgba(31, 28, 23, 0.1);
  box-shadow: none;
}

.how-to-play-x span {
  font-size: 1.7rem;
  line-height: 1;
}

.how-to-play-x:hover {
  background: rgba(31, 28, 23, 0.14);
  color: var(--text);
  transform: translateY(-1px);
}

.how-to-play-header {
  display: flex;
  gap: 1.25rem;
  justify-content: flex-start;
  align-items: start;
  margin-bottom: 1.25rem;
}

.how-to-play-header h3 {
  margin-bottom: 0.35rem;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
}

.how-to-play-intro {
  max-width: 44rem;
  margin-bottom: 0;
  color: rgba(36, 64, 70, 0.82);
  font-size: 1.05rem;
  line-height: 1.55;
}

.how-to-play-hero-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.how-to-play-overview {
  height: 100%;
  padding: 1rem;
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(216, 235, 231, 0.34), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(241, 248, 246, 0.96));
  border: 1px solid rgba(147, 173, 201, 0.14);
}

.how-to-play-demo {
  display: grid;
  gap: 0.95rem;
}

.demo-status-card {
  padding: 1rem 1.05rem;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(147, 173, 201, 0.14);
}

.demo-status-card h4 {
  margin: 0.15rem 0 0.35rem;
  font-size: 1.28rem;
}

.demo-step-copy {
  margin: 0;
  color: rgba(36, 64, 70, 0.82);
  line-height: 1.55;
}

.how-to-play-rules-panel {
  padding: 1rem 1.05rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(89, 118, 114, 0.08);
}

.how-to-play-rules-title {
  margin: 0 0 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.76rem;
  font-weight: 800;
}

.how-to-play-rule-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.65rem;
}

.how-to-play-rule-list li {
  line-height: 1.48;
}

.how-to-play-example-stack {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.how-to-play-example-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.7rem 0.8rem;
  border-radius: 18px;
  background: rgba(247, 252, 250, 0.92);
  border: 1px solid rgba(147, 173, 201, 0.12);
}

.how-to-play-example-line strong {
  text-align: right;
}

.how-to-play-example-line-good {
  background: rgba(236, 247, 244, 0.96);
  border-color: rgba(147, 173, 201, 0.16);
}

.how-to-play-example-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 28px;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(31, 28, 23, 0.08);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.demo-board {
  display: grid;
  gap: 0.85rem;
  padding: 0.15rem;
}

.tutorial-word-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.overview-middle {
  padding: 1rem;
  border-radius: 22px;
  background: rgba(246, 252, 250, 0.95);
  border: 1px dashed rgba(147, 173, 201, 0.28);
}

.demo-middle {
  min-height: 160px;
}

.overview-player-label {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.overview-action-row,
.overview-steal-flow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.overview-action-row {
  margin-top: 0.2rem;
}

.overview-action-arrow,
.overview-steal-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: rgba(111, 168, 161, 0.08);
  color: var(--brand-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mini-action-pill-strong {
  background: rgba(111, 168, 161, 0.18);
}

.mini-middle-label,
.mini-caption,
.how-to-play-number {
  display: block;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.mini-middle-label {
  margin-bottom: 0.55rem;
}

.mini-tile-rack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.mini-tile-rack-tight {
  margin-bottom: 0;
}

.mini-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(180deg, #edf7f5, var(--tile));
  border: 1px solid rgba(147, 173, 201, 0.44);
  box-shadow: inset 0 -3px 0 rgba(147, 173, 201, 0.2);
  color: var(--text);
  font-weight: 800;
}

.mini-tile-fresh {
  background: linear-gradient(180deg, #d6ebe7, #eef8f5);
  border-color: rgba(111, 168, 161, 0.36);
  box-shadow:
    inset 0 -3px 0 rgba(111, 168, 161, 0.18),
    0 0 0 4px rgba(111, 168, 161, 0.08);
}

.mini-action-pill,
.mini-word-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 40px;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  background: rgba(111, 168, 161, 0.12);
  color: var(--brand-dark);
  font-weight: 700;
}

.mini-word-pill {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(147, 173, 201, 0.14);
}

.mini-word-pill strong {
  font-size: 0.78rem;
  color: var(--muted);
}

.mini-word-pill-muted {
  background: rgba(104, 130, 122, 0.12);
  color: var(--text);
}

.mini-word-pill-highlight {
  background: rgba(111, 168, 161, 0.16);
}

.mini-word-pill-warning {
  background: rgba(177, 97, 120, 0.12);
  border: 1px solid rgba(177, 97, 120, 0.16);
  color: var(--danger-dark);
}

.mini-caption {
  margin-top: 0.7rem;
  line-height: 1.4;
}

.tutorial-middle-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 0.9rem;
  border-radius: 999px;
  background: rgba(111, 168, 161, 0.12);
  color: var(--muted);
  font-size: 0.95rem;
}

.tutorial-action {
  min-width: 150px;
  width: fit-content;
}

.tutorial-action.is-next {
  background: linear-gradient(180deg, rgba(111, 168, 161, 0.98), rgba(59, 106, 111, 0.98));
  border-color: rgba(59, 106, 111, 0.98);
  color: #f7fffd;
  box-shadow: 0 14px 28px rgba(59, 106, 111, 0.2);
}

.tutorial-action.is-next:hover {
  background: linear-gradient(180deg, rgba(100, 154, 148, 1), rgba(47, 88, 93, 1));
}

.tutorial-action.is-next:disabled {
  opacity: 1;
}

.tutorial-action:disabled {
  cursor: default;
}

.tutorial-form {
  display: grid;
  gap: 0.75rem;
}

.tutorial-input-wrap {
  gap: 0.5rem;
}

.tutorial-input-wrap span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-input-wrap input {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tutorial-input-wrap input.tutorial-input-ready {
  border-color: rgba(111, 168, 161, 0.42);
  box-shadow: 0 0 0 4px rgba(111, 168, 161, 0.08);
}

.tutorial-feedback {
  margin: 0;
  color: var(--brand-dark);
  font-weight: 700;
  line-height: 1.4;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: rgba(111, 168, 161, 0.12);
  border: 1px solid rgba(111, 168, 161, 0.18);
}

.tutorial-feedback-pop {
  animation: tutorial-nudge-pop 380ms ease-out;
}

@keyframes tutorial-nudge-pop {
  0% {
    transform: scale(0.97);
    background: rgba(111, 168, 161, 0.2);
  }
  100% {
    transform: scale(1);
    background: rgba(111, 168, 161, 0.12);
  }
}

.mini-steal-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
}

.mini-arrow {
  color: var(--muted);
  font-weight: 800;
}

.how-to-play-note {
  margin-bottom: 0;
}

.how-to-play-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(77, 61, 21, 0.08);
}

.how-to-play-note {
  margin-top: 0;
  max-width: 38rem;
}

.how-to-play-done {
  min-width: 132px;
}

.switch-device-copy {
  margin-bottom: 1rem;
}

.switch-device-link-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.switch-device-link {
  min-width: 0;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(31, 28, 23, 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

.switch-device-steps {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
  color: var(--text);
}

.switch-device-steps li + li {
  margin-top: 0.35rem;
}

.switch-device-note {
  margin-bottom: 1rem;
}

.end-modal-copy {
  margin-bottom: 1rem;
  font-size: 1.02rem;
}

.end-modal-podium {
  margin-bottom: 1rem;
}

.end-modal-card .podium-slot {
  min-width: 100px;
}

.end-modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.end-modal-global {
  margin-bottom: 1rem;
}

.endgame-opportunities {
  border-radius: 22px;
  border: 1px solid rgba(147, 173, 201, 0.2);
  background:
    radial-gradient(circle at top right, rgba(216, 235, 231, 0.48), transparent 34%),
    linear-gradient(180deg, rgba(251, 254, 252, 0.98), rgba(242, 249, 246, 0.94));
  overflow: hidden;
}

.endgame-opportunities.expanded {
  display: grid;
  gap: 0;
}

.endgame-opportunities-summary {
  padding: 0.95rem 1rem;
}

.endgame-opportunities-summary strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
}

.endgame-opportunities-summary p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.endgame-opportunities summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem 1rem;
  cursor: pointer;
  list-style: none;
}

.endgame-opportunities summary::-webkit-details-marker {
  display: none;
}

.endgame-opportunities summary strong {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 1.02rem;
}

.endgame-opportunities summary p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.endgame-opportunities summary::after {
  content: 'Show';
  flex: 0 0 auto;
  padding: 0.45rem 0.72rem;
  border-radius: 999px;
  background: rgba(111, 168, 161, 0.12);
  color: var(--brand-dark);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.endgame-opportunities[open] summary::after {
  content: 'Hide';
}

.endgame-opportunities-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid rgba(147, 173, 201, 0.16);
}

.endgame-opportunities-body.scrollable {
  max-height: min(52vh, 520px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.endgame-opportunities-hint {
  margin-top: 0.75rem;
}

.endgame-opportunities-group + .endgame-opportunities-group {
  margin-top: 0.9rem;
}

.endgame-all-plays {
  margin-top: 1rem;
  border-top: 1px solid rgba(147, 173, 201, 0.16);
  padding-top: 0.9rem;
}

.endgame-all-plays summary {
  cursor: pointer;
  color: var(--brand-dark);
  font-weight: 700;
}

.endgame-all-plays-body {
  margin-top: 0.85rem;
}

.endgame-word-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.endgame-word-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(147, 173, 201, 0.18);
}

.endgame-word-chip strong {
  letter-spacing: 0.04em;
}

.endgame-steal-list {
  display: grid;
  gap: 0.7rem;
}

.endgame-steal-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(147, 173, 201, 0.16);
}

.endgame-steal-text {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex-wrap: nowrap;
  font-size: 1rem;
  line-height: 1.35;
}

.endgame-steal-old {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: rgba(216, 100, 74, 0.55);
  text-decoration-thickness: 2px;
  white-space: nowrap;
}

.endgame-steal-arrow {
  color: var(--brand-dark);
  font-weight: 700;
  flex: 0 0 auto;
}

.endgame-steal-new {
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.endgame-steal-new .added-letter {
  animation: none;
  color: var(--brand);
  text-shadow: none;
}

.round-stat-card {
  padding: 0.9rem 0.95rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(147, 173, 201, 0.16);
  text-align: left;
}

.round-stat-card .eyebrow {
  margin-bottom: 0.35rem;
}

.round-stat-card strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1rem;
}

.round-stat-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.35;
}

.end-share-card {
  margin-bottom: 0.9rem;
  padding: 1rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(216, 235, 231, 0.56), transparent 34%),
    radial-gradient(circle at bottom left, rgba(199, 224, 219, 0.26), transparent 36%),
    linear-gradient(180deg, rgba(251, 254, 252, 0.98), rgba(243, 249, 247, 0.96));
  border: 1px solid rgba(147, 173, 201, 0.22);
  text-align: left;
}

.end-share-card .eyebrow {
  margin-bottom: 0.2rem;
}

.share-card-burst {
  margin-bottom: 0.35rem;
  letter-spacing: 0.18rem;
}

.end-share-card h4 {
  margin: 0 0 0.45rem;
  font-size: 1.25rem;
}

.share-card-copy {
  margin: 0 0 0.8rem;
  color: var(--text);
  line-height: 1.4;
}

.share-card-leaders {
  display: grid;
  gap: 0.45rem;
}

.share-card-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 0.6rem;
  align-items: center;
}

.share-card-cta {
  margin-top: 0.9rem;
  padding: 0.7rem 0.85rem;
  border-radius: 16px;
  background: rgba(111, 168, 161, 0.1);
  color: var(--brand-dark);
  font-weight: 700;
}

.share-card-link {
  margin: 0.85rem 0 0;
  color: var(--brand-dark);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

.end-modal-rematch {
  margin-bottom: 1rem;
}

.end-modal-daily {
  display: grid;
  gap: 0.45rem;
  margin: 1rem 0;
  padding: 0.9rem;
  border-radius: 18px;
  background: rgba(251, 229, 151, 0.36);
  border: 1px solid rgba(166, 113, 35, 0.16);
}

.end-modal-daily p {
  margin: 0;
}

.daily-heist-rank {
  color: var(--brand-dark);
  font-weight: 800;
}

.end-modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.heart-row,
.heart-burst {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  color: #c65378;
}

.heart-row {
  margin-bottom: 0.55rem;
  font-size: 1.1rem;
}

.heart-burst {
  margin: 0.95rem 0 1rem;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}

.heart-row span:nth-child(2),
.heart-burst span:nth-child(3),
.heart-burst span:nth-child(5) {
  color: #e7a2b7;
}

.message-modal-card h3 {
  margin-bottom: 0.4rem;
}

.message-modal-card p:last-of-type {
  margin-bottom: 0;
  line-height: 1.45;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(calc(100vw - 1.5rem), 520px);
  padding: 0.9rem 1.15rem;
  border-radius: 18px;
  background: rgba(31, 28, 23, 0.92);
  color: #fff;
  box-shadow: var(--shadow);
  text-align: center;
  z-index: 10;
}

.chat-flash {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100vw - 1.5rem), 560px);
  padding: 0.85rem 1.05rem;
  border-radius: 18px;
  background: rgba(36, 49, 65, 0.94);
  color: #fff;
  box-shadow: var(--shadow);
  text-align: center;
  z-index: 20;
  pointer-events: none;
}

@media (max-width: 900px) {
  .hero,
  .board {
    grid-template-columns: 1fr;
  }

  .top-bar,
  .panel-header,
  .status-strip,
  .turn-order-panel .section-header,
  .final-panel,
  .vote-actions,
  .split-form,
  .player-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-shell {
    width: min(100vw - 1rem, 1120px);
    padding-top: 1rem;
    padding-bottom: 2rem;
  }

  .hero {
    gap: 0.45rem;
  }

  .hero-heading-row,
  .how-to-play-header,
  .how-to-play-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-banana {
    min-height: 86px;
  }

  .banana-arc-one {
    right: 42px;
    top: 6px;
    width: 148px;
    height: 148px;
  }

  .banana-arc-two {
    right: 0;
    top: 48px;
    width: 118px;
    height: 118px;
  }

  #lobby-panel,
  #game-panel {
    padding: 1rem;
  }

  .panel.inset {
    padding: 1rem;
  }

  .lobby-name-field,
  .lobby-code-field {
    border-radius: 20px;
  }

  .top-bar-actions button,
  .top-bar-select,
  .vote-actions button,
  .final-panel button,
  .end-modal-actions button,
  .stacked-form button,
  .chat-form button,
  .switch-device-link-row button {
    width: 100%;
  }

  .top-bar-actions {
    flex-direction: row;
    justify-content: flex-end;
    align-items: flex-start;
  }

  .top-bar-actions .top-bar-menu-toggle,
  .top-bar-actions .top-bar-requests-toggle {
    display: inline-flex;
    width: auto;
    min-width: 0;
    justify-content: center;
    align-self: flex-start;
    padding-inline: 1.1rem;
  }

  .top-bar-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(14rem, calc(100vw - 2rem));
    margin-top: 0;
    box-shadow: 0 18px 34px rgba(31, 28, 23, 0.14);
  }

  .join-requests-popover {
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(22rem, calc(100vw - 1rem));
  }

  .live-room-browser-header,
  .live-room-card-head,
  .join-request-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .chat-form {
    flex-direction: column;
    align-items: stretch;
  }

  .end-modal-actions {
    flex-direction: column;
  }

  .daily-heist-card {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-heist-card button {
    width: 100%;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .mode-switch {
    gap: 0.25rem;
    padding: 0.25rem;
  }

  .mode-slider {
    top: 0.25rem;
    left: 0.25rem;
    width: calc((100% - 0.5rem) / 3);
    height: calc(100% - 0.5rem);
  }

  .mode-switch[data-mode="join"] .mode-slider {
    transform: translateX(calc(100% + 0.25rem));
  }

  .mode-switch[data-mode="practice"] .mode-slider {
    transform: translateX(calc(200% + 0.5rem));
  }

  .lobby-submit {
    justify-self: stretch;
  }

  .section-header {
    align-items: stretch;
  }

  .switch-device-link-row {
    grid-template-columns: 1fr;
  }

  .how-to-play-hero-panel {
    grid-template-columns: 1fr;
  }

  .board {
    gap: 0.7rem;
  }

  .play-panel {
    margin-top: 0;
  }

  .practice-opportunities-header {
    flex-direction: column;
    align-items: stretch;
  }

  .middle-turn-state {
    display: inline-flex;
    max-width: 100%;
  }

  .tile-rack {
    justify-content: center;
    min-height: 78px;
  }

  .tile {
    width: 48px;
    height: 56px;
    font-size: 1.4rem;
  }

  .players-grid {
    grid-template-columns: 1fr;
  }

  .word-pill {
    width: 100%;
    border-radius: 16px;
  }

  .word-pick {
    width: 100%;
  }

  .pill-action {
    width: 100%;
  }

  .player-score {
    font-size: 1.6rem;
  }

  body.game-active #game-panel,
  body:has(#game-panel:not(.hidden)) #game-panel {
    gap: 0.8rem;
  }

  body.game-active .board,
  body:has(#game-panel:not(.hidden)) .board {
    order: 1;
  }

  body.game-active .game-chrome,
  body:has(#game-panel:not(.hidden)) .game-chrome {
    order: 2;
  }

  body.game-active .turn-order-panel,
  body:has(#game-panel:not(.hidden)) .turn-order-panel {
    order: 3;
  }

  body.game-active .chat-panel,
  body:has(#game-panel:not(.hidden)) .chat-panel {
    order: 4;
  }

  body.game-active #presence-panel,
  body:has(#game-panel:not(.hidden)) #presence-panel {
    order: 5;
  }

  body.game-active .players-grid,
  body:has(#game-panel:not(.hidden)) .players-grid {
    order: 6;
  }

  body.game-active .final-panel,
  body:has(#game-panel:not(.hidden)) .final-panel {
    order: 7;
  }

  body.round-ended.game-active .final-panel,
  body.round-ended:has(#game-panel:not(.hidden)) .final-panel {
    order: 4;
  }

  body.round-ended.game-active .chat-panel,
  body.round-ended:has(#game-panel:not(.hidden)) .chat-panel {
    order: 5;
  }

  body.round-ended.game-active #presence-panel,
  body.round-ended:has(#game-panel:not(.hidden)) #presence-panel {
    order: 6;
  }

  body.round-ended.game-active .players-grid,
  body.round-ended:has(#game-panel:not(.hidden)) .players-grid {
    order: 7;
  }
}

@media (max-width: 560px) {
  .page-shell {
    width: calc(100vw - 0.75rem);
  }

  .endgame-opportunities summary,
  .endgame-steal-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .endgame-steal-text {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .endgame-opportunities summary::after {
    align-self: flex-start;
  }

  .compact-words {
    gap: 0.65rem;
  }

  .compact-word-owner-run {
    gap: 0.42rem;
    padding-right: 0.3rem;
  }

  .compact-word-chip {
    padding: 0.32rem 0.6rem;
    font-size: 0.66rem;
  }

  .modal-backdrop {
    align-items: start;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  }

  h1 {
    font-size: 2.2rem;
  }

  .lede {
    font-size: 0.98rem;
  }

  .hero {
    margin-bottom: 0.8rem;
    padding-top: 0.2rem;
    gap: 0.7rem;
  }

  .hero-copy {
    display: grid;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
  }

  .hero-heading-row {
    grid-template-columns: max-content max-content;
    align-items: start;
    justify-content: space-between;
    width: 100%;
    gap: 0.5rem;
  }

  .hero-home {
    width: auto;
    max-width: none;
    min-height: 2.8rem;
    padding: 0.38rem 0.82rem;
    font-size: 0.94rem;
    line-height: 1;
    letter-spacing: -0.02em;
    margin: 0;
    text-align: left;
  }

  .eyebrow {
    margin-bottom: 0;
    letter-spacing: 0.1em;
    font-size: 0.68rem;
  }

  .lede {
    max-width: 18rem;
    margin-left: 0;
    margin-right: 0;
    font-size: 1rem;
    line-height: 1.32;
    text-align: left;
    text-wrap: balance;
  }

  .hero-help-button {
    width: auto;
    min-height: 2.8rem;
    min-width: 0;
    margin: 0;
    padding: 0.38rem 0.82rem;
    font-size: 0.94rem;
  }

  .hero-banana {
    display: none;
  }

  body.game-active .hero,
  body:has(#game-panel:not(.hidden)) .hero {
    margin-bottom: 0.35rem;
    padding-top: 0;
  }

  body.game-active .hero-copy,
  body:has(#game-panel:not(.hidden)) .hero-copy {
    text-align: left;
    width: 100%;
  }

  body.game-active .hero-heading-row,
  body:has(#game-panel:not(.hidden)) .hero-heading-row {
    display: block;
    position: relative;
    min-height: 2.8rem;
  }

  body.game-active .hero-home,
  body:has(#game-panel:not(.hidden)) .hero-home {
    width: auto;
    max-width: none;
    min-height: 2.8rem;
    padding: 0.38rem 0.82rem;
    font-size: 0.94rem;
    line-height: 1;
    text-align: center;
  }

  body.game-active .game-chrome .top-bar,
  body:has(#game-panel:not(.hidden)) .game-chrome .top-bar {
    gap: 0.75rem;
  }

  body.game-active .top-bar-actions,
  body:has(#game-panel:not(.hidden)) .top-bar-actions {
    justify-content: flex-end;
    align-self: start;
  }

  body.game-active .top-bar-actions .top-bar-menu-toggle,
  body:has(#game-panel:not(.hidden)) .top-bar-actions .top-bar-menu-toggle {
    width: auto;
    margin-left: 0;
    min-height: 2.8rem;
    padding: 0.38rem 0.82rem;
    font-size: 0.94rem;
  }

  body.game-active .status-strip,
  body:has(#game-panel:not(.hidden)) .status-strip {
    gap: 0.85rem;
  }

  body.game-active .status-strip > div,
  body:has(#game-panel:not(.hidden)) .status-strip > div {
    padding: 0.9rem 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.56);
  }

  body.game-active .middle-panel,
  body.game-active .play-panel,
  body:has(#game-panel:not(.hidden)) .middle-panel,
  body:has(#game-panel:not(.hidden)) .play-panel {
    padding: 0.95rem;
  }

  body.game-active .flip-action-button,
  body:has(#game-panel:not(.hidden)) .flip-action-button {
    width: 100%;
  }

  .how-to-play-done {
    width: 100%;
  }

  .how-to-play-x {
    align-self: flex-end;
  }

  .status-strip,
  .player-card,
  .final-panel,
  .panel.inset,
  .vote-panel {
    border-radius: 18px;
  }

  .podium {
    gap: 0.45rem;
  }

  .podium-slot {
    min-width: 72px;
  }

  .podium-slot.top .podium-step {
    height: 110px;
  }

  .podium-slot.mid .podium-step {
    height: 86px;
  }

  .podium-slot.low .podium-step {
    height: 66px;
  }

  .compact-word-strip {
    margin-bottom: 0.2rem;
  }

  .steal-receipt {
    position: static;
    left: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0.45rem;
    box-shadow: none;
    pointer-events: auto;
  }

  .end-modal-card,
  .how-to-play-modal-card,
  .switch-device-modal-card,
  .vote-modal-card,
  .message-modal-card {
    width: 100%;
    max-height: calc(100vh - 1.5rem);
  }

  .how-to-play-modal-card {
    padding: 1.1rem;
    border-radius: 26px;
  }

  .how-to-play-hero-panel {
    grid-template-columns: 1fr;
  }

  .demo-middle,
  .overview-middle,
  .how-to-play-example-line strong {
    width: 100%;
  }

  .tutorial-word-row,
  .how-to-play-example-line {
    align-items: start;
  }

  .how-to-play-example-line {
    flex-direction: column;
  }

  .tutorial-action {
    width: 100%;
  }

  .compact-words {
    gap: 0.3rem;
  }

  .compact-word-chip {
    padding: 0.22rem 0.42rem;
    font-size: 0.6rem;
  }

  .word-pick {
    padding: 0.48rem 0.6rem;
    font-size: 0.88rem;
  }

  .tile-rack {
    gap: 0.45rem;
  }

  .tile {
    width: min(13.5vw, 46px);
    height: min(16vw, 54px);
    font-size: min(6vw, 1.3rem);
    border-radius: 14px;
  }

  .toast {
    bottom: calc(14px + env(safe-area-inset-bottom));
  }
}


@media (max-width: 400px) {
  .compact-words {
    gap: 0.22rem;
  }

  .compact-word-chip {
    padding: 0.18rem 0.34rem;
    font-size: 0.54rem;
  }

  .word-pick {
    padding: 0.42rem 0.5rem;
    font-size: 0.8rem;
  }

  .word-pick span:last-child {
    font-size: 0.74rem;
  }
}

/* 2026 visual refresh ----------------------------------------------------- */

:root {
  --bg: #f7f4ee;
  --bg-accent: #ebe7ff;
  --panel: rgba(255, 255, 255, 0.94);
  --panel-strong: #fff;
  --text: #1e2340;
  --muted: #6f7184;
  --line: rgba(35, 38, 70, 0.12);
  --brand: #6757d9;
  --brand-dark: #4939b9;
  --brand-soft: #eeebff;
  --danger: #e65f72;
  --danger-dark: #c53e54;
  --tile: #fffaf0;
  --tile-edge: #e4d7bd;
  --shadow: 0 24px 70px rgba(45, 39, 103, 0.13);
  --radius: 30px;
  --coral: #ff7657;
  --mint: #35b99f;
  --sun: #ffd166;
  --navy: #25264d;
}

body {
  font-family: ui-rounded, "SF Pro Rounded", "Avenir Next", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 4%, rgba(255, 209, 102, 0.28), transparent 20rem),
    radial-gradient(circle at 92% 7%, rgba(103, 87, 217, 0.18), transparent 24rem),
    linear-gradient(135deg, #fbf9f4 0%, #f4f0ff 52%, #eef8f5 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image: radial-gradient(rgba(37, 38, 77, 0.2) 0.75px, transparent 0.75px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, #000, transparent 68%);
}

button {
  font-weight: 750;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 18px rgba(73, 57, 185, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(73, 57, 185, 0.22);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(103, 87, 217, 0.28);
  outline-offset: 2px;
}

button.secondary {
  background: var(--brand-soft);
  color: var(--brand-dark);
  box-shadow: none;
}

button.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

input,
select,
textarea,
.custom-select-trigger {
  border: 1.5px solid rgba(40, 42, 80, 0.13);
  background: #fff;
  color: var(--text);
  box-shadow: 0 5px 14px rgba(37, 38, 77, 0.04);
}

input:hover,
select:hover,
textarea:hover,
.custom-select-trigger:hover {
  border-color: rgba(103, 87, 217, 0.34);
}

.page-shell {
  width: min(1220px, calc(100vw - 2.5rem));
  padding-top: 1.15rem;
}

.hero {
  margin-bottom: 1rem;
}

.hero-copy {
  display: grid;
  gap: 0.7rem;
}

.hero-heading-row {
  align-items: center;
}

.hero-home,
.hero-help-button,
body.game-active .hero-home,
body:has(#game-panel:not(.hidden)) .hero-home {
  min-height: 52px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.92);
  color: var(--navy);
  box-shadow: 0 12px 30px rgba(53, 48, 113, 0.1);
  backdrop-filter: blur(18px);
}

.hero-home {
  gap: 0.65rem;
  padding: 0.42rem 1rem 0.42rem 0.45rem;
  font-size: 1.08rem;
}

.brand-tile {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, #7d6ee5, #5140c5);
  box-shadow: inset 0 -3px 0 rgba(32, 25, 105, 0.28), 0 6px 12px rgba(73, 57, 185, 0.22);
  font-size: 1.1rem;
  font-weight: 900;
}

.hero-help-button {
  color: var(--brand-dark);
  padding-inline: 1.15rem;
}

.hero-lede {
  margin-left: 0.25rem;
  color: #5f6076;
  font-size: 1rem;
  font-weight: 620;
}

.panel {
  border: 1px solid rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.lobby-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.8fr);
  grid-template-rows: auto 1fr;
  column-gap: clamp(1.5rem, 4vw, 3.5rem);
  padding: clamp(1.25rem, 3vw, 2.5rem) !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(24px);
}

.lobby-header {
  grid-column: 1;
  margin-bottom: 1.15rem;
}

.lobby-header h2 {
  color: var(--navy);
  font-size: clamp(2.15rem, 4vw, 3.45rem);
  font-weight: 850;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.lobby-form {
  grid-column: 1;
  max-width: none;
  gap: 1rem;
}

.mode-switch {
  padding: 0.35rem;
  border: 1px solid rgba(51, 49, 101, 0.1);
  background: #f1eff8;
  box-shadow: inset 0 2px 6px rgba(37, 38, 77, 0.05);
}

.mode-slider {
  background: linear-gradient(145deg, #7768df, #5544c4);
  box-shadow: 0 9px 20px rgba(73, 57, 185, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.mode-option {
  font-weight: 760;
}

.mode-option.active {
  color: #fff;
}

.lobby-hint {
  padding-left: 0.25rem;
  font-size: 0.92rem;
}

.daily-heist-card {
  padding: 1rem 1.1rem;
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 209, 102, 0.3), rgba(255, 247, 217, 0.82)),
    #fffdf5;
  border: 1px solid rgba(196, 146, 30, 0.2);
  box-shadow: 0 10px 24px rgba(156, 111, 18, 0.07);
}

.daily-heist-card .eyebrow {
  color: #9b6b00;
  font-weight: 850;
}

.daily-heist-card button {
  flex: 0 0 auto;
  background: #fff;
  color: #7b5b0c;
  border: 1px solid rgba(155, 107, 0, 0.12);
  box-shadow: 0 7px 16px rgba(155, 107, 0, 0.1);
}

.lobby-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.lobby-name-field {
  grid-column: 1 / -1;
}

.lobby-name-field,
.lobby-code-field {
  gap: 0.5rem;
  padding: 0;
  border: 0;
  background: transparent;
}

.lobby-name-field > span,
.lobby-code-field > span {
  padding-left: 0.2rem;
  color: #55576d;
  font-size: 0.8rem;
  font-weight: 800;
}

.lobby-submit {
  min-height: 60px;
  background: linear-gradient(135deg, #7464dd, #5544c4);
  box-shadow: 0 14px 26px rgba(73, 57, 185, 0.25);
  font-size: 1rem;
}

.lobby-showcase {
  position: relative;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 100%;
  padding: clamp(1.5rem, 3vw, 2.25rem);
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 209, 102, 0.34), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(53, 185, 159, 0.3), transparent 34%),
    linear-gradient(155deg, #35366d 0%, #25264d 52%, #1d1e3d 100%);
  box-shadow: 0 25px 50px rgba(37, 38, 77, 0.24);
  overflow: hidden;
  isolation: isolate;
}

.showcase-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.showcase-orbit-one {
  width: 17rem;
  height: 17rem;
  right: -8rem;
  top: 2rem;
}

.showcase-orbit-two {
  width: 11rem;
  height: 11rem;
  right: -4rem;
  top: 5rem;
}

.showcase-kicker {
  margin-bottom: 0.8rem;
  color: #bdb7ff;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lobby-showcase h3 {
  margin-bottom: clamp(2rem, 5vw, 4rem);
  color: #fff;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -0.045em;
}

.showcase-word {
  display: flex;
  gap: clamp(0.3rem, 0.8vw, 0.55rem);
  margin: 0 -0.15rem 1.5rem;
  transform: rotate(-2deg);
}

.showcase-word span {
  display: grid;
  place-items: center;
  width: clamp(2.55rem, 4vw, 3.45rem);
  aspect-ratio: 0.88;
  border-radius: 13px;
  color: var(--navy);
  background: linear-gradient(145deg, #fffef8, #f3e9d6);
  border: 1px solid rgba(255, 255, 255, 0.68);
  box-shadow: inset 0 -5px 0 #d8c8aa, 0 12px 20px rgba(8, 9, 32, 0.26);
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  font-weight: 900;
}

.showcase-word span:nth-child(2) { transform: translateY(-0.45rem) rotate(2deg); }
.showcase-word span:nth-child(4) { transform: translateY(0.3rem) rotate(-1deg); }

.showcase-move {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.showcase-move-label {
  color: #aaa8c2;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.showcase-move strong {
  color: #fff;
  font-size: clamp(0.95rem, 1.6vw, 1.2rem);
  letter-spacing: 0.06em;
}

.showcase-move i { color: var(--sun); font-style: normal; }
.showcase-move b { padding-inline: 0.25rem; color: #8f87f2; }

.showcase-footer {
  position: absolute;
  left: 2rem;
  right: 2rem;
  bottom: 1.35rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #a9a9c2;
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.showcase-footer i {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

/* Game surface */
#game-panel {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(24px);
}

.status-strip {
  padding: 1rem;
  background: linear-gradient(135deg, #302f65, #262750);
  color: #fff;
  box-shadow: 0 12px 26px rgba(37, 38, 77, 0.19);
}

.status-strip .label { color: #aaa7d0; }
.status-strip strong { color: #fff; }

.panel.inset,
.player-card {
  border: 1px solid rgba(35, 38, 70, 0.09);
  box-shadow: 0 10px 28px rgba(45, 39, 103, 0.07);
}

.middle-panel {
  background:
    radial-gradient(circle at 90% 8%, rgba(103, 87, 217, 0.1), transparent 30%),
    #fff;
}

.play-panel {
  background: linear-gradient(180deg, #fff, #f8f7ff);
}

.tile {
  color: var(--navy);
  background: linear-gradient(145deg, #fffef9, #f1e6d2);
  border: 1px solid #eadcc3;
  box-shadow: inset 0 -5px 0 #d9c9ab, 0 10px 18px rgba(37, 38, 77, 0.13);
  font-weight: 900;
}

.play-submit-button {
  background: linear-gradient(135deg, #6757d9, #4939b9);
}

.play-submit-button:hover { background: linear-gradient(135deg, #5848cd, #3f30a7); }

.flip-action-button {
  background: linear-gradient(135deg, #ff805f, #ef5f44);
  box-shadow: 0 14px 28px rgba(239, 95, 68, 0.23);
}

.flip-action-button:hover { background: linear-gradient(135deg, #f76f4d, #df5037); }

.player-card {
  background: linear-gradient(155deg, #fff, #faf9ff);
}

.player-score {
  color: var(--brand-dark);
  font-weight: 900;
}

.word-pill { background: #f0edff; }
.pill-action { background: #fff0eb; color: #c24e35; }

.final-panel,
.vote-panel {
  background: linear-gradient(135deg, #f1efff, #fff);
  border-color: rgba(103, 87, 217, 0.15);
}

/* Menus, dialogs and feedback */
.top-bar-menu,
.join-requests-popover,
.custom-select-menu {
  padding: 0.6rem;
  border: 1px solid rgba(35, 38, 70, 0.11);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 55px rgba(37, 38, 77, 0.2);
  backdrop-filter: blur(20px);
}

.top-bar-menu button,
.custom-select-option {
  border-radius: 14px;
  box-shadow: none;
}

.custom-select-option:hover,
.custom-select-option.selected {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.modal-backdrop {
  background: rgba(23, 23, 48, 0.66);
  backdrop-filter: blur(14px) saturate(0.8);
}

.message-modal-card,
.vote-modal-card,
.end-modal-card,
.how-to-play-modal-card,
.switch-device-modal-card,
.feedback-modal-card,
.profile-modal-card {
  border: 1px solid rgba(255, 255, 255, 0.8);
  background:
    radial-gradient(circle at 100% 0, rgba(103, 87, 217, 0.12), transparent 32%),
    linear-gradient(160deg, #fff 0%, #f8f7ff 100%);
  box-shadow: 0 34px 90px rgba(12, 12, 36, 0.36);
}

.how-to-play-modal-card,
.end-modal-card {
  border-radius: 32px;
}

.how-to-play-x {
  color: var(--navy);
  background: #f0eef8;
  border-color: transparent;
}

.how-to-play-x:hover {
  color: var(--brand-dark);
  background: #e5e1fa;
}

.how-to-play-header h3,
.feedback-modal-card h3,
.profile-modal-card h3,
.end-modal-card h3 {
  color: var(--navy);
  font-weight: 850;
  letter-spacing: -0.04em;
}

.how-to-play-overview,
.how-to-play-rules-panel,
.profile-stat-card,
.end-modal-stats {
  border-color: rgba(35, 38, 70, 0.09);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 9px 24px rgba(45, 39, 103, 0.06);
}

.tutorial-action {
  background: linear-gradient(135deg, #6757d9, #4939b9);
  box-shadow: 0 12px 24px rgba(73, 57, 185, 0.2);
}

.tutorial-action:hover {
  background: linear-gradient(135deg, #5848cd, #3f30a7);
}

.toast,
.chat-flash {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(37, 38, 77, 0.96);
  box-shadow: 0 18px 42px rgba(12, 12, 36, 0.3);
  backdrop-filter: blur(16px);
}

@media (max-width: 900px) {
  .lobby-shell {
    grid-template-columns: 1fr;
  }

  .lobby-header,
  .lobby-form {
    grid-column: 1;
  }

  .lobby-showcase {
    display: none;
  }

  .lobby-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  body {
    background-attachment: scroll;
  }

  .page-shell {
    width: calc(100vw - 1rem);
    padding-top: 0.65rem;
  }

  .hero {
    margin-bottom: 0.65rem;
  }

  .hero-home,
  .hero-help-button,
  body.game-active .hero-home,
  body:has(#game-panel:not(.hidden)) .hero-home {
    min-height: 46px;
  }

  .brand-tile {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .hero-lede {
    display: none;
  }

  .lobby-shell {
    padding: 1.1rem !important;
    border-radius: 24px;
  }

  .lobby-header h2 {
    font-size: 2.25rem;
  }

  .lobby-fields {
    grid-template-columns: 1fr;
  }

  .lobby-name-field {
    grid-column: auto;
  }

  .daily-heist-card {
    gap: 0.75rem;
  }

  body.game-active .status-strip > div,
  body:has(#game-panel:not(.hidden)) .status-strip > div {
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  body.game-active .status-strip .label,
  body:has(#game-panel:not(.hidden)) .status-strip .label {
    color: #bbb7df;
  }

  body.game-active .status-strip strong,
  body:has(#game-panel:not(.hidden)) .status-strip strong {
    color: #fff;
  }

  .modal-backdrop {
    padding: max(0.5rem, env(safe-area-inset-top)) 0.5rem max(0.5rem, env(safe-area-inset-bottom));
  }

  .message-modal-card,
  .vote-modal-card,
  .end-modal-card,
  .how-to-play-modal-card,
  .switch-device-modal-card,
  .feedback-modal-card,
  .profile-modal-card {
    border-radius: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Lobby state and Daily Heist navigation */
.hero-public-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.hero-stats-button {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.66);
}

.mode-switch {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mode-slider {
  width: calc((100% - 0.7rem) / 4);
}

.mode-switch[data-mode="daily"] .mode-slider {
  transform: translateX(0);
}

.mode-switch[data-mode="create"] .mode-slider {
  transform: translateX(calc(100% + 0.35rem));
}

.mode-switch[data-mode="join"] .mode-slider {
  transform: translateX(calc(200% + 0.7rem));
}

.mode-switch[data-mode="practice"] .mode-slider {
  transform: translateX(calc(300% + 1.05rem));
}

.daily-heist-card {
  position: relative;
  overflow: hidden;
  min-height: 132px;
  padding: 1.25rem 1.35rem;
  background:
    radial-gradient(circle at 86% 15%, rgba(255, 255, 255, 0.84), transparent 22%),
    linear-gradient(135deg, #fff4ba 0%, #ffe49a 52%, #ffd7a6 100%);
  border-color: rgba(161, 111, 0, 0.18);
}

.daily-heist-card::after {
  content: "";
  position: absolute;
  width: 11rem;
  height: 11rem;
  right: -5rem;
  bottom: -6rem;
  border: 1px solid rgba(124, 82, 0, 0.16);
  border-radius: 50%;
}

.daily-heist-card h3 {
  color: #3e3417;
  font-size: 1.25rem;
}

.daily-heist-rules {
  display: inline-flex;
  margin: 0.75rem 0 0;
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(105, 74, 5, 0.14);
  border-radius: 999px;
  color: #6f5310;
  background: rgba(255, 255, 255, 0.48);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.015em;
}

.daily-heist-count {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  color: #fff;
  background: linear-gradient(145deg, #6e5cdc, #4e3dbc);
  box-shadow: inset 0 -5px 0 rgba(45, 32, 137, 0.3), 0 12px 24px rgba(73, 57, 185, 0.22);
  transform: rotate(3deg);
}

.daily-heist-count strong {
  margin-bottom: -0.35rem;
  font-size: 1.65rem;
  line-height: 1;
}

.daily-heist-count span {
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-callout {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(145deg, #35366d, #25264d);
}

.account-callout .eyebrow {
  color: #bdb7ff;
}

.account-callout strong {
  display: block;
  font-size: 1.05rem;
}

.account-callout #account-status {
  margin: 0;
  color: #d1d0e1;
  font-size: 0.86rem;
  line-height: 1.5;
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.account-actions button {
  min-height: 2.75rem;
}

.account-actions .secondary {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.account-open-button {
  color: #fff;
  border-color: rgba(19, 24, 42, 0.16);
  background: linear-gradient(135deg, #35366d, #25264d);
}

.account-open-button:hover {
  color: #fff;
  background: linear-gradient(135deg, #414382, #2d2f5d);
}

body.game-active .hero-public-actions,
body:has(#game-panel:not(.hidden)) .hero-public-actions {
  display: none;
}

@media (max-width: 900px) {
  .mode-option {
    padding-inline: 0.4rem;
  }
}

@media (max-width: 560px) {
  .hero-public-actions {
    gap: 0.35rem;
  }

  .hero-stats-button {
    display: inline-flex;
  }

  .hero-public-actions .hero-help-button {
    min-height: 44px;
    padding: 0.35rem 0.58rem;
    font-size: 0.78rem;
  }

  .account-open-button {
    max-width: 6.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-home {
    padding-right: 0.65rem;
    font-size: 0.88rem;
  }

  .mode-switch {
    gap: 0.2rem;
    padding: 0.25rem;
  }

  .mode-slider {
    top: 0.25rem;
    left: 0.25rem;
    width: calc((100% - 0.5rem) / 4);
    height: calc(100% - 0.5rem);
  }

  .mode-switch[data-mode="create"] .mode-slider {
    transform: translateX(calc(100% + 0.2rem));
  }

  .mode-switch[data-mode="join"] .mode-slider {
    transform: translateX(calc(200% + 0.4rem));
  }

  .mode-switch[data-mode="practice"] .mode-slider {
    transform: translateX(calc(300% + 0.6rem));
  }

  .mode-option {
    min-height: 50px;
    padding: 0.65rem 0.2rem;
    font-size: 0.78rem;
  }

  .daily-heist-card {
    min-height: 0;
    padding: 1rem;
  }

  .daily-heist-rules {
    display: flex;
    width: fit-content;
    max-width: calc(100% - 0.5rem);
    border-radius: 14px;
    line-height: 1.35;
  }

  .daily-heist-count {
    width: 68px;
    height: 68px;
    border-radius: 19px;
  }
}

/* Daily final chance and shareable result */
.daily-end-now {
  background: linear-gradient(135deg, #ff805f, #e95642);
  box-shadow: 0 12px 24px rgba(225, 83, 57, 0.22);
}

.final-panel:has(.daily-end-now:not(.hidden)) {
  border-color: rgba(255, 118, 87, 0.24);
  background:
    radial-gradient(circle at 100% 0, rgba(255, 209, 102, 0.3), transparent 34%),
    linear-gradient(135deg, #fff7e8, #fff);
}

.final-panel:has(.daily-end-now:not(.hidden)) .final-timer {
  display: inline-flex;
  margin-top: 0.8rem;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  color: #b6402e;
  background: #fff0e9;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.vote-modal-card:has(#vote-reject:not([disabled])) #vote-reject {
  box-shadow: none;
}

.daily-result-mode .end-modal-card {
  width: min(100%, 620px);
  padding: 1.25rem;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 209, 102, 0.24), transparent 32%),
    linear-gradient(155deg, #fff 0%, #f4f1ff 100%);
}

.daily-result-mode .end-modal-review-sticky {
  background: transparent;
}

.daily-result-mode .end-modal-copy {
  margin-bottom: 1rem;
}

.end-modal-daily {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  color: #fff;
  background:
    radial-gradient(circle at 95% 6%, rgba(255, 209, 102, 0.26), transparent 28%),
    radial-gradient(circle at 0 100%, rgba(53, 185, 159, 0.22), transparent 34%),
    linear-gradient(145deg, #35366d, #202142);
  box-shadow: 0 22px 40px rgba(37, 38, 77, 0.22);
}

.daily-result-topline {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  text-align: left;
}

.daily-result-topline .eyebrow {
  color: #bdb7ff;
}

.daily-result-topline > div > strong {
  font-size: 1.05rem;
}

.daily-result-topline > span {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  border-radius: 999px;
  color: #fff4ba;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.75rem;
  font-weight: 850;
}

.daily-result-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0 0.25rem;
}

.daily-result-score strong {
  font-size: clamp(4rem, 12vw, 6.3rem);
  font-weight: 950;
  line-height: 0.82;
  letter-spacing: -0.08em;
  text-shadow: 0 10px 25px rgba(10, 10, 35, 0.3);
}

.daily-result-score span {
  color: #bdbbd0;
  font-size: 0.75rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.daily-result-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.daily-result-grid article {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.75rem 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
}

.daily-result-grid span,
.daily-result-steal > span {
  color: #aaa9c1;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.daily-result-grid strong {
  overflow: hidden;
  color: #fff;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-result-steal {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border-radius: 16px;
  color: #342b12;
  background: linear-gradient(135deg, #fff4ba, #ffd88c);
}

.daily-result-steal > span {
  color: #806018;
}

.daily-result-steal strong {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.daily-result-steal b {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 11px;
  color: #fff;
  background: #6757d9;
}

.daily-result-mode .end-share-card {
  overflow: hidden;
  padding: 1.05rem;
  border: 0;
  color: #fff;
  background:
    radial-gradient(circle at 100% 0, rgba(255, 209, 102, 0.28), transparent 31%),
    linear-gradient(145deg, #6c5bdc, #4131a8);
  box-shadow: 0 18px 34px rgba(73, 57, 185, 0.22);
}

.daily-share-brand,
.daily-share-footer {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.daily-share-brand > span {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  color: #4939b9;
  background: #fff;
  font-weight: 950;
}

.daily-share-brand > strong {
  letter-spacing: 0.08em;
}

.daily-share-brand > b {
  margin-left: auto;
  color: #d7d2ff;
  font-size: 0.72rem;
}

.daily-share-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.daily-share-score strong {
  font-size: clamp(3.7rem, 11vw, 5.4rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.daily-share-score span {
  color: #d7d2ff;
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.13em;
}

.daily-share-challenge {
  margin: 0.35rem 0 0.9rem;
  color: #f2efff;
  text-align: center;
}

.daily-share-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.daily-share-stats span {
  display: grid;
  gap: 0.2rem;
  padding: 0.65rem 0.4rem;
  border-radius: 14px;
  color: #d7d2ff;
  background: rgba(255, 255, 255, 0.1);
  font-size: 0.7rem;
  text-align: center;
}

.daily-share-stats b {
  overflow: hidden;
  color: #fff;
  font-size: 0.95rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-share-footer {
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 0.74rem;
}

.daily-result-mode .share-card-link {
  margin: 0.75rem 0 0;
  padding: 0.6rem;
  border-radius: 12px;
  color: #332779;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  word-break: break-all;
}

@media (max-width: 560px) {
  .daily-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-result-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .daily-result-topline > span {
    width: fit-content;
  }
}

/* Late to Steal brand system --------------------------------------------- */

:root {
  --bg: #f7f1e8;
  --bg-accent: #efe1d4;
  --panel: rgba(255, 252, 247, 0.93);
  --panel-strong: #fffdfa;
  --text: #17192b;
  --muted: #696979;
  --line: rgba(27, 30, 51, 0.13);
  --brand: #e8563f;
  --brand-dark: #a82e27;
  --brand-soft: #fff0e8;
  --danger: #c84654;
  --danger-dark: #9f2e3c;
  --tile: #fff9eb;
  --tile-edge: #decfaf;
  --shadow: 0 24px 70px rgba(29, 27, 47, 0.15);
  --coral: #e8563f;
  --mint: #18a999;
  --sun: #f3ba4b;
  --navy: #13182a;
  --midnight: #0d1121;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at 5% 0%, rgba(243, 186, 75, 0.24), transparent 22rem),
    radial-gradient(circle at 94% 7%, rgba(232, 86, 63, 0.18), transparent 27rem),
    radial-gradient(circle at 72% 92%, rgba(24, 169, 153, 0.1), transparent 28rem),
    linear-gradient(135deg, #fffaf2 0%, #f8eee4 52%, #f0ece6 100%);
}

body::before {
  opacity: 0.13;
  background-image: radial-gradient(rgba(23, 32, 51, 0.3) 0.7px, transparent 0.7px);
  background-size: 20px 20px;
}

button {
  background: linear-gradient(135deg, #ee654d, #c83c30);
  box-shadow: 0 9px 20px rgba(176, 49, 39, 0.2);
}

button:hover {
  background: linear-gradient(135deg, #dc4c38, #a82e27);
  box-shadow: 0 13px 28px rgba(168, 46, 39, 0.25);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-color: rgba(232, 86, 63, 0.34);
}

button.secondary {
  color: var(--brand-dark);
  background: var(--brand-soft);
}

.hero {
  margin-bottom: 1.1rem;
}

.hero-copy {
  gap: 0.5rem;
}

.hero-heading-row {
  align-items: center;
}

.hero-home,
.hero-help-button,
body.game-active .hero-home,
body:has(#game-panel:not(.hidden)) .hero-home {
  color: var(--navy);
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 13px 34px rgba(39, 42, 82, 0.11);
}

.hero-home {
  gap: 0.7rem;
  padding: 0.42rem 1.05rem 0.42rem 0.42rem;
}

.brand-mark {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
}

.brand-tile {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 38px;
  border-radius: 11px;
  color: #fff9eb;
  background: linear-gradient(145deg, #232a44, #101426);
  box-shadow: inset 0 -4px 0 rgba(3, 5, 14, 0.34), 0 7px 14px rgba(19, 24, 42, 0.25);
  font-size: 1.02rem;
  font-weight: 950;
}

.brand-clock {
  position: absolute;
  z-index: 2;
  width: 17px;
  height: 17px;
  right: -4px;
  top: -4px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 3px 8px rgba(168, 46, 39, 0.28);
}

.brand-clock::before,
.brand-clock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1.8px;
  border-radius: 2px;
  background: #fff9eb;
  transform-origin: 50% 100%;
}

.brand-clock::before {
  height: 5px;
  transform: translate(-50%, -100%) rotate(0deg);
}

.brand-clock::after {
  height: 4px;
  transform: translate(-50%, -100%) rotate(118deg);
}

.brand-lockup {
  display: grid;
  gap: 0.02rem;
  text-align: left;
}

.brand-word {
  color: var(--navy);
  font-size: clamp(1rem, 2vw, 1.18rem);
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 1;
}

.brand-word sup {
  position: relative;
  top: -0.28em;
  margin-left: 0.12em;
  color: var(--brand-dark);
  font-size: 0.42em;
  letter-spacing: 0;
}

.brand-domain {
  color: #8b6a5f;
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero-lede {
  margin: 0 0 0 0.3rem;
  color: #675f62;
  font-size: 0.92rem;
  font-weight: 680;
  letter-spacing: 0.005em;
}

.hero-help-button {
  color: var(--brand-dark);
}

.panel,
.lobby-shell {
  border-color: rgba(255, 255, 255, 0.96);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
}

.mode-switch {
  background: #eee7e1;
  border-color: rgba(35, 39, 72, 0.09);
}

.mode-slider,
.lobby-submit {
  background: linear-gradient(135deg, #ee654d, #c83c30);
  box-shadow: 0 12px 25px rgba(176, 49, 39, 0.24);
}

.daily-heist-card {
  background:
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.72), transparent 24%),
    linear-gradient(135deg, #fff2bd 0%, #ffe09b 58%, #ffd0ae 100%);
}

.daily-heist-count {
  background: linear-gradient(145deg, #242b47, #101426);
  box-shadow: inset 0 -5px 0 rgba(3, 5, 14, 0.32), 0 12px 24px rgba(19, 24, 42, 0.23);
}

.lobby-showcase,
.status-strip,
.account-callout {
  background:
    radial-gradient(circle at 100% 0, rgba(243, 186, 75, 0.2), transparent 34%),
    radial-gradient(circle at 0 100%, rgba(232, 86, 63, 0.21), transparent 36%),
    linear-gradient(155deg, #252b45 0%, #151a2d 54%, #0d1121 100%);
}

.showcase-kicker,
.account-callout .eyebrow {
  color: #f3ba4b;
}

.showcase-move b {
  color: #ff7a63;
}

.showcase-move i {
  color: var(--sun);
}

.play-submit-button,
.tutorial-action {
  background: linear-gradient(135deg, #7464dd, #5544c4);
  box-shadow: 0 12px 24px rgba(73, 57, 185, 0.22);
}

.play-submit-button:hover,
.tutorial-action:hover {
  background: linear-gradient(135deg, #6555ce, #4737ad);
}

.flip-action-button {
  background: linear-gradient(135deg, #ff7a59, #ed583d);
  box-shadow: 0 14px 28px rgba(237, 88, 61, 0.23);
}

.lobby-submit {
  background: linear-gradient(135deg, #1aaf98, #087d70);
  box-shadow: 0 12px 25px rgba(8, 125, 112, 0.24);
}

.lobby-submit:hover {
  background: linear-gradient(135deg, #159c88, #066b60);
}

.middle-panel {
  background:
    radial-gradient(circle at 92% 8%, rgba(26, 174, 150, 0.09), transparent 31%),
    #fff;
}

.play-panel,
.player-card {
  background: linear-gradient(155deg, #fffdfa, #faf2ea);
}

.word-pill {
  background: #fff0e8;
}

.pill-action {
  color: #bd4a34;
  background: #fff0eb;
}

.how-to-play-modal-card {
  width: min(100%, 980px);
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
  border-radius: 34px;
  background:
    radial-gradient(circle at 100% 0, rgba(232, 86, 63, 0.13), transparent 30%),
    radial-gradient(circle at 0 100%, rgba(24, 169, 153, 0.1), transparent 34%),
    linear-gradient(160deg, #fffdfa 0%, #fff6ef 58%, #f5faf7 100%);
}

.how-to-play-brand {
  display: inline-flex;
  margin-bottom: 0.55rem;
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.15em;
}

.how-to-play-header {
  margin-bottom: 1rem;
}

.how-to-play-header h3 {
  max-width: 46rem;
  color: var(--navy);
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

.how-to-play-intro {
  max-width: 48rem;
  color: #566077;
}

.how-to-play-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.how-to-play-steps article {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid rgba(39, 44, 80, 0.09);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 9px 24px rgba(40, 43, 83, 0.05);
}

.how-to-play-steps article > span {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, #252b45, #101426);
  font-size: 0.78rem;
  font-weight: 900;
  box-shadow: inset 0 -3px 0 rgba(3, 5, 14, 0.3);
}

.how-to-play-steps article:nth-child(2) > span {
  background: linear-gradient(145deg, #25bba3, #128b78);
}

.how-to-play-steps article:nth-child(3) > span {
  background: linear-gradient(145deg, #ee654d, #c83c30);
}

.how-to-play-steps strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--navy);
  font-size: 1rem;
}

.how-to-play-steps p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.42;
}

.how-to-play-hero-panel {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: stretch;
}

.how-to-play-overview {
  background:
    radial-gradient(circle at 92% 8%, rgba(26, 174, 150, 0.1), transparent 28%),
    rgba(255, 255, 255, 0.82);
}

.demo-status-card {
  border-left: 4px solid var(--mint);
  background: #fff;
}

.how-to-play-rules-panel {
  background: rgba(255, 244, 236, 0.76);
}

.final-panel,
.vote-panel {
  border-color: rgba(232, 86, 63, 0.14);
  background: linear-gradient(135deg, #fff0e8, #fffdfa);
}

.message-modal-card,
.vote-modal-card,
.end-modal-card,
.how-to-play-modal-card,
.switch-device-modal-card,
.feedback-modal-card,
.profile-modal-card {
  background:
    radial-gradient(circle at 100% 0, rgba(232, 86, 63, 0.12), transparent 32%),
    linear-gradient(160deg, #fffdfa 0%, #fff5ed 100%);
  box-shadow: 0 34px 90px rgba(13, 17, 33, 0.34);
}

.how-to-play-x {
  background: #f6e8df;
}

.how-to-play-x:hover {
  background: #fbd9cc;
}

.how-to-play-rule-list {
  padding-left: 0;
  list-style: none;
}

.how-to-play-rule-list li {
  position: relative;
  padding-left: 1.35rem;
  color: #555f74;
  font-size: 0.9rem;
}

.how-to-play-rule-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--mint);
  font-weight: 950;
}

.how-to-play-rule-list strong {
  color: var(--navy);
}

.how-to-play-example-line {
  border-color: rgba(41, 47, 84, 0.09);
  background: rgba(255, 240, 235, 0.7);
}

.how-to-play-example-line-good {
  border-color: rgba(26, 174, 150, 0.17);
  background: rgba(232, 248, 244, 0.9);
}

.how-to-play-example-line-good .how-to-play-example-label {
  color: #087b69;
  background: rgba(26, 174, 150, 0.13);
}

.overview-middle {
  border-color: rgba(26, 174, 150, 0.27);
  background: rgba(240, 250, 247, 0.9);
}

.mini-tile-fresh {
  border-color: rgba(26, 174, 150, 0.38);
  background: linear-gradient(180deg, #d7f4ed, #f2fbf8);
  box-shadow: inset 0 -3px 0 rgba(26, 174, 150, 0.18), 0 0 0 4px rgba(26, 174, 150, 0.08);
}

.how-to-play-footer {
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(39, 44, 80, 0.09);
}

.how-to-play-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.how-to-play-footer p strong {
  color: var(--navy);
}

.how-to-play-done {
  flex: 0 0 auto;
  color: #fff !important;
  background: linear-gradient(135deg, #ee654d, #c83c30) !important;
  box-shadow: 0 10px 22px rgba(176, 49, 39, 0.2) !important;
}

.daily-share-brand > span,
.daily-result-steal b {
  color: var(--brand-dark);
}

.daily-result-steal b {
  color: #fff;
  background: var(--brand);
}

.daily-result-mode .end-share-card {
  background:
    radial-gradient(circle at 100% 0, rgba(243, 186, 75, 0.28), transparent 31%),
    linear-gradient(145deg, #252b45, #0d1121);
  box-shadow: 0 18px 34px rgba(13, 17, 33, 0.25);
}

.daily-share-brand > b {
  color: #f4cf7c;
}

@media (max-width: 760px) {
  .how-to-play-steps,
  .how-to-play-hero-panel {
    grid-template-columns: 1fr;
  }

  .how-to-play-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .how-to-play-done {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .hero-heading-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .hero-home {
    gap: 0.45rem;
    min-width: 0;
    padding: 0.35rem 0.6rem 0.35rem 0.35rem;
  }

  .brand-mark {
    width: 35px;
    height: 35px;
  }

  .brand-tile {
    width: 32px;
    height: 34px;
  }

  .brand-word {
    overflow: hidden;
    font-size: 0.86rem;
    text-overflow: ellipsis;
  }

  .brand-domain {
    display: none;
  }

  .hero-lede {
    display: block;
    margin-left: 0.15rem;
    font-size: 0.76rem;
  }

  body.game-active .brand-word,
  body:has(#game-panel:not(.hidden)) .brand-word {
    display: none;
  }

  .how-to-play-modal-card {
    padding: 1rem;
  }

  .how-to-play-header h3 {
    font-size: 2rem;
  }

  .how-to-play-steps article {
    padding: 0.75rem;
  }
}

/* Public stats and leaderboards */
.profile-modal-card {
  width: min(100%, 780px);
}

.leaderboards-section {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.35rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(19, 24, 42, 0.12);
}

.leaderboards-heading,
.leaderboard-board-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.leaderboards-heading h3,
.leaderboard-board-title h4 {
  margin: 0.08rem 0 0;
}

.leaderboards-live-badge {
  padding: 0.38rem 0.62rem;
  border-radius: 999px;
  color: #78372d;
  background: #ffe2d8;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.leaderboard-windows {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid rgba(19, 24, 42, 0.1);
  border-radius: 16px;
  background: rgba(19, 24, 42, 0.05);
}

.leaderboard-window {
  min-height: 40px;
  padding: 0.55rem 0.4rem;
  border: 0;
  border-radius: 12px;
  color: #596076;
  background: transparent;
  box-shadow: none;
  font-size: 0.76rem;
  font-weight: 800;
}

.leaderboard-window:hover,
.leaderboard-window.active {
  color: #fff;
  background: linear-gradient(135deg, #e8563f, #bd3b30);
  box-shadow: 0 8px 18px rgba(189, 59, 48, 0.2);
}

.leaderboards-status {
  margin: -0.15rem 0 0;
}

.leaderboards-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}

.leaderboards-summary > div {
  display: grid;
  gap: 0.15rem;
  padding: 0.72rem;
  border: 1px solid rgba(19, 24, 42, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.leaderboards-summary span {
  color: #697087;
  font-size: 0.69rem;
  font-weight: 750;
  text-transform: uppercase;
}

.leaderboards-summary strong {
  color: var(--navy);
  font-size: 1.18rem;
}

.leaderboards-records {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.6rem;
}

.leaderboard-record-card {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(232, 86, 63, 0.15);
  border-radius: 16px;
  background: linear-gradient(145deg, #fff8f2, #fff);
}

.leaderboard-record-card strong,
.leaderboard-record-card span {
  display: block;
}

.leaderboard-record-card strong {
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: 0.98rem;
}

.leaderboard-record-card span {
  margin-top: 0.25rem;
  color: #697087;
  font-size: 0.72rem;
  line-height: 1.35;
}

.leaderboard-board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.leaderboard-board {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid rgba(19, 24, 42, 0.09);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
}

.leaderboard-words-board {
  grid-column: 1 / -1;
}

.leaderboard-board-title {
  justify-content: flex-start;
  margin-bottom: 0.55rem;
}

.leaderboard-board-title > span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: #fff0d4;
  font-size: 1.05rem;
}

.leaderboard-list {
  display: grid;
  gap: 0.32rem;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  min-height: 48px;
  padding: 0.5rem 0.58rem;
  border-radius: 12px;
  background: rgba(19, 24, 42, 0.035);
}

.leaderboard-row.is-viewer {
  background: #fff0e8;
  box-shadow: inset 3px 0 #e8563f;
}

.leaderboard-rank {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  color: #5d6478;
  background: #fff;
  font-size: 0.72rem;
  font-weight: 900;
}

.leaderboard-name {
  min-width: 0;
}

.leaderboard-name strong,
.leaderboard-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-name strong {
  color: var(--navy);
  font-size: 0.82rem;
}

.leaderboard-name span {
  margin-top: 0.1rem;
  color: #747b8e;
  font-size: 0.68rem;
}

.leaderboard-value {
  color: #bd3b30;
  font-size: 0.76rem;
  text-align: right;
  white-space: nowrap;
}

.leaderboard-empty {
  margin: 0;
  padding: 0.7rem;
  color: #747b8e;
  font-size: 0.78rem;
  text-align: center;
}

@media (max-width: 640px) {
  .leaderboards-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .leaderboards-records,
  .leaderboard-board-grid {
    grid-template-columns: 1fr;
  }

  .leaderboard-words-board {
    grid-column: auto;
  }

  .leaderboard-window {
    padding-inline: 0.2rem;
    font-size: 0.68rem;
  }
}

/* Display utilities must win over component layout declarations. */
.hidden,
[hidden] {
  display: none !important;
}
