:root {
  color-scheme: dark;
  --ink: #f7f2df;
  --muted: #afa88a;
  --panel: rgba(24, 31, 25, .88);
  --panel-strong: rgba(20, 27, 23, .96);
  --panel-2: rgba(43, 51, 38, .88);
  --line: rgba(211, 177, 82, .38);
  --gold: #edcc70;
  --gold-2: #bb8c22;
  --danger: #d76555;
  --ok: #7fc56f;
}

* { box-sizing: border-box; }

.hidden { display: none !important; }

body {
  min-height: 100vh;
  margin: 0;
  overflow: hidden;
  background: #071212;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
select,
input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(36, 45, 35, .9);
  color: var(--ink);
  font: inherit;
}

button {
  padding: 0 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.22);
}

button:hover,
button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

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

select,
input { padding: 0 10px; }

.game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, rgba(34, 111, 128, .34), transparent 45%), #071212;
}

.entry-active .game-shell {
  filter: blur(2px) brightness(.62);
  pointer-events: none;
}

.entry-screen {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 24%, rgba(237, 204, 112, .12), transparent 26%),
    radial-gradient(circle at 82% 68%, rgba(55, 183, 173, .16), transparent 30%),
    linear-gradient(135deg, rgba(4, 13, 14, .94), rgba(11, 34, 36, .9));
}

.entry-card {
  width: min(960px, 100%);
  max-height: calc(100vh - 56px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(237, 204, 112, .44);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(26, 35, 28, .96), rgba(12, 24, 23, .94));
  box-shadow: 0 28px 70px rgba(0,0,0,.52), inset 0 0 0 1px rgba(255,255,255,.05);
}

.entry-brand span,
.mode-head span {
  color: var(--gold);
  font-size: 13px;
  font-weight: 950;
}

.entry-brand h1,
.mode-head h1 {
  margin: 6px 0;
  color: #ffe492;
  font-size: 38px;
  line-height: 1;
}

.entry-brand p,
.mode-head p {
  margin: 0;
  color: #d8cfaa;
  font-size: 14px;
}

.auth-grid,
.mode-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.auth-card {
  width: min(560px, 100%);
}

.auth-grid {
  grid-template-columns: minmax(0, 1fr);
}

.auth-author {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  color: #d8cfaa;
  font-size: 13px;
  font-weight: 800;
}

.auth-author a {
  color: #ffe492;
  text-decoration: none;
  border-bottom: 1px solid rgba(237, 204, 112, .55);
}

.auth-author a:hover,
.auth-author a:focus-visible {
  color: #ffffff;
}

.auth-panel,
.room-list-panel {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(211, 177, 82, .26);
  border-radius: 10px;
  background: rgba(25, 35, 29, .72);
}

.auth-panel h2,
.create-room-form h2 {
  margin: 0;
  color: var(--gold);
}

.auth-panel label,
.create-room-form label {
  display: grid;
  gap: 6px;
  color: #dfd3aa;
  font-size: 13px;
  font-weight: 900;
}

.auth-panel button,
.create-room-form button,
.room-actions button {
  min-height: 46px;
  border-color: #d5a735;
  background: linear-gradient(#b8912d, #75571c);
  color: #fff0bd;
}

.entry-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: #f1cd72;
  font-size: 13px;
  font-weight: 800;
}

.loading-card {
  width: min(560px, 100%);
}

.asset-progress {
  position: relative;
  height: 18px;
  margin-top: 22px;
  overflow: hidden;
  border: 1px solid rgba(237, 204, 112, .48);
  border-radius: 999px;
  background: rgba(8, 15, 13, .68);
  box-shadow: inset 0 1px 8px rgba(0,0,0,.42);
}

.asset-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5fc278, #edcc70);
  box-shadow: 0 0 16px rgba(237, 204, 112, .46);
  transition: width .16s ease-out;
}

.asset-progress b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff7d6;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
}

.mode-card {
  width: min(1060px, 100%);
}

.mode-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.mode-head button,
.mode-head-actions button {
  min-width: 110px;
}

.mode-head-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mode-contact {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid rgba(211, 177, 82, .34);
  border-radius: 6px;
  background: rgba(25, 35, 29, .68);
  color: #ffe492;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.entry-screen .modal-backdrop {
  z-index: 5;
}

.mode-choice {
  position: relative;
  min-height: 250px;
  padding: 22px;
  overflow: hidden;
  border-radius: 10px;
  text-align: left;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2), 0 20px 40px rgba(0,0,0,.28);
}

.mode-choice::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .24;
  background:
    linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18), transparent 54%),
    repeating-linear-gradient(60deg, rgba(255,255,255,.1) 0 1px, transparent 1px 18px);
}

.mode-choice.online {
  background: linear-gradient(135deg, rgba(26, 81, 94, .96), rgba(17, 33, 36, .94));
}

.mode-choice.solo {
  background: linear-gradient(135deg, rgba(74, 73, 35, .96), rgba(22, 33, 25, .94));
}

.mode-choice span,
.mode-choice b,
.mode-choice small {
  position: relative;
  display: block;
}

.mode-choice span {
  color: #ffe492;
  font-size: 34px;
}

.mode-choice b {
  margin-top: 10px;
  color: #ffffff;
  font-size: 18px;
}

.mode-choice small {
  max-width: 280px;
  margin-top: 54px;
  color: #e2d8b7;
  font-size: 14px;
}

.lobby-card {
  width: min(1180px, 100%);
  min-height: min(720px, calc(100vh - 56px));
  display: flex;
  flex-direction: column;
}

