/* Wild Safari — 2x2 stage layout */
:root {
  --ws-bg-1: #1a3a2a;
  --ws-bg-2: #0c1f15;
  --ws-sand: #e8d5a8;
  --ws-gold: #d4a84b;
  --ws-cream: #f7f0e0;
  --ws-ink: #142218;
  --ws-panel: rgba(10, 26, 16, 0.88);
  --ws-panel-border: rgba(232, 213, 168, 0.28);
  --ws-accent: #5cb88a;
  --ws-danger: #c45c4a;
  --ws-hand-card: clamp(72px, 12vw, 200px);
  --ws-played-card: clamp(170px, 15vw, 260px);
  --ws-hand-peek: clamp(22px, 3.5vw, 56px);
  --ws-played-peek: clamp(22px, 3.5vw, 56px);
  --ws-fig: clamp(96px, 13vw, 170px);
  --ws-stock-fig: clamp(110px, 14vw, 190px);
  --ws-stock-scale: 1;
  --ws-herd-scale: 1;
  --ws-font: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }

.ws-body {
  font-family: var(--ws-font);
  color: var(--ws-cream);
  background:
    radial-gradient(ellipse at 20% 15%, rgba(92, 184, 138, 0.14), transparent 45%),
    radial-gradient(ellipse at 80% 85%, rgba(212, 168, 75, 0.1), transparent 40%),
    linear-gradient(165deg, var(--ws-bg-1), var(--ws-bg-2));
  overflow: hidden;
}

.ws-app {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  height: 100dvh;
  height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.35rem 0.45rem 0.35rem;
  gap: 0.3rem;
  position: relative;
  isolation: isolate;
  z-index: 1;
}

.ws-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.7rem;
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  background: var(--ws-panel);
  border: 1px solid var(--ws-panel-border);
}

.ws-brand {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.92rem;
  color: var(--ws-gold);
  line-height: 1.15;
}
.ws-brand span {
  display: block;
  font-size: 0.6rem;
  font-weight: 600;
  color: rgba(247, 240, 224, 0.58);
  letter-spacing: 0.12em;
}

.ws-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  font-size: 0.75rem;
}

.ws-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(232, 213, 168, 0.1);
  border: 1px solid rgba(232, 213, 168, 0.18);
}
.ws-chip.is-turn {
  background: rgba(92, 184, 138, 0.25);
  border-color: rgba(92, 184, 138, 0.55);
  color: #c8f0d8;
}

.ws-turn-timer {
  position: relative;
  padding: 0.4rem 0.65rem 0.5rem;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 48, 34, 0.95), rgba(12, 28, 18, 0.98));
  border: 1px solid rgba(232, 213, 168, 0.22);
  overflow: hidden;
}
.ws-turn-timer.is-idle {
  opacity: 0.55;
}
.ws-turn-timer.is-warn {
  border-color: rgba(255, 176, 72, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 176, 72, 0.2);
}
.ws-turn-timer.is-critical {
  border-color: rgba(255, 96, 96, 0.8);
  box-shadow: 0 0 18px rgba(255, 70, 70, 0.28);
  animation: ws-timer-pulse 0.7s ease-in-out infinite;
}
.ws-turn-timer-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.ws-turn-timer-label {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: rgba(247, 240, 224, 0.88);
}
.ws-turn-timer-remain {
  font-size: 1.15rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ws-gold);
  min-width: 2.4rem;
  text-align: right;
}
.ws-turn-timer.is-warn .ws-turn-timer-remain {
  color: #ffb347;
}
.ws-turn-timer.is-critical .ws-turn-timer-remain {
  color: #ff6b6b;
}
.ws-turn-timer-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.ws-turn-timer-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(1);
  border-radius: inherit;
  background: linear-gradient(90deg, #5cb88a, #d4a84b);
  transition: transform 0.12s linear, background 0.25s ease;
  will-change: transform;
}
.ws-turn-timer.is-warn .ws-turn-timer-bar {
  background: linear-gradient(90deg, #e39b2d, #ffcf70);
}
.ws-turn-timer.is-critical .ws-turn-timer-bar {
  background: linear-gradient(90deg, #d64545, #ff8a5c);
}
@keyframes ws-timer-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.18); }
}

.ws-players {
  display: flex;
  align-items: flex-start;
  align-self: start;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.15rem;
  min-height: 0;
}

/* Mobile: "status" bottom sheet toggle */
.ws-mobile-state-toggle {
  display: none;
}

.ws-mobile-state-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: flex-end;
  justify-content: center;
  padding: 0 max(0.4rem, env(safe-area-inset-right)) max(0.35rem, env(safe-area-inset-bottom)) max(0.4rem);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
}

.ws-mobile-state-drawer.is-open {
  display: flex;
}

.ws-mobile-state-sheet {
  width: min(720px, 98vw);
  max-height: min(72vh, 620px);
  border-radius: 16px;
  background: rgba(8, 20, 14, 0.98);
  border: 1px solid rgba(232, 213, 168, 0.28);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ws-mobile-state-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(232, 213, 168, 0.18);
  background: rgba(0, 0, 0, 0.18);
}

.ws-mobile-state-title {
  color: var(--ws-sand);
  font-size: 0.95rem;
  font-weight: 900;
}

.ws-mobile-state-body {
  padding: 0.95rem 1rem 1.1rem;
  overflow: auto;
}

.ws-mobile-state-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
}

.ws-mobile-state-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(232, 213, 168, 0.14);
  padding: 0.7rem 0.8rem;
}

.ws-mobile-state-card-title {
  font-weight: 900;
  color: var(--ws-cream);
  opacity: 0.95;
  margin-bottom: 0.45rem;
  font-size: 0.86rem;
}

.ws-mobile-state-rows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ws-mobile-state-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  font-size: 0.82rem;
  color: rgba(247, 240, 224, 0.84);
  font-weight: 700;
}

.ws-mobile-state-row strong {
  font-weight: 900;
  color: var(--ws-gold);
}

.ws-player {
  flex: 1 1 0;
  align-self: flex-start;
  min-width: 130px;
  max-width: 220px;
  height: auto;
  padding: 0.4rem 0.55rem 0.45rem;
  border-radius: 12px;
  background: linear-gradient(165deg, rgba(18, 36, 24, 0.92), rgba(8, 18, 12, 0.95));
  border: 1px solid rgba(232, 213, 168, 0.18);
  font-size: 0.72rem;
}
.ws-player.is-current {
  border-color: rgba(92, 184, 138, 0.75);
  background: linear-gradient(165deg, rgba(28, 70, 48, 0.95), rgba(12, 36, 24, 0.98));
  box-shadow: 0 0 0 1px rgba(92, 184, 138, 0.25), 0 6px 18px rgba(0, 0, 0, 0.25);
}
.ws-player.is-me {
  box-shadow: inset 0 0 0 1px rgba(212, 168, 75, 0.55);
}
.ws-player.is-me.is-current {
  box-shadow: inset 0 0 0 1px rgba(212, 168, 75, 0.55), 0 0 0 1px rgba(92, 184, 138, 0.25);
}
.ws-player-head {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.78rem;
}
.ws-player-meeple {
  width: 22px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.35));
}
.ws-player-head small {
  opacity: 0.65;
  font-weight: 600;
}
.ws-player-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.ws-player-stats {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-left: auto;
  flex-shrink: 0;
}
.ws-player-stat {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(247, 240, 224, 0.82);
}
.ws-player-stat strong {
  color: var(--ws-gold);
  font-weight: 800;
}
.ws-player-stat i {
  color: var(--ws-gold);
  font-size: 0.58rem;
}
@media (max-width: 820px) {
  .ws-player-stats { gap: 0.15rem; }
  .ws-player-stat { padding: 0.03rem 0.22rem; font-size: 0.56rem; }
}
.ws-player-score {
  margin-top: 0.2rem;
  display: flex;
  align-items: baseline;
  gap: 0.15rem;
  line-height: 1;
}
.ws-player-score strong {
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  font-weight: 900;
  color: var(--ws-gold);
  letter-spacing: -0.02em;
  text-shadow: 0 2px 8px rgba(212, 168, 75, 0.25);
}
.ws-player-score small {
  font-size: 0.72rem;
  font-weight: 800;
  color: rgba(247, 240, 224, 0.65);
}
.ws-player-time {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(247, 240, 224, 0.72);
}
.ws-player.is-current .ws-player-time {
  color: #c8f0d8;
}
.ws-player-animals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  margin-top: 0.3rem;
}
.ws-player-animals span {
  display: inline-flex;
  align-items: center;
  gap: 0.08rem;
  padding: 0.04rem 0.25rem;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.62rem;
}
.ws-player-animals img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

