:root {
  --purple: #b53b35;
  --purple-dark: #872722;
  --navy: #243b53;
  --bg: #f6f4f2;
  --ink: #1e1c21;
  --red: #b23232;
  --border: #e5dedc;
  --felt: #1b5e3c;
  --felt-dark: #113f28;
  --gold: #f0b429;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

header {
  background: linear-gradient(135deg, #a83731, #7c231f);
  color: #fff;
  padding: 24px 20px 28px;
  text-align: center;
  border-bottom: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 12px rgba(124, 35, 31, 0.2);
}

.header-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 6px;
}

.swiss-flag {
  position: relative;
  width: 34px;
  height: 34px;
  background: #b53b35;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}

.swiss-flag::before,
.swiss-flag::after {
  content: '';
  position: absolute;
  background: #fff;
  border-radius: 1px;
}

.swiss-flag::before {
  width: 18px;
  height: 6px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.swiss-flag::after {
  width: 6px;
  height: 18px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

header h1 {
  font-size: 2rem;
  margin-bottom: 0;
}

header p {
  max-width: 680px;
  margin: 0 auto;
  opacity: 0.92;
  font-size: 0.98rem;
}

.badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.82rem;
  margin-top: 10px;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 8px 10px;
  max-width: 1180px;
  margin: 0 auto 10px;
}

.nav-pill, .langbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 8px;
  padding: 6px 13px;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.88rem;
  text-decoration: none;
}

.nav-pill:hover, .langbtn:hover {
  background: rgba(255, 255, 255, 0.34);
}

.lang-select {
  appearance: auto;
  padding-right: 8px;
}

.lang-select option {
  color: var(--ink);
  background: #fff;
  font-weight: 600;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 16px 60px;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(76, 51, 176, 0.06);
}

.muted {
  color: #635c80;
  font-size: 0.92rem;
}

.lobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 20px;
  margin-top: 8px;
}

.lobby-grid h2 {
  color: var(--purple-dark);
  border-left: 5px solid var(--purple);
  padding-left: 10px;
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.form-row {
  margin-top: 14px;
}

.form-row label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 5px;
}

.form-row input[type="text"],
.form-row select,
.join-row input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #faf9fe;
  color: var(--ink);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.check-wrap {
  padding-bottom: 6px;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-bottom: 0 !important;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.08s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-block {
  width: 100%;
  margin-top: 16px;
}

.btn-primary {
  background: var(--purple);
  color: #fff;
}

.btn-primary:hover {
  background: var(--purple-dark);
}

.btn-secondary {
  background: var(--ink);
  color: #fff;
}

.btn-secondary:hover {
  background: #362a6f;
}

.btn-outline {
  background: #fff;
  color: var(--purple-dark);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--purple);
  background: var(--bg);
}

.btn-danger-outline {
  background: #fff;
  color: var(--red);
  border: 1px solid #f1c3c9;
}

.btn-danger-outline:hover {
  background: #fdecef;
}

.btn-small {
  padding: 6px 11px;
  font-size: 0.82rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 12px;
  color: #777;
  font-size: 0.85rem;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.join-row {
  display: flex;
  gap: 8px;
}

.join-row input {
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 1px;
}

.saved-solo-card {
  margin-top: 16px;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #f0d797;
  background: #fffaf0;
}

.saved-solo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.saved-solo-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.status-left, .status-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--purple);
  color: #fff;
  border-radius: 999px;
  padding: 4px 12px;
  font-weight: 700;
  font-size: 0.84rem;
}

.chip-soft {
  background: var(--bg);
  color: var(--purple-dark);
  border: 1px solid var(--border);
}

.chip-identity {
  background: var(--ink);
  color: #fff;
  border: 1px solid #3a3640;
}

.chip-trump {
  background: #fff8e6;
  color: #7c4d00;
  border: 1px solid #f0d797;
}

.waiting-panel {
  margin-bottom: 20px;
}

.waiting-panel h2 {
  color: var(--purple-dark);
  margin-bottom: 6px;
}