.lobby-card .entry-message {
  margin-top: 8px;
}

.lobby-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lobby-head-actions button {
  min-width: 112px;
}

.primary-button {
  border-color: #d5a735;
  background: linear-gradient(#c09a31, #78591c);
  color: #fff0bd;
}

.lobby-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  flex: 1;
  min-height: 0;
  margin-top: 18px;
}

.room-list-panel {
  min-height: 0;
}

.room-list {
  display: block;
  min-height: 400px;
  max-height: min(62vh, 600px);
  overflow-y: auto;
  border: 1px solid rgba(211, 177, 82, .24);
  border-radius: 10px;
  background: rgba(14, 26, 22, .62);
}

.room-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.room-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(23, 33, 27, .98);
  box-shadow: 0 1px 0 rgba(211, 177, 82, .3);
}

.room-table th,
.room-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(211, 177, 82, .16);
  color: #ded2ad;
  text-align: left;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.room-table th {
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0;
}

.room-table td strong {
  color: #ffe492;
  font-size: 18px;
}

.room-table td:last-child,
.room-table th:last-child {
  width: 112px;
  text-align: right;
}

.room-table button {
  min-height: 34px;
  min-width: 78px;
  border-color: #d5a735;
  background: rgba(80, 65, 24, .86);
  color: #ffefbd;
}

.room-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  font-size: 12px;
  font-weight: 950;
}

.room-status.open {
  color: #c9f0bd;
  background: rgba(68, 123, 61, .25);
  border-color: rgba(127, 197, 111, .42);
}

.room-status.full {
  color: #ffd2c9;
  background: rgba(118, 55, 45, .25);
  border-color: rgba(215, 101, 85, .42);
}

.empty-row td {
  height: 340px;
  color: #d7cba3;
  text-align: center !important;
  font-size: 15px;
  font-weight: 900;
}

.empty-room,
.room-card-item,
.waiting-player {
  border: 1px solid rgba(211, 177, 82, .28);
  border-radius: 8px;
  background: rgba(31, 42, 34, .75);
}

.empty-room {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: #d7cba3;
  font-weight: 900;
}

.room-card-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
}

.room-card-item strong {
  display: block;
  color: var(--gold);
  font-size: 20px;
}

.room-card-item span,
.room-card-item p {
  margin: 0;
  color: #d8cfaa;
  font-size: 12px;
  font-weight: 800;
}

.room-card {
  width: min(720px, 100%);
}

.waiting-player-list {
  display: grid;
  gap: 9px;
  margin-top: 18px;
  max-height: 430px;
  overflow-y: auto;
}

.waiting-player {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
}

.waiting-player.local {
  border-color: var(--gold);
  background: rgba(62, 60, 31, .78);
}

.waiting-player.offline {
  border-color: rgba(215, 101, 85, .55);
  opacity: .78;
}

.waiting-player span {
  min-width: 0;
  font-size: 18px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.waiting-player i {
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
}

.waiting-player b {
  color: var(--gold);
  font-size: 13px;
}

.waiting-player button {
  min-height: 34px;
  color: #ffd9cf;
  border-color: rgba(215, 101, 85, .72);
}

.room-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.legacy-online-field {
  display: none !important;
}

.board-stage {
  position: absolute;
  inset: 0;
  background: #14596b;
  overflow: hidden;
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  image-rendering: pixelated;
}

canvas.dragging { cursor: grabbing; }

.hud-panel,
.turn-banner,
.room-controls,
.hand-dock,
.quick-nav,
.trade-row {
  position: absolute;
  z-index: 10;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(28, 36, 29, .94), rgba(17, 25, 22, .9));
  box-shadow: 0 18px 38px rgba(0,0,0,.34), inset 0 0 0 1px rgba(255,255,255,.04);
  backdrop-filter: blur(6px);
}

.players-panel {
  left: 14px;
  top: 10px;
  width: 380px;
  height: auto;
  max-height: min(388px, calc(100vh - 24px));
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
}

.brand h1 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0;
}

.players-list {
  display: grid;
  gap: 7px;
  flex: 0 1 auto;
  align-content: start;
  grid-auto-rows: max-content;
  min-height: 0;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  scrollbar-color: rgba(237, 204, 112, .72) rgba(255,255,255,.08);
  scrollbar-width: thin;
}

.players-list::-webkit-scrollbar { width: 7px; }
.players-list::-webkit-scrollbar-track { background: rgba(255,255,255,.08); border-radius: 999px; }
.players-list::-webkit-scrollbar-thumb { background: rgba(237, 204, 112, .72); border-radius: 999px; }

.debug-resources {
  left: 406px;
  top: 10px;
  width: 300px;
  max-height: min(388px, calc(100vh - 24px));
  padding: 10px;
  overflow: auto;
  scrollbar-width: thin;
}

.debug-resources h2 {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 18px;
  line-height: 1;
}

.debug-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  color: #f3ead0;
  font-size: 11px;
  font-weight: 850;
}

.debug-table th {
  padding: 5px 4px;
  color: var(--gold);
  text-align: center;
  background: rgba(18, 25, 20, .95);
}

.debug-table td {
  padding: 6px 4px;
  text-align: center;
  background: rgba(38, 49, 39, .78);
}

.debug-table th:first-child,
.debug-table td:first-child {
  text-align: left;
  border-radius: 6px 0 0 6px;
}

.debug-table th:last-child,
.debug-table td:last-child {
  border-radius: 0 6px 6px 0;
}