/* ===== Stage 2x2 ===== */
.ws-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.35fr);
  grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr);
  grid-template-areas:
    "stock played"
    "mine hand";
  gap: 0.4rem;
  min-height: 0;
  overflow: hidden;
  width: 100%;
}

.ws-zone-stock { grid-area: stock; }
.ws-zone-played { grid-area: played; }
.ws-zone-mine { grid-area: mine; }
.ws-zone-hand { grid-area: hand; }

/* Focus dim — guide attention to the active action zone */
.ws-stage.is-focus-play .ws-zone-stock,
.ws-stage.is-focus-take .ws-zone-hand {
  position: relative;
}
.ws-stage.is-focus-play .ws-zone-stock::after,
.ws-stage.is-focus-take .ws-zone-hand::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(4, 10, 8, 0.55);
  pointer-events: none;
  z-index: 8;
  transition: opacity 0.25s ease;
}
.ws-stage.is-focus-play .ws-zone-hand,
.ws-stage.is-focus-take .ws-zone-stock {
  box-shadow: 0 0 0 2px rgba(212, 168, 75, 0.35), 0 10px 28px rgba(0, 0, 0, 0.2);
}

.ws-stock-wrap,
.ws-herd-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.ws-zoom-controls {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  z-index: 12;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  max-width: min(100%, 230px);
  justify-content: flex-end;
  padding: 0.2rem;
  border-radius: 10px;
  background: rgba(8, 18, 12, 0.78);
  border: 1px solid rgba(232, 213, 168, 0.28);
  backdrop-filter: blur(4px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.ws-herd-total {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  min-width: 3.4rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: rgba(8, 18, 12, 0.86);
  border: 1px solid rgba(212, 168, 75, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  pointer-events: none;
  line-height: 1;
}
.ws-herd-total .ws-fig-coin {
  font-size: 1rem;
}
.ws-herd-total-num {
  font-size: 1.05rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ws-gold);
  letter-spacing: -0.02em;
}
.ws-zoom-btn {
  min-width: 1.7rem;
  height: 1.7rem;
  padding: 0 0.35rem;
  border: none;
  border-radius: 7px;
  background: rgba(232, 213, 168, 0.12);
  color: var(--ws-cream);
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}
.ws-zoom-btn:hover {
  background: rgba(212, 168, 75, 0.35);
  color: #fff;
}
.ws-zoom-reset {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.ws-zoom-btn.ws-zoom-text {
  font-size: 0.6rem;
  font-weight: 800;
  min-width: auto;
  padding: 0 0.4rem;
}

.ws-played-tabs {
  display: inline-flex;
  gap: 0.2rem;
  padding: 0.12rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(232, 213, 168, 0.2);
}
.ws-played-tab {
  border: none;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.7rem;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  color: rgba(247, 240, 224, 0.65);
}
.ws-played-tab.is-active {
  background: linear-gradient(180deg, #f0d48a, #d4a84b);
  color: #142218;
}

.ws-panel-box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-radius: 14px;
  background: var(--ws-panel);
  border: 1px solid var(--ws-panel-border);
  padding: 0.45rem 0.5rem 0.55rem;
  overflow: hidden;
}

.ws-zone-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--ws-sand);
  margin-bottom: 0.35rem;
  flex-shrink: 0;
}
.ws-zone-title-main {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.ws-zone-title small {
  font-weight: 600;
  font-size: 0.65rem;
  color: rgba(247, 240, 224, 0.55);
}
.ws-stock-count {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #142218;
  background: linear-gradient(180deg, #f0d48a, #d4a84b);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

/* Hand — cool slate felt */
.ws-zone-hand {
  background:
    linear-gradient(160deg, rgba(28, 48, 62, 0.92), rgba(14, 28, 38, 0.95)),
    radial-gradient(ellipse at 20% 0%, rgba(90, 140, 170, 0.18), transparent 55%);
  border-color: rgba(140, 180, 200, 0.28);
}
.ws-zone-hand .ws-zone-title { color: #d7e8f2; }
.ws-zone-hand .ws-zone-title small { color: rgba(215, 232, 242, 0.55); }

/* Played cards — warm board green */
.ws-zone-played {
  background:
    linear-gradient(165deg, rgba(36, 52, 28, 0.94), rgba(18, 32, 16, 0.96)),
    radial-gradient(ellipse at 80% 10%, rgba(212, 168, 75, 0.12), transparent 50%);
  border-color: rgba(180, 160, 100, 0.3);
}
.ws-zone-played .ws-zone-title { color: #efe3c4; }
.ws-zone-played .ws-played[hidden],
.ws-zone-played .ws-played-chart[hidden] {
  display: none !important;
}

/* Hand stacks — size driven by --ws-hand-card (JS fits to panel) */
.ws-hand-stacks {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-evenly;
  gap: 0.35rem;
  overflow: hidden;
  padding: 0.15rem 0.1rem 0.3rem;
}

.ws-hand-col {
  flex: 0 0 auto;
  width: var(--ws-hand-card);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ws-hand-col-label {
  font-size: 0.65rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
  opacity: 0.8;
}

.ws-hand-cascade {
  position: relative;
  width: 100%;
}

.ws-hand-card {
  position: absolute;
  left: 0;
  width: 100%;
  padding: 0;
  border: none;
  background: #1c2e24;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
  touch-action: manipulation;
}
.ws-hand-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  pointer-events: none;
  opacity: 1;
}
.ws-hand-card:disabled {
  cursor: default;
  opacity: 1;
  filter: none;
}
.ws-hand-card:focus {
  outline: none;
}
.ws-hand-card:focus-visible {
  outline: 2px solid var(--ws-gold);
  outline-offset: 2px;
}
.ws-hand-card.is-selected {
  transform: translateX(10px) scale(1.03);
  box-shadow: 0 0 0 3px var(--ws-gold), 0 6px 16px rgba(0, 0, 0, 0.45);
  z-index: 30 !important;
}
/* hover only when not selected — avoids click/hover fight */
.ws-hand-card:not(:disabled):not(.is-selected):hover {
  transform: translateX(5px);
}
.ws-hand-card:not(:disabled):not(.is-selected):active {
  transform: translateX(5px) scale(0.99);
}

/* Right top — played piles large */
.ws-played {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.35rem;
  overflow: auto;
  align-items: start;
}

@media (max-width: 900px) {
  .ws-played {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.ws-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 0.3rem 0.15rem;
  border-radius: 10px;
  background: transparent;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.ws-pile.is-warn {
  border-color: rgba(245, 158, 11, 0.75);
  background: rgba(245, 158, 11, 0.12);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 8px 22px rgba(245, 158, 11, 0.15);
  animation: ws-warn-pulse 1.8s ease-in-out infinite;
}
.ws-pile.is-danger {
  border-color: rgba(239, 68, 68, 0.85);
  background: rgba(185, 28, 28, 0.2);
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 10px 28px rgba(185, 28, 28, 0.25);
  animation: ws-danger-pulse 1.1s ease-in-out infinite;
  z-index: 2;
}
.ws-pile.is-warn .ws-pile-meta,
.ws-pile.is-danger .ws-pile-meta {
  font-weight: 800;
}
.ws-pile.is-warn .ws-pile-meta { color: #fbbf24; }
.ws-pile.is-danger .ws-pile-meta { color: #fecaca; }
.ws-pile-alert {
  margin-top: 0.25rem;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.ws-pile.is-warn .ws-pile-alert { color: #fbbf24; }
.ws-pile.is-danger .ws-pile-alert { color: #fecaca; }

@keyframes ws-warn-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.25), 0 8px 22px rgba(245, 158, 11, 0.12); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18), 0 10px 26px rgba(245, 158, 11, 0.22); }
}
@keyframes ws-danger-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35), 0 10px 28px rgba(185, 28, 28, 0.2); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0.2), 0 12px 32px rgba(185, 28, 28, 0.35); }
}

.ws-pile-head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 0.15rem;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  font-weight: 800;
}
.ws-pile-value {
  color: var(--ws-gold);
  font-size: 1.25rem;
}
.ws-pile-value small {
  font-size: 0.58rem;
  color: rgba(247, 240, 224, 0.65);
}
.ws-pile-meta {
  font-size: 0.7rem;
  opacity: 0.85;
  margin-bottom: 0.3rem;
  font-weight: 700;
}
.ws-pile-stock-num {
  color: var(--ws-gold);
  font-size: 0.95rem;
  font-weight: 900;
}

.ws-cascade {
  position: relative;
  width: min(100%, var(--ws-played-card));
  border-radius: 10px;
  border: 1px dashed rgba(232, 213, 168, 0.3);
  background: rgba(8, 16, 10, 0.45);
  box-sizing: border-box;
}
.ws-cascade-empty {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.ws-cascade-ghost {
  display: block;
  width: 82%;
  max-height: 88%;
  height: auto;
  object-fit: contain;
  opacity: 0.2;
  filter: grayscale(0.25) brightness(1.05);
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.ws-cascade-card {
  position: absolute;
  left: 0;
  width: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #1a2418;
}
.ws-cascade-card img {
  display: block;
  width: 100%;
  height: auto;
}
.ws-cascade-card.is-latest {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5), 0 0 0 2px rgba(212, 168, 75, 0.5);
}

/* Fun animal stock chart — 2-col board, clear info | chart split */
.ws-played-chart {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-auto-rows: minmax(0, 1fr);
  gap: 0.28rem;
  padding: 0.04rem 0.02rem 0.12rem;
  align-content: stretch;
}
.ws-ticker {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(108px, 0.78fr) minmax(0, 1.35fr);
  gap: 0;
  align-items: stretch;
  border-radius: 10px;
  padding: 0;
  background: linear-gradient(160deg, rgba(20, 40, 28, 0.95), rgba(10, 22, 14, 0.98));
  border: 1px solid rgba(232, 213, 168, 0.22);
  overflow: hidden;
}
.ws-ticker-info {
  position: relative;
  z-index: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.28rem;
  padding: 0.4rem 0.42rem;
  background: rgba(0, 0, 0, 0.28);
  border-right: 1px solid rgba(232, 213, 168, 0.22);
}
.ws-ticker-chart {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: stretch;
  padding: 0.25rem 0.35rem;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 11px,
      rgba(232, 213, 168, 0.045) 11px,
      rgba(232, 213, 168, 0.045) 12px
    );
}
.ws-ticker-brand {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
}
.ws-ticker-icon {
  width: clamp(56px, 7vw, 84px);
  height: clamp(56px, 7vw, 84px);
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
}
.ws-ticker-brand-text {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ws-ticker-name {
  display: block;
  font-size: 0.92rem;
  font-weight: 900;
  color: #f3e6c4;
  line-height: 1.1;
}
.ws-ticker-delta {
  margin-top: 0;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15;
}
.ws-ticker-delta.is-up { color: #7dffa8; }
.ws-ticker-delta.is-down { color: #ff9b8a; }
.ws-ticker-delta.is-flat { color: rgba(247, 240, 224, 0.55); }
.ws-ticker-price {
  display: block;
  margin-top: 0.15rem;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 900;
  color: var(--ws-gold);
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 2px 10px rgba(212, 168, 75, 0.28);
}
.ws-ticker-price small {
  font-size: 0.68rem;
  margin-left: 0.1rem;
  color: rgba(247, 240, 224, 0.65);
  font-weight: 800;
}
.ws-ticker-calc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.12rem 0.2rem;
  padding: 0.3rem 0.35rem;
  border-radius: 8px;
  background: rgba(212, 168, 75, 0.1);
  border: 1px solid rgba(212, 168, 75, 0.28);
  font-size: 0.74rem;
  font-weight: 800;
  color: rgba(247, 240, 224, 0.9);
}
.ws-ticker-calc .ws-chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  padding: 0.08rem 0.28rem;
  border-radius: 5px;
  background: rgba(212, 168, 75, 0.22);
  color: #f0d48a;
  font-weight: 900;
  font-size: 0.82rem;
}
.ws-ticker-calc .ws-chip-num.is-value {
  background: rgba(92, 184, 138, 0.22);
  color: #b8f5d0;
}
.ws-ticker-calc .ws-chip-num.is-total {
  background: linear-gradient(180deg, #f0d48a, #d4a84b);
  color: #142218;
}
.ws-ticker-calc .ws-op {
  opacity: 0.65;
  font-weight: 700;
}
.ws-ticker-svg {
  width: 100%;
  height: 100%;
  min-height: 118px;
  display: block;
}
.ws-ticker-svg.is-empty {
  opacity: 0.72;
}

@media (max-width: 900px) {
  .ws-played-chart {
    grid-template-columns: 1fr;
    overflow: auto;
  }
}

/* Left bottom — player animal tabs + herd */
.ws-herd-actions {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
}
.ws-herd-hint {
  margin: -0.15rem 0 0.35rem;
  font-size: 0.65rem;
  opacity: 0.65;
}
.ws-herd-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  overflow-x: auto;
  margin-bottom: 0.35rem;
  flex-shrink: 0;
  padding-bottom: 0.1rem;
}
.ws-herd-tab {
  flex: 0 0 auto;
  border: 1px solid rgba(232, 213, 168, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(247, 240, 224, 0.78);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.ws-herd-tab.is-active {
  background: rgba(92, 184, 138, 0.28);
  border-color: rgba(92, 184, 138, 0.7);
  color: #e8fff1;
}
.ws-herd-tab.is-me {
  box-shadow: inset 0 0 0 1px rgba(212, 168, 75, 0.4);
}
.ws-herd-tab small {
  opacity: 0.75;
  font-weight: 600;
  margin-left: 0.25rem;
}

.ws-my-herd {
  position: relative;
  flex: 1;
  min-height: 120px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px dashed rgba(232, 213, 168, 0.2);
  overflow: hidden;
  touch-action: none;
}

.ws-fig {
  position: absolute;
  width: calc(var(--ws-fig) * var(--ws-herd-scale, 1));
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.4));
  z-index: 1;
  transition: width 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ws-fig:active,
.ws-fig.is-dragging {
  cursor: grabbing;
  z-index: 2147482000 !important;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.55));
}
.ws-fig img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.ws-fig-price {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  margin-top: 0.12rem;
  min-width: 2.6em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(8, 16, 12, 0.78);
  border: 1px solid rgba(212, 168, 75, 0.45);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  line-height: 1;
}
.ws-fig-coin {
  font-size: 0.78em;
  line-height: 1;
}
.ws-fig-price-num {
  font-size: clamp(0.72rem, 1.6vw, 0.9rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--ws-gold);
  letter-spacing: -0.02em;
}

/* Top left — SAFARI field */
.ws-zone-stock {
  background:
    linear-gradient(180deg, rgba(20, 40, 18, 0.55), rgba(12, 28, 14, 0.72)),
    radial-gradient(ellipse at 30% 20%, rgba(212, 168, 75, 0.18), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(92, 140, 70, 0.2), transparent 45%),
    repeating-linear-gradient(
      -18deg,
      rgba(232, 213, 168, 0.035) 0 2px,
      transparent 2px 10px
    );
  border-color: rgba(212, 168, 75, 0.32);
}
.ws-zone-stock .ws-zone-title {
  color: #f0d48a;
}
.ws-zone-stock .ws-zone-title small {
  color: rgba(247, 240, 224, 0.55);
}

.ws-stock {
  position: relative;
  flex: 1;
  min-height: 140px;
  overflow: hidden;
  border-radius: 10px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(120, 90, 40, 0.35), transparent 55%),
    linear-gradient(180deg, rgba(60, 90, 40, 0.25), rgba(30, 50, 25, 0.45));
  border: 1px solid rgba(212, 168, 75, 0.22);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.25);
}

.ws-stock-fig {
  position: absolute;
  width: calc(var(--ws-stock-fig) * var(--ws-stock-scale, 1));
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.4));
  transition: filter 0.12s, outline-color 0.12s, width 0.15s ease;
  border-radius: 12px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.ws-stock-fig-spin {
  width: 100%;
  transform-origin: center center;
}
.ws-stock-fig.is-selectable {
  cursor: grab;
}
.ws-stock-fig.is-selectable:hover:not(.is-dragging) {
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5)) brightness(1.06);
}
.ws-stock-fig.is-dragging {
  cursor: grabbing;
  z-index: 2147482000 !important;
  transition: none;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.55));
  outline-color: rgba(212, 168, 75, 0.35);
}
.ws-stock.is-stock-dragging .ws-stock-fig:not(.is-dragging) {
  pointer-events: none;
}
.ws-stock.is-stock-dragging {
  touch-action: none;
  user-select: none;
}
body.ws-stock-drag-lock {
  cursor: grabbing !important;
  user-select: none !important;
  touch-action: none !important;
}
body.ws-stock-drag-lock * {
  cursor: grabbing !important;
}
/* brief same-animal highlight — stay above siblings */
.ws-stock-fig.is-flash {
  outline-color: var(--ws-gold);
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
  z-index: 2147481000 !important;
}
.ws-stock-fig img {
  width: 100%;
  height: auto;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}
