:root {
  color-scheme: light;
  --bg: #fcf9eb;
  --surface: #fffdf5;
  --edge: #cec8b6;
  --text: #201f1a;
  --muted: #5e5b52;
  --lime: #25251e;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family:
    Inter, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.48;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
:focus-visible {
  outline: 3px solid var(--lime);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.065em;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.055em;
}
h3 {
  letter-spacing: -0.045em;
}
p {
  color: #5e5b52;
  line-height: 1.7;
}
header {
  height: 76px;
  background: #fcf9eb;
  border-bottom: 1px solid #201f1a;
}
.nav-wrap,
main {
  width: min(1192px, calc(100% - 80px));
  margin: auto;
}
.nav-wrap {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 46px;
}
.brand {
  display: flex;
  align-items: center;
  letter-spacing: -1.7px;
  font:
    italic 950 25px/1 "Arial Black",
    Arial,
    sans-serif;
  color: #201f1a;
}
.brand img {
  width: 35px;
  height: 35px;
  margin-right: 10px;
  image-rendering: auto;
}
.brand span {
  color: var(--lime);
}
nav,
.nav-end,
.controls,
.filters,
.title-pair,
.room-game,
.spread,
.section-head,
.page-title,
.dial-head,
.timer,
.legend {
  display: flex;
  align-items: center;
}
.nav-end {
  margin-left: auto;
  gap: 15px;
}
nav {
  height: 100%;
  gap: 7px;
}
.nav-link,
.textbtn,
.iconbtn,
.filter {
  background: none;
  color: var(--muted);
  border: 0;
}
.nav-link,
.textbtn,
.btn,
.primary,
.pick,
.filter,
.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 650;
  font-size: 14px;
}
.nav-link {
  padding: 0 15px;
}
.nav-link.on {
  color: var(--lime);
  background: #e9e5d4;
  border-radius: 7px;
}
.iconbtn {
  width: 44px;
  border-radius: 8px;
}
.btn,
.primary,
.pick {
  padding: 0 17px;
  border-radius: 7px;
}
.btn,
.pick {
  background: #fffdf4;
  border: 1px solid #33322a;
  color: var(--text);
}
.btn:hover,
.iconbtn:hover,
.pick:hover {
  background: #eee9d7;
}
.primary {
  background: var(--lime);
  color: #fffdf4;
  border: 1px solid var(--lime);
}
.primary:hover {
  background: #484638;
}
.create-btn {
  min-height: 38px;
}
.textbtn {
  padding: 0 8px;
}
.textbtn:hover,
.filter:hover {
  color: var(--text);
}
.page-title,
.section-head,
.spread,
.dial-head {
  justify-content: space-between;
  gap: 16px;
}
.title-pair {
  gap: 12px;
}
.page-title .title-pair > svg,
.section-head .title-pair > svg {
  color: var(--lime);
}
main {
  padding: 32px 0 64px;
  min-height: 80vh;
}
.page-title {
  margin-bottom: 21px;
}
.live {
  font: 11px var(--mono);
  color: #625e52;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.live i {
  width: 7px;
  height: 7px;
  background: #517443;
  border-radius: 50%;
  box-shadow: 0 0 6px #5174433d;
}
.shelf {
  margin-top: 30px;
}
.section-head {
  margin-bottom: 16px;
}
.filters {
  gap: 4px;
}
.filter {
  font-size: 13px;
  padding: 0 13px;
  border-radius: 6px;
}
.filter.on {
  color: var(--lime);
  background: #ded9c5;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.panel,
.detail,
.room-list,
.empty {
  border: 1px solid var(--edge);
  background: var(--surface);
  border-radius: 12px;
}
.panel,
.detail-copy {
  padding: clamp(20px, 4vw, 44px);
}
.panel {
  max-width: 900px;
  margin: 0 auto;
}
.search-panel {
  max-width: none;
  padding: 20px;
  margin-bottom: 16px;
}
.controls {
  gap: 10px;
  flex-wrap: wrap;
}
.detail {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  margin-top: 16px;
  overflow: hidden;
}
.poster {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.poster img {
  width: 65%;
  image-rendering: auto;
}
.eyebrow {
  color: var(--lime);
}
.detail h1,
.panel h1 {
  margin: 7px 0;
}
.detail-copy > p,
.panel > p {
  margin: 12px 0 20px;
}
.room-list {
  overflow: hidden;
}
.room-line,
.rows li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--edge);
}
.room-line:last-child,
.rows li:last-child {
  border-bottom: 0;
}
.room-info {
  min-width: 0;
  flex: 1;
}
.room-info b,
.room-info small {
  display: block;
  overflow-wrap: anywhere;
}
.room-info small,
small,
.status,
.hint {
  font-size: 12px;
  color: var(--muted);
}
.small-art,
.room-game img {
  object-fit: contain;
  image-rendering: auto;
  width: 64px;
}
.room-game {
  gap: 15px;
}
.empty {
  min-height: 145px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
}
.empty b {
  color: #26251e;
}
.empty span {
  font-size: 13px;
}
.searchbox {
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-panel .filters {
  margin-top: 12px;
  flex-wrap: wrap;
}
.search-panel select {
  width: auto;
  max-width: 100%;
}
label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14px;
  font-weight: 650;
  color: #36342c;
}
.check {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
}
.check input {
  width: auto;
}
.check input[type="checkbox"] {
  width: 17px;
  height: 17px;
}
.check,
.filter,
button {
  accent-color: var(--lime);
}
form {
  display: grid;
  gap: 17px;
}
input,
select,
textarea {
  width: 100%;
  padding: 11px 13px;
  background: #fffef8;
  border: 1px solid #8d8979;
  color: var(--text);
  border-radius: 6px;
  min-height: 44px;
}
select:not([multiple]):not([size]) {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4.5L12.5 6' fill='none' stroke='%23575549' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]) {
    appearance: auto;
    background-image: none;
    padding-right: 13px;
  }
}
#options:empty {
  display: none;
}
textarea {
  resize: vertical;
}
.check input {
  min-height: auto;
}
dialog {
  padding: 25px;
  border: 1px solid #49463b;
  border-radius: 14px;
  background: #fffdf2;
  color: var(--text);
  width: min(460px, calc(100% - 30px));
  max-height: 90dvh;
  box-shadow: 0 20px 80px #0008;
}
dialog::backdrop {
  background: #08070cc9;
}
dialog p {
  font-size: 14px;
  margin: 10px 0 14px;
}
.dial-head {
  margin-bottom: 15px;
}
.dial-head h2 {
  font-size: 23px;
}
.geo-box {
  background: #f1eedd;
  padding: 14px;
  border-radius: 8px;
}
.geo-box p {
  font-size: 12px;
}
.geo-box .btn {
  font-size: 12px;
}
.rows {
  margin: 15px 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--edge);
  border-radius: 8px;
}
.rows li {
  justify-content: space-between;
  min-height: 48px;
}
.rows li span {
  margin-left: auto;
  color: var(--muted);
}
.spread > div,
.rows li > b,
.result-head h2,
.legend span {
  min-width: 0;
  overflow-wrap: anywhere;
}
.spread > button,
.rows li > button {
  flex-shrink: 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--edge);
  margin: 20px 0;
}
.room-game h2 {
  margin: 3px 0;
}
.timer {
  gap: 6px;
  font-family: var(--mono);
}
.center-stage,
.result-head {
  padding: 30px 0;
  text-align: center;
}
.center-stage img,
.result-head img {
  width: 145px;
  image-rendering: auto;
}
.center-stage h2,
.result-head h2 {
  font-size: 32px;
}
.count {
  display: block;
  color: var(--lime);
  font: 900 50px var(--mono);
}
.game-panel .controls {
  justify-content: center;
}
.pick {
  min-width: 70px;
}
.pick.selected {
  border-color: var(--lime);
  color: var(--lime);
}
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
  gap: 8px;
}
.tiles .pick {
  min-width: 0;
}
.hint {
  text-align: center;
  margin-top: 14px;
}
details {
  margin-top: 16px;
  color: var(--muted);
}
summary {
  cursor: pointer;
  padding: 12px 0;
}
details code {
  display: block;
  overflow-wrap: anywhere;
  margin: 4px 0 12px;
}
.board-scroll {
  overflow-x: auto;
  margin: 16px 0;
}
.board-scroll canvas {
  display: block;
  width: 100%;
  border-radius: 9px;
}
#trace {
  max-width: 350px;
}