.seats-lobby {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.lobby-seat-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lobby-seat-card.mine {
  border-color: var(--purple);
  background: #fdf1f0;
}

.lobby-seat-head {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
}

.waiting-actions {
  display: flex;
  justify-content: flex-end;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 18px;
  align-items: start;
}

@media (max-width: 920px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.felt-table {
  background: radial-gradient(circle at center, var(--felt) 0%, var(--felt-dark) 100%);
  border: 6px solid #4e3729;
  border-radius: 22px;
  padding: 16px;
  color: #fff;
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.28), 0 6px 18px rgba(36, 27, 77, 0.14);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.table-middle {
  display: grid;
  grid-template-columns: 150px 1fr 150px;
  gap: 10px;
  align-items: center;
}

.seat-box {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-top: 5px solid var(--purple);
  border-radius: 12px;
  padding: 9px 12px;
  text-align: center;
  font-size: 0.86rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.seat-box.team-1-seat {
  border-top-color: var(--navy);
}

.seat-box.is-me {
  background: #fff9f8;
}

.seat-box.active-turn {
  border-color: var(--gold);
  border-top-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240, 180, 41, 0.65), 0 6px 16px rgba(0, 0, 0, 0.3);
  background: #fffdf2;
}

.seat-top, .seat-bottom {
  max-width: 340px;
  margin: 0 auto;
  width: 100%;
}

.seat-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.seat-name {
  font-weight: 800;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 0.1px;
}

.seat-pos-pill {
  font-size: 0.72rem;
  font-weight: 700;
  background: #efeae9;
  color: #4f4a54;
  border-radius: 999px;
  padding: 1px 7px;
}

.seat-you-pill {
  font-size: 0.72rem;
  font-weight: 800;
  background: var(--purple);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
}

.seat-meta {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
  min-height: 20px;
}

.role-pill {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 6px;
  background: #e9eef4;
  color: var(--navy);
}

.role-pill.turn-pill {
  background: #fef0c7;
  color: #8a5600;
  border: 1px solid #f0b429;
}

.role-pill.dealer-pill {
  background: #fde8e7;
  color: var(--purple-dark);
}

.mini-backs {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-top: 6px;
}

.mini-back {
  width: 12px;
  height: 17px;
  border-radius: 2px;
  background: linear-gradient(135deg, #b53b35, #872722);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.trick-center {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.turn-banner {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  font-weight: 600;
}

.trick-slots {
  display: grid;
  grid-template-areas:
    ". top ."
    "left . right"
    ". bottom .";
  grid-template-columns: 90px 90px 90px;
  grid-template-rows: 108px 108px 108px;
  gap: 8px;
  align-items: center;
  justify-items: center;
}

.slot-top { grid-area: top; }
.slot-left { grid-area: left; }
.slot-right { grid-area: right; }
.slot-bottom { grid-area: bottom; }

.trick-slot {
  min-width: 68px;
  min-height: 94px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.trick-slot.filled {
  border: none;
}

.trick-owner-tag {
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  max-width: 96px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.trump-picker {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
  max-width: 440px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}

.trump-picker h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--purple-dark);
}

.trump-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.trump-btn {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 10px;
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.92rem;
}

.trump-btn:hover {
  border-color: var(--purple);
  background: #fdecec;
}

.trump-btn.chibre-btn {
  background: #fff6de;
  border-color: #ebc35b;
}

.hand-panel {
  margin-top: 14px;
  padding: 14px 16px;
}

.hand-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-weight: 700;
}

.annonce-controls {
  background: #fdf3f2;
  border: 1px solid #f0c9c6;
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
}

.player-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  min-height: 106px;
  align-items: center;
}

.pcard {
  width: 70px;
  height: 100px;
  background: #fff;
  border: 1px solid #c9c3de;
  border-radius: 9px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px;
  font-weight: 700;
  user-select: none;
  position: relative;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.pcard.small {
  width: 64px;
  height: 90px;
  padding: 5px;
}

.pcard.mini {
  width: 48px;
  height: 66px;
  padding: 4px;
  font-size: 0.8rem;
}

.pcard.red { color: var(--red); }
.pcard.black { color: #222; }

.pcard .rank {
  font-size: 1.15rem;
  line-height: 1.1;
}

.pcard .center-suit {
  font-size: 1.5rem;
  text-align: center;
  line-height: 1;
}

.pcard .pts {
  font-size: 0.68rem;
  background: var(--purple);
  color: #fff;
  border-radius: 5px;
  padding: 1px 5px;
  align-self: flex-start;
}

.pcard .pts.zero {
  background: #bbb;
}

.pcard.trump-card {
  border-color: #d69c18;
  background: #fffdf5;
}

.pcard.clickable {
  cursor: pointer;
}

.pcard.clickable:hover {
  transform: translateY(-7px);
  box-shadow: 0 8px 14px rgba(76, 51, 176, 0.25);
  border-color: var(--purple);
}

.pcard.disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-card {
  padding: 15px;
}

.side-card h3 {
  font-size: 1.02rem;
  color: var(--purple-dark);
  margin-bottom: 8px;
}

.score-target {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--purple);
  margin-bottom: 8px;
}

.team-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.team-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  background: var(--bg);
}

.team-box.team-0 {
  border-left: 4px solid var(--purple);
}

.team-box.team-1 {
  border-left: 4px solid var(--navy);
}

.team-title {
  font-size: 0.78rem;
  font-weight: 700;
}

.team-pts {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 2px 0;
}

.team-sub {
  font-size: 0.75rem;
  color: #635c80;
}

.annonce-summary {
  margin-top: 10px;
  font-size: 0.82rem;
  background: #fdf3f2;
  border: 1px solid #f0d0cd;
  border-radius: 8px;
  padding: 8px;
}

.last-trick-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.last-trick-cards {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.game-log {
  list-style: none;
  font-size: 0.82rem;
  max-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.game-log li {
  padding: 4px 7px;
  background: var(--bg);
  border-radius: 6px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 48, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 50;
}

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.25);
}

.modal-card.modal-wide {
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-card h2 {
  color: var(--purple-dark);
  margin-bottom: 10px;
}

.summary-table {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 0.9rem;
}

.summary-table th, .summary-table td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.summary-table th {
  background: var(--bg);
  color: var(--purple-dark);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.rules-quick ul {
  margin: 8px 0 12px 18px;
  font-size: 0.9rem;
}

.rules-quick h3 {
  margin-top: 10px;
  color: var(--purple-dark);
  font-size: 1rem;
}

.toast {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 80;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.sym-red { color: var(--red); }
.sym-black { color: #222; }

.release-panel h2 {
  color: var(--purple-dark);
  border-left: 5px solid var(--purple);
  padding-left: 10px;
  margin-bottom: 16px;
}

.release-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
}

.release-head {
  margin-bottom: 8px;
}

.release-desc {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.release-group {
  margin-top: 10px;
}

.release-subhead {
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--purple-dark);
  margin-bottom: 4px;
}

.release-subhead.improvements {
  color: #1b5e3c;
}

.release-subhead.fixes {
  color: var(--navy);
}

.release-empty {
  font-size: 0.88rem;
  color: #777;
  font-style: italic;
  margin-left: 4px;
}

.site-footer {
  text-align: center;
  padding: 24px 16px 36px;
  color: #666;
  font-size: 0.88rem;
  border-top: 1px solid var(--border);
  max-width: 1180px;
  margin: 0 auto;
}

.site-footer a {
  color: var(--purple-dark);
  font-weight: 600;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.auth-area {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.16);
}

.user-pill:hover {
  background: #fff;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.user-stats-mini {
  background: var(--bg);
  color: var(--purple-dark);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.74rem;
  font-weight: 800;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.profile-avatar-lg {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.stat-tile {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--purple-dark);
}

.stat-lbl {
  font-size: 0.74rem;
  color: #635c80;
  font-weight: 600;
}

.profile-nick-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.profile-nick-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.94rem;
  font-family: inherit;
}

.admin-container {
  max-width: 1380px;
}

.admin-page {
  padding: 20px 22px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.admin-page .admin-tabs {
  gap: 8px;
  margin-bottom: 16px;
}

.admin-page .admin-tab {
  padding: 7px 15px;
  font-size: 0.88rem;
}

.admin-page .admin-table-wrap {
  max-height: 60vh;
}

.admin-cell-wrap {
  white-space: normal !important;
  min-width: 160px;
  max-width: 420px;
  word-break: break-word;
}

.admin-page .stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.admin-access-denied {
  max-width: 560px;
  margin: 24px auto;
  text-align: center;
  padding: 28px 24px;
}

.admin-access-denied h2 {
  color: var(--purple-dark);
  margin-bottom: 10px;
}

.admin-pill {
  background: #232028;
  border-color: rgba(240, 180, 41, 0.7);
  color: #ffe8a3;
}

.admin-pill:hover {
  background: #35303d;
}

.admin-section {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.admin-section h3 {
  font-size: 1rem;
  color: var(--purple-dark);
  margin-bottom: 8px;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.admin-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 0.9rem;
}

.admin-table-wrap {
  overflow-x: auto;
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}

.admin-table th, .admin-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.admin-table th {
  background: var(--bg);
  color: var(--purple-dark);
  position: sticky;
  top: 0;
}

.modal-top {
  z-index: 65;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-tab {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.admin-tab.active {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.admin-tab.warn-tab {
  border-color: #ebc35b;
  background: #fff9e6;
  color: #8a5600;
}

.admin-tab.warn-tab.active {
  background: #c77c00;
  color: #fff;
  border-color: #c77c00;
}

.flag-card {
  background: #fffaf0;
  border: 1px solid #f0d08a;
  border-left: 5px solid #d9822b;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.flag-card.high {
  background: #fdf2f2;
  border-color: #ebb5b5;
  border-left-color: var(--red);
}

.flag-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.flag-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.status-pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.status-ok { background: #e3f5e7; color: #1f6f36; }
.status-warn { background: #fef0c7; color: #8a5600; }
.status-blocked { background: #fde2e2; color: #9c1a1a; }

.log-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.spectate-hands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  width: 100%;
}

.spectate-hand-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}

.spectate-hand-title {
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.spectate-hand-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.chip-spectate {
  background: #232028;
  color: #ffe8a3;
  border: 1px solid rgba(240, 180, 41, 0.7);
}

.alpha-banner {
  background: linear-gradient(135deg, #fffaf0, #fdf2ee);
  border: 1px solid #ecc69d;
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  padding: 11px 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.custom-user-banner {
  background: linear-gradient(135deg, #f3f7fc, #eef4fb);
  border: 1px solid #bfd2e8;
  border-left: 5px solid var(--navy);
  border-radius: 12px;
  padding: 11px 16px;
  margin-bottom: 16px;
  font-size: 0.92rem;
  color: var(--ink);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: 0 2px 6px rgba(36, 59, 83, 0.08);
}

.custom-user-banner-icon {
  font-size: 1.05rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.custom-user-banner-content {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  min-width: 0;
}

.custom-user-banner-label {
  font-weight: 800;
  color: var(--navy);
}

.custom-user-banner-text {
  font-weight: 600;
  white-space: pre-wrap;
  word-break: break-word;
}

.profile-custom-msg {
  background: #f3f7fc;
  border: 1px solid #bfd2e8;
  border-left: 4px solid var(--navy);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 0.9rem;
  color: var(--ink);
}

.profile-custom-msg-label {
  font-weight: 800;
  color: var(--navy);
  font-size: 0.8rem;
  margin-bottom: 3px;
}

.profile-custom-msg-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #faf9fe;
  color: var(--ink);
  resize: vertical;
  min-height: 76px;
}

.user-msg-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.admin-msg-preview {
  white-space: pre-wrap !important;
  min-width: 140px;
  max-width: 280px;
  word-break: break-word;
  font-size: 0.82rem;
}

.alpha-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fef0c7;
  color: #7c4d00;
  border: 1px solid #f0b429;
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 800;
}

.testers-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tester-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 13px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.danger-box {
  background: #fdf0f0;
  border: 1px solid #ecc0c0;
  border-left: 4px solid var(--red);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  color: #6b1414;
  margin-top: 8px;
}

.btn-danger-solid {
  background: var(--red);
  color: #fff;
}

.btn-danger-solid:hover:not(:disabled) {
  background: #911d1d;
}

.btn-danger-solid:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Learn / Rules Page Integration */
.learn-nav {
  position: sticky;
  top: 0;
  z-index: 15;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(30, 28, 33, 0.05);
}

.learn-nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

.learn-nav a {
  text-decoration: none;
  color: var(--purple-dark);
  background: var(--bg);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 999px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.learn-nav a:hover {
  background: var(--purple);
  color: #fff;
  border-color: var(--purple);
}

.learn-section {
  scroll-margin-top: 72px;
  margin-bottom: 20px;
}

.learn-section h2 {
  font-size: 1.4rem;
  color: var(--purple-dark);
  margin-bottom: 14px;
  border-left: 5px solid var(--purple);
  padding-left: 12px;
}

.learn-section h3 {
  margin: 16px 0 8px;
  color: var(--ink);
  font-size: 1.05rem;
}

.learn-section p {
  margin-bottom: 10px;
}

.learn-section ul {
  margin: 6px 0 10px 22px;
  line-height: 1.65;
}

.learn-note {
  font-size: 0.88rem;
  color: #635c80;
}

.learn-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.learn-step:last-child {
  margin-bottom: 0;
}

.learn-stepnum {
  flex-shrink: 0;
  min-width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--purple);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  padding: 0 6px;
  box-shadow: 0 2px 6px rgba(135, 39, 34, 0.22);
}

.learn-step h3 {
  margin: 0 0 4px;
  color: var(--purple-dark);
}

.learn-step p {
  margin-bottom: 0;
}

.learn-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 12px 0;
}

.pcard {
  width: 72px;
  height: 102px;
  background: #fff;
  border: 1.5px solid #d5ceca;
  border-radius: 9px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 7px;
  font-weight: 800;
  transition: transform 0.12s;
}

.pcard:hover {
  transform: translateY(-2px);
}

.pcard.trump-top {
  border-color: var(--gold);
  background: linear-gradient(180deg, #fffdf6, #fff);
}

.pcard .rank {
  font-size: 1.3rem;
  line-height: 1.1;
}

.pcard .rank small {
  font-size: 1rem;
}

.pcard.red { color: var(--red); }
.pcard.black { color: #222; }

.pcard .pts {
  font-size: 0.7rem;
  background: var(--purple);
  color: #fff;
  border-radius: 6px;
  padding: 2px 6px;
  align-self: flex-start;
  font-weight: 700;
}

.pcard .pts.zero {
  background: #a59eab;
}

.learn-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin: 12px 0;
}

.learn-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.learn-table th,
.learn-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 0.94rem;
}

.learn-table th {
  background: var(--purple);
  color: #fff;
  font-weight: 700;
}

.learn-table tr:last-child td {
  border-bottom: none;
}

.learn-table td b.num {
  color: var(--purple-dark);
}

.learn-picker {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.learn-suits {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.suitbtn {
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  padding: 9px 15px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.1s;
}

.suitbtn:hover {
  border-color: var(--purple);
  background: #fdf9f8;
  transform: translateY(-1px);
}

.suitbtn.active {
  border-color: var(--purple);
  background: #f9ecea;
  color: var(--purple-dark);
}

.suitbtn.chibre-pick {
  background: #fff8e6;
  border-color: var(--gold);
  color: #7c5800;
}

.suitbtn.chibre-pick.active {
  background: #fef0c7;
}

.picklog {
  margin-top: 10px;
  font-size: 0.92rem;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple);
  border-radius: 8px;
  padding: 10px 12px;
}

.quiz {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
}

.quiz .question {
  display: block;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin-bottom: 12px;
}

.opt {
  display: block;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--ink);
  transition: border-color 0.12s, background 0.12s;
}

.opt:hover:not(:disabled) {
  border-color: var(--purple);
  background: #fdf9f8;
}

.opt.correct {
  background: #e3f5e7;
  border-color: #3ba55d;
  color: #165b2c;
}

.opt.wrong {
  background: #fde2e2;
  border-color: var(--red);
  color: #7f1414;
}

.explain {
  display: none;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple);
  border-radius: 8px;
  padding: 10px 12px;
}

.explain.show {
  display: block;
}

#quizScore {
  font-weight: 800;
  color: var(--purple-dark);
  font-size: 1rem;
  margin-top: 10px;
}


/* PWA & Mobile Touch Polish */
.btn,
.pcard,
.trump-btn,
.suitbtn,
.opt,
.nav-pill,
.langbtn,
.admin-tab {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}




@media (max-width: 680px) {
  header {
    padding: 14px 12px 18px;
  }
  .topbar {
    justify-content: center;
    gap: 7px;
    margin-bottom: 12px;
  }
  .auth-area {
    width: 100%;
    justify-content: center;
    margin-right: 0;
    flex-wrap: wrap;
    gap: 6px;
  }
  .nav-pill, .langbtn {
    padding: 5px 10px;
    font-size: 0.8rem;
    border-radius: 7px;
  }
  .user-pill {
    font-size: 0.8rem;
    padding: 3px 10px 3px 4px;
    max-width: 100%;
  }
  .header-brand {
    gap: 8px;
    margin-bottom: 6px;
  }
  .swiss-flag {
    width: 24px;
    height: 24px;
    border-width: 1.5px;
    border-radius: 5px;
  }
  .swiss-flag::before {
    width: 13px;
    height: 4px;
  }
  .swiss-flag::after {
    width: 4px;
    height: 13px;
  }
  header h1 {
    font-size: 1.3rem;
    line-height: 1.25;
  }
  header p {
    font-size: 0.88rem;
    line-height: 1.4;
  }
  .badge {
    font-size: 0.76rem;
    padding: 3px 11px;
    margin-top: 8px;
  }
  .alpha-banner {
    flex-direction: column;
    text-align: center;
    font-size: 0.86rem;
  }
}

/* Community Chat Dock & Drawer */
.chat-backdrop {
  display: none;
}

.chat-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: min(360px, calc(100vw - 36px));
  background: linear-gradient(135deg, var(--purple), var(--purple-dark));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 11px 16px;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(135, 39, 34, 0.34);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.chat-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(135, 39, 34, 0.42);
}

.chat-fab:active {
  transform: scale(0.97);
}

.chat-fab-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chat-fab .chat-unread-badge {
  margin-left: 2px;
  background: var(--gold);
  color: var(--ink);
}

.chat-fab.has-unread {
  animation: chatPulse 1.8s ease-in-out infinite;
}

.chat-fab-preview {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.94;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  padding-left: 10px;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-jump-btn.has-unread {
  border-color: var(--purple);
  background: #fdf1f0;
  color: var(--purple-dark);
  font-weight: 800;
}

@keyframes chatPulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(135, 39, 34, 0.34), 0 0 0 0 rgba(240, 180, 41, 0.55); }
  50% { box-shadow: 0 8px 22px rgba(135, 39, 34, 0.34), 0 0 0 7px rgba(240, 180, 41, 0); }
}

.chat-peek {
  position: fixed;
  right: 18px;
  bottom: 74px;
  z-index: 45;
  width: min(340px, calc(100vw - 36px));
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--purple);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(30, 28, 33, 0.22);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  animation: chatSlideUp 0.18s ease-out;
}

.chat-peek-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  background: transparent;
  border: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  color: var(--ink);
}

.chat-peek-body:hover {
  background: #faf7f6;
}

.chat-peek-avatar-wrap {
  flex-shrink: 0;
  display: inline-flex;
}

.chat-peek-avatar-wrap .chat-avatar {
  width: 26px;
  height: 26px;
}

.chat-peek-text-wrap {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-peek-author {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--purple-dark);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-peek-text {
  font-size: 0.85rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-peek-close {
  border: none;
  border-left: 1px solid var(--border);
  background: transparent;
  color: #635c80;
  padding: 0 11px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
}

.chat-peek-close:hover {
  background: var(--bg);
  color: var(--ink);
}

.chat-panel.chat-drawer {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 46;
  width: min(390px, calc(100vw - 36px));
  height: min(530px, calc(100vh - 36px));
  height: min(530px, calc(100dvh - 36px));
  margin-top: 0;
  padding: 15px 16px;
  display: flex;
  flex-direction: column;
  border-color: #d8c7c4;
  box-shadow: 0 16px 40px rgba(30, 28, 33, 0.25);
  animation: chatSlideUp 0.18s ease-out;
}

@keyframes chatSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-drag-handle {
  display: none;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.chat-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.chat-header h2 {
  color: var(--purple-dark);
  border-left: 5px solid var(--purple);
  padding-left: 10px;
  margin-bottom: 0;
  font-size: 1.12rem;
}

.chat-close-btn {
  flex-shrink: 0;
  line-height: 1.1;
}

.chat-body {
  margin-top: 10px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-scroll-bottom {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  background: var(--purple);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 5px 13px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  z-index: 2;
}

.chat-scroll-bottom:hover {
  background: var(--purple-dark);
}

@media (max-width: 680px) {
  .chat-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(20, 14, 48, 0.45);
    z-index: 45;
  }
  .chat-fab {
    right: 12px;
    bottom: 12px;
    padding: 9px 14px;
    font-size: 0.88rem;
  }
  .chat-fab-preview {
    display: none;
  }
  .chat-peek {
    right: 12px;
    left: 12px;
    bottom: 62px;
    width: auto;
  }
  .chat-panel.chat-drawer {
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(78vh, 560px);
    height: min(78dvh, 560px);
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    padding: 10px 14px calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .chat-drag-handle {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #d6cecc;
    margin: 0 auto 8px;
    flex-shrink: 0;
  }
  .chat-header h2 {
    font-size: 1.02rem;
  }
}

.chat-empty {
  margin: auto;
  text-align: center;
  color: #635c80;
  font-size: 0.9rem;
}

.chat-msg {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chat-msg.mine {
  border-color: #dfbbb8;
  background: #fffaf9;
}

.chat-msg.admin-msg {
  border-left: 4px solid var(--navy);
}

.chat-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.chat-msg-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.86rem;
  flex-wrap: wrap;
}

.chat-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}

.chat-admin-pill {
  font-size: 0.68rem;
  font-weight: 800;
  background: #232028;
  color: #ffe8a3;
  border-radius: 999px;
  padding: 1px 7px;
}

.chat-msg-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #635c80;
}

.chat-msg-del {
  background: transparent;
  border: 1px solid transparent;
  color: var(--red);
  cursor: pointer;
  border-radius: 6px;
  padding: 1px 5px;
  font-size: 0.78rem;
  line-height: 1.2;
}

.chat-msg-del:hover {
  background: #fdecef;
  border-color: #f1c3c9;
}

.chat-msg-text {
  font-size: 0.92rem;
  color: var(--ink);
  word-break: break-word;
}

.chat-guest-notice {
  margin-top: 10px;
  background: #fffaf0;
  border: 1px solid #ecc69d;
  border-left: 4px solid var(--gold);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.chat-form {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.chat-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #faf9fe;
  color: var(--ink);
}

.chat-form input[type="text"]:disabled {
  background: #f0eef2;
  color: #888;
  cursor: not-allowed;
}

.chat-form .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.chat-footer-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  min-height: 18px;
}

.chat-unread-badge {
  display: inline-block;
  margin-left: 5px;
  background: var(--purple);
  color: #fff;
  border-radius: 999px;
  padding: 0 6px;
  font-size: 0.72rem;
  font-weight: 800;
}

.admin-chat-config {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.admin-chat-config input[type="number"] {
  width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.94rem;
  font-family: inherit;
  background: #faf9fe;
  color: var(--ink);
}
/* Mobile & Compact Table UX */
.cards-count-pill {
  display: none;
}

.mobile-score-strip {
  display: none;
}

.mobile-last-trick-drawer {
  display: none;
}

#playerHand.my-turn .pcard.clickable {
  border-color: var(--purple);
  box-shadow: 0 3px 9px rgba(181, 59, 53, 0.22);
}

@media (hover: none) {
  .pcard:hover,
  .pcard.clickable:hover {
    transform: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.14);
  }
  #playerHand.my-turn .pcard.clickable:hover {
    box-shadow: 0 3px 9px rgba(181, 59, 53, 0.22);
  }
  .pcard.clickable:active {
    transform: scale(0.95);
  }
}

@media (max-width: 920px) {
  .mobile-score-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
  }
  .mobile-score-teams {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 0.84rem;
  }
  .mobile-score-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
  }
  .mobile-score-pill.team-0 {
    border-left: 3px solid var(--purple);
  }
  .mobile-score-pill.team-1 {
    border-left: 3px solid var(--navy);
  }
  .mobile-score-pill small {
    color: #635c80;
    font-weight: 600;
  }
  .mob-team-lbl {
    font-weight: 700;
    color: #4f4a54;
    font-size: 0.76rem;
  }
  .mobile-score-vs {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--purple-dark);
  }
  .mobile-last-trick-btn {
    padding: 3px 8px;
    font-size: 0.76rem;
    flex-shrink: 0;
  }
  .mobile-last-trick-drawer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 10px;
    margin-bottom: 8px;
    border-radius: 10px;
  }
}

@media (max-width: 680px) {
  body.in-table header,
  body.in-table #alphaInviteBanner {
    display: none;
  }
  body.in-table .container {
    padding: 6px 8px 72px;
  }
  body.in-table .custom-user-banner {
    padding: 6px 10px;
    margin-bottom: 6px;
    font-size: 0.8rem;
  }
  body.in-table #playerIdentityBadge:not(.chip-spectate) {
    display: none;
  }

  .status-bar {
    padding: 7px 10px;
    gap: 6px;
    margin-bottom: 6px;
    border-radius: 11px;
  }
  .status-left,
  .status-right {
    gap: 5px;
  }
  .status-bar .chip {
    padding: 3px 8px;
    font-size: 0.74rem;
  }
  .status-bar .btn-small {
    padding: 4px 8px;
    font-size: 0.74rem;
  }

  .mobile-score-strip {
    padding: 5px 8px;
    margin-bottom: 6px;
  }
  .mobile-score-teams {
    gap: 4px 6px;
    font-size: 0.78rem;
  }
  .mobile-score-pill {
    padding: 2px 6px;
  }
  .mobile-score-vs {
    font-size: 0.72rem;
  }

  .felt-table {
    border-width: 4px;
    border-radius: 16px;
    padding: 8px;
    gap: 6px;
  }

  .mini-backs {
    display: none;
  }
  .cards-count-pill {
    display: inline-block;
  }

  .seat-box {
    padding: 4px 6px;
    border-radius: 9px;
    border-top-width: 3px;
    font-size: 0.74rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  }
  .seat-box.active-turn {
    box-shadow: 0 0 0 2px rgba(240, 180, 41, 0.75), 0 3px 8px rgba(0, 0, 0, 0.25);
  }

  .seat-top,
  .seat-bottom {
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 4px 9px;
    text-align: left;
  }
  .seat-top .seat-name-row,
  .seat-bottom .seat-name-row {
    justify-content: flex-start;
    gap: 4px;
  }
  .seat-top .seat-meta,
  .seat-bottom .seat-meta {
    margin-top: 0;
    min-height: 0;
    justify-content: flex-end;
  }

  .table-middle {
    grid-template-columns: minmax(62px, 78px) 1fr minmax(62px, 78px);
    gap: 6px;
    align-items: center;
  }
  .seat-side {
    min-width: 0;
    padding: 5px 4px;
  }
  .seat-side .seat-name-row {
    gap: 2px;
    flex-direction: column;
  }
  .seat-side .seat-name {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
  }
  .seat-side .seat-meta {
    gap: 2px;
    margin-top: 3px;
    min-height: 0;
  }

  .seat-name {
    font-size: 0.84rem;
  }
  .seat-pos-pill,
  .seat-you-pill,
  .role-pill {
    font-size: 0.62rem;
    padding: 1px 5px;
  }

  .trick-center {
    min-height: 0;
    gap: 4px;
  }
  .turn-banner {
    font-size: 0.74rem;
    padding: 2px 10px;
    text-align: center;
  }

  .trick-slots {
    grid-template-columns: 50px 50px 50px;
    grid-template-rows: 64px 32px 64px;
    gap: 3px;
  }
  .trick-slot {
    min-width: 48px;
    min-height: 62px;
    position: relative;
  }
  .trick-slot .pcard.small {
    width: 46px;
    height: 62px;
    padding: 3px;
    border-radius: 7px;
  }
  .trick-slot .pcard.small .rank {
    font-size: 0.88rem;
  }
  .trick-slot .pcard.small .center-suit {
    font-size: 1.05rem;
  }
  .trick-slot .pcard.small .pts {
    display: none;
  }
  .trick-owner-tag {
    font-size: 0.58rem;
    padding: 0 5px;
    max-width: 60px;
    margin-top: -8px;
    z-index: 2;
  }

  .felt-table.choosing-trump .table-middle {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .felt-table.choosing-trump .seat-side .seat-name-row {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
  }
  .felt-table.choosing-trump .trick-center {
    grid-column: 1 / -1;
    width: 100%;
  }
  .trump-picker {
    width: 100%;
    max-width: 100%;
    padding: 10px;
    border-radius: 11px;
  }
  .trump-picker h3 {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }
  .trump-btns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .trump-btn {
    padding: 7px 8px;
    font-size: 0.82rem;
    border-radius: 8px;
  }
  .trump-btn.chibre-btn {
    grid-column: 1 / -1;
  }

  .hand-panel {
    margin-top: 6px;
    padding: 8px 8px 10px;
    border-radius: 12px;
  }
  .hand-header {
    margin-bottom: 6px;
    font-size: 0.8rem;
    gap: 6px;
  }
  .hand-header .muted {
    font-size: 0.74rem;
    text-align: right;
  }
  .annonce-controls {
    padding: 6px 8px;
    margin-bottom: 6px;
    gap: 6px;
    font-size: 0.78rem;
  }

  .player-hand {
    gap: 5px;
    min-height: 76px;
  }
  #playerHand .pcard {
    width: calc((100% - 20px) / 5);
    max-width: 64px;
    min-width: 48px;
    height: 76px;
    padding: 4px;
    border-radius: 8px;
  }
  #playerHand .pcard .rank {
    font-size: 0.96rem;
    line-height: 1.05;
  }
  #playerHand .pcard .center-suit {
    font-size: 1.2rem;
  }
  #playerHand .pcard .pts {
    font-size: 0.56rem;
    padding: 1px 3px;
    border-radius: 4px;
    white-space: nowrap;
  }
  #playerHand .pcard.clickable:hover {
    transform: none;
  }
  #playerHand .pcard.clickable:active {
    transform: scale(0.95);
  }
}