.ws-stock-fig .ws-fig-price {
  margin-top: 0.08rem;
}
.ws-stock-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  font-size: 0.85rem;
}

/* Center guide — large toast that fades away */
.ws-center-guide {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 80;
  pointer-events: none;
  text-align: center;
  min-width: min(560px, 82vw);
  padding: 1.6rem 2rem 1.5rem;
  border-radius: 24px;
  background: rgba(8, 22, 14, 0.82);
  border: 2px solid rgba(212, 168, 75, 0.45);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.55s ease,
    transform 0.55s ease,
    visibility 0.55s;
}
.ws-center-guide.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.ws-center-guide.is-hiding {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -48%) scale(1.04);
}
.ws-center-guide.is-my-turn {
  border-color: rgba(92, 184, 138, 0.75);
  background: rgba(10, 42, 26, 0.88);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45), 0 0 40px rgba(92, 184, 138, 0.18);
}
.ws-guide-main {
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ws-gold);
  line-height: 1.1;
}
.ws-center-guide.is-my-turn .ws-guide-main {
  color: #e8fff1;
  text-shadow: 0 0 28px rgba(92, 184, 138, 0.35);
}
.ws-guide-sub {
  margin-top: 0.55rem;
  font-size: clamp(1.15rem, 2.8vw, 1.75rem);
  font-weight: 800;
  color: rgba(247, 240, 224, 0.92);
}
.ws-guide-action {
  margin-top: 0.55rem;
  font-size: clamp(0.8rem, 1.4vw, 1rem);
  color: rgba(247, 240, 224, 0.55);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70vw;
}

