@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Fraunces:opsz,wght@9..144,700;9..144,800&display=swap');

:root {
  --ink: #eef8f4;
  --muted: #91aaa6;
  --deep: #041316;
  --navy: #071b20;
  --panel: rgba(10, 36, 41, 0.86);
  --panel-solid: #0a2429;
  --line: rgba(176, 222, 212, 0.15);
  --mint: #43e6ad;
  --mint-deep: #0b9d74;
  --coral: #ff6b5f;
  --gold: #ffc857;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -5%, rgba(21, 122, 99, 0.22), transparent 34rem),
    radial-gradient(circle at 100% 50%, rgba(255, 107, 95, 0.08), transparent 34rem),
    var(--deep);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.12;
  pointer-events: none;
}

.ambient-one {
  left: -9rem;
  top: 28%;
  background: var(--mint);
}

.ambient-two {
  right: -10rem;
  bottom: -3rem;
  background: var(--coral);
}

.hidden {
  display: none !important;
}

.site-header {
  width: min(1380px, calc(100% - 40px));
  height: 88px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 47px;
  height: 45px;
}

.mini-die {
  position: absolute;
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  border-radius: 9px;
  font-size: 8px;
  letter-spacing: 3px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.die-a {
  top: 0;
  left: 0;
  color: #083125;
  background: var(--mint);
  transform: rotate(-9deg);
}

.die-b {
  right: 0;
  bottom: 0;
  color: #461712;
  background: var(--coral);
  transform: rotate(9deg);
}

.brand-name {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-weight: 800;
  font-size: 27px;
  line-height: 0.9;
  letter-spacing: 0.06em;
}

.brand-kicker,
.eyebrow,
.step-label {
  display: block;
  color: var(--mint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.brand-kicker {
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.connection-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.connection-pill i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 10px currentColor;
}

.connection-pill.connected i {
  background: var(--mint);
}

.connection-pill.disconnected i {
  background: var(--coral);
}

.text-button,
.icon-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: #b9ceca;
  cursor: pointer;
  font-size: 13px;
}

.text-button:hover,
.icon-button:hover {
  color: var(--ink);
}

.icon-button {
  min-width: 74px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.app-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0 80px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: linear-gradient(150deg, rgba(14, 46, 51, 0.92), rgba(7, 27, 32, 0.94));
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.lobby-view {
  min-height: calc(100vh - 216px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(420px, 0.75fr);
  align-items: center;
  gap: clamp(40px, 8vw, 120px);
}

.lobby-copy h1 {
  max-width: 720px;
  margin: 18px 0 22px;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(52px, 7vw, 94px);
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.lobby-copy h1 em {
  color: var(--mint);
  font-style: normal;
}

.hero-copy {
  max-width: 590px;
  margin: 0;
  color: #a8bfba;
  font-size: clamp(17px, 1.8vw, 21px);
  line-height: 1.6;
}

.rule-strip {
  max-width: 650px;
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.rule-strip div {
  padding: 20px 14px 20px 0;
}

.rule-strip div + div {
  padding-left: 18px;
  border-left: 1px solid var(--line);
}

.rule-strip strong,
.rule-strip span {
  display: block;
}

.rule-strip strong {
  color: var(--gold);
  font-family: "Fraunces", Georgia, serif;
  font-size: 25px;
}

.rule-strip span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.lobby-card {
  padding: clamp(24px, 4vw, 38px);
}

.shared-room-notice {
  margin: -10px 0 23px;
  padding: 13px 15px;
  border: 1px solid rgba(67, 230, 173, 0.25);
  border-radius: 12px;
  background: rgba(67, 230, 173, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #b8d6cf;
  font-size: 13px;
}

.shared-room-notice strong {
  color: var(--mint);
  font-size: 13px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  color: #b6cbc6;
  font-size: 12px;
  font-weight: 600;
}

.field-help {
  color: #78958f;
  font-size: 10px;
  line-height: 1.45;
}

.field-help strong {
  color: var(--gold);
}

input,
select {
  width: 100%;
  height: 50px;
  padding: 0 15px;
  border: 1px solid rgba(184, 218, 211, 0.22);
  border-radius: 12px;
  outline: none;
  background: rgba(3, 18, 21, 0.7);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s;
}

input::placeholder {
  color: #57736e;
}

input:focus,
select:focus {
  border-color: var(--mint);
  box-shadow: 0 0 0 3px rgba(67, 230, 173, 0.11);
}

.join-block {
  margin-top: 31px;
}

.section-heading {
  margin-bottom: 13px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 15px;
}

.section-heading h2,
.players-header h2,
.modal-card h2 {
  margin: 4px 0 0;
  font-family: "Fraunces", Georgia, serif;
  font-size: 24px;
}

.no-account {
  color: var(--muted);
  font-size: 10px;
}

.room-browser {
  max-height: 270px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  scrollbar-color: #28544d transparent;
}

.no-rooms {
  min-height: 92px;
  padding: 18px;
  display: grid;
  place-content: center;
  gap: 5px;
  border: 1px dashed rgba(184, 218, 211, 0.18);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.no-rooms strong {
  color: #bdd2cd;
  font-size: 13px;
}

.room-option {
  width: 100%;
  min-height: 68px;
  padding: 12px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(184, 218, 211, 0.16);
  border-radius: 13px;
  background: rgba(3, 18, 21, 0.5);
  color: var(--ink);
  text-align: left;
}

.room-option:hover {
  border-color: rgba(67, 230, 173, 0.5);
  background: rgba(20, 62, 59, 0.55);
}

.room-option.invited {
  border-color: rgba(67, 230, 173, 0.5);
  box-shadow: inset 3px 0 var(--mint);
}

.room-option-name,
.room-option-meta {
  display: block;
}

.room-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  font-size: 13px;
}

.room-option-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.room-option-action {
  color: var(--mint);
  font-size: 11px;
  font-weight: 700;
}

.button {
  min-height: 48px;
  padding: 0 19px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, opacity 0.15s;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button.primary {
  background: var(--mint);
  color: #06241d;
  box-shadow: 0 12px 25px rgba(31, 198, 145, 0.18);
}

.button.primary:hover:not(:disabled) {
  background: #66f0c0;
  box-shadow: 0 14px 30px rgba(31, 198, 145, 0.28);
}

.button.secondary {
  border-color: var(--line);
  background: rgba(25, 60, 64, 0.5);
  color: #d7e8e4;
}

.button.secondary:hover:not(:disabled) {
  background: rgba(37, 79, 81, 0.7);
}

.button.compact {
  min-height: 38px;
  padding: 0 14px;
  font-size: 11px;
}

.button.full-width {
  width: 100%;
}

.divider {
  height: 1px;
  margin: 28px 0 13px;
  position: relative;
  background: var(--line);
  text-align: center;
}

.divider span {
  position: relative;
  top: -9px;
  padding: 0 10px;
  background: var(--panel-solid);
  color: #698681;
  font-size: 10px;
}

.host-options summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px;
  color: #c2d7d2;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
}

.host-options summary::-webkit-details-marker {
  display: none;
}

.host-options[open] summary span {
  transform: rotate(45deg);
}

.host-options-body {
  padding-top: 14px;
}

.host-room-note {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.settings-grid {
  margin-bottom: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-grid select {
  height: 45px;
  font-size: 12px;
}

.form-error {
  min-height: 20px;
  margin: 14px 0 0;
  color: #ff938a;
  font-size: 12px;
  line-height: 1.45;
}

.fair-note {
  margin: 8px 0 0;
  color: #6e8e88;
  font-size: 10px;
  text-align: center;
}

.fair-note span {
  color: var(--gold);
}

/* Game */

.game-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.room-bar {
  min-height: 78px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 25px;
}

.room-identity .eyebrow {
  margin-bottom: 2px;
}

.room-title {
  color: var(--ink);
  font-size: 19px;
  font-weight: 800;
}

.room-title span,
.room-title small {
  display: block;
}

.room-title small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 500;
}

.room-meta,
.room-share {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-count {
  color: #aec5c0;
  font-size: 12px;
}

.status-chip,
.phase-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.status-chip.waiting {
  border-color: rgba(255, 200, 87, 0.3);
  background: rgba(255, 200, 87, 0.08);
  color: var(--gold);
}

.status-chip.playing {
  border-color: rgba(67, 230, 173, 0.3);
  background: rgba(67, 230, 173, 0.08);
  color: var(--mint);
}

.status-chip.complete {
  border-color: rgba(255, 107, 95, 0.3);
  background: rgba(255, 107, 95, 0.08);
  color: #ff9a91;
}

.room-share {
  justify-self: end;
}

.announcement {
  padding: 12px 18px;
  border: 1px solid rgba(255, 200, 87, 0.25);
  border-radius: 12px;
  background: rgba(255, 200, 87, 0.08);
  color: #ffe2a3;
  text-align: center;
  font-size: 13px;
}

.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(340px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.play-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pot-panel {
  min-height: 500px;
  padding: clamp(22px, 4vw, 38px);
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.pot-panel::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  left: calc(50% - 180px);
  top: 65px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(67, 230, 173, 0.13), transparent 68%);
  pointer-events: none;
}

.pot-panel.danger::before {
  background: radial-gradient(circle, rgba(255, 107, 95, 0.14), transparent 68%);
}

.pot-panel.bust {
  border-color: rgba(255, 107, 95, 0.65);
  animation: bust-shake 0.45s ease 2;
}

.pot-panel.double {
  border-color: rgba(255, 200, 87, 0.55);
  box-shadow: 0 0 50px rgba(255, 200, 87, 0.11), var(--shadow);
}

.pot-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.pot-topline .eyebrow {
  margin-bottom: 9px;
}

.phase-pill.safe {
  border-color: rgba(67, 230, 173, 0.3);
  background: rgba(67, 230, 173, 0.08);
  color: var(--mint);
}

.phase-pill.danger {
  border-color: rgba(255, 107, 95, 0.34);
  background: rgba(255, 107, 95, 0.1);
  color: #ff938a;
}

.round-display {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.round-display strong {
  margin-left: 8px;
  color: var(--ink);
  font-size: 16px;
}

.round-display span {
  margin-left: 4px;
}

.pot-amount {
  position: relative;
  z-index: 1;
  margin: 18px 0 15px;
  text-align: center;
}

.pot-amount span {
  display: block;
  font-family: "Fraunces", Georgia, serif;
  font-size: clamp(76px, 12vw, 132px);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.pot-amount small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.roll-stage {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}

.dice-pair {
  perspective: 520px;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex: 0 0 auto;
}

.die {
  --die-light: #fffef8;
  --die-mid: #eeeadd;
  --die-edge: #aaa99f;
  --die-pip: #151a1a;
  position: relative;
  isolation: isolate;
  width: 68px;
  height: 68px;
  padding: 10px;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 14px;
  background:
    radial-gradient(circle at 28% 19%, rgba(255, 255, 255, 0.98), transparent 28%),
    linear-gradient(145deg, var(--die-light) 0 45%, var(--die-mid) 100%);
  box-shadow:
    inset 2px 2px 3px rgba(255, 255, 255, 0.95),
    inset -4px -5px 7px rgba(78, 80, 75, 0.19),
    0 3px 0 var(--die-edge),
    0 5px 0 color-mix(in srgb, var(--die-edge), #000 18%),
    0 14px 22px rgba(0, 0, 0, 0.38);
  transform: rotate(-4deg) rotateX(4deg);
  transform-style: preserve-3d;
  transition: transform 180ms ease, filter 180ms ease;
}

.die.coral {
  --die-light: #e8483f;
  --die-mid: #a91520;
  --die-edge: #74111a;
  --die-pip: #fff9df;
  border-color: rgba(255, 151, 145, 0.55);
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.35), transparent 25%),
    linear-gradient(145deg, var(--die-light) 0 42%, var(--die-mid) 100%);
  box-shadow:
    inset 2px 2px 3px rgba(255, 196, 190, 0.35),
    inset -4px -5px 8px rgba(59, 0, 8, 0.35),
    0 3px 0 var(--die-edge),
    0 5px 0 color-mix(in srgb, var(--die-edge), #000 22%),
    0 14px 22px rgba(0, 0, 0, 0.4);
  transform: rotate(5deg) rotateX(4deg);
}

.die::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  pointer-events: none;
}

.die i {
  display: block;
  visibility: hidden;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 38%, color-mix(in srgb, var(--die-pip), #fff 18%) 0 8%, var(--die-pip) 48%, color-mix(in srgb, var(--die-pip), #000 42%) 100%);
  box-shadow:
    inset 1.5px 1.5px 2px rgba(0, 0, 0, 0.72),
    inset -1px -1px 1px rgba(255, 255, 255, 0.18),
    0 1px 1px rgba(255, 255, 255, 0.52);
  transform: translateZ(2px);
}

.die[data-value="1"] i:nth-child(5),
.die[data-value="2"] i:nth-child(1),
.die[data-value="2"] i:nth-child(9),
.die[data-value="3"] i:nth-child(1),
.die[data-value="3"] i:nth-child(5),
.die[data-value="3"] i:nth-child(9),
.die[data-value="4"] i:nth-child(1),
.die[data-value="4"] i:nth-child(3),
.die[data-value="4"] i:nth-child(7),
.die[data-value="4"] i:nth-child(9),
.die[data-value="5"] i:nth-child(1),
.die[data-value="5"] i:nth-child(3),
.die[data-value="5"] i:nth-child(5),
.die[data-value="5"] i:nth-child(7),
.die[data-value="5"] i:nth-child(9),
.die[data-value="6"] i:nth-child(1),
.die[data-value="6"] i:nth-child(3),
.die[data-value="6"] i:nth-child(4),
.die[data-value="6"] i:nth-child(6),
.die[data-value="6"] i:nth-child(7),
.die[data-value="6"] i:nth-child(9) {
  visibility: visible;
}

.pot-panel.rolling .die {
  filter: brightness(1.06);
  animation: die-tumble 0.48s cubic-bezier(0.36, 0.08, 0.58, 1) infinite;
}

.pot-panel.rolling .die:nth-child(2) {
  animation-delay: -0.23s;
  animation-direction: reverse;
}

.roll-copy {
  max-width: 390px;
  min-width: 0;
}

.roller-label {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.roll-summary {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.next-roll {
  position: absolute;
  right: 38px;
  bottom: 28px;
  left: 38px;
}

.next-roll-copy {
  margin-bottom: 7px;
  display: flex;
  justify-content: space-between;
  color: #78928d;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.timer-track {
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.timer-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--mint);
  transition: width 0.2s linear;
}

.danger .timer-track span {
  background: var(--coral);
}

.bank-zone {
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1fr minmax(210px, 0.46fr);
  align-items: center;
  gap: 20px;
}

.bank-guidance strong {
  display: block;
  margin-top: 5px;
  font-family: "Fraunces", Georgia, serif;
  font-size: 19px;
}

.bank-button {
  min-height: 72px;
  background: linear-gradient(120deg, var(--mint), #2bc996);
  color: #06231c;
  box-shadow: 0 14px 32px rgba(34, 205, 151, 0.22);
}

.bank-button:not(:disabled) {
  animation: bank-breathe 2.2s ease-in-out infinite;
}

.bank-button span,
.bank-button small {
  display: block;
}

.bank-button span {
  font-size: 19px;
  letter-spacing: 0.04em;
}

.bank-button small {
  margin-top: 3px;
  font-size: 9px;
  opacity: 0.65;
}

.host-controls {
  min-height: 70px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
}

.host-controls > div:first-child span,
.host-controls > div:first-child small {
  display: block;
}

.host-controls > div:first-child span {
  font-size: 12px;
  font-weight: 700;
}

.host-controls > div:first-child small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.control-buttons {
  display: flex;
  align-items: center;
  gap: 9px;
}

.danger-outline {
  min-height: 38px;
  border-color: rgba(255, 107, 95, 0.35);
  background: transparent;
  color: #ff978e;
  font-size: 11px;
}

.players-panel {
  max-height: calc(100vh - 168px);
  min-height: 600px;
  padding: 22px;
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
}

.players-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
}

.players-header h2 {
  font-size: 26px;
}

.legend {
  color: var(--muted);
  font-size: 9px;
}

.legend i {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: var(--mint);
}

.score-head {
  padding: 20px 9px 8px;
  display: grid;
  grid-template-columns: 1fr 68px 62px;
  color: #63817b;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.score-head span:nth-child(2),
.score-head span:nth-child(3) {
  text-align: right;
}

.players-list {
  min-height: 0;
  overflow-y: auto;
  scrollbar-color: #28544d transparent;
}

.player-row {
  min-height: 46px;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 62px;
  align-items: center;
  border-top: 1px solid rgba(180, 220, 212, 0.09);
  font-size: 12px;
}

.player-row.self {
  border-radius: 9px;
  background: rgba(67, 230, 173, 0.055);
}

.player-row.away {
  opacity: 0.42;
}

.player-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.player-name small {
  margin-left: 5px;
  color: var(--gold);
  font-size: 8px;
  font-weight: 700;
}

.player-score {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.player-status {
  justify-self: end;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.player-status.active {
  color: var(--mint);
}

.player-status.banked {
  color: var(--gold);
}

.player-status.away {
  color: var(--muted);
}

/* Modals and feedback */

.modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  padding: 24px;
  display: grid;
  place-items: center;
  overflow-y: auto;
  background: rgba(1, 11, 13, 0.8);
  backdrop-filter: blur(10px);
}

.modal-card {
  width: min(620px, 100%);
  padding: clamp(26px, 5vw, 42px);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 28px;
}

.qr-card {
  max-width: 420px;
  text-align: center;
}

.qr-card h2 {
  margin-bottom: 20px;
}

.qr-card h2 span {
  color: var(--mint);
  letter-spacing: 0.1em;
}

.qr-image {
  width: min(270px, 100%);
  padding: 10px;
  border-radius: 18px;
  background: #fff;
}

.qr-card p:not(.eyebrow) {
  margin: 15px 0;
  color: var(--muted);
  font-size: 12px;
}

.rules-intro {
  color: #aac2bc;
  line-height: 1.6;
}

.rules-steps {
  margin: 25px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  list-style: none;
}

.rules-steps li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 13px;
}

.rules-steps li > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(67, 230, 173, 0.3);
  border-radius: 50%;
  color: var(--mint);
  font-size: 11px;
  font-weight: 800;
}

.rules-steps strong {
  font-size: 13px;
}

.rules-steps p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.odds-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.odds-row div {
  padding: 14px;
  text-align: center;
}

.odds-row div + div {
  border-left: 1px solid var(--line);
}

.odds-row strong,
.odds-row span {
  display: block;
}

.odds-row strong {
  color: var(--gold);
  font-family: "Fraunces", Georgia, serif;
  font-size: 18px;
}

.odds-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.game-over-card {
  max-width: 470px;
  text-align: center;
}

.trophy {
  width: 65px;
  height: 65px;
  margin: 15px auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 200, 87, 0.12);
  color: var(--gold);
  font-size: 28px;
}

.winner-text {
  color: #b7cec8;
}

.final-scores {
  max-height: 260px;
  margin: 20px 0;
  overflow-y: auto;
  text-align: left;
}

.final-score-row {
  padding: 10px 4px;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.final-score-row span:first-child {
  color: var(--muted);
}

.final-score-row strong {
  color: var(--gold);
}

.game-over-card .button + .button {
  margin-top: 9px;
}

.toast {
  position: fixed;
  z-index: 150;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: calc(100% - 30px);
  padding: 12px 17px;
  border: 1px solid rgba(67, 230, 173, 0.24);
  border-radius: 999px;
  background: #10332f;
  color: #d9fff3;
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.38);
  transform: translateX(-50%);
  font-size: 12px;
}

@keyframes die-tumble {
  0% { transform: translate3d(0, 1px, 0) rotate(-5deg) rotateX(4deg) rotateY(0); }
  36% { transform: translate3d(-3px, -10px, 0) rotate(9deg) rotateX(20deg) rotateY(-16deg) scale(1.04); }
  68% { transform: translate3d(3px, -4px, 0) rotate(-2deg) rotateX(-8deg) rotateY(13deg) scale(1.01); }
  100% { transform: translate3d(0, 1px, 0) rotate(5deg) rotateX(4deg) rotateY(0); }
}

@keyframes bust-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes bank-breathe {
  0%, 100% { box-shadow: 0 14px 32px rgba(34, 205, 151, 0.19); }
  50% { box-shadow: 0 14px 38px rgba(34, 205, 151, 0.38); }
}

@media (max-width: 980px) {
  .lobby-view {
    grid-template-columns: 1fr;
    min-height: auto;
    gap: 44px;
  }

  .lobby-copy {
    text-align: center;
  }

  .lobby-copy .eyebrow,
  .hero-copy,
  .rule-strip {
    margin-right: auto;
    margin-left: auto;
  }

  .lobby-card {
    width: min(560px, 100%);
    margin: 0 auto;
  }

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

  .players-panel {
    min-height: 340px;
    max-height: 520px;
    position: static;
  }
}

@media (max-width: 680px) {
  .site-header {
    width: min(100% - 24px, 1280px);
    height: 72px;
  }

  .brand-name {
    font-size: 23px;
  }

  .brand-mark {
    transform: scale(0.88);
    transform-origin: left center;
  }

  .header-actions {
    gap: 10px;
  }

  .connection-pill,
  .header-actions .text-button {
    display: none;
  }

  .app-shell {
    width: min(100% - 24px, 1280px);
    padding: 34px 0 105px;
  }

  .lobby-copy h1 {
    margin-top: 13px;
    font-size: clamp(46px, 14vw, 68px);
  }

  .rule-strip {
    margin-top: 30px;
    grid-template-columns: 1fr 1fr;
  }

  .rule-strip div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .rule-strip div:nth-child(4) {
    border-top: 1px solid var(--line);
  }

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

  .room-bar {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .room-meta {
    justify-self: end;
  }

  .room-share {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .room-share .button {
    flex: 1;
  }

  .player-count {
    display: none;
  }

  .pot-panel {
    min-height: 480px;
    padding: 21px 18px;
  }

  .pot-amount {
    margin-top: 36px;
  }

  .pot-amount span {
    font-size: clamp(75px, 24vw, 108px);
  }

  .roll-stage {
    flex-direction: column;
    gap: 13px;
    text-align: center;
  }

  .die {
    width: 56px;
    height: 56px;
    padding: 8px;
    border-radius: 12px;
  }

  .die i {
    width: 8px;
    height: 8px;
  }

  .next-roll {
    right: 18px;
    left: 18px;
  }

  .bank-zone {
    position: fixed;
    z-index: 40;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 10px max(12px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    grid-template-columns: 1fr 1.15fr;
    border-width: 1px 0 0;
    border-radius: 0;
    background: rgba(5, 24, 27, 0.96);
    box-shadow: 0 -15px 45px rgba(0, 0, 0, 0.35);
  }

  .bank-guidance strong {
    font-size: 14px;
  }

  .bank-button {
    min-height: 64px;
  }

  .host-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .control-buttons {
    width: 100%;
  }

  .control-buttons .button {
    flex: 1;
  }

  .players-panel {
    padding: 18px 13px;
  }

  .players-header .legend {
    display: none;
  }

  .odds-row {
    grid-template-columns: 1fr;
  }

  .odds-row div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}

@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;
  }
}