@media (max-width: 370px) {
  .table-middle {
    grid-template-columns: minmax(52px, 62px) 1fr minmax(52px, 62px);
    gap: 4px;
  }
  .trick-slots {
    grid-template-columns: 44px 44px 44px;
    grid-template-rows: 58px 28px 58px;
    gap: 2px;
  }
  .trick-slot {
    min-width: 42px;
    min-height: 56px;
  }
  .trick-slot .pcard.small {
    width: 42px;
    height: 56px;
  }
  #playerHand .pcard {
    height: 70px;
    padding: 3px;
  }
  #playerHand .pcard .rank {
    font-size: 0.88rem;
  }
  #playerHand .pcard .center-suit {
    font-size: 1.05rem;
  }
  #playerHand .pcard .pts {
    font-size: 0.52rem;
  }
}

/* Tournament Mode & Teams */
.tournament-invites-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.trn-invite-banner {
  background: linear-gradient(135deg, #fffaf0, #fdf2ee);
  border: 1px solid #e7c07d;
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.trn-invite-content {
  min-width: 0;
  flex: 1;
}

.trn-invite-msg {
  margin-top: 4px;
  font-style: italic;
  color: var(--ink);
  font-size: 0.9rem;
}

.trn-invite-link {
  margin-top: 3px;
  color: var(--purple-dark);
  word-break: break-all;
}

.trn-invite-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

.tournament-guest-notice {
  margin-top: 10px;
  background: #fffaf0;
  border: 1px solid #ecc69d;
  border-left: 4px solid var(--gold);
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 0.88rem;
  font-weight: 600;
}

.my-tournaments-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.my-trn-heading {
  font-size: 0.84rem;
  font-weight: 700;
  color: #635c80;
  margin-top: 4px;
}

.my-trn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px 11px;
  font-size: 0.9rem;
  margin-top: 6px;
}

.trn-my-match-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  border-left: 5px solid var(--purple);
  background: #fffaf9;
}

.trn-lb-select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #faf9fe;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
}

.trn-my-row {
  background: #fdf1f0;
}

.trn-phase-block {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.trn-round-block {
  margin-top: 8px;
}

.admin-tournament-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  align-items: end;
}

.admin-tournament-form input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #faf9fe;
  color: var(--ink);
}

.trn-admin-phase {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
}

.trn-admin-match {
  margin-top: 4px;
  padding: 5px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.84rem;
}

.invite-players-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 8px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.invite-player-item {
  padding: 4px 6px;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--border);
}
