html,
body {
  --bg-primary: #321600;
  --bg-secondary: rgba(0, 0, 0, 0.35);
  --bg-card-area: rgba(255, 255, 255, 0.04);
  --bg-table: rgba(255, 255, 255, 0.02);
  --bg-modal: rgba(0, 0, 0, 0.5);
  --bg-score: rgba(255, 255, 255, 0.06);
  --bg-room-item: rgba(255, 255, 255, 0.08);
  --text-primary: #fff;
  --text-secondary: #ccc;
  --text-muted: #999;
  --text-warm: #ffd;
  --accent-gold: #ffd54d;
  --accent-green: #4CAF50;
  --accent-green-dark: #2e7d32;
  --accent-orange: #ff9800;
  --accent-red: #c62828;
  --accent-blue: #2196f3;
  --accent-blue-dark: #1565c0;
  --btn-primary-bg: #4CAF50;
  --btn-primary-text: white;
  --btn-secondary-bg: #666;
  --btn-secondary-text: white;
  --btn-join-bg: #ff9800;
  --btn-disabled-bg: #555;
  --card-bg: #fff;
  --card-text: #000;
  --card-red: #c21;
  --card-black: #111;
  --card-back-start: #444;
  --card-back-end: #222;
  --card-shadow: rgba(0, 0, 0, 0.25);
  --border-tapper: #df3e41;
  --border-bettel: #e91e63;
  --border-lead: #159A48;
  --modal-bg: #1a1a2e;
  --modal-border: #444;
  --input-bg: #fff;
  --input-text: #000;
  --input-border: none;
  --input-placeholder: #888;
  --divider: rgba(255, 255, 255, 0.15);
  --badge-bg: #073a86;
  --hint-button-start: #4caf50;
  --hint-button-end: #2e7d32;
  --help-button-start: #ffd54d;
  --help-button-end: #ffc107;
  --stats-button-start: #2196f3;
  --stats-button-end: #1565c0;
}
body.theme-kartentisch {
  --bg-primary: #0a3d0a;
  --bg-secondary: rgba(0, 0, 0, 0.4);
  --bg-card-area: rgba(255, 255, 255, 0.06);
  --bg-table: rgba(0, 0, 0, 0.2);
  --bg-modal: rgba(0, 20, 0, 0.65);
  --bg-score: rgba(255, 255, 255, 0.08);
  --bg-room-item: rgba(255, 255, 255, 0.1);
  --text-primary: #f0e6d2;
  --text-secondary: #c4b998;
  --text-muted: #8a7e66;
  --text-warm: #ffe49c;
  --accent-gold: #d4a843;
  --accent-green: #66bb6a;
  --accent-green-dark: #388e3c;
  --accent-orange: #e6a817;
  --accent-red: #b71c1c;
  --accent-blue: #4fc3f7;
  --accent-blue-dark: #0288d1;
  --btn-primary-bg: #d4a843;
  --btn-primary-text: #1a0f00;
  --btn-secondary-bg: #4a6741;
  --btn-secondary-text: #f0e6d2;
  --btn-join-bg: #d4a843;
  --btn-disabled-bg: #3a5530;
  --card-bg: #f5f0e1;
  --card-text: #1a1200;
  --card-red: #b91c1c;
  --card-black: #1a1200;
  --card-back-start: #1a4d1a;
  --card-back-end: #0d2e0d;
  --card-shadow: rgba(0, 0, 0, 0.35);
  --border-tapper: #d4a843;
  --border-bettel: #c0392b;
  --border-lead: #81c784;
  --modal-bg: #0d2b0d;
  --modal-border: #2e5a2e;
  --input-bg: #f5f0e1;
  --input-text: #1a1200;
  --input-border: 2px solid #d4a843;
  --input-placeholder: #8a7e66;
  --divider: rgba(212, 168, 67, 0.3);
  --badge-bg: #2e5a2e;
  --hint-button-start: #d4a843;
  --hint-button-end: #a07c30;
  --help-button-start: #66bb6a;
  --help-button-end: #388e3c;
  --stats-button-start: #4fc3f7;
  --stats-button-end: #0288d1;
}
body.theme-modern-dark {
  --bg-primary: #0f1923;
  --bg-secondary: rgba(255, 255, 255, 0.05);
  --bg-card-area: rgba(255, 255, 255, 0.04);
  --bg-table: rgba(255, 255, 255, 0.03);
  --bg-modal: rgba(15, 25, 35, 0.85);
  --bg-score: rgba(255, 255, 255, 0.06);
  --bg-room-item: rgba(255, 255, 255, 0.07);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-warm: #fbbf24;
  --accent-gold: #f59e0b;
  --accent-green: #22c55e;
  --accent-green-dark: #16a34a;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-blue: #3b82f6;
  --accent-blue-dark: #2563eb;
  --btn-primary-bg: #3b82f6;
  --btn-primary-text: white;
  --btn-secondary-bg: #334155;
  --btn-secondary-text: #e2e8f0;
  --btn-join-bg: #3b82f6;
  --btn-disabled-bg: #1e293b;
  --card-bg: #f8fafc;
  --card-text: #0f172a;
  --card-red: #dc2626;
  --card-black: #0f172a;
  --card-back-start: #1e293b;
  --card-back-end: #0f172a;
  --card-shadow: rgba(0, 0, 0, 0.4);
  --border-tapper: #f59e0b;
  --border-bettel: #ec4899;
  --border-lead: #22c55e;
  --modal-bg: #1e293b;
  --modal-border: #334155;
  --input-bg: #1e293b;
  --input-text: #e2e8f0;
  --input-border: 1px solid #475569;
  --input-placeholder: #64748b;
  --divider: rgba(148, 163, 184, 0.15);
  --badge-bg: #1e40af;
  --hint-button-start: #22c55e;
  --hint-button-end: #16a34a;
  --help-button-start: #f59e0b;
  --help-button-end: #d97706;
  --stats-button-start: #3b82f6;
  --stats-button-end: #2563eb;
}
.theme-switcher {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}
.theme-switcher .theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.theme-switcher .theme-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.theme-switcher .theme-btn.active {
  border-color: var(--accent-gold);
  box-shadow: 0 0 12px rgba(255, 213, 77, 0.5);
}
.theme-switcher .theme-btn.theme-stube {
  background: linear-gradient(135deg, #321600, #5a2d0c);
}
.theme-switcher .theme-btn.theme-kartentisch {
  background: linear-gradient(135deg, #0a3d0a, #1a6b1a);
}
.theme-switcher .theme-btn.theme-modern {
  background: linear-gradient(135deg, #0f1923, #1e3a5f);
}
.theme-switcher .theme-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 4px;
}
.theme-switcher .theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
}
* {
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}
button {
  font-size: 1.5rem;
  border-radius: 6px;
  border: none;
  padding: 6px 14px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.15s ease;
}
button:hover {
  filter: brightness(1.1);
}
button:active {
  transform: scale(0.97);
}
.small-text {
  font-size: 0.9rem;
}
html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  background: var(--bg-primary);
  transition: background-color 0.4s ease;
}
body {
  color: var(--text-primary);
  font-size: 1.1rem;
  container-type: inline-size;
  container-name: body;
}
#root {
  min-height: 100%;
  background: var(--bg-primary);
  transition: background-color 0.4s ease;
}
.root,
:root {
  --card-h: clamp(110px, 12vh, 150px);
  --card-w: calc(var(--card-h) * 0.688);
  --card-h-lg: calc(var(--card-h) * 1.2);
  --card-w-lg: calc(var(--card-w) * 1.2);
}
.board {
  width: 100%;
  max-width: none;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.score {
  background: var(--bg-score);
  padding: 8px 12px;
  border-radius: 6px;
  transition: background 0.3s ease;
}
.score.center {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.score.center strong {
  white-space: nowrap;
}
.score.left {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  align-items: baseline;
}
.bidding {
  border-radius: 6px;
  backdrop-filter: blur(4px);
  background: var(--bg-secondary);
  padding: 10px 10px 0 10px;
  margin-bottom: 0;
}
.bidding-actions button {
  margin-right: 8px;
}
.main-wrap {
  flex: 1 1 auto;
  display: flex;
}
main {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
}
.player {
  width: 220px;
  min-width: 160px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.player .collected {
  margin-top: 6px;
  color: var(--text-warm);
}
.player .stack {
  padding: 6px;
  background: var(--bg-card-area);
  min-height: 80px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.player.tapper {
  border: 5px solid var(--border-tapper);
  border-radius: 6px;
}
.player.tapper .stack {
  background: linear-gradient(180deg, rgba(223, 62, 65, 0.08), rgba(223, 62, 65, 0.02));
}
.player.bettel {
  border: 5px solid var(--border-bettel);
  border-radius: 6px;
}
.player.bettel .stack {
  background: linear-gradient(180deg, rgba(233, 30, 99, 0.12), rgba(233, 30, 99, 0.04));
}
.player.lead-not-tapper {
  border: 3px solid var(--border-lead);
  border-radius: 6px;
}
.stack-badge {
  position: absolute;
  background: var(--badge-bg);
  color: var(--text-primary);
  padding: 4px 6px;
  border-radius: 12px;
  font-weight: 700;
  margin-left: -12px;
  margin-top: -10px;
}
.stack-badge.bottom {
  position: static;
  display: inline-block;
  margin-left: 12px;
  margin-top: 8px;
}
.stack {
  position: relative;
}
.card {
  background: var(--card-bg);
  color: var(--card-text);
  padding: 6px;
  margin: 6px;
  border-radius: 8px;
  display: inline-flex;
  flex-direction: column;
  justify-content: space-between;
  width: var(--card-w);
  height: var(--card-h);
  box-shadow: 0 4px 8px var(--card-shadow);
  transition: box-shadow 0.3s ease;
}
.card.small {
  width: calc(var(--card-w) * 0.7);
  height: calc(var(--card-h) * 0.7);
  padding: 4px;
}
.card.back {
  background: linear-gradient(135deg, var(--card-back-start), var(--card-back-end));
  color: var(--text-secondary);
  padding: 18px 8px;
  width: var(--card-w);
  height: var(--card-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.card .suit {
  text-align: center;
  font-size: 34px;
  line-height: 1;
}
.card .rank {
  font-weight: 700;
  font-size: 14px;
}
.card .rank.bottom {
  transform: rotate(180deg);
  text-align: right;
}
.card.red {
  color: var(--card-red);
}
.card.black {
  color: var(--card-black);
}
.card.tapper-outline {
  border: 5px solid var(--border-tapper);
  box-sizing: border-box;
  border-radius: 6px;
}
.card.face-sprite {
  background-color: transparent;
  color: transparent;
  background-repeat: no-repeat;
  display: inline-block;
  width: var(--card-w);
  height: var(--card-h);
  margin: 6px;
  border-radius: 8px;
  box-shadow: 0 4px 8px var(--card-shadow);
  overflow: hidden;
}
.played-card.lead-not-tapper .card {
  border: 5px solid var(--border-lead);
  box-sizing: border-box;
  border-radius: 6px;
}
button.card.play {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  position: relative;
}
button.card.play:hover {
  transform: translateY(-12px) scale(1.08);
  z-index: 100;
}
button.card.play:hover .card,
button.card.play:hover .face-sprite {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.6) !important;
}
button.card.play.disabled {
  cursor: not-allowed;
  opacity: 0.9;
  filter: grayscale(10%);
}
button.card.play.disabled:hover {
  transform: translateY(-4px) scale(1.02);
  filter: grayscale(10%);
}
.middle {
  flex: 1;
  text-align: center;
  padding: 20px;
}
.table {
  min-height: calc(var(--card-h-lg) * 2.88);
  width: calc(var(--card-w-lg) * 4.8);
  margin: 0 auto;
  position: relative;
  background: var(--bg-table);
  border-radius: 8px;
  cursor: default;
  z-index: 10;
  transition: background 0.3s ease;
}
.played-card {
  z-index: 40;
  text-align: center;
  position: absolute;
  width: calc(var(--card-w-lg) * 1.2);
}
.played-card .owner {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  white-space: nowrap;
  font-size: 0.85rem;
}
.played-card.p0 {
  top: 50%;
  left: 15px;
  transform: translateY(-50%);
}
.played-card.p1 {
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
}
.played-card.p2 {
  top: 50%;
  right: 15px;
  transform: translateY(-50%);
}
.played-card.p3 {
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
}
.played-card .card {
  margin: 0;
}
.played-card .card,
.played-card .face-sprite {
  width: calc(var(--card-w-lg) * 1.2);
  height: calc(var(--card-h-lg) * 1.2);
}
.message {
  margin-top: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px;
  border-radius: 6px;
  position: relative;
  z-index: 50;
}
.message .hint {
  display: block;
  margin-top: 6px;
  color: var(--text-warm);
}
.bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 0;
}
.hand {
  flex: 1;
  margin: 0 12px;
}
.hand .card,
.hand .face-sprite,
.hand .card.back {
  width: var(--card-w-lg);
  height: var(--card-h-lg);
}
.cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  max-width: 100%;
  overflow: auto;
  padding: 6px;
  background: var(--bg-card-area);
  border-radius: 6px;
  transition: background 0.3s ease;
}
.player.current-turn {
  position: relative;
  box-shadow: 0 0 0 3px var(--accent-gold);
  animation: pulse-border 1.5s ease-in-out infinite;
}
.player.current-turn::before {
  content: '👉 Am Zug';
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: var(--bg-primary);
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  animation: pulse-glow 1.5s ease-in-out infinite;
  white-space: nowrap;
}
@keyframes pulse-glow {
  0%,
  100% {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1.05);
  }
}
@keyframes pulse-border {
  0%,
  100% {
    box-shadow: 0 0 0 3px var(--accent-gold);
  }
  50% {
    box-shadow: 0 0 0 5px var(--accent-gold), 0 0 15px rgba(255, 213, 77, 0.5);
  }
}
.last-tricks {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 8px;
  border-radius: 8px;
  z-index: 200;
  max-width: 200px;
}
.last-tricks h4 {
  margin: 0 0 6px 0;
  font-size: 0.8rem;
  color: var(--accent-gold);
}
.last-trick {
  display: flex;
  gap: 2px;
  margin-bottom: 6px;
  align-items: center;
  padding: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}
.last-trick .trick-label {
  font-size: 0.65rem;
  color: #aaa;
  width: 20px;
}
.last-trick .mini-card {
  width: 22px;
  height: 32px;
  background: var(--card-bg);
  border-radius: 3px;
  font-size: 0.55rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--card-text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.last-trick .mini-card.red {
  color: var(--card-red);
}
.last-trick .mini-card.winner {
  border: 2px solid var(--accent-gold);
}
.last-trick .trick-winner {
  font-size: 0.6rem;
  color: var(--accent-gold);
  margin-left: 4px;
}
.controls {
  width: 160px;
  text-align: center;
}
.talon-area {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
  border-radius: 6px;
  display: inline-block;
  max-width: 90%;
}
.talon-cards {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.card.talon,
.talon .card {
  width: var(--card-w);
  height: var(--card-h);
}
button.card.talon,
div.card.face-sprite {
  padding: 0px;
  margin: 0px;
}
.selected {
  outline: 3px solid var(--accent-gold);
  border-radius: 6px;
}
.swap-controls {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.ai-players-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-around;
  margin-top: 10px;
}
.ai-players-row .player {
  flex: 1 1 auto;
  min-width: 160px;
  max-width: 300px;
}
@container body (max-width: 900px) {
  .board {
    height: auto;
    min-height: 100vh;
  }
  main {
    flex-direction: column;
    align-items: stretch;
  }
  .middle {
    order: 0;
  }
  .bottom-row {
    flex-direction: column;
    align-items: stretch;
  }
  .bottom-row > .hand {
    order: 0;
    width: 100%;
  }
  .player {
    width: auto;
  }
  .ai-players-row {
    order: 10;
  }
  .ai-players-row .player {
    flex: 1 1 30%;
    min-width: 120px;
  }
}
@media (max-width: 900px) {
  .hand h4 {
    margin-top: 5px;
  }
  .swap-controls {
    flex-direction: column;
  }
  .table {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: stretch !important;
    gap: 4px !important;
    padding: 6px !important;
    min-height: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    position: relative !important;
    box-sizing: border-box !important;
  }
  .played-card,
  .card-placeholder {
    position: static !important;
    transform: none !important;
    width: calc(25% - 3px) !important;
    max-width: calc(25% - 3px) !important;
    flex: 0 0 calc(25% - 3px) !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  .played-card .card,
  .played-card .face-sprite {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    aspect-ratio: 2.5 / 3.5 !important;
  }
  .played-card .owner {
    position: static !important;
    transform: none !important;
    margin-bottom: 2px;
    top: auto !important;
    left: auto !important;
    font-size: 0.75rem !important;
  }
  .played-card.p0,
  .card-placeholder.p0 {
    order: 1 !important;
  }
  .played-card.p1,
  .card-placeholder.p1 {
    order: 2 !important;
  }
  .played-card.p2,
  .card-placeholder.p2 {
    order: 3 !important;
  }
  .played-card.p3,
  .card-placeholder.p3 {
    order: 4 !important;
  }
  .card-placeholder {
    background: rgba(255, 255, 255, 0.08) !important;
    border: 2px dashed rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px !important;
    min-height: 80px !important;
    padding: 6px 2px !important;
    display: flex !important;
  }
  .card-placeholder .placeholder-text {
    font-size: 0.6rem !important;
    color: rgba(255, 255, 255, 0.6) !important;
    text-align: center !important;
    word-wrap: break-word !important;
    line-height: 1.2 !important;
  }
  .card-placeholder .owner {
    font-weight: bold !important;
    font-size: 0.75rem !important;
    margin-bottom: 4px !important;
  }
}
@media (min-width: 901px) {
  .card-placeholder {
    display: none !important;
  }
}
@media (max-width: 900px) {
  .table.winner-p0 .played-card.animating.p1,
  .table.winner-p0 .played-card.animated.p1 {
    --fly-x: -60px;
    --fly-y: 0;
  }
  .table.winner-p0 .played-card.animating.p2,
  .table.winner-p0 .played-card.animated.p2 {
    --fly-x: -120px;
    --fly-y: 0;
  }
  .table.winner-p0 .played-card.animating.p3,
  .table.winner-p0 .played-card.animated.p3 {
    --fly-x: -180px;
    --fly-y: 0;
  }
  .table.winner-p1 .played-card.animating.p0,
  .table.winner-p1 .played-card.animated.p0 {
    --fly-x: 60px;
    --fly-y: 0;
  }
  .table.winner-p1 .played-card.animating.p2,
  .table.winner-p1 .played-card.animated.p2 {
    --fly-x: -60px;
    --fly-y: 0;
  }
  .table.winner-p1 .played-card.animating.p3,
  .table.winner-p1 .played-card.animated.p3 {
    --fly-x: -120px;
    --fly-y: 0;
  }
  .table.winner-p2 .played-card.animating.p0,
  .table.winner-p2 .played-card.animated.p0 {
    --fly-x: 120px;
    --fly-y: 0;
  }
  .table.winner-p2 .played-card.animating.p1,
  .table.winner-p2 .played-card.animated.p1 {
    --fly-x: 60px;
    --fly-y: 0;
  }
  .table.winner-p2 .played-card.animating.p3,
  .table.winner-p2 .played-card.animated.p3 {
    --fly-x: -60px;
    --fly-y: 0;
  }
  .table.winner-p3 .played-card.animating.p0,
  .table.winner-p3 .played-card.animated.p0 {
    --fly-x: 180px;
    --fly-y: 0;
  }
  .table.winner-p3 .played-card.animating.p1,
  .table.winner-p3 .played-card.animated.p1 {
    --fly-x: 120px;
    --fly-y: 0;
  }
  .table.winner-p3 .played-card.animating.p2,
  .table.winner-p3 .played-card.animated.p2 {
    --fly-x: 60px;
    --fly-y: 0;
  }
}
.hint-button {
  position: fixed;
  left: 10px;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 200;
  transition: transform 0.2s, box-shadow 0.2s;
  bottom: 150px;
  background: linear-gradient(135deg, var(--hint-button-start), var(--hint-button-end));
  color: white;
}
.hint-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.hint-button:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.6;
}
.hint-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  border: 3px solid var(--accent-green);
  border-radius: 16px;
  padding: 20px 30px;
  z-index: 1000;
  text-align: center;
  animation: hint-pop 0.3s ease-out;
}
.hint-overlay h3 {
  color: var(--accent-green);
  margin: 0 0 12px 0;
}
.hint-overlay .hint-card {
  display: inline-block;
  transform: scale(1.3);
  margin: 10px;
}
@keyframes hint-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}
.played-card.animating {
  animation: collect-to-center 0.5s ease-in-out forwards;
  z-index: 100;
}
@keyframes collect-to-center {
  0% {
    opacity: 1;
    transform: translateX(0) translateY(0) scale(1);
  }
  70% {
    opacity: 1;
    transform: translateX(var(--fly-x, 0)) translateY(var(--fly-y, 0)) scale(0.8) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: translateX(var(--fly-x, 0)) translateY(var(--fly-y, 0)) scale(0.66) rotate(0deg);
  }
}
.table.winner-p0 .played-card.animating.p1 {
  --fly-x: -80px;
  --fly-y: 60px;
}
.table.winner-p0 .played-card.animating.p2 {
  --fly-x: -120px;
  --fly-y: 0;
}
.table.winner-p0 .played-card.animating.p3 {
  --fly-x: -80px;
  --fly-y: -60px;
}
.table.winner-p0 .played-card.animating.p0 {
  --fly-x: 0;
  --fly-y: 0;
  animation-name: winner-card;
}
.table.winner-p1 .played-card.animating.p0 {
  --fly-x: 60px;
  --fly-y: -80px;
}
.table.winner-p1 .played-card.animating.p2 {
  --fly-x: -60px;
  --fly-y: -80px;
}
.table.winner-p1 .played-card.animating.p3 {
  --fly-x: 0;
  --fly-y: -120px;
}
.table.winner-p1 .played-card.animating.p1 {
  --fly-x: 0;
  --fly-y: 0;
  animation-name: winner-card;
}
.table.winner-p2 .played-card.animating.p0 {
  --fly-x: 120px;
  --fly-y: 0;
}
.table.winner-p2 .played-card.animating.p1 {
  --fly-x: 80px;
  --fly-y: 60px;
}
.table.winner-p2 .played-card.animating.p3 {
  --fly-x: 80px;
  --fly-y: -60px;
}
.table.winner-p2 .played-card.animating.p2 {
  --fly-x: 0;
  --fly-y: 0;
  animation-name: winner-card;
}
.table.winner-p3 .played-card.animating.p0 {
  --fly-x: 60px;
  --fly-y: 80px;
}
.table.winner-p3 .played-card.animating.p1 {
  --fly-x: 0;
  --fly-y: 120px;
}
.table.winner-p3 .played-card.animating.p2 {
  --fly-x: -60px;
  --fly-y: 80px;
}
.table.winner-p3 .played-card.animating.p3 {
  --fly-x: 0;
  --fly-y: 0;
  animation-name: winner-card;
}
@keyframes winner-card {
  0% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 0 25px 8px rgba(76, 175, 80, 0.7);
  }
  100% {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 0 15px 5px rgba(76, 175, 80, 0.5);
  }
}
.played-card.animated {
  transform: translateX(var(--fly-x, 0)) translateY(var(--fly-y, 0)) scale(0.66);
  opacity: 1;
}
.played-card.animated.winner-card {
  transform: scale(1) !important;
  box-shadow: 0 0 15px 5px rgba(76, 175, 80, 0.5);
}
.table.winner-p0 .played-card.animated.p1 {
  --fly-x: -80px;
  --fly-y: 60px;
}
.table.winner-p0 .played-card.animated.p2 {
  --fly-x: -120px;
  --fly-y: 0;
}
.table.winner-p0 .played-card.animated.p3 {
  --fly-x: -80px;
  --fly-y: -60px;
}
.table.winner-p0 .played-card.animated.p0 {
  --fly-x: 0;
  --fly-y: 0;
}
.table.winner-p1 .played-card.animated.p0 {
  --fly-x: 60px;
  --fly-y: -80px;
}
.table.winner-p1 .played-card.animated.p2 {
  --fly-x: -60px;
  --fly-y: -80px;
}
.table.winner-p1 .played-card.animated.p3 {
  --fly-x: 0;
  --fly-y: -120px;
}
.table.winner-p1 .played-card.animated.p1 {
  --fly-x: 0;
  --fly-y: 0;
}
.table.winner-p2 .played-card.animated.p0 {
  --fly-x: 120px;
  --fly-y: 0;
}
.table.winner-p2 .played-card.animated.p1 {
  --fly-x: 80px;
  --fly-y: 60px;
}
.table.winner-p2 .played-card.animated.p3 {
  --fly-x: 80px;
  --fly-y: -60px;
}
.table.winner-p2 .played-card.animated.p2 {
  --fly-x: 0;
  --fly-y: 0;
}
.table.winner-p3 .played-card.animated.p0 {
  --fly-x: 60px;
  --fly-y: 80px;
}
.table.winner-p3 .played-card.animated.p1 {
  --fly-x: 0;
  --fly-y: 120px;
}
.table.winner-p3 .played-card.animated.p2 {
  --fly-x: -60px;
  --fly-y: 80px;
}
.table.winner-p3 .played-card.animated.p3 {
  --fly-x: 0;
  --fly-y: 0;
}
.trick-winner-highlight {
  animation: winner-glow 0.6s ease-out;
}
@keyframes winner-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.8);
  }
  50% {
    box-shadow: 0 0 30px 10px rgba(76, 175, 80, 0.6);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
  }
}
.stats-button {
  position: fixed;
  left: 10px;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 200;
  transition: transform 0.2s, box-shadow 0.2s;
  bottom: 10px;
  background: linear-gradient(135deg, var(--stats-button-start), var(--stats-button-end));
  color: white;
}
.stats-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.help-button {
  position: fixed;
  left: 10px;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 200;
  transition: transform 0.2s, box-shadow 0.2s;
  bottom: 80px;
  background: linear-gradient(135deg, var(--help-button-start), var(--help-button-end));
  color: #333;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.help-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5);
}
.stats-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fade-in 0.2s ease-out;
}
@keyframes fade-in {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}
.stats-modal {
  background: var(--modal-bg);
  border-radius: 16px;
  padding: 24px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  border: 2px solid var(--modal-border);
}
.stats-modal h2 {
  color: var(--accent-gold);
  margin: 0 0 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.stats-modal .close-btn {
  background: var(--accent-red);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
}
.stats-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stats-summary .stat-box {
  background: var(--bg-room-item);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
}
.stats-summary .stat-box .stat-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--text-primary);
}
.stats-summary .stat-box .stat-label {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}
.stats-summary .stat-box.win .stat-value {
  color: var(--accent-green);
}
.stats-summary .stat-box.loss .stat-value {
  color: var(--accent-red);
}
.stats-summary .stat-box.balance .stat-value {
  color: var(--accent-gold);
}
.game-history {
  max-height: 300px;
  overflow-y: auto;
}
.game-history h3 {
  color: #888;
  font-size: 14px;
  margin: 0 0 8px 0;
  text-transform: uppercase;
}
.game-history-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  margin-bottom: 6px;
  border-left: 4px solid;
}
.game-history-entry.won {
  border-color: var(--accent-green);
}
.game-history-entry.lost {
  border-color: var(--accent-red);
}
.game-history-entry .entry-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.game-history-entry .entry-mode {
  font-weight: bold;
  color: var(--text-primary);
}
.game-history-entry .entry-role {
  font-size: 12px;
  color: #888;
}
.game-history-entry .entry-date {
  font-size: 11px;
  color: #666;
}
.game-history-entry .entry-result {
  text-align: right;
}
.game-history-entry .entry-amount {
  font-weight: bold;
  font-size: 16px;
}
.game-history-entry .entry-amount.positive {
  color: var(--accent-green);
}
.game-history-entry .entry-amount.negative {
  color: var(--accent-red);
}