.debug-table .dot {
  width: 10px;
  height: 10px;
  margin-right: 6px;
}

.rank-stat-head,
.player-card {
  display: grid;
  grid-template-columns: 30px minmax(76px, 1fr) repeat(3, 36px) 48px 42px;
  gap: 5px;
  align-items: center;
  text-align: center;
  min-width: 0;
}

.rank-stat-head {
  position: sticky;
  top: 0;
  z-index: 1;
  min-height: 24px;
  border: 1px solid rgba(211, 177, 82, .22);
  border-radius: 6px;
  background: rgba(18, 25, 20, .95);
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.player-card {
  min-height: 34px;
  padding: 5px 7px;
  border: 1px solid rgba(211, 177, 82, .24);
  border-radius: 7px;
  background: rgba(50, 60, 42, .7);
  color: #fff4d8;
  font-size: 12px;
  font-weight: 900;
}

.player-card.active { border-color: var(--gold); }
.player-card.local { background: rgba(61, 65, 34, .82); }

.player-total-score {
  color: var(--gold) !important;
  font-size: 15px !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.5);
}

.player-name {
  display: flex;
  align-items: center;
  min-width: 0;
  text-align: left;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.offline-mark {
  display: inline-block;
  width: 19px;
  height: 19px;
  margin-left: 6px;
  background: url("assets/island/ui/broken-chain.svg") center / contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.58));
  opacity: .9;
  vertical-align: -4px;
}

.dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 8px;
  border: 1px solid rgba(255,255,255,.55);
  vertical-align: -2px;
}

.player-meta {
  color: #d8d0af;
  font-size: 11px;
  line-height: 1.35;
}

.turn-banner {
  left: 50%;
  top: -12px;
  width: 390px;
  padding: 26px 22px 18px;
  text-align: center;
  transform: translateX(-50%);
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  clip-path: none;
}

.turn-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  clip-path: polygon(0 0, 100% 0, 78% 100%, 22% 100%);
  background: linear-gradient(135deg, rgba(28, 36, 29, .96), rgba(17, 25, 22, .9));
  box-shadow: 0 18px 38px rgba(0,0,0,.34), inset 0 0 0 1px rgba(211, 177, 82, .38), inset 0 0 0 2px rgba(255,255,255,.04);
}

.turn-banner > * {
  position: relative;
  z-index: 1;
}

.turn-banner strong {
  display: block;
  color: var(--gold);
  font-size: 30px;
  line-height: 1;
}

.turn-banner strong.danger {
  color: #ff6a5f;
  text-shadow: 0 0 12px rgba(255, 76, 64, .5);
}

.turn-banner span {
  display: block;
  margin-top: 5px;
  color: #f3d88a;
  font-size: 13px;
  font-weight: 900;
}

.turn-banner small {
  display: block;
  margin-top: 4px;
  color: #d6cfb6;
  font-size: 11px;
  font-weight: 800;
}

.turn-progress {
  position: absolute;
  left: 50%;
  top: calc(100% + 7px);
  z-index: 2;
  width: 320px;
  height: 18px;
  margin: 0;
  transform: translateX(-50%);
  overflow: hidden;
  border: 1px solid rgba(237, 204, 112, .45);
  border-radius: 999px;
  background: rgba(8, 15, 13, .75);
}

.turn-progress i {
  position: absolute;
  inset: 0 auto 0 0;
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5fc278, #edcc70);
  box-shadow: 0 0 12px rgba(237, 204, 112, .45);
  transition: width .18s linear;
}

.turn-progress b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff7d6;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.75);
}

.turn-progress.ending {
  border-color: rgba(255, 94, 84, .9);
}

.turn-progress.ending i {
  background: linear-gradient(90deg, #ff3f36, #ff8a5c);
  box-shadow: 0 0 16px rgba(255, 74, 64, .88);
  animation: urgent-progress .42s steps(2, end) infinite;
}

.timer-pill {
  display: inline-grid;
  place-items: center;
  min-width: 136px;
  min-height: 36px;
  margin-top: 9px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 24, 22, .92);
  color: var(--gold);
  font-size: 18px;
  font-weight: 950;
  box-shadow: none;
}