/* Opponent animal take announce */
.ws-take-announce {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.86);
  z-index: 85;
  pointer-events: none;
  text-align: center;
  min-width: min(420px, 78vw);
  padding: 1.4rem 1.6rem 1.5rem;
  border-radius: 24px;
  background: rgba(8, 22, 14, 0.88);
  border: 2px solid rgba(212, 168, 75, 0.5);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 50px rgba(212, 168, 75, 0.12);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.5s ease,
    transform 0.55s ease,
    visibility 0.5s;
}
.ws-take-announce.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}
.ws-take-announce.is-hiding {
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -46%) scale(1.06);
}
.ws-take-announce-name {
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  font-weight: 800;
  color: rgba(247, 240, 224, 0.85);
  margin-bottom: 0.35rem;
}
.ws-take-announce-img {
  width: clamp(160px, 28vw, 280px);
  height: auto;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.45));
}
.ws-take-announce-animal {
  margin-top: 0.45rem;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 900;
  color: var(--ws-gold);
  letter-spacing: -0.02em;
}

/* Chat side drawer */
.ws-side {
  display: none;
  position: fixed;
  right: 0.65rem;
  bottom: 0.65rem;
  width: min(420px, 94vw);
  height: min(62vh, 560px);
  max-height: min(70vh, 620px);
  z-index: 35;
}
.ws-side.is-open { display: flex; }
.ws-panel {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  background: rgba(8, 20, 14, 0.97);
  border: 1px solid var(--ws-panel-border);
  padding: 0.75rem 0.8rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}
.ws-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-shrink: 0;
}
.ws-panel h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--ws-sand);
}
.ws-chat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
  padding-right: 0.15rem;
}
.ws-chat-item {
  font-size: 0.82rem;
  line-height: 1.35;
  padding: 0.4rem 0.5rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.ws-chat-item strong { color: var(--ws-gold); }
.ws-chat-form {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.ws-chat-form input {
  flex: 1;
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(232, 213, 168, 0.25);
  background: rgba(0, 0, 0, 0.25);
  color: var(--ws-cream);
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
}
.ws-chat-form button {
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
}

/* Chat marquee — right → left like Carcassonne */
.ws-chat-marquee-layer {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  overflow: hidden;
}
.ws-chat-marquee {
  position: absolute;
  left: 100%;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: min(78vw, 520px);
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(232, 213, 168, 0.5);
  background: rgba(12, 28, 18, 0.9);
  color: var(--ws-cream);
  font-size: clamp(0.82rem, 1.7vw, 1rem);
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
  animation: ws-chat-marquee-slide 8.5s linear forwards;
  will-change: transform, opacity;
}
.ws-chat-marquee-name {
  color: var(--ws-gold);
  flex-shrink: 0;
}
.ws-chat-marquee-sep {
  color: rgba(247, 240, 224, 0.5);
  flex-shrink: 0;
}
.ws-chat-marquee-text {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  font-weight: 600;
  color: #f8fafc;
}
@keyframes ws-chat-marquee-slide {
  0% {
    transform: translateX(0);
    opacity: 0;
  }
  6% {
    opacity: 1;
  }
  88% {
    opacity: 1;
  }
  100% {
    transform: translateX(calc(-100vw - 110%));
    opacity: 0;
  }
}
.ws-btn {
  border: none;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  font-weight: 700;
  font-size: 0.74rem;
  cursor: pointer;
  background: var(--ws-accent);
  color: #062214;
}
.ws-btn-ghost {
  background: transparent;
  color: var(--ws-cream);
  border: 1px solid rgba(232, 213, 168, 0.35);
}
.ws-btn-mini {
  padding: 0.15rem 0.4rem;
  font-size: 0.65rem;
}
.ws-btn-danger { background: var(--ws-danger); color: #fff; }
.ws-btn-confirm {
  flex: 1 1 100%;
  min-height: 56px;
  width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: 12px;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #f0d48a, #d4a84b);
  color: #142218;
  box-shadow: 0 6px 16px rgba(212, 168, 75, 0.28);
}
.ws-modal-actions:has(.ws-btn-confirm) {
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.ws-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(5, 14, 10, 0.78);
  backdrop-filter: blur(5px);
}
.ws-overlay.is-open { display: flex; }
body.ws-confirm-open .ws-overlay {
  align-items: flex-start;
  padding-top: 0.55rem;
  background: rgba(5, 14, 10, 0.72);
}
body.ws-confirm-open .ws-turn-timer {
  position: relative;
  z-index: 100001;
}
body.ws-modal-open .ws-stage,
body.ws-modal-open .ws-take-announce,
body.ws-modal-open .ws-center-guide,
body.ws-modal-open .ws-side,
body.ws-modal-open .ws-chat-marquee-layer {
  visibility: hidden !important;
  pointer-events: none !important;
}
.ws-modal {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #234632, #142a1c);
  border: 1px solid rgba(232, 213, 168, 0.3);
  padding: 0;
}
.ws-modal.is-final {
  width: min(860px, 100%);
  max-height: min(92vh, 960px);
}
.ws-modal-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
  border-bottom: 1px solid rgba(232, 213, 168, 0.22);
  background: rgba(8, 20, 14, 0.55);
  position: sticky;
  top: 0;
  z-index: 2;
}
.ws-modal h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ws-gold);
  min-width: 0;
}
.ws-modal-exit {
  flex-shrink: 0;
  border: 1px solid rgba(232, 213, 168, 0.4);
  border-radius: 8px;
  padding: 0.35rem 0.75rem;
  font-weight: 800;
  font-size: 0.78rem;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.28);
  color: var(--ws-cream);
}
.ws-modal-exit:hover {
  background: rgba(212, 168, 75, 0.22);
  border-color: rgba(212, 168, 75, 0.65);
  color: #f0d48a;
}
.ws-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0.9rem 1.15rem 1.05rem;
}
.ws-modal-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }

