:root {
  --bg-0: #051b2f;
  --bg-1: #0b2d4a;
  --felt-0: #72bca5;
  --felt-1: #0d3d2f;
  --panel: rgba(7, 22, 35, 0.72);
  --panel-border: rgba(136, 179, 220, 0.24);
  --text-main: #f4f9ff;
  --text-muted: #afc5da;
  --accent: #6bc8ff;
  --accent-2: #8ef5cd;
  --danger: #ff5f75;
  --gold: #f6d365;
  --team1: #6bc8ff;
  --team2: #ff8f6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Inter, system-ui, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(1000px 500px at 50% -80px, #1a6da8 0%, transparent 60%),
    radial-gradient(700px 400px at 100% 100%, rgba(142, 245, 205, 0.08) 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
}

#app {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 36px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 8px;
}

.logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  color: var(--gold);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(246, 211, 101, 0.35);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: clamp(1.7rem, 3.5vw, 2.5rem);
  font-weight: 800;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.45);
}

.tagline {
  margin: 4px 0 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.screen-title {
  margin: 0 0 6px;
  font-size: 1.35rem;
}

.screen-subtitle {
  margin: 0 0 16px;
  color: var(--text-muted);
  line-height: 1.45;
}

.field-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9deef;
}

#join-screen,
#game-screen {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  padding: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 22px 46px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

#join-screen {
  max-width: 520px;
  margin: 28px auto 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.mode-picker {
  margin: 4px 0 0;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(4, 16, 27, 0.55);
  display: grid;
  gap: 10px;
}

.mode-picker legend {
  padding: 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9deef;
}

.mode-option {
  display: block;
  cursor: pointer;
}

.mode-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mode-card {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.mode-card strong {
  display: block;
  margin-bottom: 2px;
}

.mode-card small {
  color: var(--text-muted);
}

.mode-option input:checked + .mode-card {
  border-color: rgba(142, 245, 205, 0.75);
  background: rgba(142, 245, 205, 0.1);
  box-shadow: 0 0 0 2px rgba(142, 245, 205, 0.12);
}

.mode-option:hover .mode-card {
  transform: translateY(-1px);
}

.full-width {
  width: 100%;
  margin-top: 4px;
}

input {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-main);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.98rem;
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(107, 200, 255, 0.24);
}

.game-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.room-badge,
.phase-badge {
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.88rem;
}

.room-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.room-code {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mode-chip {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  background: rgba(107, 200, 255, 0.18);
  border: 1px solid rgba(107, 200, 255, 0.35);
  color: #d9efff;
}

.phase-badge {
  color: #f8ebbb;
  border: 1px solid rgba(246, 211, 101, 0.35);
  background: rgba(92, 75, 15, 0.35);
}

.phase-badge[data-phase="playing"] {
  color: #d7ffe9;
  border-color: rgba(142, 245, 205, 0.4);
  background: rgba(20, 74, 55, 0.45);
}

.phase-badge[data-phase="gameover"] {
  color: #ffe5a8;
  border-color: rgba(246, 211, 101, 0.55);
  background: rgba(98, 81, 21, 0.55);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: start;
}

#sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.sidebar-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(246, 211, 101, 0.35);
  background: linear-gradient(135deg, rgba(98, 81, 21, 0.55), rgba(58, 48, 11, 0.65));
  color: #f8ebbb;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
  transition: transform 120ms ease, filter 120ms ease, border-color 120ms ease;
}

.sidebar-help-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  border-color: rgba(246, 211, 101, 0.55);
}

.sidebar-help-btn[aria-expanded="true"] {
  border-color: rgba(142, 245, 205, 0.55);
  background: linear-gradient(135deg, rgba(20, 74, 55, 0.65), rgba(12, 45, 34, 0.75));
  color: var(--accent-2);
}

.help-btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 900;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.help-panel {
  border-radius: 16px;
  border: 1px solid rgba(246, 211, 101, 0.28);
  background: rgba(4, 14, 24, 0.92);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
}