.legend {
  gap: 8px 16px;
  flex-wrap: wrap;
  font-size: 12px;
}
.legend i {
  display: inline-grid;
  place-items: center;
  margin-right: 5px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  font: 11px var(--mono);
  color: #15151a;
}
#invite-notices {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 24px);
  z-index: 21;
  display: grid;
  gap: 5px;
  pointer-events: none;
}
#invite-notices > div {
  padding: 10px 16px;
  background: #fffbed;
  color: var(--text);
  font-size: 14px;
  border: 1px solid var(--edge);
  border-radius: 8px;
  box-shadow: 0 3px 12px #332f252e;
}
#toast {
  position: fixed;
  z-index: 20;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 18px;
  background: #eef1e7;
  color: #23251e;
  border-radius: 8px;
  box-shadow: 0 5px 20px #0005;
  opacity: 0;
  pointer-events: none;
  max-width: min(90vw, 540px);
  width: max-content;
  font-size: 14px;
}
#toast.show {
  opacity: 1;
}
.error-msg {
  color: #a52b26;
  margin: 8px 0;
}
button,
a,
select,
input,
textarea {
  font-family: inherit;
}
@media (min-width: 1600px) {
  main {
    padding-top: 42px;
  }
}
@media (max-width: 850px) {
  .nav-wrap,
  main {
    width: calc(100% - 40px);
  }
  .nav-wrap {
    gap: 16px;
  }
  .cards {
    gap: 12px;
  }
  .card-caption {
    padding: 12px;
  }
  .nav-end {
    gap: 3px;
  }
  .section-head {
    flex-wrap: wrap;
  }
}
@media (max-width: 650px) {
  header {
    height: auto;
  }
  .nav-wrap {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 10px;
  }
  .nav-wrap,
  main {
    width: calc(100% - 28px);
  }
  .brand {
    font-size: 21px;
  }
  .brand img {
    width: 28px;
  }
  .nav-end {
    order: 1;
  }
  nav {
    width: 100%;
    order: 2;
    height: 49px;
    gap: 4px;
  }
  nav .nav-link {
    font-size: 13px;
    min-height: 37px;
  }
  .create-btn {
    font-size: 12px;
  }
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .card-art {
    height: 107px;
  }
  .card-art img {
    width: 76%;
  }
  .card-caption h3 {
    font-size: 16px;
  }
  .page-title {
    margin-bottom: 14px;
  }
  main {
    padding-top: 22px;
  }
  .page-title .title-pair {
    gap: 8px;
  }
  .shelf {
    margin-top: 22px;
  }
  .section-head {
    gap: 6px;
    margin-bottom: 10px;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .filter {
    padding: 0 10px;
  }
  .section-head .filters {
    width: 100%;
  }
  .detail {
    grid-template-columns: 1fr;
  }
  .poster {
    min-height: 160px;
  }
  .poster img {
    height: 110px;
    width: auto;
  }
  .detail-copy {
    padding: 20px;
  }
  .room-line {
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
  }
  .small-art {
    width: 38px;
  }
  .room-info {
    min-width: 130px;
  }
  .rows li {
    gap: 7px;
    padding: 9px;
    font-size: 13px;
  }
  .search-panel {
    padding: 12px;
  }
  .board-scroll canvas {
    min-height: 150px;
  }
  .center-stage h2,
  .result-head h2 {
    font-size: 24px;
  }
  .spread {
    align-items: flex-start;
  }
  .btn {
    padding: 0 12px;
  }
  .room-game img {
    width: 45px;
  }
  .title-pair {
    gap: 8px;
  }
  .live {
    font-size: 10px;
  }
  .section-head .title-pair {
    min-height: 38px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.bomb-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.bomb-fields input {
  min-width: 0;
}
.player-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.player-status {
  color: var(--muted);
  font-size: 13px;
}
.player-status {
  margin-top: 18px;
  border-top: 1px solid var(--edge);
  padding-top: 12px;
  gap: 6px;
}
.player-status span {
  padding: 5px 8px;
  border-radius: 5px;
  background: #f0ecdf;
  overflow-wrap: anywhere;
}
.player-status b {
  color: #24231c;
}
.replay-control {
  margin-top: 12px;
}
@font-face {
  font-family: Gaegu;
  src: url("/fonts/Gaegu-interface.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
body {
  background-color: var(--bg);
  background-image:
    radial-gradient(#77725730 0.75px, transparent 1px),
    radial-gradient(#77725725 0.65px, transparent 1px);
  background-size: 17px 17px;
  background-position:
    0 0,
    8.5px 8.5px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.nav-wrap,
main {
  max-width: 1080px;
}
header {
  border-bottom: 1.5px solid var(--text);
}
.brand,
.section-head h2,
.card-caption h3,
.mast p {
  font-family: Gaegu, "Apple SD Gothic Neo", sans-serif;
}
.brand {
  font-size: 32px;
  letter-spacing: -0.09em;
  font-style: normal;
}
.brand img {
  width: 40px;
  margin-right: 6px;
}
.nav-link.on {
  background: none;
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}
.nav-link {
  color: var(--text);
}
.create-btn {
  background: var(--text);
  color: var(--bg);
  border-radius: 40px;
}
.create-btn:hover {
  background: #454235;
}
.mast {
  min-height: 235px;
  display: grid;
  place-items: center;
  position: relative;
  isolation: isolate;
}
.mast-inner {
  width: min(65%, 580px);
  text-align: center;
}
.mast h1 img {
  width: 100%;
  height: auto;
  display: block;
}
.mast p {
  font-size: clamp(21px, 2.4vw, 30px);
  color: var(--text);
  margin-top: 1px;
  letter-spacing: -0.055em;
  line-height: 1.25;
}
.mast:before,
.mast:after {
  content: "";
  position: absolute;
  top: 37%;
  width: clamp(46px, 10vw, 115px);
  height: 90px;
  background: center/contain no-repeat;
  z-index: -1;
}
.mast:before {
  left: 4%;
  background-image: url("/art/loops.svg");
  transform: rotate(-12deg);
}
.mast:after {
  right: 4%;
  top: 24%;
  background-image: url("/art/spark-ink.svg");
  transform: rotate(9deg);
}
.shelf {
  margin-top: 32px;
}
.section-head {
  border-bottom: 2px solid var(--text);
  padding-bottom: 8px;
}
.section-head h2 {
  font-size: 32px;
  line-height: 1.1;
  letter-spacing: -0.07em;
}
.filter {
  border: 1px solid transparent;
  border-radius: 22px;
  min-height: 38px;
}
.filter.on {
  background: var(--text);
  color: var(--bg);
}
.cards {
  gap: 16px;
}
.game-tile {
  position: relative;
  min-width: 0;
}
.game-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fffdf4;
  border: 1.5px solid #585448;
  border-radius: 4px 8px 4px 6px;
  transition:
    box-shadow 0.15s,
    transform 0.15s;
}
.game-card:hover,
.game-tile:focus-within .game-card {
  box-shadow: 3px 4px 0 #29271f;
  transform: translateY(-2px);
}
.card-art {
  height: clamp(125px, 12vw, 162px);
  position: relative;
}
.card-art img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.18s;
}
.game-card:hover img {
  transform: rotate(-3deg);
}
.card-caption {
  padding: 8px 66px 14px 18px;
}
.card-caption h3 {
  font-size: 27px;
  line-height: 1.1;
  margin: 0;
  letter-spacing: -0.08em;
}
.card-settings {
  position: absolute;
  right: 8px;
  bottom: 4px;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  font-size: 12px;
  text-underline-offset: 3px;
  color: var(--muted);
}
.card-settings:hover {
  text-decoration: underline;
  color: var(--text);
}
.live {
  margin-top: 15px;
}
.poster {
  background: #f1eddc;
  border-right: 1px solid var(--edge);
}
.poster img {
  max-width: 80%;
  height: auto;
}
.poster .mono,
.eyebrow,
.mono {
  font: 700 11px var(--mono);
  color: var(--muted);
  letter-spacing: 1px;
}
.panel,
.detail,
.empty,
.room-list {
  border-color: #aaa48f;
  border-radius: 6px;
}
.btn,
.pick,
.primary {
  border-radius: 7px;
}
.ladder-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.ladder-picker h2 {
  margin: 18px 0 4px;
  text-align: center;
}
.ladder-picker p {
  text-align: center;
}
.lanes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(66px, 1fr));
  gap: 8px;
  margin: 22px 0;
}
.lane {
  padding: 10px 4px;
  min-width: 0;
  display: grid;
  gap: 4px;
  background: #fffcef;
  border: 1px solid #96917e;
  border-radius: 5px;
  color: var(--text);
}
.lane b {
  font:
    700 26px Gaegu,
    sans-serif;
}
.lane small {
  overflow-wrap: anywhere;
}
.lane.selected {
  background: #26251e;
  border-color: #26251e;
  color: white;
  opacity: 1;
}
.lane.selected small {
  color: #fff9e1;
}
@media (max-width: 650px) {
  .brand {
    font-size: 28px;
  }
  .mast {
    min-height: 155px;
  }
  .mast-inner {
    width: 76%;
  }
  .mast:before,
  .mast:after {
    width: 10%;
    height: 40px;
    left: 0;
    top: 44%;
  }
  .mast:after {
    left: auto;
    right: -1%;
    top: 23%;
  }
  .shelf {
    margin-top: 14px;
  }
  .section-head h2 {
    font-size: 26px;
  }
  .section-head .filters {
    width: auto;
  }
  .filter {
    padding: 0 7px;
    min-height: 36px;
  }
  .card-art {
    height: 104px;
  }
  .card-art img {
    width: 100%;
  }
  .card-caption {
    padding: 3px 38px 13px 8px;
  }
  .card-caption h3 {
    font-size: 21px;
  }
  .card-settings {
    right: 0;
    bottom: 0;
    font-size: 11px;
  }
  .poster {
    border-right: 0;
    border-bottom: 1px solid var(--edge);
  }
  .poster img {
    height: 110px;
  }
}
.game-panel {
  background: #fffdf3;
  border: 1.5px solid #514d40;
  border-radius: 5px 10px 6px 4px;
}
.game-panel h1,
.game-panel h2,
.bomb-head strong,
.playing-card,
.game-panel .pick,
.game-panel .disc {
  font-family: Gaegu, "Apple SD Gothic Neo", sans-serif;
  letter-spacing: -0.06em;
}
.game-panel h1 {
  font-size: clamp(29px, 4.5vw, 40px);
  line-height: 1.08;
}
.game-panel h2 {
  font-size: clamp(27px, 4vw, 39px);
}
.game-panel hr {
  border-top: 2px solid #302e27;
}
.game-panel .center-stage,
.game-panel .result-head,
.ladder-picker {
  background-color: #f8f4e5;
  background-image: radial-gradient(#c8c0a8 0.65px, transparent 0.95px);
  background-size: 16px 16px;
  border-radius: 4px 7px 4px 5px;
  padding: 22px 12px;
  margin: 14px 0;
}
.result-head img {
  height: 88px;
  width: auto;
  max-width: 65%;
  display: block;
  margin: 0 auto;
}
.result-head p {
  color: #514d3e;
}
.result-head h2 {
  margin: 4px auto 0;
  line-height: 1.2;
}
.game-panel .pick {
  font-size: 23px;
  min-width: 86px;
  border: 1.5px solid #35332b;
  border-radius: 6px 9px 4px 8px;
  box-shadow: 1px 2px 0 #39372e;
}
.game-panel .pick.selected {
  background: #282820;
  color: #fff9ea;
}
.game-panel .pick.selected img {
  background: #faf6e8;
  border-radius: 8px;
}
.game-panel[data-game-type="rps"] .pick {
  flex-direction: column;
  gap: 0;
  line-height: 1;
  padding: 8px 6px 10px;
  min-width: 0;
  width: clamp(68px, 25%, 125px);
}
.pick img {
  width: 100%;
  height: clamp(46px, 9vw, 78px);
  object-fit: contain;
}
.playing-card {
  width: 100px;
  height: 138px;
  border: 2px solid #37352c;
  border-radius: 6px 8px 5px 7px;
  background: #fffdf3;
  color: #923e32;
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-items: center;
  margin: 4px auto 20px;
  padding: 5px 9px;
  line-height: 1;
  box-shadow: 3px 3px 0 #39372e;
  transform: rotate(-4deg);
}
.playing-card small {
  color: inherit;
  justify-self: start;
  font:
    700 16px Gaegu,
    sans-serif;
}
.playing-card small:last-child {
  justify-self: end;
  transform: rotate(180deg);
}
.playing-card b {
  font:
    700 58px/1 Gaegu,
    sans-serif;
}
.draw-outcome {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 14px 0;
  color: #4f4a3e;
  font-size: 14px;
}
.draw-outcome strong {
  color: #923e32;
  font:
    700 29px Gaegu,
    sans-serif;
}
.game-panel .board-scroll {
  border: 1.5px solid #514d40;
  border-radius: 5px;
}
.game-panel .board-scroll canvas {
  border-radius: 0;
  min-height: 0;
}
.ladder-picker .lanes {
  margin: 15px 0;
}
.lane {
  box-shadow: 0 2px #aaa38b;
  border-radius: 7px 5px 8px 4px;
}
.lane:disabled:not(.selected) {
  opacity: 0.8;
}

.game-panel[data-game-type="bomb"] {
  --rust: #953824;
  --ink: #2c2a22;
}
.bomb-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 6px 0 12px;
}
.bomb-mascot {
  width: 72px;
  height: 56px;
  object-fit: cover;
}
.bomb-head > div {
  min-width: 0;
}
.bomb-head strong {
  display: block;
  font:
    700 clamp(26px, 4vw, 36px)/1.1 Gaegu,
    sans-serif;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.bomb-feedback,
.bomb-last {
  margin: 4px 0 0;
  font-size: 14px;
  line-height: 1.45;
  color: #514c3e;
  overflow-wrap: anywhere;
}
.bomb-feedback.hit,
.bomb-last {
  color: var(--rust);
  font-weight: 700;
}
.bomb-last {
  text-align: center;
  margin: 12px 0;
}
.bomb-clock {
  color: var(--rust);
  white-space: nowrap;
  font-size: 14px;
}
.bomb-clock b {
  font:
    700 34px/1 Gaegu,
    sans-serif;
}
.fuse-track {
  height: 5px;
  margin: 0 0 10px;
  background: #e3dcc9;
  border-radius: 3px;
  overflow: hidden;
}
.fuse-track i {
  display: block;
  height: 100%;
  transform-origin: left;
  background: repeating-linear-gradient(55deg, #963c23 0 5px, #c57851 5px 8px);
}
.bomb-counter {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding: 9px 3px;
  color: #5e5749;
  font-size: 12px;
}
.bomb-counter b {
  color: var(--ink);
  margin-left: 3px;
  font-variant-numeric: tabular-nums;
}
.bomb-field {
  --disc: clamp(46px, 6vw, 62px);
  position: relative;
  isolation: isolate;
  height: clamp(300px, 45vh, 430px);
  border: 2px solid var(--ink);
  border-radius: 8px 5px 9px 5px;
  box-shadow: 2px 3px 0 #716750;
  background: #f4eedb radial-gradient(#c7bda0 0.75px, transparent 1px);
  background-size: 15px 15px;
  overflow: hidden;
}
.bomb-field::before,
.bomb-field::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 5px;
  pointer-events: none;
  background: repeating-linear-gradient(
    -53deg,
    #514a38 0 5px,
    #e3cf9a 5px 11px
  );
}
.bomb-field::before {
  top: 0;
}
.bomb-field::after {
  bottom: 0;
}
.bomb-space {
  position: absolute;
  inset: calc(var(--disc) / 2 + 8px);
  isolation: isolate;
}
.game-panel .disc {
  position: absolute;
  width: var(--disc);
  height: var(--disc);
  display: grid;
  place-items: center;
  padding: 0;
  line-height: 1;
  transform: translate(-50%, -50%) rotate(var(--ink-tilt));
  border-radius: 50% 47% 51% 48%;
  border: 2px solid #373329;
  background: var(--ticket);
  box-shadow: 1px 3px 0 #5d5645;
  color: #29261e;
  font:
    700 clamp(27px, 4vw, 35px)/1 Gaegu,
    sans-serif;
}
.disc::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px dashed #7b7159;
  border-radius: 50%;
  pointer-events: none;
}
.disc:disabled {
  opacity: 1;
}
.disc:enabled:hover,
.disc:focus-visible {
  outline: 2px solid #784028;
  outline-offset: 1px;
}
.disc:focus-visible {
  z-index: 2;
}
.disc small {
  position: absolute;
  right: 2px;
  bottom: -1px;
  font: 700 13px/1 system-ui;
  color: inherit;
  background: inherit;
  border-radius: 50%;
}
.game-panel .disc.safe,
.game-panel .disc.exploded {
  pointer-events: none;
  z-index: -1;
  box-shadow: none;
}
.game-panel .disc.safe {
  border: 1.5px dashed #8f8972;
  background: #eeeada;
  color: #78705b;
}
.disc.safe::before {
  display: none;
}
.game-panel .disc.exploded {
  background: var(--rust);
  color: #fff7df;
  border-color: #542d20;
}
.disc.exploded::before {
  border-color: #e6b296;
}
.bomb-recap .bomb-head {
  display: none;
}
.bomb-recap {
  margin-top: 12px;
  color: var(--ink);
}
.ladder-scroll {
  max-height: min(50svh, 550px);
  overflow: auto;
  background: #fcf8ea;
}
.ladder-diagram {
  display: block;
  width: 100%;
  background: radial-gradient(#cdc5ad 0.65px, transparent 1px) 0 0/16px 16px;
  fill: #a13d2b;
}
.ladder-rails,
.ladder-ink {
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}
.ladder-rails {
  stroke: #817b69;
  stroke-width: 2;
}
.ladder-ink {
  stroke: #a13d2b;
  stroke-width: 4;
  stroke-dasharray: 1 1;
}
.ladder-diagram text {
  text-anchor: middle;
  fill: #413e32;
  font:
    700 18px Gaegu,
    sans-serif;
}
.ladder-diagram .endpoint {
  font-size: 15px;
  fill: #706a59;
}
.ladder-diagram .prize {
  font: 700 19px system-ui;
  fill: #8d4b27;
}
.ladder-diagram .chosen {
  fill: #972f1e;
  font-weight: 700;
}
.ladder-destination {
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  color: #823821;
  margin: 12px 0;
}
.ladder-tip {
  fill: #9f3822;
  stroke: #fff8df;
  stroke-width: 2px;
}
.last-rail .ladder-tip {
  stroke: #e5b25d;
  stroke-width: 3px;
}
.ladder-diagram .endpoint.chosen {
  font: 700 18px Gaegu, sans-serif;
  text-decoration: underline;
}
.ladder-destination[data-outcome] {
  font: 700 clamp(21px, 4vw, 28px)/1.2 Gaegu, sans-serif;
}
.ladder-rerun:not([hidden]) {
  display: flex;
  align-items: end;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}
.race-view {
  margin: 14px 0;
}
.race-toolbar,
.race-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
}
.race-toolbar {
  justify-content: space-between;
  flex-wrap: wrap;
}
.race-toolbar label {
  flex-direction: row;
  min-width: 0;
  flex: 1;
}
.race-track-select {
  min-width: 0;
  width: auto;
  max-width: 65%;
  flex: 1;
}
.race-count {
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: #534e40;
}
.race-follow {
  margin: 9px 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: #493e2d;
  overflow-wrap: anywhere;
}
.race-stage {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
  height: clamp(300px, 47vh, 480px);
  background: #fcf8e9;
  border: 1.5px solid #464237;
  border-radius: 6px;
}
.race-stage > svg,
.race-tags {
  position: absolute;
  inset: 0;
}
.race-connectors line {
  stroke: #514838;
  stroke-width: 1.3;
}
.race-ball circle {
  stroke: #302e26;
  stroke-width: 1.6;
}
.race-ball text {
  font:
    700 10px system-ui,
    sans-serif;
  fill: #25231c;
  text-anchor: middle;
  dominant-baseline: central;
}
.race-tags {
  pointer-events: none;
}
.race-tag {
  position: absolute;
  left: 0;
  top: 0;
  visibility: hidden;
  max-width: min(168px, 57%);
  background: #fffcf1;
  color: #25231d;
  border: 1px solid #6c6554;
  border-radius: 5px;
  padding: 1px 5px;
  font:
    700 14px/18px system-ui,
    sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-tag.tracked {
  max-width: calc(100% - 8px);
  color: #fffae8;
  background: #302e25;
  border-color: #302e25;
}

.race-order:empty {
  display: none;
}

.identity-tag {
  margin-inline-start: 0.35em;
  color: #67645d;
  font:
    600 0.88em/1.2 ui-monospace,
    monospace;
  letter-spacing: 0.025em;
  white-space: nowrap;
}
.handle-button {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  max-width: 12rem;
  min-height: 42px;
  margin-inline-start: auto;
  padding: 4px 7px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  line-height: 1.3;
  font-family: inherit;
  font-weight: 650;
  cursor: pointer;
}
.handle-button .identity-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.handle-button:hover .identity-name {
  text-decoration: underline;
}
#nick-form h2 {
  margin: 0;
}
.nick-field {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--text);
  border-radius: 8px;
  background: #fffdf5;
  padding-inline: 12px;
}
.nick-field:focus-within {
  outline: 2px solid var(--text);
}
.nick-field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding-inline: 0;
}
.nick-field input:focus {
  outline: none;
  box-shadow: none;
}
.nick-field .identity-tag {
  font-size: 16px;
}
#nick-form .primary {
  width: 100%;
  margin-top: 10px;
}
@media (min-width: 651px) and (max-width: 850px) {
  .handle-button {
    max-width: 8rem;
  }
  nav .nav-link {
    padding-inline: 8px;
  }
}
@media (max-width: 650px) {
  nav .nav-link {
    padding-inline: 8px;
    flex-shrink: 0;
  }
  .handle-button {
    font-size: 13px;
  }
}

#friend-search {
  width: 100%;
  margin: 6px 0;
}
#friend-results {
  --friend-row-height: 44px;
  max-height: calc(5 * var(--friend-row-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 14px;
}
.friend-result {
  width: 100%;
  height: var(--friend-row-height);
  padding: 6px 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  border: 0;
  border-bottom: 1px solid var(--edge);
  background: transparent;
  text-align: start;
}
.friend-result > span {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
}
.friend-result .identity-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-result:disabled {
  opacity: 1;
  background: #f5f2e8;
}
.friend-result[data-state="pending"] small {
  color: #805621;
}
.friend-result[data-state="playing"] small {
  color: #665f71;
}
.friend-result:enabled:hover,
.friend-result:focus-visible {
  background: #f1eedd;
}
.friend-result .identity-tag, .friend-result small { flex-shrink: 0; }
.friend-result small {
  color: #48604b;
  white-space: nowrap;
}
#inbox {
  position: fixed;
  bottom: max(16px, env(safe-area-inset-bottom));
  right: 16px;
  width: min(330px, calc(100% - 32px));
  padding: 16px;
  z-index: 12;
  border: 1.5px solid var(--text);
  border-radius: 12px;
  background: #fffbed;
  box-shadow: 3px 4px 0 #332f2538;
  overflow-wrap: anywhere;
}
#inbox p {
  margin: 5px 0;
}
#inbox .controls {
  margin: 9px 0 0;
}

