:root {
  --gold: #f1c40f;
  --gold2: #d4af37;
  --green1: #145f44;
  --green2: #052216;
  --red: #8b1e22;
  --panel: rgba(5, 12, 8, 0.9);
  --card-w: 134px;
  --gap: 10px;
  --back-w: 96px;
  --back-overlap: 0.34;
  --hand-overlap: 0;
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(circle at center, #1a2920 0%, #07100b 100%);
  color: #eee;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  user-select: none;
  overflow-x: hidden;
}
body {
  min-height: 100dvh;
}
button,
input {
  font: inherit;
  touch-action: manipulation;
}
#game {
  width: min(1320px, 100%);
  min-height: 100dvh;
  margin: auto;
  padding: max(8px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right))
    max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hidden {
  display: none !important;
}
.top {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 48px;
}
#status {
  min-width: 0;
  padding: 10px 14px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 13px;
  background: var(--panel);
  color: var(--gold);
  font-size: clamp(0.8rem, 2.4vw, 1.1rem);
  font-weight: 800;
  box-shadow: 0 5px 18px rgba(0, 0, 0, 0.4);
}
/* Фиксированная кнопка музыки — не зависит от сетки/грид-колонок top-бара,
       поэтому не "уезжает" при перестройке разметки (в т.ч. на мобильных). */
#music {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 11px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--gold);
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}
#roomBadge {
  max-width: 60vw;
  padding: 7px 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Плашка таймеров: ход + раунд, всегда сверху экрана, под строкой статуса */