.log-panel {
  right: 22px;
  top: 10px;
  width: 318px;
  height: 430px;
  max-height: calc(100vh - 360px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-title h2,
.hud-panel h2 {
  margin: 0;
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
}

.panel-title span {
  color: var(--gold);
  font-weight: 900;
}

.status-log {
  display: block;
  flex: 1;
  min-height: 0;
  max-height: none;
  margin: 0;
  padding: 2px 4px 2px 0;
  list-style: none;
  overflow-y: auto;
  scrollbar-width: thin;
}

.status-log li {
  display: block;
  min-width: 0;
  color: #e8dfbf;
  font-size: 12px;
  font-weight: 500;
  line-height: 20px;
  min-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}

.log-tabs button {
  position: relative;
  min-height: 32px;
  padding: 0 8px;
  border-color: rgba(237, 204, 112, .28);
  background: rgba(28, 38, 31, .84);
  color: #d9cfaa;
  box-shadow: none;
}

.log-tabs button.active {
  border-color: rgba(237, 204, 112, .74);
  background: linear-gradient(180deg, rgba(93, 78, 25, .72), rgba(31, 40, 31, .92));
  color: var(--gold);
}

.log-tabs b {
  position: absolute;
  right: 8px;
  top: -7px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d85245;
  color: #fff7dd;
  font-size: 10px;
  line-height: 1;
}

.chat-panel {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
}

.chat-messages {
  min-height: 0;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.chat-empty {
  display: grid;
  place-items: center;
  height: 100%;
  color: #9d967f;
  font-size: 12px;
}

.chat-message {
  display: grid;
  gap: 3px;
  margin-bottom: 7px;
  padding: 7px 8px;
  border: 1px solid rgba(211, 177, 82, .18);
  border-radius: 8px;
  background: rgba(19, 29, 24, .68);
}

.chat-message.mine {
  border-color: rgba(237, 204, 112, .42);
  background: rgba(66, 55, 20, .52);
}

.chat-message header {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.chat-message .dot {
  width: 9px;
  height: 9px;
  margin: 0;
}

.chat-message p {
  margin: 0;
  color: #efe5c2;
  font-size: 12px;
  line-height: 17px;
  word-break: break-word;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 6px;
}

.chat-form input,
.chat-form button {
  min-height: 34px;
}

.chat-form button {
  padding: 0 8px;
}

.trade-request-list {
  left: 14px;
  top: 410px;
  width: 380px;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 6px;
  height: 184px;
  padding: 8px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.trade-request-card {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(211, 177, 82, .3);
  border-radius: 8px;
  background: rgba(35, 44, 35, .78);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.trade-request-line {
  display: grid;
  grid-template-columns: 20px minmax(44px, 1fr) 14px minmax(44px, 1fr) 62px;
  align-items: center;
  gap: 4px;
}

.trade-request-player {
  min-width: 0;
  display: grid;
  place-items: center;
}

.trade-request-player .dot {
  margin: 0;
}

.trade-request-res {
  display: flex;
  min-height: 30px;
  gap: 3px;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 7px;
  background: rgba(8, 15, 13, .38);
}

.trade-request-res span {
  position: relative;
  display: grid;
  place-items: center;
}

.trade-request-res img {
  width: 26px;
  height: 26px;
}

.trade-request-res b {
  position: absolute;
  right: -5px;
  top: -5px;
  display: grid;
  place-items: center;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
}

.trade-request-res.offer b { background: #5fac68; }
.trade-request-res.request b { background: #d96458; }

.trade-request-arrow {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 15px;
  font-weight: 950;
}

.trade-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.trade-request-actions button {
  min-width: 28px;
  min-height: 28px;
  padding: 0 7px;
  font-size: 17px;
}

.trade-request-actions .reject {
  border-color: rgba(255, 97, 84, .62);
  color: #ff7b70;
}

.trade-request-actions .accept {
  border-color: rgba(95, 194, 120, .62);
  color: #79dd8e;
}

.actions-panel {
  right: 22px;
  top: auto;
  bottom: 12px;
  width: 318px;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 14px;
}

.build-costs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}

.cost-card {
  display: grid;
  width: 100%;
  color: inherit;
  text-align: left;
  gap: 6px;
  min-height: 70px;
  padding: 7px;
  border: 1px solid rgba(211, 177, 82, .24);
  border-radius: 6px;
  background: rgba(49, 59, 42, .72);
  box-shadow: none;
}

.cost-card:not(:disabled) {
  cursor: pointer;
}

.cost-card.selected {
  border-color: var(--gold);
  background: rgba(62, 48, 18, .86);
}

.cost-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #f5e6bb;
  font-weight: 950;
  font-size: 13px;
}

.cost-title span:last-child {
  color: var(--gold);
  font-size: 10px;
}

.cost-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cost-pill {
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 1px 6px;
  border: 1px solid #55614f;
  border-radius: 999px;
  color: #eee8d4;
  font-size: 11px;
  font-weight: 900;
}

.cost-pill.missing {
  color: #e1a098;
  border-color: #774238;
}

.cost-dot,
.res-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.45);
}

.action-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.action-footer.solo-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-footer button {
  min-height: 44px;
  font-size: 17px;
}

.action-footer #resetButton {
  border-color: #d5a735;
  background: linear-gradient(#c79b24, #9d7418);
  color: #fff2bd;
}

.action-footer .secondary-button {
  border-color: rgba(237, 204, 112, .48);
  background: rgba(30, 42, 34, .9);
  color: #eadcae;
  box-shadow: inset 0 -3px 0 rgba(0,0,0,.2);
}

.quick-nav {
  left: 22px;
  bottom: 12px;
  display: grid;
  grid-template-columns: repeat(3, 78px);
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.quick-stats {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-stats span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(23, 31, 26, .92);
  color: #e8dfbf;
  font-size: 12px;
  font-weight: 900;
}

.quick-stats b {
  color: var(--gold);
  font-size: 14px;
}

.quick-nav button {
  min-height: 72px;
  border-radius: 6px;
  color: var(--gold);
  font-size: 16px;
}

.hand-dock {
  left: 50%;
  bottom: -8px;
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: min(760px, calc(100vw - 760px));
  padding: 8px 16px 16px;
  overflow: visible;
  transform: translateX(-50%);
}

.resource-bar {
  display: flex;
  gap: 7px;
}

.resource-chip {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  align-items: center;
  width: 84px;
  min-height: 112px;
  padding: 6px 6px 26px;
  border: 1px solid rgba(211, 177, 82, .28);
  border-radius: 8px;
  background: rgba(48, 57, 41, .82);
  font-weight: 950;
}

.card-art {
  width: 64px;
  height: 64px;
  object-fit: contain;
  filter: drop-shadow(0 5px 8px rgba(0,0,0,.35));
  pointer-events: none;
}

.resource-chip span {
  margin-top: 2px;
  font-size: 14px;
}

.resource-chip b {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(111, 171, 96, .95);
  color: #fff;
}

.dev-cards {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 22;
  display: flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 24, 21, .96);
  box-shadow: 0 14px 32px rgba(0,0,0,.34);
}

.dev-cards.hidden {
  display: none;
}

.dev-menu-wrap {
  position: relative;
}

.dev-menu-button {
  position: relative;
  width: 84px;
  min-height: 112px;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  padding: 6px 6px 26px;
  color: var(--gold);
}

.dev-menu-button b {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(23, 27, 22, .95);
  color: var(--gold);
}

.dev-chip {
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  justify-items: center;
  width: 78px;
  min-height: 112px;
  padding: 7px 6px 28px;
  border: 1px dashed rgba(211, 177, 82, .42);
  border-radius: 8px;
  background: rgba(35, 42, 35, .72);
  color: #d4c390;
  font-weight: 900;
}

.dev-chip > span {
  max-width: 100%;
  font-size: 12px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dev-count {
  position: absolute;
  left: 50%;
  bottom: 6px;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(23, 27, 22, .95);
  color: var(--gold);
  transform: translateX(-50%);
}

.dev-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 18;
  display: none;
  width: 260px;
  padding: 10px 12px;
  border: 1px solid #8d7b53;
  border-radius: 8px;
  background: rgba(18, 22, 19, .98);
  color: #e9e1c8;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  box-shadow: 0 14px 30px rgba(0,0,0,.36);
  transform: translateX(-50%);
}

.dev-tip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 14px;
}

.dev-chip:hover .dev-tip,
.dev-chip:focus-within .dev-tip { display: block; }

.room-controls {
  position: static;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.room-controls label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.room-controls label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.room-controls label select,
.room-controls label input,
.room-controls > button {
  width: 100%;
}

.room-controls > button {
  grid-column: 1 / -1;
  min-height: 44px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(3, 8, 8, .58);
}

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

.trade-modal,
.settings-modal,
.create-room-modal,
.rules-modal,
.choice-modal {
  width: min(640px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(28, 36, 29, .98), rgba(17, 25, 22, .96));
  box-shadow: 0 22px 60px rgba(0,0,0,.42);
}

.settings-modal {
  overflow: hidden;
}

.online-settings-empty {
  display: grid;
  place-items: center;
  min-height: 132px;
  border: 1px dashed rgba(237, 204, 112, .34);
  border-radius: 8px;
  background: rgba(18, 25, 20, .72);
  color: #f0dfad;
  font-size: 18px;
  font-weight: 900;
}

.trade-modal .panel-title button,
.settings-modal .panel-title button,
.create-room-modal .panel-title button,
.rules-modal .panel-title button,
.choice-modal .panel-title button {
  min-width: 36px;
  min-height: 34px;
  padding: 0;
  font-size: 22px;
}

.rules-modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.rules-content {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
}

.rules-content section {
  padding: 12px;
  border: 1px solid rgba(211, 177, 82, .22);
  border-radius: 8px;
  background: rgba(28, 38, 31, .68);
}

.rules-content h3,
.rules-content p {
  margin: 0;
}

.rules-content h3 {
  color: var(--gold);
  font-size: 16px;
}

.rules-content p {
  margin-top: 7px;
  color: #e4d9b7;
  font-size: 13px;
  line-height: 1.65;
}

.create-room-modal {
  width: min(520px, calc(100vw - 32px));
}

.create-room-form {
  display: grid;
  gap: 14px;
}

.choice-modal {
  width: min(430px, calc(100vw - 32px));
}

.discard-modal {
  width: min(640px, calc(100vw - 32px));
}

.choice-modal p {
  margin: 0 0 14px;
  color: #e1d8b7;
  font-size: 14px;
  line-height: 1.5;
}

.robber-warnings {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.robber-warnings p {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(237, 204, 112, .28);
  border-radius: 8px;
  background: rgba(70, 55, 18, .42);
  color: #fff4d8;
  font-size: 13px;
  font-weight: 900;
}

.robber-warnings small {
  color: #cfc5a1;
  font-size: 11px;
  white-space: nowrap;
}

.choice-actions,
.victim-list {
  display: grid;
  gap: 10px;
}

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

.danger-button {
  border-color: rgba(255, 103, 86, .72);
  background: linear-gradient(#8b332a, #5a1d19);
  color: #ffe4dc;
}

.victim-list button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  text-align: left;
}

.victim-list i {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
}

.trade-row {
  position: static;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  gap: 8px;
  align-items: center;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.trade-builder {
  display: grid;
  gap: 10px;
}

.trade-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 108px;
  padding: 10px;
  border: 1px solid rgba(211, 177, 82, .24);
  border-radius: 8px;
  background: rgba(42, 10, 5, .68);
  overflow-x: auto;
}

.trade-box > span {
  color: #a99674;
  font-weight: 900;
}

.trade-palette {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.trade-res-card,
.trade-box-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  min-width: 0;
  min-height: 86px;
  padding: 6px 4px 22px;
  border: 1px solid rgba(211, 177, 82, .28);
  border-radius: 8px;
  background: rgba(35, 44, 35, .78);
  color: #f2e5ba;
  font-size: 12px;
  font-weight: 950;
}

.trade-box-card {
  flex: 0 0 74px;
}

.trade-res-card img,
.trade-box-card img {
  width: 48px;
  height: 48px;
}

.trade-res-card b,
.trade-box-card b {
  position: absolute;
  right: 5px;
  bottom: 5px;
  display: grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(111, 171, 96, .95);
  color: #fff;
  font-size: 12px;
}

.trade-swap {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.trade-status {
  display: grid;
  gap: 8px;
}

.trade-pending {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(211, 177, 82, .24);
  border-radius: 8px;
  background: rgba(35, 44, 35, .72);
  color: #e8dfbf;
  font-size: 12px;
  font-weight: 900;
}

.bank-tabs,
.bank-grid,
.discard-list,
.monopoly-choices {
  display: grid;
  gap: 10px;
}

.bank-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}

.bank-tabs button {
  min-height: 42px;
  color: #d8d0af;
}

.bank-tabs button.active {
  border-color: var(--gold);
  background: rgba(83, 66, 20, .9);
  color: var(--gold);
}

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

.bank-tab-panel.hidden {
  display: none;
}

.bank-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(211, 177, 82, .22);
  border-radius: 8px;
  background: rgba(38, 48, 39, .7);
}

.bank-card > span {
  color: #e6d9ad;
  font-size: 12px;
  font-weight: 900;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.bank-buy-choices {
  display: grid;
  gap: 10px;
}

.bank-sell-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 108px;
  padding: 8px 6px;
  border: 1px solid rgba(211, 177, 82, .28);
  border-radius: 8px;
  background: rgba(31, 43, 34, .82);
  color: #f2e5ba;
  font-weight: 950;
}

.bank-sell-card.selected {
  border-color: var(--gold);
  background: rgba(84, 65, 18, .82);
  box-shadow: 0 0 0 1px rgba(237, 204, 112, .38), 0 10px 24px rgba(0,0,0,.18);
}

.bank-sell-list {
  display: grid;
  gap: 10px;
}

.bank-sell-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  padding: 8px;
  border: 1px dashed rgba(211, 177, 82, .38);
  border-radius: 8px;
  background: rgba(9, 16, 14, .3);
  overflow-x: auto;
}

.bank-sell-selected > span {
  color: #aaa17f;
  font-size: 13px;
  font-weight: 900;
}

.bank-sell-chip {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 72px;
  min-height: 58px;
  padding: 5px;
  border-color: rgba(237, 204, 112, .42);
  background: rgba(38, 48, 39, .8);
}

.bank-sell-chip img {
  width: 34px;
  height: 34px;
}

.bank-sell-chip span {
  font-size: 11px;
}

.bank-sell-chip b,
.bank-sell-card b {
  position: absolute;
  right: 7px;
  top: 7px;
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--gold);
  color: #2b2117;
  font-size: 13px;
}

.bank-sell-choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.monopoly-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.bank-sell-card img {
  width: 56px;
  height: 56px;
}

.bank-sell-card small {
  color: #cfc5a1;
  font-size: 11px;
  font-weight: 800;
}

.bank-sell-card:not(:disabled),
.bank-sell-chip:not(:disabled) {
  cursor: pointer;
}

#confirmDiscardButton {
  width: 100%;
  margin-top: 12px;
}

#confirmYearButton,
#confirmMonopolyButton {
  width: 100%;
  margin-top: 14px;
}