.ws-final-detail {
  margin-top: 0.35rem;
}
.ws-final-round {
  margin: 0.75rem 0 1.1rem;
  padding: 0.75rem 0.7rem 0.55rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(232, 213, 168, 0.16);
}
.ws-final-round-title {
  font-size: 0.95rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--ws-gold);
  margin-bottom: 0.55rem;
}
.ws-final-player {
  margin: 0.45rem 0 0.7rem;
  padding: 0.35rem 0.4rem 0.15rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}
.ws-final-player.is-me {
  background: rgba(92, 184, 138, 0.12);
  border: 1px solid rgba(92, 184, 138, 0.28);
}
.ws-final-player-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
  margin-bottom: 0.15rem;
  padding: 0.15rem 0.2rem;
}
.ws-final-player-head strong {
  font-size: 0.88rem;
}
.ws-final-player-score {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--ws-gold);
}
.ws-final-player-score small {
  font-size: 0.68rem;
  opacity: 0.7;
  font-weight: 700;
}
.ws-final-player-total {
  margin-left: auto;
  font-size: 0.72rem;
  color: rgba(247, 240, 224, 0.7);
}
.ws-final-player .ws-score-calc {
  margin-bottom: 0.25rem;
}
.ws-final-player .ws-score-calc li {
  padding: 0.28rem 0.2rem;
}

.ws-result-values {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .ws-result-values {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.ws-result-animal {
  text-align: center;
  padding: 0.35rem 0.25rem 0.4rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(232, 213, 168, 0.16);
}
.ws-result-animal-name {
  font-size: 0.72rem;
  font-weight: 800;
  margin-bottom: 0.15rem;
  color: var(--ws-sand);
}
.ws-result-pair {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.ws-result-fig {
  width: clamp(56px, 10vw, 84px);
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}
.ws-result-fig img,
.ws-result-card img {
  width: 100%;
  height: auto;
  display: block;
}
.ws-result-card {
  width: clamp(48px, 8.5vw, 70px);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(212, 168, 75, 0.45);
}
.ws-result-card.is-empty {
  aspect-ratio: 5/7;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(247, 240, 224, 0.4);
  font-size: 0.7rem;
  border-style: dashed;
}
.ws-result-final-val {
  margin-top: 0.2rem;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ws-gold);
}
.ws-result-final-val small {
  font-size: 0.7rem;
  color: rgba(247, 240, 224, 0.65);
  font-weight: 700;
}

.ws-score-calc {
  list-style: none;
  padding: 0;
  margin: 0 0 0.85rem;
}
.ws-score-calc li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 0.55rem;
  align-items: center;
  padding: 0.45rem 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.ws-score-calc-fig {
  width: 40px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}
.ws-score-calc-fig img { width: 100%; height: auto; display: block; }
.ws-score-calc-body {
  min-width: 0;
}
.ws-score-calc-name {
  font-size: 0.8rem;
  font-weight: 800;
  margin-bottom: 0.1rem;
}
.ws-score-calc-formula {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.78rem;
  color: rgba(247, 240, 224, 0.78);
}
.ws-score-calc-formula .ws-chip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4rem;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(232, 213, 168, 0.12);
  font-weight: 800;
}
.ws-score-calc-formula .ws-chip-num.is-value {
  background: rgba(212, 168, 75, 0.28);
  color: var(--ws-gold);
}
.ws-score-calc-formula .ws-op {
  opacity: 0.55;
  font-weight: 700;
}
.ws-score-calc-sub {
  font-size: 1.05rem;
  font-weight: 900;
  color: #e8fff1;
  white-space: nowrap;
}
.ws-score-calc-sub small {
  font-size: 0.7rem;
  opacity: 0.7;
  font-weight: 700;
}

.ws-result-totals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
}
.ws-result-total-card {
  flex: 1 1 140px;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: rgba(92, 184, 138, 0.14);
  border: 1px solid rgba(92, 184, 138, 0.35);
}
.ws-result-total-card .label {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-bottom: 0.15rem;
}
.ws-result-total-card .value {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--ws-gold);
}

