@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@400;500;600&display=swap');
:root {
  color-scheme:light;
  --bg:#e9dfd3;
  --paper:#f8f2ea;
  --surface:#fffaf4;
  --ink:#39291f;
  --muted:#796657;
  --line:#cdb6a0;
  --accent:#8c674c;
  --green:#355447;
  --focus:#765239;
  font-family:'DM Sans',system-ui,sans-serif
}
* {
  box-sizing:border-box
}
html {
  scroll-behavior:smooth
}
body {
  margin:0;
  background:radial-gradient(circle at 50% 0,#f6ece0,var(--bg) 75%);
  color:var(--ink);
  font-size:16px;
  line-height:1.55
}
button,input,select {
  font:inherit
}
button {
  cursor:pointer
}
button:disabled {
  opacity:.45;
  cursor:not-allowed
}
button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible,summary:focus-visible {
  outline:3px solid var(--focus);
  outline-offset:3px
}
.hidden,.grain {
  display:none!important
}
.shell {
  max-width:1450px;
  margin:30px auto;
  background:var(--paper);
  border-radius:22px;
  box-shadow:0 25px 65px #593a272b;
  overflow:hidden
}
header {
  display:flex;
  align-items:center;
  justify-content:space-between;
  height:82px;
  padding:0 6.5%;
  border-bottom:1px solid #9c806422
}
.brand {
  display:flex;
  align-items:center;
  gap:12px;
  font:500 30px 'Playfair Display',Georgia,serif;
  letter-spacing:-.04em
}
.brand-mark {
  width:30px;
  height:30px;
  border:1px solid var(--accent);
  border-radius:8px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  transform:rotate(-10deg)
}
.brand-mark i {
  width:4px;
  height:4px;
  border-radius:50%;
  background:var(--accent)
}
.brand-mark i:first-child {
  transform:translateY(-5px)
}
.brand-mark i:last-child {
  transform:translateY(5px)
}
.rules-link {
  color:#694d3b;
  text-decoration:none;
  font-size:14px
}
.rules-link:hover {
  text-decoration:underline
}
.home {
  display:grid;
  grid-template-columns:minmax(0,1.15fr) minmax(340px,.85fr);
  align-items:center;
  gap:4%;
  padding:50px 6.5% 65px;
  background:linear-gradient(110deg,#f9f4ee,#eddfd0)
}
.hero {
  min-width:0
}
.hero-kicker {
  font-size:12px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color:#8e674e
}
h1 {
  font:400 clamp(46px,4.4vw,70px)/1.12 'Playfair Display',Georgia,serif;
  letter-spacing:-.05em;
  margin:24px 0
}
h1 em {
  font-style:normal;
  color:var(--accent)
}
.hero p {
  color:#756458;
  font-size:18px;
  margin:0
}
.dice-scene {
  height:320px;
  margin:8px -25px 24px;
  display:grid;
  place-items:center;
  overflow:visible
}
.dice-still {
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  filter:drop-shadow(0 26px 24px #6b4d3650)
}
.panel {
  padding:32px;
  background:#fffcf8df;
  border:1px solid #fff9;
  border-radius:18px;
  box-shadow:0 14px 36px #664c3420
}
.panel-heading h2,.table h2,.room-settings h3 {
  font-family:'Playfair Display',Georgia,serif;
  font-weight:500;
  letter-spacing:-.03em
}
.panel-heading h2 {
  font-size:31px;
  margin:0 0 7px
}
.panel-heading p {
  color:var(--muted);
  font-size:14px;
  margin:0 0 25px
}
.tabs {
  display:flex;
  gap:5px;
  padding:5px;
  background:#eaddcf;
  border-radius:10px
}
.tab {
  flex:1;
  background:transparent;
  border:0;
  border-radius:7px;
  padding:11px 8px;
  color:#755d4d;
  font-size:14px;
  font-weight:600;
  min-height:44px
}
.tab.active {
  background:var(--surface);
  color:var(--ink);
  box-shadow:0 2px 6px #5a39221c
}
.form {
  display:grid;
  gap:20px;
  padding-top:26px
}
label {
  display:grid;
  gap:9px;
  color:#5d4839;
  font-size:13px;
  font-weight:600
}
input:not([type=range]):not([type=checkbox]),select {
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:8px;
  color:var(--ink);
  padding:13px 15px;
  min-height:48px;
  width:100%
}
input::placeholder {
  color:#a18d7d
}
input[type=range] {
  width:100%;
  accent-color:var(--accent);
  min-height:28px
}
.lobby-options {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:15px
}
.dice-setting {
  position:relative
}
.dice-setting span {
  position:absolute;
  right:0;
  color:var(--accent);
  font-weight:700
}
.range-label {
  grid-column:1;
  grid-row:2;
  display:flex;
  justify-content:space-between;
  color:#917c6b;
  font-size:11px;
  margin-top:-17px
}
.lobby-options>label:last-child {
  grid-column:2;
  grid-row:1/3
}
.settings-card {
  border-block:1px solid #c7ac9655;
  padding:17px 0
}
.switch-row {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  font-size:14px
}
.switch-row input {
  appearance:none;
  position:relative;
  width:40px;
  height:24px;
  flex:0 0 40px;
  border-radius:16px;
  background:#c9b9a7;
  cursor:pointer
}
.switch-row input:before {
  content:'';
  position:absolute;
  top:3px;
  left:3px;
  width:18px;
  height:18px;
  border-radius:50%;
  background:white;
  transition:transform .2s
}
.switch-row input:checked {
  background:var(--accent)
}
.switch-row input:checked:before {
  transform:translateX(16px)
}
.primary {
  min-height:48px;
  border:0;
  border-radius:9px;
  padding:13px 22px;
  background:var(--accent);
  color:#fffaf3;
  font-weight:700;
  transition:background .2s,transform .2s
}
.primary:hover:not(:disabled) {
  background:#6e4d37;
  transform:translateY(-1px)
}
small,.form small {
  font-size:12px;
  color:#917c6b
}
.form small {
  text-align:center;
  margin-top:-7px
}
.game {
  padding:32px 6.5% 18px
}
.game-top,.table-header,.bottom {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px
}
.game-top {
  padding-bottom:25px;
  border-bottom:1px solid #cdb7a2;
  margin-bottom:20px
}
.eyebrow,.felt-label {
  color:#956f51;
  font-size:11px;
  letter-spacing:.14em;
  font-weight:600
}
.room-code {
  font-size:30px;
  font-weight:700;
  letter-spacing:.16em;
  font-variant-numeric:tabular-nums
}
.top-actions {
  display:flex;
  gap:10px
}
.ghost,.text-button {
  min-height:44px;
  padding:10px 15px;
  border:1px solid #cbb59f;
  border-radius:9px;
  background:var(--surface);
  color:#694b37;
  font-size:13px
}
.text-button {
  border:0;
  background:transparent
}
.room-settings {
  background:var(--surface);
  border:1px solid #d6c3b0;
  border-radius:14px;
  padding:24px;
  margin-bottom:20px
}
.room-settings h3 {
  font-size:24px;
  margin:0
}
.room-settings p {
  font-size:14px;
  color:var(--muted)
}
.settings-grid {
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:20px;
  align-items:center;
  margin:20px 0
}
.table {
  background:#fffbf6;
  border:1px solid #d6c5b3;
  border-radius:20px;
  box-shadow:0 12px 40px #6b4b3020;
  padding:30px
}
.table h2 {
  font-size:32px;
  margin:3px 0 0
}
.round-badge {
  max-width:270px;
  border:1px solid #cdb398;
  border-radius:24px;
  padding:9px 13px;
  text-align:center;
  color:#82593f;
  font-size:12px
}
.players {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:24px 0
}
.player {
  min-width:125px;
  padding:11px 16px;
  border:1px solid #d2bda6;
  border-radius:12px;
  background:#f0e4d6
}
.player.turn {
  border-color:#ad8060;
  background:#e2c9ad
}
.player .name {
  font-weight:700;
  font-size:14px
}
.player .count {
  color:#7b6556;
  font-size:12px;
  margin-top:3px
}
.felt {
  display:grid;
  place-items:center;
  min-height:285px;
  padding:30px 18px;
  border:9px solid #9a6f4a;
  border-radius:115px;
  background:radial-gradient(ellipse at 50% 30%,#657e67,#334c40 78%);
  box-shadow:inset 0 0 65px #12281d70,0 12px 26px #503b2933
}
.felt-inner {
  text-align:center;
  width:100%
}
.felt-label {
  color:#f3e5d1
}
.hand {
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
  gap:16px;
  margin:28px 0 15px;
  perspective:900px
}
.cube {
  --size:57px;
  position:relative;
  display:inline-block;
  width:var(--size);
  height:var(--size);
  margin:6px;
  border-radius:12px;
  background:linear-gradient(135deg,#fffdf5,#d8d1c4);
  box-shadow:inset 1px 1px 2px white,inset -2px -2px 4px #aca394,0 5px 0 #afa797,0 8px 0 #827c70,0 17px 20px #0005;
  transform:rotate(-5deg)
}
.cube-face {
  position:absolute;
  inset:0;
  display:grid;
  grid-template:repeat(3,1fr)/repeat(3,1fr);
  gap:5px;
  padding:11px
}
.cube-top,.cube-right {
  display:none
}
.pip {
  border-radius:50%;
  background:radial-gradient(circle at 65% 75%,#49423a,#181511);
  box-shadow:inset 1px 2px 2px #000,0 1px 1px #fff
}
.cube-small {
  --size:36px;
  margin:6px;
  border-radius:8px;
  transform:none;
  box-shadow:inset 1px 1px 1px white,0 3px 0 #9a9284,0 5px 7px #0004
}
.cube-small .cube-face {
  padding:7px;
  gap:3px
}
.hand .cube:nth-child(even) {
  transform:rotate(7deg)
}
.hand.rolling .cube {
  animation:dice-toss 1s cubic-bezier(.22,.65,.3,1) both;
  animation-delay:calc(var(--i,0)*75ms)
}
@keyframes dice-toss {
  0% {
    opacity:0;
    transform:translateY(-110px) rotate(110deg) scale(.7)
  }
  35% {
    opacity:1
  }
  68% {
    transform:translateY(0) rotate(8deg) scale(1.05,.95)
  }
  82% {
    transform:translateY(-18px) rotate(-8deg)
  }
  100% {
    opacity:1;
    transform:translateY(0) rotate(-5deg)
  }
}
.action-area {
  display:flex;
  align-items:center;
  justify-content:center;
  flex-wrap:wrap;
  gap:14px;
  padding-top:24px
}
.bid-picker {
  width:100%;
  display:grid;
  grid-template-columns:auto 1fr;
  align-items:center;
  gap:18px 30px;
  padding:24px;
  border:1px solid #d4bda5;
  border-radius:14px;
  background:#f4eadf
}
.picker-title {
  font-weight:700
}
.stepper {
  display:flex;
  align-items:center;
  gap:16px;
  grid-column:1;
  grid-row:2
}
.stepper output {
  min-width:48px;
  text-align:center;
  font-size:30px;
  font-weight:700;
  font-variant-numeric:tabular-nums
}
.step-button {
  width:44px;
  height:44px;
  border:1px solid #cdb59c;
  border-radius:8px;
  background:var(--surface);
  color:#5a3c29;
  font-size:24px
}
.face-choices {
  grid-column:2;
  grid-row:1/3;
  display:flex;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px
}
.face-choice {
  min-width:52px;
  min-height:52px;
  border:1px solid transparent;
  border-radius:12px;
  padding:8px;
  background:#e8d9c8;
  transition:background .2s,transform .2s
}
.face-choice[aria-pressed=true] {
  background:#cfac8b;
  border-color:#8d6244;
  transform:translateY(-3px)
}
.face-choice:hover:not(:disabled) {
  background:#dbbfa4
}
.face-choice:disabled {
  opacity:.3;
  cursor:not-allowed;
  filter:grayscale(.7);
  transform:none
}
.bid-summary {
  grid-column:1/-1;
  text-align:center;
  color:var(--muted);
  font-size:13px;
  margin:0
}
.bid-picker>.primary {
  grid-column:1/-1
}
.special-button {
  min-height:44px;
  border:1px solid #ac8c68;
  border-radius:9px;
  padding:11px 18px;
  background:#f3e3ce;
  color:#7d5638;
  font-size:13px
}
.danger {
  min-height:44px;
  border:1px solid #78473d;
  border-radius:9px;
  padding:11px 22px;
  background:#78473d;
  color:#fff8f1;
  font-weight:700
}
.hint {
  color:var(--muted);
  font-size:14px
}
.reveal {
  width:min(100%,620px);
  margin:20px auto 0;
  color:#f7e9d8
}
.reveal-summary {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px
}
.reveal-stat {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:3px;
  padding:13px 10px;
  border:1px solid #fff4;
  border-radius:12px;
  background:#f7e9d81a
}
.reveal-stat span {
  color:#e7d8c6;
  font-size:13px
}
.reveal-stat strong {
  color:#ffe0a6;
  font-size:clamp(18px,2.4vw,25px);
  line-height:1.25
}
.reveal-loser {
  margin:16px 0 18px;
  font-weight:700;
  font-size:16px
}
.reveal-hands {
  display:grid;
  gap:8px
}
.reveal-row {
  display:grid;
  grid-template-columns:minmax(80px,130px) 1fr;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:12px;
  background:#182d245c;
  text-align:left
}
.reveal-player {
  overflow-wrap:anywhere;
  font-weight:600
}
.reveal-dice {
  display:flex;
  flex-wrap:wrap;
  gap:9px
}
.cube-number {
  --size:39px;
  display:grid;
  place-items:center;
  flex:none;
  margin:0;
  border-radius:8px;
  color:#453526;
  font-size:23px;
  font-weight:800;
  font-variant-numeric:tabular-nums;
  transform:none;
  box-shadow:inset 1px 1px 2px white,inset -2px -2px 4px #aca394,0 3px 0 #afa797,0 6px 9px #0003
}
.cube-number.is-match {
  outline:2px solid #f4ca80;
  outline-offset:2px
}
.bottom {
  align-items:flex-start;
  padding:25px 0
}
.log {
  color:#786756;
  font-size:13px;
  line-height:1.8;
  margin-top:9px
}
.log>div:first-child {
  font-weight:700
}
.rules-panel {
  margin:0 6.5%;
  padding:23px 0;
  background:none;
  border:0;
  border-top:1px solid #cdb7a2;
  border-radius:0;
  color:#765f4f
}
.rules-panel summary {
  cursor:pointer;
  color:#5b3d2c
}
.rules-panel p {
  max-width:850px;
  line-height:1.8
}
footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  margin:0 6.5%;
  padding:23px 0;
  border-top:1px solid #cdb7a2;
  color:#927a66;
  font-size:12px
}
footer span:first-child {
  font:500 20px 'Playfair Display',Georgia,serif;
  color:#684a35
}
.toast {
  position:fixed;
  bottom:24px;
  left:50%;
  z-index:200;
  max-width:90vw;
  padding:13px 22px;
  border-radius:10px;
  background:#f5e1c4;
  color:#4f3525;
  box-shadow:0 12px 30px #0004;
  transform:translateX(-50%)
}
.special-announcement {
  position:fixed;
  inset:0;
  z-index:100;
  pointer-events:none;
  display:grid;
  place-items:center;
  background:radial-gradient(ellipse,#ad8a68f0,#392e28f4);
  backdrop-filter:blur(10px);
  animation:special-overlay 2.8s both
}
.special-content {
  text-align:center;
  padding:25px;
  animation:special-title 2.8s both
}
.special-content h2 {
  font:500 clamp(36px,7vw,80px) 'Playfair Display',Georgia,serif;
  color:#fff3dc;
  letter-spacing:.05em;
  margin:35px 0 12px
}
.special-content p,.special-content small {
  color:#f7e8d3
}
.special-emblem .cube {
  --size:80px
}
.special-emblem .cube-face {
  padding:17px;
  gap:7px
}
@keyframes special-overlay {
  0%,100% {
    opacity:0
  }
  15%,80% {
    opacity:1
  }
}
@keyframes special-title {
  0% {
    transform:scale(.85);
    opacity:0
  }
  20%,80% {
    transform:scale(1);
    opacity:1
  }
  100% {
    transform:scale(1.05);
    opacity:0
  }
}
@media(max-width:1100px) {
  .shell {
    margin:16px
  }
  .home {
    grid-template-columns:1fr;
    gap:26px
  }
  .hero {
    max-width:720px
  }
  .panel {
    max-width:640px;
    width:100%;
    margin:auto
  }
  .dice-scene {
    height:290px
  }
  .settings-grid {
    grid-template-columns:1fr
  }
  .bid-picker {
    grid-template-columns:1fr;
    justify-items:center
  }
  .stepper {
    grid-column:1;
    grid-row:2
  }
  .face-choices {
    grid-column:1;
    grid-row:3;
    justify-content:center
  }
  .bid-summary,.bid-picker>.primary {
    grid-column:1;
    width:100%
  }
}
@media(max-width:650px) {
  .shell {
    margin:0;
    border-radius:0
  }
  .home {
    padding:30px 20px 46px
  }
  .hero h1 {
    font-size:clamp(42px,10vw,56px)
  }
  .hero p {
    font-size:16px
  }
  .dice-scene {
    height:235px;
    margin:8px -8px 18px
  }
  .panel {
    padding:22px
  }
  .game {
    padding:20px
  }
  .game-top,.table-header {
    align-items:flex-start;
    flex-wrap:wrap
  }
  .top-actions {
    flex-wrap:wrap
  }
  .room-code {
    font-size:24px
  }
  .table {
    padding:16px
  }
  .table h2 {
    font-size:26px
  }
  .felt {
    min-height:230px;
    border-width:6px;
    border-radius:55px
  }
  .hand {
    gap:7px
  }
  .cube {
    --size:46px
  }
  .cube-face {
    padding:9px;
    gap:4px
  }
  .cube-small {
    --size:32px
  }
  .cube-small .cube-face {
    padding:6px;
    gap:3px
  }
  .reveal-summary {
    grid-template-columns:1fr
  }
  .reveal-row {
    grid-template-columns:1fr;
    gap:7px
  }
  .cube-number {
    --size:35px;
    font-size:21px
  }
  .face-choices {
    gap:5px
  }
  .face-choice {
    min-width:44px;
    min-height:44px;
    padding:4px
  }
  .bid-picker {
    padding:18px 10px
  }
  .action-area>.special-button,.action-area>.danger {
    width:100%
  }
  .bottom {
    flex-direction:column
  }
  .rules-panel,footer {
    margin-inline:20px
  }
}
@media(max-width:380px) {
  .lobby-options {
    grid-template-columns:1fr
  }
  .lobby-options>label:last-child {
    grid-column:1;
    grid-row:3
  }
  .range-label {
    grid-column:1
  }
  .top-actions {
    width:100%
  }
  .top-actions .ghost {
    flex:1
  }
  .face-choices {
    gap:2px
  }
  .face-choice {
    padding:2px
  }
}
@media(prefers-reduced-motion:reduce) {
  html {
    scroll-behavior:auto
  }
  *,*::before,*::after {
    animation-duration:.01ms!important;
    transition-duration:.01ms!important
  }
}
@media (min-width: 651px) and (max-width: 1100px) {
  .dice-scene { margin-bottom: 120px; }
}
.game[data-phase='waiting'] .felt {
  min-height: 190px;
  border-radius: 80px;
}
.game[data-phase='waiting'] .action-area {
  padding-top: 20px;
}
.brand{color:#684a35;text-decoration:none;gap:11px;white-space:nowrap;line-height:1}
.brand:hover .brand-name{text-decoration:underline;text-decoration-color:#9b785d;text-underline-offset:5px;text-decoration-thickness:1px}
.brand-mark{display:block;width:36px;height:36px;flex:none;border:0;border-radius:0;transform:none;color:#8c674c}
.brand-name{display:inline-block;position:relative;top:-5px;font:500 30px/1 'Playfair Display',Georgia,serif;letter-spacing:-.04em}
.brand-footer{font-size:inherit}
.brand-footer .brand-mark{width:26px;height:26px}
.brand-footer .brand-name{top:-3px;font-size:23px}
@media(max-width:650px){.brand-mark{width:32px;height:32px}.brand-name{font-size:27px}.brand-footer .brand-mark{width:24px;height:24px}.brand-footer .brand-name{font-size:21px}}