.dice-overlay,
.dev-draw-overlay,
.victory-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  pointer-events: none;
  background: rgba(8, 20, 22, .18);
}

.round-splash {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 24;
  min-width: min(640px, calc(100vw - 80px));
  padding: 22px 46px;
  border-top: 2px solid rgba(237, 204, 112, .72);
  border-bottom: 2px solid rgba(237, 204, 112, .72);
  background: linear-gradient(90deg, transparent, rgba(14, 23, 18, .94) 18%, rgba(33, 42, 28, .96) 50%, rgba(14, 23, 18, .94) 82%, transparent);
  color: var(--gold);
  text-align: center;
  font-size: clamp(34px, 5vw, 68px);
  font-weight: 950;
  line-height: 1;
  text-shadow: 0 5px 0 rgba(0,0,0,.32);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.round-splash.hidden { display: none; }

.round-splash.showing {
  animation: round-splash-in 2s ease both;
}

.dice-overlay.hidden,
.dev-draw-overlay.hidden,
.victory-overlay.hidden { display: none; }

.dev-draw-overlay {
  z-index: 23;
  background: rgba(8, 20, 22, .12);
}

.dev-draw-card {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 190px;
  padding: 18px 20px 16px;
  border: 1px solid rgba(237, 204, 112, .58);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(21, 31, 26, .96), rgba(44, 39, 20, .92));
  box-shadow: 0 24px 70px rgba(0,0,0,.52), inset 0 0 0 1px rgba(255,255,255,.05);
}

