:root {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #334155;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --red: #ef4444;
  --green: #10b981;
  --team1: #3b82f6;
  --team2: #ec4899;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at top left, #1e293b 0%, #0f172a 70%);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
}

a.back-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.75);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: all 0.2s ease;
  z-index: 100;
}
@media (hover: hover) {
  a.back-link:hover, .back-link:hover {
    color: #fff;
    border-color: #8b5cf6;
    box-shadow: 0 0 24px rgba(139, 92, 246, 0.7), 0 0 8px rgba(139, 92, 246, 0.45);
  }
}

.app-container {
  max-width: 500px;
  width: 100%;
  margin: 0 auto;
  padding: calc(3.5rem + env(safe-area-inset-top, 0px)) 0.5rem calc(1rem + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 1rem;
}

.header { display: flex; flex-direction: column; gap: 1rem; }
.title-row { display: flex; justify-content: space-between; align-items: center; }

h1 {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  color: transparent;
}

.btn-icon {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}
@media (hover: hover) { .btn-icon:hover { background: var(--border); color: var(--text); } }
.btn-icon:active { background: var(--border); color: var(--text); }
#btn-poker-end-game { display: none; background: rgba(239, 68, 68, 0.15); border: 1px solid var(--red); color: var(--red); padding: 0.3rem 0.6rem; border-radius: 8px; font-weight: bold; cursor: pointer; font-size: 0.8rem; transition: background 0.2s; }

.mode-toggle {
  display: flex;
  background: var(--panel);
  border-radius: 12px;
  padding: 4px;
  border: 1px solid var(--border);
}
.mode-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.6rem 0;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 48px;
}
.mode-btn.active { background: var(--border); color: var(--text); box-shadow: 0 2px 5px rgba(0,0,0,0.2); }

.board {
  display: flex;
  background: rgba(30, 41, 59, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-radius: 16px;
  padding: 1.5rem 1rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.bg-z { position: absolute; top: 10%; bottom: 10%; width: 40%; z-index: 0; opacity: 0.05; pointer-events: none; }
.bg-z-left { left: 5%; }
.bg-z-right { right: 5%; }
.bg-z svg { width: 100%; height: 100%; fill: none; stroke: var(--text); stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; }

.team { flex: 1; display: flex; flex-direction: column; align-items: center; z-index: 1; }
.team-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  border: 1px dashed transparent;
  outline: none;
  transition: all 0.2s;
  text-align: center;
  -webkit-user-select: text;
  user-select: text;
}
.team-name:focus { border-color: var(--border); background: rgba(255,255,255,0.05); color: var(--text); }
#name-team1 { color: var(--team1); }
#name-team2 { color: var(--team2); }

.score { font-size: clamp(3rem, 15vw, 4.5rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; margin: 0.25rem 0; text-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.score-diff { font-size: 0.85rem; margin-top: 0.5rem; min-height: 1rem; color: var(--green); font-weight: 500; }
.divider { width: 1px; background: var(--border); margin: 0 1rem; z-index: 1; }

/* Counter Mode */
#counter-teams-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  width: 100%;
  z-index: 1;
}
.counter-tile {
  background: rgba(30, 41, 59, 0.7);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}
@media (hover: hover) {
  .counter-tile:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); border-color: rgba(255, 255, 255, 0.15); }
}
.counter-tile .team-name { margin-bottom: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: 0.5px; text-align: center; }
.counter-tile .score { font-size: clamp(2.5rem, 12vw, 3.5rem); font-weight: 800; margin: 0.5rem 0; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.tile-controls { display: flex; width: 100%; gap: 0.8rem; justify-content: center; }
.tile-btn {
  flex: 1;
  height: 52px;
  border-radius: 14px;
  border: 1px solid transparent;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  background: rgba(255,255,255,0.05);
}
.tile-btn.minus { color: var(--red); background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); }
.tile-btn.minus:active { background: rgba(239, 68, 68, 0.25); transform: scale(0.95); }
.tile-btn.plus { color: var(--green); background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); }
.tile-btn.plus:active { background: rgba(16, 185, 129, 0.25); transform: scale(0.95); }