.ws-rank-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ws-rank-table th, .ws-rank-table td {
  padding: 0.35rem 0.25rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.ws-rank-table tr.is-me td {
  color: #e8fff1;
  font-weight: 700;
}

.ws-toast {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 60;
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
  background: rgba(20, 34, 24, 0.95);
  border: 1px solid rgba(232, 213, 168, 0.35);
  font-size: 0.78rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.ws-toast.is-show { opacity: 1; }
.ws-hint { font-size: 0.72rem; color: rgba(247, 240, 224, 0.72); }

.ws-play-wrap.carc-game-wrap {
  background:
    radial-gradient(circle at 14% 10%, rgba(212, 168, 75, 0.22), transparent 36%),
    radial-gradient(circle at 88% 8%, rgba(92, 184, 138, 0.16), transparent 32%),
    linear-gradient(180deg, #f7f0e0 0%, #e8dcc4 55%, #d9c9a8 100%);
}
.ws-play-wrap .cc-launcher-kicker {
  color: #ffffff;
}
.ws-play-wrap .cc-launcher-title {
  color: #142218;
}
.ws-play-wrap .cc-waiting-hero-bg {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(212, 168, 75, 0.28), transparent 45%),
    linear-gradient(135deg, #163226, #0f2418 60%, #1a3a2a);
}
.ws-play-wrap .cc-waiting-color-btn {
  min-width: 44px;
  min-height: 44px;
}
.ws-play-wrap .cc-seat-meeple-sm {
  width: 28px;
  height: 34px;
  object-fit: contain;
}
.ws-play-wrap .cc-seat-meeple-sm.is-empty {
  display: inline-block;
  width: 28px;
  height: 34px;
  border-radius: 6px;
  background: rgba(0,0,0,.06);
}

/* Practice / Spectate lobby — safari theme over shared carcassonne launcher styles */
.ws-practice-wrap .cc-launcher-card--practice .cc-launcher-card-badge {
  background: #1a3a2a;
  color: #f7f0e0;
}
.ws-practice-wrap .cc-launcher-card-btn--practice {
  background: #d4a84b;
  border-color: #d4a84b;
  color: #142218;
}
.ws-practice-wrap .cc-launcher-card-btn--practice:hover,
.ws-practice-wrap .cc-launcher-card-btn--practice:focus {
  background: #c4983f;
  border-color: #c4983f;
  color: #142218;
}
.ws-practice-wrap .cc-practice-panel-kicker {
  background: #1a3a2a;
  color: #f7f0e0;
}
.ws-practice-wrap .cc-practice-panel-ornament {
  background: linear-gradient(90deg, transparent, #d4a84b, transparent);
}
.ws-practice-wrap .cc-practice-quick-btn--primary {
  background: #1a3a2a;
  border-color: #1a3a2a;
  color: #f7f0e0;
}
.ws-practice-wrap .cc-practice-quick-btn--primary:hover,
.ws-practice-wrap .cc-practice-quick-btn--primary:focus {
  background: #244a36;
  border-color: #244a36;
  color: #fff;
}
.ws-practice-wrap .cc-practice-info-icon {
  background: rgba(212, 168, 75, 0.18);
  color: #8a6a24;
}
.ws-practice-wrap .cc-launcher-side-panel {
  border-color: rgba(26, 58, 42, 0.14);
  background:
    radial-gradient(circle at 90% 10%, rgba(212, 168, 75, 0.16), transparent 42%),
    linear-gradient(180deg, #fffdf7 0%, #f3ead5 100%);
}

.ws-spectate-page.cc-spectate-page {
  background:
    radial-gradient(circle at 12% 8%, rgba(212, 168, 75, 0.18), transparent 34%),
    radial-gradient(circle at 88% 12%, rgba(92, 184, 138, 0.14), transparent 30%),
    linear-gradient(180deg, #f7f0e0 0%, #e8dcc4 100%);
}
.ws-spectate-page .cc-spectate-hero-bg {
  background:
    radial-gradient(ellipse at 18% 30%, rgba(212, 168, 75, 0.32), transparent 48%),
    linear-gradient(135deg, #163226, #0f2418 55%, #1a3a2a);
}
.ws-spectate-page .cc-spectate-kicker {
  background: rgba(212, 168, 75, 0.92);
  color: #142218;
}
.ws-spectate-page .cc-spectate-nav-btn--primary {
  background: #d4a84b;
  border-color: #d4a84b;
  color: #142218;
}
.ws-spectate-page .cc-spectate-nav-btn--primary:hover,
.ws-spectate-page .cc-spectate-nav-btn--primary:focus {
  background: #c4983f;
  border-color: #c4983f;
  color: #142218;
}
.ws-spectate-page .cc-spectate-panel--live .cc-spectate-panel-header {
  background: linear-gradient(135deg, #d8efe2 0%, #eef8f1 100%);
  color: #0f2418;
}
.ws-spectate-page .ws-spectate-code-panel .cc-spectate-panel-header,
.ws-spectate-page .ws-spectate-tip-panel .cc-spectate-panel-header {
  background: linear-gradient(135deg, #efe3c2 0%, #f8f1de 100%);
  color: #3d2f12;
}
.ws-spectate-code-form {
  display: flex;
  gap: 0.55rem;
  align-items: stretch;
}
.ws-spectate-code-form .form-control {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.ws-spectate-tips {
  padding-left: 1.1rem;
  margin: 0;
  color: #5a5347;
  font-size: 0.9rem;
}
.ws-spectate-tips li + li {
  margin-top: 0.35rem;
}
.ws-spectate-animal-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 1rem;
  align-items: flex-end;
}
.ws-spectate-animal-row img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(20, 34, 24, 0.18));
}
.ws-spectate-page .cc-spectate-match-status.is-live {
  background: rgba(26, 58, 42, 0.12);
  color: #1a3a2a;
}
.ws-spectate-page .cc-spectate-match-action {
  background: #1a3a2a;
  color: #f7f0e0;
}
.ws-spectate-page .cc-spectate-refresh-btn {
  border-color: rgba(26, 58, 42, 0.25);
  color: #1a3a2a;
}
.ws-spectate-page .cc-spectate-refresh-btn:hover {
  background: #1a3a2a;
  border-color: #1a3a2a;
  color: #fff;
}

.ws-lobby-count {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.ws-lobby-count-btn {
  min-width: 3.4rem;
  min-height: 2.6rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(20, 34, 24, 0.18);
  background: #fff;
  font-weight: 700;
  color: #1a3a2a;
}
.ws-lobby-count-btn.is-active {
  background: #1a3a2a;
  border-color: #1a3a2a;
  color: #f7f0e0;
}
.ws-lobby-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: min(58vh, 520px);
  overflow: auto;
}
.ws-lobby-room {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(20, 34, 24, 0.12);
  background: linear-gradient(180deg, #fff, #f7faf7);
  min-height: 44px;
}
.ws-lobby-room:hover {
  border-color: rgba(26, 58, 42, 0.35);
  background: #f1f7f2;
}
.ws-lobby-room-code {
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #1a3a2a;
}
.ws-lobby-room-meta {
  color: #5b6b62;
  font-size: 0.9rem;
}
.ws-lobby-room-go {
  font-size: 0.82rem;
  font-weight: 700;
  color: #2f6b4f;
}
.ws-lobby-toast {
  margin-top: 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 0.6rem;
  background: rgba(180, 48, 48, 0.1);
  color: #8a1f1f;
  font-size: 0.9rem;
}

/* Waiting overlay */
.ws-waiting {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background:
    radial-gradient(ellipse at 30% 20%, rgba(212, 168, 75, 0.18), transparent 50%),
    rgba(8, 18, 12, 0.72);
  backdrop-filter: blur(4px);
}
.ws-waiting[hidden] { display: none !important; }
.ws-waiting-card {
  width: min(440px, 100%);
  padding: 1.4rem 1.35rem 1.25rem;
  border-radius: 1.1rem;
  background: linear-gradient(165deg, #163226, #0f2418 55%, #0c1c14);
  border: 1px solid rgba(232, 213, 168, 0.28);
  color: #f7f0e0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.35);
}
.ws-waiting-kicker {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  color: rgba(232, 213, 168, 0.75);
  margin-bottom: 0.35rem;
}
.ws-waiting-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0 0 0.85rem;
}
.ws-waiting-code {
  display: inline-block;
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.18em;
  padding: 0.45rem 0.8rem;
  border-radius: 0.65rem;
  background: rgba(232, 213, 168, 0.12);
  border: 1px solid rgba(232, 213, 168, 0.28);
  margin-bottom: 0.65rem;
}
.ws-waiting-hint {
  margin: 0 0 1rem;
  color: rgba(247, 240, 224, 0.72);
  font-size: 0.92rem;
}
.ws-waiting-seats {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.ws-waiting-seats li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 44px;
}
.ws-waiting-seats li.is-empty {
  opacity: 0.55;
}
.ws-waiting-seat-no {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 800;
  background: rgba(212, 168, 75, 0.22);
  color: #e8d5a8;
}
.ws-waiting-seat-name { font-weight: 650; }
.ws-waiting-actions { display: flex; justify-content: flex-end; }
body.ws-is-waiting .ws-stage,
body.ws-is-waiting .ws-players,
body.ws-is-waiting .ws-turn-timer {
  filter: blur(1.5px);
  pointer-events: none;
}
body.ws-spectate .ws-zone-hand .ws-zone-title small { display: none; }

@media (max-width: 820px) {
  :root {
    --ws-played-card: clamp(86px, 16vw, 116px);
    --ws-played-peek: clamp(16px, 2.8vw, 26px);
  }

  .ws-app {
    padding: 0.28rem 0.32rem 0.32rem;
    gap: 0.24rem;
  }

  .ws-topbar {
    flex-wrap: nowrap;
    gap: 0.28rem;
    padding: 0.28rem 0.38rem;
  }

  .ws-brand {
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
  }
  .ws-brand span {
    font-size: 0.5rem;
    letter-spacing: 0.08em;
  }

  .ws-meta {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    gap: 0.22rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 0.08rem;
    flex: 1 1 auto;
    min-width: 0;
  }
  .ws-meta .ws-chip,
  .ws-meta .ws-btn {
    flex: 0 0 auto;
    min-height: 29px;
    padding: 0.14rem 0.36rem;
    font-size: 0.66rem;
    border-radius: 7px;
    line-height: 1.05;
  }
  .ws-meta #ws-chat-toggle,
  .ws-meta #ws-mobile-state-toggle,
  .ws-meta #ws-forfeit,
  .ws-meta a.ws-btn-ghost[href] {
    min-width: 29px;
    width: 29px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    line-height: 1;
  }

  .ws-turn-timer {
    padding: 0.24rem 0.45rem 0.33rem;
  }
  .ws-turn-timer-row {
    margin-bottom: 0.24rem;
  }
  .ws-turn-timer-label {
    font-size: 0.68rem;
  }
  .ws-turn-timer-remain {
    font-size: 0.92rem;
    min-width: 2rem;
  }

  .ws-players {
    gap: 0.28rem;
    padding-bottom: 0.08rem;
  }
  .ws-player {
    min-width: 150px;
    max-width: 190px;
    padding: 0.28rem 0.4rem 0.34rem;
    border-radius: 10px;
    font-size: 0.64rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "head score"
      "time score"
      "animals animals";
    row-gap: 0.1rem;
    column-gap: 0.28rem;
  }
  .ws-player-head {
    grid-area: head;
    gap: 0.22rem;
    font-size: 0.68rem;
  }
  .ws-player-meeple {
    width: 16px;
    height: 20px;
  }
  .ws-player-score {
    grid-area: score;
    margin-top: 0;
    align-self: center;
    justify-self: end;
  }
  .ws-player-score strong {
    font-size: 1.1rem;
  }
  .ws-player-score small {
    font-size: 0.58rem;
  }
  .ws-player-time {
    grid-area: time;
    margin-top: 0;
    font-size: 0.6rem;
  }
  .ws-player-animals {
    grid-area: animals;
    margin-top: 0.08rem;
  }
  .ws-player-animals span {
    font-size: 0.56rem;
    padding: 0.02rem 0.2rem;
  }

  .ws-stage {
    display: flex;
    flex-direction: column;
    overflow: auto;
  }
  .ws-zone-stock { order: 1; min-height: 180px; }
  .ws-zone-played { order: 2; min-height: 260px; }
  .ws-zone-mine { order: 3; min-height: 160px; }
  .ws-zone-hand { order: 4; min-height: 220px; }
  .ws-center-guide {
    position: fixed;
    left: 50%;
    top: 42%;
    transform: translate(-50%, -50%) scale(0.92);
    width: min(560px, 90vw);
    margin: 0;
    order: unset;
  }
  .ws-center-guide.is-visible {
    transform: translate(-50%, -50%) scale(1);
  }
  .ws-center-guide.is-hiding {
    transform: translate(-50%, -48%) scale(1.04);
  }

  /* Show status toggle on small screens */
  .ws-mobile-state-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile: only 2 rows for current action phase */
  .ws-stage.is-mobile-mode-play-card .ws-zone-stock,
  .ws-stage.is-mobile-mode-play-card .ws-zone-mine {
    display: none !important;
  }
  .ws-stage.is-mobile-mode-play-card .ws-zone-played {
    order: 1;
    min-height: 176px;
  }
  .ws-stage.is-mobile-mode-play-card .ws-zone-hand {
    order: 2;
    min-height: 180px;
  }

  .ws-stage.is-mobile-mode-take-animal .ws-zone-hand,
  .ws-stage.is-mobile-mode-take-animal .ws-zone-played {
    display: none !important;
  }
  .ws-stage.is-mobile-mode-take-animal .ws-zone-stock {
    order: 1;
    min-height: 320px;
    flex: 1 1 64%;
  }
  .ws-stage.is-mobile-mode-take-animal .ws-zone-mine {
    order: 2;
    min-height: 165px;
    flex: 1 1 36%;
  }

  /* Mobile played board: keep all five animal piles in one row */
  .ws-zone-played {
    padding: 0.32rem 0.36rem 0.42rem;
  }
  .ws-zone-played .ws-zone-title {
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
  }
  .ws-zone-played .ws-zone-title small {
    font-size: 0.56rem;
  }
  .ws-played {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.18rem;
    overflow: hidden;
  }
  .ws-pile {
    padding: 0.18rem 0.06rem;
    border-radius: 8px;
  }
  .ws-pile-head {
    font-size: 0.64rem;
    margin-bottom: 0.12rem;
    padding: 0 0.05rem;
  }
  .ws-pile-value {
    font-size: 0.9rem;
  }
  .ws-pile-value small {
    font-size: 0.46rem;
  }
  .ws-pile-meta {
    font-size: 0.52rem;
    margin-bottom: 0.16rem;
    line-height: 1.15;
    text-align: center;
  }
  .ws-cascade {
    width: 100%;
    border-radius: 8px;
  }
  .ws-cascade-ghost {
    width: 72%;
    max-height: 76%;
  }

  /* Mobile tool buttons: stock + herd both compact */
  .ws-zone-mine .ws-zoom-controls,
  .ws-zone-stock .ws-zoom-controls {
    right: 0.28rem;
    bottom: 0.28rem;
    gap: 0.12rem;
    padding: 0.1rem;
    max-width: 142px;
    border-radius: 8px;
  }
  .ws-zone-mine .ws-zoom-btn,
  .ws-zone-stock .ws-zoom-btn {
    min-width: 1.18rem;
    width: 1.18rem;
    height: 1.18rem;
    padding: 0;
    border-radius: 5px;
    font-size: 0.62rem;
    line-height: 1;
  }
  .ws-zone-mine .ws-zoom-btn.ws-zoom-text,
  .ws-zone-stock .ws-zoom-btn.ws-zoom-text {
    font-size: 0.62rem;
    padding: 0;
    min-width: 1.18rem;
    width: 1.18rem;
  }
  .ws-zone-mine .ws-zoom-btn.ws-zoom-reset,
  .ws-zone-stock .ws-zoom-btn.ws-zoom-reset {
    font-size: 0.5rem;
    letter-spacing: -0.02em;
  }
}

@media (orientation: landscape) and (max-height: 620px) {
  .ws-app {
    padding: 0.18rem 0.28rem 0.22rem;
    gap: 0.18rem;
  }
  .ws-players {
    max-height: 4.4rem;
  }
  .ws-player {
    min-width: 132px;
    max-width: 180px;
    padding: 0.2rem 0.35rem 0.22rem;
  }
  .ws-player-score strong {
    font-size: 0.98rem;
  }

  .ws-stage {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
    grid-template-rows: minmax(0, 1.2fr) minmax(0, 1fr);
    grid-template-areas:
      "stock played"
      "mine hand";
    overflow: hidden;
    gap: 0.28rem;
  }
  .ws-zone-stock,
  .ws-zone-played,
  .ws-zone-mine,
  .ws-zone-hand,
  .ws-stage.is-mobile-mode-play-card .ws-zone-stock,
  .ws-stage.is-mobile-mode-play-card .ws-zone-mine,
  .ws-stage.is-mobile-mode-play-card .ws-zone-played,
  .ws-stage.is-mobile-mode-play-card .ws-zone-hand,
  .ws-stage.is-mobile-mode-take-animal .ws-zone-stock,
  .ws-stage.is-mobile-mode-take-animal .ws-zone-mine,
  .ws-stage.is-mobile-mode-take-animal .ws-zone-played,
  .ws-stage.is-mobile-mode-take-animal .ws-zone-hand {
    display: flex !important;
    min-height: 0 !important;
    order: unset !important;
    flex: unset !important;
  }
  .ws-played {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow: auto;
  }
  .ws-center-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(420px, 70vw);
  }
}

/* Compact phones / narrow tablets */
body.ws-compact.ws-body {
  padding:
    max(0px, env(safe-area-inset-top))
    max(0px, env(safe-area-inset-right))
    max(0px, env(safe-area-inset-bottom))
    max(0px, env(safe-area-inset-left));
}
body.ws-compact .ws-topbar {
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  min-height: 0;
}
body.ws-compact .ws-brand {
  font-size: 0.78rem;
  line-height: 1.15;
}
body.ws-compact .ws-brand span {
  display: block;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}
body.ws-compact .ws-meta {
  gap: 0.2rem;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  min-width: 0;
  padding-bottom: 0.08rem;
}
body.ws-compact .ws-chip,
body.ws-compact .ws-btn:not(.ws-btn-confirm) {
  min-height: 30px;
  padding: 0.16rem 0.4rem;
  font-size: 0.64rem;
  border-radius: 7px;
  line-height: 1.05;
}
body.ws-compact .ws-meta #ws-chat-toggle,
body.ws-compact .ws-meta #ws-mobile-state-toggle,
body.ws-compact .ws-meta #ws-forfeit,
body.ws-compact .ws-meta a.ws-btn-ghost[href] {
  min-width: 29px;
  width: 29px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  line-height: 1;
}
body.ws-compact .ws-turn-timer {
  padding: 0.28rem 0.55rem 0.4rem;
}
body.ws-compact .ws-turn-timer-label,
body.ws-compact .ws-turn-timer-remain {
  font-size: 0.72rem;
}
body.ws-compact .ws-players {
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  overflow-x: auto;
}
body.ws-compact .ws-player {
  min-width: 150px;
  max-width: 190px;
  padding: 0.28rem 0.4rem 0.34rem;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "head score"
    "time score"
    "animals animals";
  row-gap: 0.1rem;
  column-gap: 0.28rem;
  font-size: 0.64rem;
}
body.ws-compact .ws-player-head { grid-area: head; font-size: 0.68rem; gap: 0.22rem; }
body.ws-compact .ws-player-meeple { width: 16px; height: 20px; }
body.ws-compact .ws-player-score { grid-area: score; margin-top: 0; align-self: center; justify-self: end; }
body.ws-compact .ws-player-score strong { font-size: 1.1rem; }
body.ws-compact .ws-player-score small { font-size: 0.58rem; }
body.ws-compact .ws-player-time { grid-area: time; margin-top: 0; font-size: 0.6rem; }
body.ws-compact .ws-player-animals { grid-area: animals; margin-top: 0.08rem; }
body.ws-compact .ws-player-animals span { font-size: 0.56rem; padding: 0.02rem 0.2rem; }
body.ws-compact .ws-zone-title {
  font-size: 0.78rem;
  gap: 0.25rem;
}
body.ws-compact .ws-zone-stock,
body.ws-compact .ws-zone-played,
body.ws-compact .ws-zone-mine,
body.ws-compact .ws-zone-hand {
  min-height: 150px;
}
body.ws-compact .ws-hand-card,
body.ws-compact .ws-played-card,
body.ws-compact .ws-zoom-btn {
  min-width: 44px;
  min-height: 44px;
}
body.ws-compact .ws-side {
  width: 100%;
  max-width: none;
  height: min(62vh, 520px);
  max-height: calc(100dvh - 4rem);
  right: 0;
  left: 0;
  bottom: 0;
  border-radius: 0;
}
body.ws-compact .ws-side .ws-panel {
  border-radius: 1rem 1rem 0 0;
}
body.ws-compact .ws-chat-form input,
body.ws-compact .ws-chat-form button {
  min-height: 44px;
}
body.ws-compact .ws-modal {
  width: min(100vw - 0.75rem, 640px);
  max-height: calc(100dvh - 1rem);
}
body.ws-compact .ws-waiting-card {
  padding: 1.1rem;
}

body.ws-compact .ws-zone-mine .ws-zoom-controls,
body.ws-compact .ws-zone-stock .ws-zoom-controls {
  right: 0.28rem;
  bottom: 0.28rem;
  gap: 0.12rem;
  padding: 0.1rem;
  max-width: 142px;
  border-radius: 8px;
}
body.ws-compact .ws-zone-mine .ws-zoom-btn,
body.ws-compact .ws-zone-stock .ws-zoom-btn {
  min-width: 1.18rem;
  width: 1.18rem;
  height: 1.18rem;
  padding: 0;
  border-radius: 5px;
  font-size: 0.62rem;
  line-height: 1;
}
body.ws-compact .ws-zone-mine .ws-zoom-btn.ws-zoom-text,
body.ws-compact .ws-zone-stock .ws-zoom-btn.ws-zoom-text {
  font-size: 0.62rem;
  padding: 0;
  min-width: 1.18rem;
  width: 1.18rem;
}
body.ws-compact .ws-zone-mine .ws-zoom-btn.ws-zoom-reset,
body.ws-compact .ws-zone-stock .ws-zoom-btn.ws-zoom-reset {
  font-size: 0.5rem;
  letter-spacing: -0.02em;
}

/* 2026-08-24 visual spacing and readability pass */
.wild-safari-page{background:linear-gradient(145deg,#142b1e,#304a25 46%,#c08a3a);min-height:100vh}.ws-intro-page{position:relative;isolation:isolate;background:radial-gradient(circle at 85% 15%,#e6b95b45,transparent 30%),linear-gradient(140deg,#183424,#45622f);color:#fff;min-height:70vh}.ws-intro-page:before{content:"";position:absolute;z-index:-1;right:3%;top:3rem;width:min(360px,42vw);aspect-ratio:1;background:url('/assets/wild_safari/3d/lion.png') center/contain no-repeat;opacity:.18;filter:drop-shadow(0 20px 30px #0008)}.ws-intro-page .card{border:1px solid #ffffff4a;border-radius:22px;overflow:hidden;background:#fffdf8f3;box-shadow:0 22px 60px #0a1f12a0!important}.ws-intro-page .col-lg-4>.card+.card{margin-top:1.5rem}.ws-intro-page .card-body{color:#243229}.ws-intro-page .text-muted{color:#5b685f!important}.ws-intro-page .row{--bs-gutter-x:1.5rem;--bs-gutter-y:1.5rem}.ws-intro-page h1{font-weight:900;letter-spacing:-.04em}.ws-intro-page img{filter:drop-shadow(0 9px 10px #182b1b55);transition:transform .2s}.ws-intro-page img:hover{transform:translateY(-5px) scale(1.04)}
.ws-body{color:#f8f1df}.ws-topbar{gap:1rem;padding:.8rem 1rem;border-bottom:1px solid rgba(255,255,255,.12);box-shadow:0 7px 24px rgba(0,0,0,.2)}.ws-players{gap:.75rem!important;padding:.7rem!important}.ws-player{margin:0!important;border:1px solid rgba(255,255,255,.15)!important;box-shadow:0 8px 20px rgba(0,0,0,.22)}.ws-stage{gap:1rem!important;padding:1rem!important}.ws-panel-box{padding:1rem!important;border:1px solid rgba(255,255,255,.16)!important;border-radius:18px!important;box-shadow:0 12px 30px rgba(0,0,0,.28)!important}.ws-panel-box+.ws-panel-box{margin:0}.ws-zone-title{margin-bottom:.75rem!important}.ws-center-guide{border:1px solid rgba(255,215,128,.35)!important;box-shadow:0 12px 32px rgba(0,0,0,.28)!important}.ws-side .ws-panel{border-left:1px solid rgba(255,255,255,.12);box-shadow:-12px 0 35px rgba(0,0,0,.35)}.ws-modal{border:1px solid rgba(255,255,255,.2);box-shadow:0 30px 90px rgba(0,0,0,.65)}.ws-btn:focus-visible,.ws-zoom-btn:focus-visible,.ws-played-tab:focus-visible,.ws-herd-tab:focus-visible{outline:3px solid #ffd96a!important;outline-offset:3px}.cc-launcher-card{height:100%;border-radius:20px!important;overflow:hidden;box-shadow:0 14px 36px rgba(22,45,25,.18)!important}.cc-launcher-card-body{padding:1.35rem!important}.cc-launcher-hero-head{padding:1.4rem;border-radius:22px;background:linear-gradient(125deg,#153622,#41612fe8);color:#fff;box-shadow:0 18px 45px rgba(15,39,20,.3)}.cc-launcher-lead{color:rgba(255,255,255,.78)!important}.ws-play-wrap .row,.ws-spectate-page .row{--bs-gutter-y:1.5rem}
@media(max-width:700px){.ws-stage{gap:.65rem!important;padding:.55rem!important}.ws-panel-box{padding:.7rem!important;border-radius:14px!important}.ws-players{gap:.5rem!important;padding:.5rem!important}.ws-intro-page .col-lg-4>.card+.card{margin-top:1rem}.cc-launcher-card-body{padding:1rem!important}}