.help-panel[hidden] {
  display: none;
}

.help-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.help-panel-header h3 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #f8ebbb;
}

.help-close-btn {
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
}

.help-close-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: none;
}

.help-panel-body {
  overflow-y: auto;
  padding: 12px 14px 14px;
}

.help-note {
  margin: 0 0 12px;
  color: #d9efff;
  font-size: 0.88rem;
  line-height: 1.4;
}

.help-subnote {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.rank-section {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.rank-section h4 {
  margin: 0 0 4px;
  font-size: 0.88rem;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rank-list {
  margin: 0;
  padding-left: 1.2rem;
  color: #e8f4ff;
  font-size: 0.86rem;
  line-height: 1.55;
}

.rank-list li {
  margin-bottom: 2px;
}

.rank-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

.pip-ranks {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.pip-ranks > div {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pip-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.pip-label.red {
  color: #ff8f9d;
}

.pip-label.black {
  color: #b8c9d9;
}

.pip-order {
  margin: 0;
  font-size: 0.8rem;
  color: #d7e9f9;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  line-height: 1.45;
  word-break: break-word;
}

.scoring-hint .hint-list {
  margin: 0;
  padding-left: 1.1rem;
  color: #d7e9f9;
  font-size: 0.84rem;
  line-height: 1.5;
}

.game-main {
  display: grid;
  gap: 16px;
  min-width: 0;
}

#players {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.player-pill {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(6, 18, 30, 0.5);
  color: var(--text-main);
  font-weight: 600;
}

.player-pill.team1 {
  border-color: rgba(107, 200, 255, 0.45);
}

.player-pill.team2 {
  border-color: rgba(255, 143, 107, 0.45);
}

.player-pill.me {
  border-color: rgba(142, 245, 205, 0.7);
  box-shadow: 0 0 0 2px rgba(142, 245, 205, 0.15);
}

.player-pill.waiting {
  color: var(--text-muted);
  border-style: dashed;
}

#table {
  border-radius: 16px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    radial-gradient(circle at 50% 0%, rgba(142, 245, 205, 0.06), transparent 45%),
    rgba(5, 22, 14, 0.42);
}

#chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: calc(100vh - 180px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(4, 14, 24, 0.72);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.18);
}

.chat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px rgba(142, 245, 205, 0.8);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 92%;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-message.me {
  align-self: flex-end;
  background: rgba(107, 200, 255, 0.14);
  border-color: rgba(107, 200, 255, 0.28);
}

.chat-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.chat-text {
  line-height: 1.35;
  word-break: break-word;
}

.chat-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.16);
}

.chat-form input {
  margin: 0;
}

.chat-send {
  margin: 0;
  white-space: nowrap;
}

.status-line,
.subtle-line,
.section-label {
  margin: 6px 0 8px;
}

.status-line {
  color: #e1f2ff;
  font-weight: 600;
}

.subtle-line {
  color: var(--text-muted);
}

.section-label {
  color: #d6ecff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.07em;
}

.stat-chip {
  margin: 0 0 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(107, 200, 255, 0.32);
  background: rgba(7, 26, 45, 0.7);
  color: #d9efff;
  font-size: 0.92rem;
}

.action-btn,
button {
  background: linear-gradient(135deg, #70d5ff, #4ab8f2);
  color: #092133;
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 6px 8px 0 0;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 8px 16px rgba(6, 45, 73, 0.36);
  transition: transform 120ms ease, box-shadow 120ms ease, filter 120ms ease;
}

.action-btn:hover,
button:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.action-btn:active,
button:active {
  transform: translateY(1px);
}

.action-btn:disabled,
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.35);
  transform: none;
  box-shadow: none;
}