.dev-draw-card p,
.dev-draw-card h2 {
  margin: 0;
}

.dev-draw-card p {
  color: #f2d989;
  font-size: 13px;
  font-weight: 900;
}

.dev-draw-card img {
  width: 118px;
  height: 156px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 12px 18px rgba(0,0,0,.45));
}

.dev-draw-card h2 {
  color: #fff0bb;
  font-size: 24px;
  line-height: 1;
}

.dev-draw-overlay.showing .dev-draw-card {
  animation: dev-draw-pop 2s ease both;
}

.victory-overlay {
  padding: 26px;
  background: rgba(7, 16, 15, .78);
  backdrop-filter: blur(4px);
}

.victory-effects {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti {
  position: absolute;
  left: var(--x);
  top: -18px;
  width: 9px;
  height: 15px;
  border-radius: 2px;
  background: var(--color);
  box-shadow: 0 0 10px color-mix(in srgb, var(--color) 60%, transparent);
  opacity: 0;
  transform: rotate(var(--rot));
  animation: confetti-fall var(--dur) linear var(--delay) infinite both;
}

.firework {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #fff 0 12%, var(--color) 14% 18%, transparent 20%),
    conic-gradient(from 0deg, transparent 0 8%, var(--color) 9% 11%, transparent 12% 22%, var(--color) 23% 25%, transparent 26% 36%, var(--color) 37% 39%, transparent 40% 50%, var(--color) 51% 53%, transparent 54% 64%, var(--color) 65% 67%, transparent 68% 78%, var(--color) 79% 81%, transparent 82%);
  filter: drop-shadow(0 0 12px var(--color));
  opacity: 0;
  transform: translate(-50%, -50%) scale(.15);
  animation: firework-burst 1.45s ease-out var(--delay) infinite both;
}

.victory-board {
  position: relative;
  z-index: 1;
  width: min(920px, calc(100vw - 52px));
  height: min(680px, calc(100vh - 90px));
  max-height: min(680px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(237, 204, 112, .48);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(18, 31, 24, .96), rgba(12, 23, 20, .94));
  box-shadow: 0 22px 70px rgba(0,0,0,.48);
  pointer-events: auto;
}

.victory-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid rgba(237, 204, 112, .28);
}