@media (pointer: coarse), (max-width: 650px) {
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea {
    font-size: max(16px, 1rem);
  }
}

.walk-result-settling .game-panel :is(button, summary) {
  pointer-events: none;
  opacity: 0.55;
}

/* Keep every target still while the turn clock runs down. */
.bomb-clock {
  min-width: 3.4em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.bomb-odds {
  color: var(--rust);
}
.short-fuse .bomb-clock {
  color: #762c1d;
  background: #f2d5bd;
  border-radius: 4px;
}
.short-fuse[data-my-turn="true"] .bomb-field {
  box-shadow: inset 0 0 0 3px #ad5036, 2px 3px 0 #716750;
}
.race-call {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 9px 0 6px;
}
.race-call .race-follow {
  min-width: 0;
  margin: 0;
}
.race-finish {
  flex: none;
  color: #873921;
  font-size: 14px;
}

.rps-recap {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 12px 0;
  padding: 9px 12px;
  background: #f3ead5;
  border-block: 1px dashed #ad9874;
  overflow-wrap: anywhere;
}
.rps-recap strong { color: #8a3824; }

.card-ink.red, .game-panel .pick[data-value="red"] { color: #923e32; }
.playing-card.black, .card-ink.black, .game-panel .pick[data-value="black"] { color: #302e27; }

.dodge-stage { width: min(100%, 460px, 67vh); margin: 0 auto; }
.dodge-hud { display: flex; align-items: baseline; justify-content: space-between; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.dodge-hud b { font-size: 1.35rem; }
#dodge-arena { display: block; box-sizing: border-box; width: 100%; aspect-ratio: 1; border: 2px solid #303328; border-radius: 7px 4px 8px 3px; touch-action: none; user-select: none; }
.dodge-stage .hint { margin: 8px 0; }
.dodge-stick { display: none; }
#dodge-arena[hidden] { display: none; }
html:has(.dodge-stage[data-controlling]) { touch-action: none; }
body:has(.dodge-stage[data-controlling]) { touch-action: none; user-select: none; -webkit-user-select: none; }
.dodge-stick:not([hidden]) {
  position: fixed; z-index: 10; transform: translate(-50%, -50%); pointer-events: none;
  display: grid; place-items: center; width: 76px; height: 76px;
  box-sizing: border-box; border: 2px solid #47564255; border-radius: 50%; background: #7b896826;
}
.dodge-stick span { width: 32px; height: 32px; border-radius: 50%; background: #52644665; border: 1px solid #3c4b3570; }

/* Keep the live board in the viewport, with the room controls still reachable. */
body.focus-game #shell { display:none; }
body.focus-game main { width:100%; max-width:none; padding:0; }
.focus-game .game-panel { width:100%; max-width:none; min-height:100dvh; margin:0; padding:clamp(8px,1.5vw,20px); border:0; border-radius:0; }
.focus-game .game-panel > .spread:first-child { gap:8px; }
.focus-game .game-panel h1 { margin:0; font-size:clamp(22px,3vw,34px); }
.focus-game .game-panel hr { margin:6px 0; }
.panel-actions { display:flex; gap:6px; flex-shrink:0; }
.panel-actions button { padding:6px 10px; }
.focus-game .dodge-stage { width:min(100%,80dvh); }
.focus-game .bomb-field { height:clamp(270px,65dvh,800px); }
.focus-game .board-scroll { max-width:min(100%,155dvh); margin-inline:auto; }
.focus-game .game-panel[data-game-type="pinball"]:has(.race-stage) {
  height:100dvh; display:flex; flex-direction:column; padding-bottom:max(8px,env(safe-area-inset-bottom));
}
.focus-game .race-view { display:flex; flex:1; min-height:0; flex-direction:column; }
.focus-game .race-stage { flex:1; height:auto; min-height:100px; }
.focus-game .race-order { max-height:2.5em; overflow:auto; }
.focus-game .track-list { flex-shrink:0; }
.focus-game .race-view, .focus-game .game-panel[data-game-type="pinball"] > p { margin:4px 0; }
.track-list { display:flex; gap:5px; height:auto; overflow-x:auto; padding:4px 0; }
.track-list button { flex:0 0 auto; border:1px solid #696550; background:#fff9e7; border-radius:1em; padding:6px 13px; font-weight:bold; }
.track-list [aria-pressed="true"] { background:#39392e; color:white; }
.wave-hint { margin:4px 0; color:#824320; font-weight:700; }
.wave-ready { cursor:crosshair; outline:3px solid #be7548; }
.race-quarter { white-space:nowrap; font-size:14px; }
.bomb-burst { position:absolute; inset:0; display:grid; place-items:center; background:#46402d61; z-index:3; }
.bomb-burst div { text-align:center; display:grid; justify-items:center; padding:15px 26px; border:3px solid #393324; border-radius:8px; background:#ffdf9f; box-shadow:4px 5px #45372a; animation:bomb-pop .22s ease-out; }
.bomb-burst img { width:90px; } .bomb-burst strong { font: bold 32px Gaegu,sans-serif; }
@keyframes bomb-pop { from {transform:scale(.78) rotate(-6deg)} to {transform:scale(1)} }
@media (prefers-reduced-motion:reduce) { .bomb-burst div { animation:none; } }
.bomb-sheet[data-my-turn="true"] .bomb-head, .card-turn { padding:8px 12px; border-left:5px solid #97663e; background:#f8eac3; }
.card-turn, .garden-hud { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.garden-race { margin:auto; width:min(100%,calc(76dvh * .7273)); }
.garden { display:block; width:100%; border:2px solid #464738; border-radius:8px; }
.garden text { font: bold 10px system-ui,sans-serif; }
.cat-runner text { paint-order:stroke; stroke:#fffbea; stroke-width:2.8px; fill:#352e24; }
.snack { touch-action:none; font-weight:700; background:#f6d7a4; padding:8px 14px; border:2px solid #554b37; border-radius:12px; cursor:grab; }
.garden-hud, .snack-hint { margin:5px 0; }
.cat-picker { max-width:700px; margin:5vh auto; text-align:center; }
.cat-choices { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
.cat-choices button { padding:6px; background:#f7edd4; border:2px solid #625a43; border-radius:9px; }
.cat-choices svg { display:block; width:100%; height:auto; }
.cat-choices button { background:#fff3dc; }
.snack.dragging { cursor:grabbing; background:#f8c273; } .cat-choices small { display:block; }
.race-stage.wave-ready { touch-action:manipulation; }
.immersive-game main { position:fixed; inset:0; height:100dvh; min-height:0; overflow:auto; background:#fffdf3; }
.immersive-game .game-panel { padding: max(3px,env(safe-area-inset-top)) max(4px,env(safe-area-inset-right)) max(3px,env(safe-area-inset-bottom)) max(4px,env(safe-area-inset-left)); }
.immersive-game .game-panel[data-game-type="pinball"]:has(.race-stage) { position:relative; padding:0; overflow:hidden; }
.immersive-game .game-panel[data-game-type="pinball"]:has(.race-stage) > :is(hr,p,.spread) { display:none; }
.immersive-game .game-panel[data-game-type="pinball"]:has(.race-stage) > .spread:first-child {
  position:absolute; display:flex; right:max(8px,env(safe-area-inset-right)); top:max(6px,env(safe-area-inset-top)); z-index:3;
}
.immersive-game .game-panel[data-game-type="pinball"]:has(.race-stage) > .spread h1 { display:none; }
.immersive-game .race-view, .immersive-game .race-stage { margin:0; height:100%; border:0; border-radius:0; }
.immersive-game .race-call, .immersive-game .track-list, .immersive-game .wave-hint {
  position:absolute; z-index:2; background:#fff9e9ee; border-radius:7px;
}
.immersive-game .race-call { top:max(8px,env(safe-area-inset-top)); left:6px; margin:0; gap:6px; padding:4px 6px; max-width:calc(100% - 180px); flex-wrap:wrap; pointer-events:none; }
.immersive-game .race-call .race-count { display:none; }
.immersive-game .track-list { bottom:max(4px,env(safe-area-inset-bottom)); left:6px; right:6px; width:auto; padding:3px; }
.immersive-game .wave-hint { bottom:calc(48px + env(safe-area-inset-bottom)); left:6px; padding:1px 7px; pointer-events:none; }