.timer-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.timer-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 64px;
  height: 30px;
  padding: 4px 10px;
  border-radius: 9px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background: rgba(255, 255, 255, 0.045);
  color: #eef7eb;
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}
.timer-chip.round {
  color: #cbd3cd;
  border-color: rgba(212, 175, 55, 0.22);
}
.timer-chip.warning {
  color: #ffe4b5;
  border-color: rgba(255, 179, 71, 0.5);
  background: rgba(255, 130, 40, 0.08);
}
.timer-chip.danger {
  color: #ffd1d1;
  border-color: rgba(239, 83, 80, 0.72);
  background: rgba(198, 40, 40, 0.13);
}
.opponent-label,
.my-label {
  color: var(--gold2);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
}
#opponent {
  min-height: calc(var(--back-w) * 1.4 + 6px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0 8px;
  flex-wrap: nowrap;
  max-width: 100%;
}
.back {
  width: var(--back-w);
  height: calc(var(--back-w) * 1.4);
  flex: 0 0 auto;
  margin-left: calc(var(--back-w) * var(--back-overlap) * -1);
  border: 2px solid #fff;
  border-radius: 9px;
  background-color: #b71c1c;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}
.back:first-child {
  margin-left: 0;
}
.back::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  pointer-events: none;
}
.back.blue {
  background-color: #143a91;
}
.back.red {
  background-color: #b71c1c;
}
.skin-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 30;
}
.skin-modal {
  width: min(560px, 100%);
  max-height: 92dvh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.skin-title {
  font-size: 1.15rem;
  font-weight: 900;
  color: var(--gold);
  margin-bottom: 14px;
  text-align: center;
}
.skin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.skin-card {
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 14px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: center;
  color: #fff;
  font-weight: 800;
}
.skin-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.16);
}
.skin-preview {
  height: 210px;
  border-radius: 10px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-bottom: 8px;
  border: 0;
}
.skin-card small {
  display: block;
  opacity: 0.72;
  font-weight: 600;
  margin-top: 3px;
}
.skin-close,
.settings-close {
  margin-top: 14px;
  width: 100%;
  background: linear-gradient(135deg, #202b27, #111714) !important;
  border: 1px solid rgba(212, 175, 55, 0.55) !important;
  color: #fff !important;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.35);
}
.skin-view-btn {
  width: 100%;
  margin-top: 12px;
  min-height: 48px;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  border-color: #42a5f5;
}
.card-viewer {
  width: min(760px, 100%);
  max-height: 94dvh;
  background: rgba(8, 14, 12, 0.97);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 22px;
  padding: 14px;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-viewer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.card-viewer-title {
  font-size: 1.2rem;
  font-weight: 1000;
  color: var(--gold);
  text-align: center;
  flex: 1;
}
.card-viewer-count {
  min-width: 64px;
  text-align: center;
  padding: 8px 10px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 11px;
  color: #fff;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.04);
}
.viewer-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 520px;
  flex: 1;
}
.viewer-card-wrap {
  width: min(330px, 62vw);
  max-height: 68dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto;
}
.viewer-card {
  display: block;
  width: 100%;
  max-height: 68dvh;
  object-fit: contain;
  border-radius: 12px;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.65));
  touch-action: none;
}
.viewer-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(255, 255, 255, 0.045);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 2;
}
.viewer-arrow:first-child {
  left: 8px;
}
.viewer-arrow:last-child {
  right: 8px;
}
.viewer-arrow:hover {
  filter: brightness(1.2);
}
.viewer-arrow:disabled {
  opacity: 0.28;
  cursor: default;
}
.viewer-arrow:active {
  transform: translateY(-50%) scale(0.96);
}
.viewer-hint {
  text-align: center;
  color: #9fa9a2;
  font-size: 0.75rem;
}
.viewer-close {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  background: linear-gradient(135deg, #202b27, #111714);
  border: 1px solid rgba(212, 175, 55, 0.55);
  color: #fff;
}
.viewer-name {
  text-align: center;
  color: #fff;
  font-weight: 900;
  font-size: 0.95rem;
}

.result-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.result-modal {
  width: min(420px, 100%);
  background: linear-gradient(160deg, #0d1a13, #07100b);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 22px;
  padding: 28px 22px 22px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75);
  text-align: center;
  animation: resultPop 0.28s ease;
}
@keyframes resultPop {
  from {
    transform: scale(0.85);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
.result-emoji {
  font-size: 3.6rem;
  line-height: 1;
  margin-bottom: 10px;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}
.result-title {
  font-size: 1.5rem;
  font-weight: 1000;
  color: var(--gold);
  margin-bottom: 8px;
}
.result-sub {
  color: #cfd8d1;
  font-size: 0.92rem;
  margin-bottom: 20px;
  min-height: 1.2em;
}
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-actions .btn {
  min-height: 48px;
}
#resultRestart {
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  border-color: #42a5f5;
}
.result-close {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.3);
}
.result-modal.result-win {
  border-color: rgba(76, 175, 80, 0.7);
}
.result-modal.result-win .result-title {
  color: #8bf29a;
}
.result-modal.result-lose {
  border-color: rgba(239, 83, 80, 0.75);
}
.result-modal.result-lose .result-title {
  color: #ff8d8d;
}
#arena {
  flex: 1;
  min-height: 340px;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 175px;
  gap: 12px;
  align-items: center;
  position: relative;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn {
  min-height: 50px;
  border-radius: 13px;
  border: 1px solid transparent;
  font-weight: 900;
  letter-spacing: 0.4px;
  color: #fff;
  cursor: pointer;
  transition:
    transform 0.15s,
    filter 0.15s,
    box-shadow 0.15s;
}
.btn:active:not(:disabled) {
  transform: scale(0.97);
}
.btn:disabled {
  background: #222 !important;
  border-color: #333 !important;
  color: #666 !important;
  cursor: not-allowed;
  box-shadow: none;
}
#bito {
  background: linear-gradient(135deg, #2e7d32, #1b5e20);
  border-color: #4caf50;
}
#take {
  background: linear-gradient(135deg, #c62828, #8e0000);
  border-color: #ef5350;
}
#surrender {
  background: linear-gradient(135deg, #543d27, #34271c);
  border-color: #b58a57;
  color: #fff4e5;
}
#surrender:hover:not(:disabled) {
  border-color: #e3b77f;
}
#surrender:focus-visible {
  outline: 2px solid #ffe0ad;
  outline-offset: 3px;
}
#restart {
  display: none;
  background: linear-gradient(135deg, #1565c0, #0d47a1);
  border-color: #42a5f5;
}
#shareRoom {
  background: linear-gradient(135deg, #1976d2, #0d47a1);
  border-color: #42a5f5;
  color: #fff;
  box-shadow: 0 4px 12px rgba(13, 71, 161, 0.3);
}
#leave {
  background: #252525;
  border-color: #555;
}
#table {
  min-height: 300px;
  padding: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 12px;
  position: relative;
  border: 10px solid var(--red);
  outline: 4px solid #180806;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, var(--green1), var(--green2));
  box-shadow:
    inset 0 0 50px rgba(0, 0, 0, 0.8),
    0 14px 30px rgba(0, 0, 0, 0.65);
}
#table::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 2px solid rgba(235, 225, 180, 0.3);
  border-radius: 999px;
  pointer-events: none;
}
.pair {
  position: relative;
  width: var(--card-w);
  height: calc(var(--card-w) * 1.4);
}
.card {
  display: block;
  width: var(--card-w);
  height: calc(var(--card-w) * 1.4);
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(0 5px 9px rgba(0, 0, 0, 0.6));
}
.attack {
  position: absolute;
  inset: 0 auto auto 0;
}
.defend {
  position: absolute;
  top: 19%;
  left: 19%;
  transform: rotate(10deg);
  z-index: 2;
}
.info {
  min-height: 150px;
  padding: 10px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  text-align: center;
}
.info-deck {
  font-size: 0.82rem;
  line-height: 1.2;
}
.info-trump {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}
.info-trump-label {
  font-size: 0.78rem;
  color: #cbd3cd;
}
#deckCount {
  color: var(--gold);
  font-weight: 900;
}
#trump img {
  width: 92px;
  height: calc(92px * 1.4);
}
#hand {
  min-height: calc(var(--card-w) * 1.4 + 10px);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  flex-wrap: nowrap;
  gap: var(--gap);
  padding: 4px 4px max(6px, env(safe-area-inset-bottom));
  max-width: 100%;
}
#hand .card {
  position: relative;
  transition: transform 0.12s;
}
#hand .card:active {
  transform: translateY(-10px);
}
#hand .card {
  cursor: pointer;
}
#hand.scroll {
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
#hand.scroll::-webkit-scrollbar {
  display: none;
}
@media (hover: hover) {
  #hand .card:hover {
    transform: translateY(-10px);
    z-index: 99 !important;
  }
}
@media (hover: hover) {
  .btn:hover:not(:disabled) {
    filter: brightness(1.12);
    transform: translateY(-1px);
  }
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.9);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #fff;
  z-index: 50;
  display: none;
  max-width: min(90vw, 520px);
  text-align: center;
}
/* Lobby */
#lobby {
  width: min(620px, 100%);
  margin: auto;
  padding: 20px 12px 30px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.logo {
  text-align: center;
  color: var(--gold);
  font-size: clamp(2rem, 8vw, 3.4rem);
  font-weight: 1000;
  text-shadow: 0 4px 15px #000;
}
.subtitle {
  text-align: center;
  color: #bfc8c2;
  margin-top: -8px;
}
.panel {
  background: var(--panel);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 18px;
  padding: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
.create {
  display: flex;
  gap: 8px;
}
.create input {
  flex: 1;
  min-width: 0;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid #555;
  background: #111b15;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
  outline: none;
}
.primary {
  background: linear-gradient(135deg, #b78b00, #6f5300);
  border-color: #e1bc3d;
}
.room-create {
  width: 100%;
  min-height: 50px;
}
.room-share {
  width: 100%;
  min-height: 44px;
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(212, 175, 55, 0.3);
}
.mode-title {
  font-weight: 900;
  color: var(--gold);
  margin: 0 0 10px;
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.mode-option {
  position: relative;
}
.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.mode-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: #fff;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  transition: 0.15s;
}
.mode-option input:checked + label {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.14);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25) inset;
  color: var(--gold);
}
.mode-note {
  font-size: 0.72rem;
  color: #9fa9a2;
  margin: -4px 0 12px;
  text-align: center;
}
.room-mode {
  font-size: 0.72rem;
  color: #d9c46a;
  margin-top: 3px;
  font-weight: 800;
}
#roomList {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 48vh;
  overflow: auto;
}
.room {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}
.room-code {
  font-size: 1.15rem;
  font-weight: 1000;
  letter-spacing: 2px;
  color: var(--gold);
}
.room-meta {
  font-size: 0.75rem;
  color: #aeb8b1;
}
.room button {
  min-width: 92px;
  min-height: 42px;
}
.empty {
  text-align: center;
  color: #89938d;
  padding: 18px;
}
.room-share {
  margin-top: 8px;
}
.room-music {
  align-self: center;
  min-height: 42px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(212, 175, 55, 0.35);
}
.room-skin,
.room-settings {
  min-height: 42px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.35);
  border-color: rgba(212, 175, 55, 0.35);
}
.settings-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.settings-modal {
  width: min(520px, 100%);
  max-height: 90dvh;
  overflow: auto;
  background: #0a1510;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}
.settings-title {
  font-size: 1.35rem;
  font-weight: 1000;
  color: var(--gold);
  text-align: center;
  margin-bottom: 14px;
}
.setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.setting-row:last-of-type {
  border-bottom: 0;
}
.setting-label {
  font-weight: 850;
}
.setting-sub {
  display: block;
  font-size: 0.7rem;
  color: #929d96;
  margin-top: 3px;
  font-weight: 500;
}
.setting-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-toggle {
  min-width: 92px;
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: #111c16;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}
.setting-range {
  width: 145px;
  accent-color: #d4af37;
}
.theme-select {
  min-height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: #111c16;
  color: #fff;
  padding: 6px 9px;
}
.settings-close {
  width: 100%;
  margin-top: 14px;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(212, 175, 55, 0.3);
}
body.theme-light {
  background: radial-gradient(circle at center, #eef3ef 0%, #cfd8d2 100%);
  color: #172019;
}
body.theme-light .panel,
body.theme-light .settings-modal {
  background: rgba(245, 248, 246, 0.95);
  color: #172019;
}
body.theme-light .subtitle,
body.theme-light .room-meta,
body.theme-light .setting-sub {
  color: #536158;
}
body.theme-light .setting-toggle,
body.theme-light .theme-select {
  background: #e7ece9;
  color: #172019;
}
body.theme-blue {
  background: radial-gradient(circle at center, #182b45 0%, #07101c 100%);
}
body.theme-blue .panel,
body.theme-blue .settings-modal {
  background: rgba(7, 17, 30, 0.94);
}
@media (max-width: 1100px) {
  :root {
    --card-w: 116px;
    --back-w: 84px;
  }
}
@media (max-width: 850px) {
  :root {
    --card-w: 104px;
    --back-w: 72px;
  }
  #arena {
    grid-template-columns: 112px minmax(0, 1fr) 130px;
    gap: 8px;
  }
  #table {
    min-height: 290px;
    border-width: 8px;
  }
  .info {
    padding: 7px;
  }
  #trump img {
    width: 78px;
    height: calc(78px * 1.4);
  }
}
@media (max-width: 600px) {
  :root {
    --card-w: 88px;
    --gap: 4px;
    --back-w: 62px;
  }
  #game {
    gap: 5px;
  }
  .top {
    gap: 5px;
  }
  #roomBadge {
    max-width: 78vw;
    font-size: 0.68rem;
    padding: 6px 8px;
  }
  #status {
    padding: 8px 9px;
    font-size: 0.74rem;
    white-space: normal;
    line-height: 1.25;
  }
  #music {
    min-width: 38px;
    min-height: 38px;
    font-size: 0;
    padding: 8px;
  }
  #music::before {
    content: '🎵';
    font-size: 1rem;
  }
  .timer-chip {
    min-width: 54px;
    height: 26px;
    font-size: 0.7rem;
  }
  .back {
    border-width: 1px;
    border-radius: 6px;
  }
  #arena {
    min-height: 0;
    grid-template-columns: 1fr 1fr;
    grid-template-areas: 'table table' 'actions info';
    gap: 6px;
  }
  #table {
    grid-area: table;
    min-height: 200px;
    padding: 12px 7px;
    border-width: 6px;
    gap: 6px;
    border-radius: 52px;
  }
  #table::before {
    inset: 6px;
  }
  .actions {
    grid-area: actions;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .info {
    grid-area: info;
    min-height: 58px;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
  }
  .info-deck {
    font-size: 0.7rem;
    max-width: 70px;
  }
  .info-trump-label {
    display: none;
  }
  .btn {
    min-height: 46px;
    font-size: 0.68rem;
    flex: 1;
    min-width: 30%;
  }
  #shareRoom {
    min-width: 100%;
    font-size: 0.7rem;
  }
  #trump img {
    width: 52px;
    height: calc(52px * 1.4);
  }
  #hand {
    gap: 3px;
    padding-left: 2px;
    padding-right: 2px;
  }
  .create {
    flex-direction: column;
  }
  .room {
    padding: 10px;
  }
  .room button {
    min-width: 82px;
  }
  .logo {
    font-size: 2.2rem;
  }
}
@media (max-width: 600px) {
  .skin-modal {
    padding: 14px;
  }
  .skin-preview {
    height: 160px;
  }
  .card-viewer {
    padding: 10px;
    border-radius: 18px;
  }
  .viewer-arrow {
    width: 44px;
    height: 44px;
    font-size: 1.7rem;
  }
  .viewer-arrow:first-child {
    left: 4px;
  }
  .viewer-arrow:last-child {
    right: 4px;
  }
  .viewer-card-wrap,
  .viewer-card {
    width: min(260px, 64vw);
    max-height: 62dvh;
  }
  .viewer-hint {
    font-size: 0.68rem;
  }
  .viewer-name {
    font-size: 0.86rem;
  }
}
@media (max-width: 380px) {
  :root {
    --card-w: 78px;
    --back-w: 54px;
  }
  #table {
    min-height: 180px;
  }
  .btn {
    font-size: 0.62rem;
  }
}
@media (max-height: 600px) and (orientation: landscape) {
  :root {
    --card-w: 74px;
    --back-w: 52px;
  }
  #game {
    min-height: 100vh;
    gap: 3px;
    padding-top: 4px;
    padding-bottom: 4px;
  }
  #arena {
    grid-template-columns: 90px minmax(0, 1fr) 100px;
    grid-template-areas: none;
  }
  #table {
    grid-area: auto;
    min-height: 190px;
  }
  .actions,
  .info {
    grid-area: auto;
  }
}

#voteTimeout,
#voteResume {
  background: linear-gradient(135deg, #24556b, #153645);
  border-color: #649eaf;
  color: #fff;
  padding: 10px 14px;
}
#timeoutDialog {
  width: min(420px, calc(100% - 32px));
  box-sizing: border-box;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  margin: auto;
  padding: 28px 24px;
  border: 1px solid #b58a57;
  border-radius: 22px;
  background: linear-gradient(160deg, #13261c, #09130e);
  color: #fff4e5;
  text-align: center;
  box-shadow: 0 24px 80px #0009;
}
#timeoutDialog::backdrop {
  background: #000c;
}
#timeoutDialog h2 {
  margin: 0 0 12px;
}
#timeoutCountdown {
  font-size: 3.5rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #ffe0ad;
}
#timeoutDialog p {
  line-height: 1.5;
}
#voteResume {
  width: 100%;
}
.timeout-help {
  font-size: 0.85rem;
  color: #b9c9bf;
}
#voteTimeout:focus-visible,
#voteResume:focus-visible {
  outline: 2px solid #ffe0ad;
  outline-offset: 3px;
}