.victory-head p {
  margin: 0 0 4px;
  color: #bfc9af;
  font-size: 13px;
  font-weight: 700;
}

.victory-head h2 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(24px, 3.4vw, 42px);
  line-height: 1.08;
}

.victory-head > b {
  flex: 0 0 auto;
  color: #fff4d8;
  font-size: 18px;
}

.victory-table {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.victory-row {
  display: grid;
  grid-template-columns: 56px minmax(130px, 1.4fr) repeat(5, minmax(62px, .62fr)) minmax(110px, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 14px;
  color: #f5ead0;
  font-size: 15px;
  font-weight: 800;
}

.victory-row.header {
  min-height: 34px;
  color: var(--gold);
  font-size: 13px;
  border-bottom: 1px solid rgba(237, 204, 112, .2);
}

.victory-row:not(.header) {
  margin-top: 6px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.045);
}

.victory-row.winner {
  border-color: rgba(237, 204, 112, .52);
  background: linear-gradient(90deg, rgba(173, 126, 31, .34), rgba(255,255,255,.055));
}

.victory-player {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.victory-player i {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid rgba(255,255,255,.65);
  border-radius: 50%;
}

.victory-rank {
  color: var(--gold);
  font-size: 19px;
}

.victory-footer {
  display: flex;
  justify-content: center;
  padding: 14px 20px 18px;
  border-top: 1px solid rgba(237, 204, 112, .22);
}

.victory-footer button {
  min-width: 180px;
  min-height: 46px;
  border-color: #d5a735;
  background: linear-gradient(#c09a31, #78591c);
  color: #fff0bd;
}

.dice-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 12px;
  width: min(1120px, calc(100vw - 52px));
  perspective: 640px;
}

.dice-pair {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 12px 10px 10px;
  border: 1px solid rgba(237, 204, 112, .46);
  border-radius: 8px;
  background: rgba(15, 24, 19, .84);
  box-shadow: 0 16px 40px rgba(0,0,0,.28);
}

.dice-player {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 128px;
  color: #fff4d8;
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dice-player i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255,244,216,.28);
}

.dice-pips {
  display: flex;
  gap: 10px;
}

.dice-pair b {
  color: var(--gold);
  font-size: 14px;
}

.dice-box span,
.dice-pips span {
  position: relative;
  display: block;
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255,244,216,.72);
  border-radius: 12px;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,255,255,.65), transparent 18%),
    linear-gradient(145deg, color-mix(in srgb, var(--dice-color, #edcc70) 92%, #ffffff 8%), color-mix(in srgb, var(--dice-color, #edcc70) 72%, #000000 28%));
  color: #1c1710;
  box-shadow: 0 16px 0 rgba(0,0,0,.24), inset 0 -8px 0 rgba(0,0,0,.16), inset 0 5px 0 rgba(255,255,255,.24);
  transform-style: preserve-3d;
}

.dice-box span::after,
.dice-pips span::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.22);
}

.dice-box span i,
.dice-pips span i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff7d8;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.28), 0 1px 2px rgba(0,0,0,.38);
}