.action-btn.secondary {
  background: linear-gradient(135deg, #d2dbe3, #b6c3d1);
  color: #1b2d3e;
}

.action-btn.primary {
  background: linear-gradient(135deg, #8ef5cd, #66d8ae);
  color: #0f2a21;
}

.trick-winner-banner {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 1.06rem;
  font-weight: 800;
  color: #f8ebbb;
  background: linear-gradient(120deg, rgba(58, 48, 11, 0.65), rgba(98, 81, 21, 0.6));
  border: 1px solid rgba(246, 211, 101, 0.35);
  animation: pulseGlow 1.4s ease-in-out infinite;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(246, 211, 101, 0); }
  50% { box-shadow: 0 0 18px rgba(246, 211, 101, 0.25); }
}

.bid-board {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(5, 18, 30, 0.56);
}

.bid-line {
  margin: 4px 0;
  color: #d7e9f9;
  font-weight: 600;
}

.bid-line.me {
  color: var(--accent-2);
}

.bid-line.current {
  color: #f8ebbb;
  font-weight: 800;
}

.team-board {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(4, 16, 27, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.team-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.result-panel {
  padding: 8px 4px 4px;
}

.result-panel h2 {
  margin: 0 0 10px;
}

.result-panel.gameover h2 {
  font-size: 1.8rem;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.score-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.score-card span {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.score-card strong {
  font-size: 1.6rem;
}

.score-card.team1 {
  border-color: rgba(107, 200, 255, 0.35);
}

.score-card.team2 {
  border-color: rgba(255, 143, 107, 0.35);
}

#trick-area {
  position: relative;
  width: min(92vw, 460px);
  height: min(92vw, 460px);
  margin: 14px auto;
  border-radius: 50%;
  border: 8px solid #073322;
  background:
    radial-gradient(circle at 50% 34%, #1f6d53 2%, var(--felt-0) 50%, var(--felt-1) 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.08),
    inset 0 0 32px rgba(0, 0, 0, 0.45),
    0 16px 32px rgba(0, 0, 0, 0.4);
}

#trick-area.two-player {
  width: min(92vw, 360px);
  height: min(72vw, 320px);
}

.trick-player {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.trick-player.top {
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
}

.trick-player.bottom {
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column-reverse;
}

.trick-player.left {
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.trick-player.right {
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
}

.trick-name {
  font-size: 0.74rem;
  font-weight: 700;
  color: #edf6ff;
  background: rgba(2, 12, 20, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 999px;
  padding: 4px 10px;
  white-space: nowrap;
}

.trick-name.me {
  color: var(--accent-2);
}

.trick-name.current-turn {
  color: #f8ebbb;
  border-color: rgba(246, 211, 101, 0.55);
  box-shadow: 0 0 0 1px rgba(246, 211, 101, 0.28);
}

.current-turn-pill {
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-block;
  font-weight: 700;
  color: #f8ebbb;
  border: 1px solid rgba(246, 211, 101, 0.4);
  background: rgba(92, 75, 15, 0.35);
}

#hand {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 154px;
  padding: 6px 8px 4px;
  margin-top: 2px;
  text-align: center;
}

.kitty-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 10px 0 4px;
}

.card {
  position: relative;
  width: 74px;
  height: 102px;
  margin: 6px;
  border-radius: 12px;
  border: 2px solid #21323f;
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.98), rgba(242, 247, 250, 0.98));
  color: inherit;
  box-shadow:
    0 5px 14px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  cursor: pointer;
  user-select: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    border-color 150ms ease,
    opacity 150ms ease,
    filter 150ms ease;
}

.card.empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.7);
}

.card-corner {
  position: absolute;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
}

.card-corner.top-left {
  top: 6px;
  left: 6px;
}

.card-corner.bottom-right {
  bottom: 6px;
  right: 6px;
  transform: rotate(180deg);
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 29px;
  font-weight: 800;
}

.card.hearts,
.card.diamonds {
  color: #c2273b;
}

.card.clubs,
.card.spades {
  color: #1f2c38;
}

.card.trump {
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px rgba(246, 211, 101, 0.7),
    0 0 14px rgba(246, 211, 101, 0.45),
    0 5px 14px rgba(0, 0, 0, 0.3);
}

.playable {
  border-color: #67d8ae;
}

.playable:hover {
  transform: translateY(-14px) scale(1.08);
  box-shadow: 0 16px 20px rgba(0, 0, 0, 0.35);
  z-index: 1000;
}

.unplayable {
  opacity: 0.42;
  filter: grayscale(0.45);
  cursor: not-allowed;
}

.card.selected {
  border-color: var(--danger);
  box-shadow:
    0 0 0 1px rgba(255, 95, 117, 0.7),
    0 0 12px rgba(255, 95, 117, 0.25),
    0 5px 14px rgba(0, 0, 0, 0.3);
  background: linear-gradient(165deg, #ffeef1, #ffdce2);
  transform: scale(0.95);
}

.card.playing {
  transform: translateY(-104px) scale(0.72);
  opacity: 0;
  transition: all 210ms ease;
}

@media (max-width: 960px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  #chat-panel {
    min-height: 280px;
    max-height: 340px;
  }
}

@media (max-width: 720px) {
  #app {
    padding: 14px 10px 22px;
  }

  #join-screen,
  #game-screen {
    border-radius: 14px;
    padding: 12px;
  }

  #players {
    grid-template-columns: 1fr;
  }

  .card {
    width: 62px;
    height: 88px;
    margin: 4px;
  }

  .card-center {
    font-size: 23px;
  }
}