.color-p0 { color: #3b82f6; }
.color-p1 { color: #ec4899; }
.color-p2 { color: #10b981; }
.color-p3 { color: #f59e0b; }
.color-p4 { color: #8b5cf6; }
.color-p5 { color: #ef4444; }
.color-p6 { color: #06b6d4; }
.color-p7 { color: #f97316; }

/* Lists & History */
.list-wrapper { display: flex; flex-direction: column; background: var(--panel); border-radius: 16px; border: 1px solid var(--border); overflow: hidden; flex-shrink: 0; }
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,0.02);
  -webkit-user-select: none;
  user-select: none;
}
.list-header:active { background: rgba(255,255,255,0.05); }
.list-container { overflow-y: auto; max-height: 45vh; transition: max-height 0.3s ease; border-top: 1px solid var(--border); }
.list-wrapper.collapsed .list-container { max-height: 0; border-top: none; }
#list-chevron { transition: transform 0.3s ease; }
.list-wrapper.collapsed #list-chevron { transform: rotate(-90deg); }

.history-item { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.history-item:last-child { border-bottom: none; }
.history-calc { color: var(--muted); text-align: center; width: 40%; }
.history-item .t1 { color: var(--team1); }
.history-item--round { flex-direction: column; align-items: stretch; gap: 4px; position: relative; }
.history-undo { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.history-row { display: flex; justify-content: space-between; width: 85%; }
.history-subrow { display: flex; justify-content: space-between; width: 85%; font-size: 0.8rem; }
.history-subrow--tichu { border-top: 1px dashed var(--border); padding-top: 4px; }
.history-col { width: 30%; }
.history-col--r { width: 30%; text-align: right; }
.history-mid { width: 40%; text-align: center; color: var(--muted); }
.history-pts-t1 { color: var(--team1); font-weight: 700; }
.history-pts-t2 { color: var(--team2); font-weight: 700; }
.history-weis-tag { font-size: 0.7rem; color: var(--primary); }
.list-empty { padding: 2rem; text-align: center; color: var(--muted); }
.history-item .t2 { color: var(--team2); }
.btn-undo { background: transparent; border: none; color: var(--red); cursor: pointer; padding: 4px; font-size: 1rem; }

/* Coiffeur Table */
.coiffeur-grid { display: flex; flex-direction: column; }
.coiffeur-row { display: grid; grid-template-columns: 1fr 2fr 1fr; border-bottom: 1px solid var(--border); align-items: center; }
.coiffeur-row:last-child { border-bottom: none; }
.c-cell { padding: 0.75rem 0.5rem; text-align: center; font-weight: 600; font-size: 0.95rem; }
.c-name { color: var(--text); font-size: 0.9rem; font-weight: 500; }
.c-score { cursor: pointer; background: rgba(255,255,255,0.03); transition: background 0.2s; min-height: 44px; display: flex; align-items: center; justify-content: center; }
@media (hover: hover) { .c-score:hover { background: rgba(255,255,255,0.08); } }
.c-score.done { cursor: default; background: transparent; }
.c-score.t1-done { color: var(--team1); }
.c-score.t2-done { color: var(--team2); }

.c-mult-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  padding: 2px 4px;
  font-size: 0.8rem;
  margin-left: 4px;
  cursor: pointer;
  outline: none;
}
.c-mult-select:focus { border-color: var(--primary); color: var(--text); }

/* Controls & Inputs */
.controls { margin-top: auto; padding-top: 1rem; }
.control-group { display: none; flex-direction: column; gap: 1rem; }
.control-group.active { display: flex; }
.input-row { display: flex; flex-direction: column; gap: 0.5rem; }

input[type="number"] {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  outline: none;
  text-align: center;
  min-height: 48px;
  -webkit-user-select: text;
  user-select: text;
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"]:focus { border-color: var(--primary); }
.btn-match-inline { position: absolute; right: 0.4rem; top: 50%; transform: translateY(-50%); background: var(--panel); border: 1px solid var(--primary); color: var(--primary); padding: 0.3rem 0.6rem; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: 0.9rem; transition: 0.1s; }

.multipliers { display: flex; background: var(--panel); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; width: 100%; }
.mult-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 0.8rem 0;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  border-right: 1px solid var(--border);
  transition: all 0.2s;
}
.mult-btn:last-child { border-right: none; }
.mult-btn.active { background: var(--border); color: var(--text); }

.action-row { display: flex; gap: 0.75rem; }
.action-btn { flex: 1; padding: 1rem; border-radius: 12px; border: none; font-size: 1.05rem; font-weight: 700; color: #fff; cursor: pointer; transition: opacity 0.2s, transform 0.1s; }
.action-btn:active { transform: scale(0.97); }
.team1-btn { background: var(--team1); }
.team2-btn { background: var(--team2); }

.coiffeur-instruction { text-align: center; color: var(--muted); font-size: 0.9rem; padding: 1rem; background: var(--panel); border-radius: 12px; border: 1px solid var(--border); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.modal-overlay.active { opacity: 1; pointer-events: auto; }
.modal {
  background: rgba(30, 41, 59, 0.85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  width: 90%;
  max-width: 350px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 40px rgba(0,0,0,0.6);
  transform: translateY(20px);
  transition: transform 0.3s;
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 1.1rem; }
.close-btn { background: transparent; border: none; color: var(--muted); font-size: 1.5rem; cursor: pointer; line-height: 1; padding: 0.5rem; margin: -0.5rem; }
.modal-body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.modal-info { font-size: 0.9rem; color: var(--muted); }
.modal-result { font-size: 1.1rem; text-align: center; margin-bottom: 0.5rem; }
#btn-save-coiffeur { background: var(--primary); }

/* Weis Section */
.weis-section { margin-top: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.weis-header { font-size: 0.8rem; color: var(--muted); text-align: center; margin-bottom: 0.75rem; }
.weis-grid-ui { display: flex; justify-content: space-between; align-items: stretch; }
.weis-col-ui { display: flex; flex-direction: column; gap: 0.5rem; width: 48%; }
.w-title { font-size: 0.85rem; text-align: center; font-weight: 600; }
.weis-divider { width: 1px; background: var(--border); }
.w-btn-group { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.w-btn {
  flex: 1 1 30%;
  min-height: 48px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.w-btn.t1 { border-color: rgba(59, 130, 246, 0.4); }
.w-btn.t2 { border-color: rgba(236, 72, 153, 0.4); }
.w-btn:active { transform: scale(0.95); }

/* Toast Notification */
.toast-container { position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 0.5rem; z-index: 9999; pointer-events: none; }
.toast { background: var(--red); color: white; padding: 0.75rem 1.5rem; border-radius: 20px; font-size: 0.9rem; font-weight: 600; box-shadow: 0 5px 15px rgba(239, 68, 68, 0.4); opacity: 0; transform: translateY(20px); animation: toast-in 0.3s forwards; }
.toast.fade-out { animation: toast-out 0.3s forwards; }
@keyframes toast-in { to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-20px); } }

/* Tichu Styles */
.tichu-action-row { display: flex; gap: 0.75rem; }
.tichu-ansagen-box { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem; }
.t-title { font-size: 0.85rem; font-weight: 700; margin-bottom: 0.5rem; text-align: center; }
.t-ansagen-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.t-btn { background: var(--panel); border: 1px solid var(--border); color: var(--muted); padding: 0.5rem; border-radius: 8px; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s; min-height: 48px; }
.t-btn:active { transform: scale(0.95); }

.t-doppel { flex: 1; border-width: 2px; }
.t-doppel.active.t1 { background: rgba(59, 130, 246, 0.2); border-color: var(--team1); color: var(--team1); }
.t-doppel.active.t2 { background: rgba(236, 72, 153, 0.2); border-color: var(--team2); color: var(--team2); }
.t-ansage.active-win { background: rgba(16, 185, 129, 0.2); border-color: var(--green); color: var(--green); }
.t-ansage.active-loss { background: rgba(239, 68, 68, 0.2); border-color: var(--red); color: var(--red); }

.t-badge-group { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 4px; width: 100%; }
.t-badge { font-size: 0.65rem; padding: 2px 4px; border-radius: 4px; font-weight: 700; }
.t-badge.win { background: rgba(16, 185, 129, 0.2); color: var(--green); }
.t-badge.loss { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.t-badge.doppel { background: rgba(255, 215, 0, 0.2); color: #fbbf24; }

/* Tichu Emotes */
.tichu-emote-btn {
  position: fixed;
  background: rgba(30,41,59,0.9);
  border: 2px solid var(--primary);
  border-radius: 50%;
  width: 55px;
  height: 55px;
  font-size: 28px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: transform 0.2s, box-shadow 0.2s;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tichu-emote-btn:active { transform: scale(0.9); box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.tichu-emote-btn.active { display: flex; }
.tichu-emote-btn img { width: 75%; height: auto; pointer-events: none; }

.pos-br, .pos-bl { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.pos-tl, .pos-tr { top: calc(90px + env(safe-area-inset-top, 0px)); }
.pos-br, .pos-tr { right: 20px; }
.pos-bl, .pos-tl { left: 20px; }

.flying-dragon-container, .flying-dog-container, .phoenix-container, .bomb-container {
  position: fixed;
  height: auto;
  pointer-events: none;
}
.flying-dragon-img, .flying-dog-img, .phoenix-img, .bomb-img { width: 100%; height: auto; }

.flying-dragon-container {
  top: 50%; left: 50%; transform: translate(-50%, -50%); width: 250px; z-index: 9999;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6));
  animation: dragon-cinematic 3.5s ease-in-out forwards;
}
@keyframes dragon-cinematic {
  0% { transform: translate3d(calc(-50vw - 300px), -50%, 0) scale(0.5); opacity: 0; }
  15% { opacity: 1; }
  30% { transform: translate3d(-50%, -50%, 0) scale(1.5); }
  70% { transform: translate3d(-50%, -50%, 0) scale(1.5); opacity: 1; }
  75% { transform: translate3d(-50%, -50%, 0) scale(1.5); opacity: 0; }
  100% { transform: translate3d(-50%, -50%, 0) scale(1.5); opacity: 0; }
}

.flying-dog-container {
  top: 60%; left: 0; width: 250px; z-index: 9999;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.6));
  animation: dog-run 2.5s linear forwards;
}
@keyframes dog-run {
  0% { transform: translate3d(-300px, -50%, 0) scale(1); }
  100% { transform: translate3d(120vw, -50%, 0) scale(1.2); }
}

.phoenix-container {
  top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.1); width: 300px; z-index: 10001;
  filter: drop-shadow(0 0 50px rgba(255,100,0,0.8)); opacity: 0;
  animation: phoenix-rise 4s ease-in-out forwards;
}
@keyframes phoenix-rise {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.1); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
}

.bomb-container {
  top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.4); width: 240px; z-index: 10000;
  filter: drop-shadow(0 0 36px rgba(239, 68, 68, 0.75)); opacity: 0;
  animation: bomb-impact 1.05s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes bomb-impact {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.35); }
  22% { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.12); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.45); }
}

/* Poker Mode */
#controls-poker { padding-bottom: 2rem; }
.poker-view { display: none; flex-direction: column; gap: 1rem; }
.poker-view.active { display: flex; }
.poker-view-title { text-align: center; margin-bottom: 1rem; color: var(--text); }
.poker-full-btn { width: 100%; margin-top: 1.5rem; }
.poker-setup-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.poker-setup-item { display: flex; flex-direction: column; gap: 0.5rem; }
.poker-setup-item label { color: var(--muted); font-size: 0.9rem; font-weight: 600; }

.poker-table-arena { position: relative; width: 100%; aspect-ratio: 1 / 1.05; margin-bottom: 0.5rem; }
.poker-table-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  height: 85%;
  z-index: 5;
  background: radial-gradient(ellipse at center, #115e59 0%, #064e3b 70%, #022c22 100%);
  border: 12px solid #292524;
  border-radius: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 0 2px rgba(251, 191, 36, 0.4), inset 0 0 40px rgba(0,0,0,0.8), 0 20px 40px rgba(0,0,0,0.6);
}
.poker-phase { background: rgba(0,0,0,0.5); color: #fbbf24; padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; margin-bottom: 0.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.poker-community-cards { display: flex; justify-content: center; gap: 0.35rem; margin-top: 0.5rem; margin-bottom: 0.25rem; min-height: 52px; perspective: 800px; }
.poker-card {
  width: 36px;
  height: 54px;
  border-radius: 6px;
  background-color: #b91c1c;
  background-image:
    linear-gradient(135deg, #7f1d1d 25%, transparent 25%),
    linear-gradient(225deg, #7f1d1d 25%, transparent 25%),
    linear-gradient(45deg, #7f1d1d 25%, transparent 25%),
    linear-gradient(315deg, #7f1d1d 25%, #b91c1c 25%);
  background-position: 8px 0, 8px 0, 0 0, 0 0;
  background-size: 16px 16px;
  background-repeat: repeat;
  border: 3px solid #fff;
  box-shadow: 0 5px 15px rgba(0,0,0,0.8), inset 0 0 0 1px rgba(0,0,0,0.3);
  opacity: 0;
  transform-style: preserve-3d;
  transform: translate3d(0, -50px, -50px) scale(0.6) rotateY(180deg) rotateX(45deg);
}
.card-deal-anim { animation: deal-card 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
@keyframes deal-card {
  0% { opacity: 0; transform: translate3d(0, -50px, -50px) scale(0.6) rotateY(180deg) rotateX(45deg); }
  50% { opacity: 1; transform: translate3d(0, -20px, 50px) scale(1.2) rotateY(90deg) rotateX(10deg); }
  100% { opacity: 1; transform: translate3d(0, 0, 0) scale(1) rotateY(0deg) rotateX(0deg); }
}

.poker-pot-label { font-size: 0.8rem; color: #a7f3d0; font-weight: 600; margin-top: 4px; }
.poker-pot-value { font-size: 2.5rem; font-weight: 800; color: #fff; text-shadow: 0 4px 10px rgba(0,0,0,0.5); line-height: 1; }
.poker-call-info { margin-top: 4px; color: #fcd34d; font-weight: 600; font-size: 0.9rem; background: rgba(0,0,0,0.3); display: inline-block; padding: 4px 12px; border-radius: 12px; }

.poker-players-list { position: absolute; inset: 0; pointer-events: none; z-index: 10; }
.poker-players-list > * { pointer-events: auto; }
.poker-player-mini {
  position: absolute;
  transform: translate(-50%, -50%);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.35rem 0.5rem;
  width: 75px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.poker-player-mini.active-turn { border-color: var(--primary); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); animation: pulse-turn 1.5s infinite; }
@keyframes pulse-turn {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 10px rgba(59, 130, 246, 0.5); }
  50% { transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); }
}
.poker-player-mini.folded { opacity: 0.4; filter: grayscale(100%); }
.poker-mini-name { font-size: 0.8rem; font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.poker-mini-chips { font-size: 1rem; font-weight: 700; color: var(--text); }
.poker-mini-bet { font-size: 0.75rem; color: var(--green); margin-top: 4px; }

.poker-role-badge { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; border-radius: 50%; font-size: 0.6rem; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 4px rgba(0,0,0,0.5); }
.role-d { background: #fff; color: #000; }
.role-sb { background: #3b82f6; color: #fff; }
.role-bb { background: #ef4444; color: #fff; }

.poker-action-area {
  background: rgba(30, 41, 59, 0.6);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 1rem;
  margin-top: 1rem;
  display: block;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}
.active-player-title { text-align: center; color: var(--primary); font-size: 1.2rem; margin-bottom: 0.2rem; }
.active-player-chips { text-align: center; color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.poker-actions-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.p-btn { flex: 1; padding: 1rem 0; border-radius: 12px; border: none; font-weight: 700; font-size: 1.1rem; cursor: pointer; color: #fff; transition: transform 0.1s; }
.p-btn:active { transform: scale(0.95); }
.p-btn-fold { background: var(--border); color: var(--muted); }
.p-btn-call { background: var(--primary); }
.p-btn-raise { background: var(--green); }
.p-btn:disabled { opacity: 0.5; pointer-events: none; }

.poker-raise-section { background: rgba(255,255,255,0.03); padding: 0.75rem; border-radius: 12px; }
.chip-buttons { display: flex; gap: 0.5rem; justify-content: space-between; }
.chip-btn {
  background: radial-gradient(circle at center, #334155 50%, #1e293b 100%);
  border: 2px dashed #64748b;
  color: #fff;
  flex: 1;
  max-width: 80px;
  height: 50px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
  padding: 0;
}
.chip-btn:active { transform: translateY(2px); box-shadow: 0 1px 2px rgba(0,0,0,0.3); }

.poker-showdown-list { display: flex; flex-direction: column; gap: 0.5rem; }
.showdown-item { display: flex; align-items: center; justify-content: space-between; background: rgba(30, 41, 59, 0.5); border: 1px solid rgba(255, 255, 255, 0.08); padding: 1rem; border-radius: 12px; cursor: pointer; transition: all 0.2s; }
.showdown-item:hover { background: rgba(30, 41, 59, 0.8); }
.showdown-item.selected { border-color: var(--green); background: rgba(16, 185, 129, 0.1); }