.dice-box span[data-value="1"] i:nth-child(1), .dice-pips span[data-value="1"] i:nth-child(1) { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.dice-box span[data-value="2"] i:nth-child(1), .dice-pips span[data-value="2"] i:nth-child(1) { left: 24%; top: 24%; }
.dice-box span[data-value="2"] i:nth-child(2), .dice-pips span[data-value="2"] i:nth-child(2) { right: 24%; bottom: 24%; }
.dice-box span[data-value="3"] i:nth-child(1), .dice-pips span[data-value="3"] i:nth-child(1) { left: 23%; top: 23%; }
.dice-box span[data-value="3"] i:nth-child(2), .dice-pips span[data-value="3"] i:nth-child(2) { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.dice-box span[data-value="3"] i:nth-child(3), .dice-pips span[data-value="3"] i:nth-child(3) { right: 23%; bottom: 23%; }
.dice-box span[data-value="4"] i:nth-child(1), .dice-pips span[data-value="4"] i:nth-child(1) { left: 23%; top: 23%; }
.dice-box span[data-value="4"] i:nth-child(2), .dice-pips span[data-value="4"] i:nth-child(2) { right: 23%; top: 23%; }
.dice-box span[data-value="4"] i:nth-child(3), .dice-pips span[data-value="4"] i:nth-child(3) { left: 23%; bottom: 23%; }
.dice-box span[data-value="4"] i:nth-child(4), .dice-pips span[data-value="4"] i:nth-child(4) { right: 23%; bottom: 23%; }
.dice-box span[data-value="5"] i:nth-child(1), .dice-pips span[data-value="5"] i:nth-child(1) { left: 23%; top: 23%; }
.dice-box span[data-value="5"] i:nth-child(2), .dice-pips span[data-value="5"] i:nth-child(2) { right: 23%; top: 23%; }
.dice-box span[data-value="5"] i:nth-child(3), .dice-pips span[data-value="5"] i:nth-child(3) { left: 50%; top: 50%; transform: translate(-50%, -50%); }
.dice-box span[data-value="5"] i:nth-child(4), .dice-pips span[data-value="5"] i:nth-child(4) { left: 23%; bottom: 23%; }
.dice-box span[data-value="5"] i:nth-child(5), .dice-pips span[data-value="5"] i:nth-child(5) { right: 23%; bottom: 23%; }
.dice-box span[data-value="6"] i:nth-child(1), .dice-pips span[data-value="6"] i:nth-child(1) { left: 23%; top: 20%; }
.dice-box span[data-value="6"] i:nth-child(2), .dice-pips span[data-value="6"] i:nth-child(2) { right: 23%; top: 20%; }
.dice-box span[data-value="6"] i:nth-child(3), .dice-pips span[data-value="6"] i:nth-child(3) { left: 23%; top: 50%; transform: translateY(-50%); }
.dice-box span[data-value="6"] i:nth-child(4), .dice-pips span[data-value="6"] i:nth-child(4) { right: 23%; top: 50%; transform: translateY(-50%); }
.dice-box span[data-value="6"] i:nth-child(5), .dice-pips span[data-value="6"] i:nth-child(5) { left: 23%; bottom: 20%; }
.dice-box span[data-value="6"] i:nth-child(6), .dice-pips span[data-value="6"] i:nth-child(6) { right: 23%; bottom: 20%; }

.dice-overlay.rolling .dice-box span {
  animation: dice-drop .76s cubic-bezier(.16,.84,.26,1) both, dice-shake .16s steps(2, end) infinite;
}

.dice-overlay.rolling .dice-box span:nth-child(2) {
  animation-delay: .08s, 0s;
}

.dice-overlay strong {
  min-width: 160px;
  padding: 8px 16px;
  border: 2px solid #8d7b53;
  border-radius: 6px;
  background: rgba(28, 33, 29, .9);
  color: var(--gold);
  text-align: center;
  font-size: 22px;
}

@keyframes dice-drop {
  0% { opacity: 0; transform: translateY(-160px) rotateX(70deg) rotateZ(-35deg) scale(.82); }
  62% { opacity: 1; transform: translateY(10px) rotateX(0deg) rotateZ(8deg) scale(1.06); }
  100% { opacity: 1; transform: translateY(0) rotateX(0deg) rotateZ(0deg) scale(1); }
}

@keyframes dice-shake {
  50% { filter: brightness(1.12); }
}

@keyframes round-splash-in {
  0% { opacity: 0; transform: translate(-50%, -45%) scale(.94); }
  18%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -54%) scale(1.03); }
}

@keyframes dev-draw-pop {
  0% { opacity: 0; transform: translateY(18px) scale(.9); }
  16%, 76% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(1.03); }
}

@keyframes confetti-fall {
  0% { opacity: 0; transform: translate3d(0, -20px, 0) rotate(var(--rot)); }
  8% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 105vh, 0) rotate(calc(var(--rot) + 780deg)); }
}

@keyframes firework-burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.12); }
  18% { opacity: 1; }
  78% { opacity: .75; transform: translate(-50%, -50%) scale(9); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(11); }
}

@keyframes urgent-progress {
  50% { filter: brightness(1.55); opacity: .55; }
}

@media (max-width: 1200px) {
  .players-panel { width: 340px; }
  .debug-resources {
    left: 366px;
    width: min(300px, calc(100vw - 388px));
  }
  .trade-request-list { width: 340px; }
  .log-panel,
  .actions-panel,
  .room-controls,
  .trade-row { width: 318px; }
  .settings-modal .room-controls,
  .trade-modal .trade-row { width: 100%; }
  .hand-dock { max-width: min(650px, calc(100vw - 520px)); }
  .resource-chip, .dev-chip { width: 104px; }
}

@media (max-width: 900px) {
  body { overflow: auto; }
  .game-shell { min-height: 1180px; height: auto; }
  .players-panel, .debug-resources, .trade-request-list, .log-panel, .actions-panel, .room-controls, .trade-row, .quick-nav, .hand-dock, .turn-banner {
    position: relative;
    inset: auto;
    transform: none;
    width: auto;
    max-width: none;
    margin: 10px;
  }
  .board-stage { position: relative; height: 520px; }
  .game-shell { display: grid; }
  .hand-dock, .resource-bar, .dev-cards { flex-wrap: wrap; }
  .settings-modal .room-controls,
  .trade-modal .trade-row {
    position: static;
    margin: 0;
  }
}