.scoreboard {
  background: var(--surface, #1e1e2e);
  border: 1px solid var(--border, #333);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.scoreboard-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.scoreboard-team {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.scoreboard-label {
  font-size: 0.75rem;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.scoreboard-score {
  font-size: 1.8rem;
  font-weight: 700;
  line-height: 1;
}

.scoreboard-team.team1 .scoreboard-score { color: var(--team1-color, #60a5fa); }
.scoreboard-team.team2 .scoreboard-score { color: var(--team2-color, #f87171); }

.scoreboard-divider {
  font-size: 0.85rem;
  opacity: 0.4;
  padding: 0 4px;
}

.scoreboard-meta {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.scoreboard-chip {
  font-size: 0.75rem;
  background: var(--chip-bg, rgba(255,255,255,0.08));
  border-radius: 20px;
  padding: 2px 10px;
  opacity: 0.8;
}

.hand-history-panel {
  margin-bottom: 12px;
}

.hand-history-toggle {
  width: 100%;
  text-align: left;
}

.hand-history-dropdown {
  margin-top: 8px;
  background: var(--surface, #1e1e2e);
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  padding: 12px;
}

.hand-history-tables {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.hand-history-team {
  flex: 1;
}

.hand-history-team-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  text-align: center;
}

.hand-history-team.team1 .hand-history-team-title { color: var(--team1-color, #60a5fa); }
.hand-history-team.team2 .hand-history-team-title { color: var(--team2-color, #f87171); }

.hand-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.hand-history-table th {
  font-size: 0.7rem;
  opacity: 0.5;
  text-transform: uppercase;
  padding: 2px 6px;
  text-align: center;
}

.hand-history-table td {
  text-align: center;
  padding: 4px 6px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.negative-score {
  color: #f87171;
  border: 1px solid #f87171;
  border-radius: 50%;
  display: inline-block;
  min-width: 1.6em;
  line-height: 1.6em;
  text-align: center;
}

.discard-info {
  background: var(--surface, #1e1e2e);
  border: 1px solid var(--border, #333);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 10px;
}

.discard-info-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.discard-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 80px;
}

.discard-name {
  font-size: 0.75rem;
  opacity: 0.7;
}

.discard-status {
  font-size: 0.8rem;
  font-weight: 600;
}

.discard-status.done {
  color: #4ade80;
}

.discard-status.pending {
  color: #facc15;
}

.discard-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #60a5fa;
}