@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700&family=Lora:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --wood-dark: #241609;
  --wood: #4a2f18;
  --wood-light: #6b4526;
  --felt-dark: #14261d;
  --felt: #24422f;
  --felt-light: #315a3d;
  --cream: #f2e9d8;
  --ink: #2b2013;
  --brass: #c9a441;
  --brass-bright: #e8c667;
  --ember: #b5432b;
  --lamp: #f0c674;
  --surface-text: var(--cream);
  --accent-text: var(--brass-bright);
  --center-label-color: rgba(255,255,255,0.35);
}
:root[data-theme="light"] {
  --wood-dark: #f2ecdd;
  --wood: #e8dcc4;
  --wood-light: #f0e6d0;
  --felt-dark: #c7ddce;
  --felt: #dcebe0;
  --felt-light: #eef6f0;
  --brass: #b5892f;
  --surface-text: var(--ink);
  --accent-text: #8a6a25;
  --center-label-color: rgba(43,32,19,0.28);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--wood-dark);
  background-image:
    repeating-linear-gradient(100deg, rgba(0,0,0,0.15) 0px, rgba(0,0,0,0.15) 1px, transparent 1px, transparent 34px),
    radial-gradient(ellipse at 22% 15%, rgba(240,198,116,0.14), transparent 45%),
    radial-gradient(ellipse at 78% 10%, rgba(240,198,116,0.10), transparent 45%),
    radial-gradient(ellipse at 50% 50%, transparent 40%, rgba(0,0,0,0.5) 100%);
  color: var(--surface-text);
  font-family: 'Lora', Georgia, serif;
  min-height: 100vh;
}
#root { min-height: 100vh; padding: 14px; padding-bottom: 44px; max-width: 1100px; margin: 0 auto; }

.my-name-banner {
  text-align: center; font-family: 'Cinzel', Georgia, serif; font-size: 20px; font-weight: 700;
  color: var(--accent-text); letter-spacing: 0.03em; margin-bottom: 12px; text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.app-shell { display: flex; align-items: flex-start; gap: 14px; }
.main-col { flex: 1; min-width: 0; }
.chat-col {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column;
  background: var(--wood-light);
  background-image: repeating-linear-gradient(4deg, rgba(0,0,0,0.12) 0px, rgba(0,0,0,0.12) 2px, transparent 2px, transparent 10px);
  border-radius: 12px; padding: 10px;
  box-shadow: inset 0 0 0 2px var(--brass), 0 8px 18px rgba(0,0,0,0.4);
  position: sticky; top: 14px; max-height: calc(100vh - 28px);
}
.chat-log { flex: 1; overflow-y: auto; font-size: 12px; min-height: 160px; max-height: 55vh; margin-bottom: 8px; padding-right: 2px; }
.chat-msg { margin-bottom: 6px; line-height: 1.35; word-break: break-word; }
.chat-msg .who { font-weight: 700; color: var(--accent-text); }
.chat-msg.mine .who { color: var(--lamp); }
.chat-form { display: flex; gap: 4px; }
.chat-form input {
  flex: 1; min-width: 0; padding: 6px 8px; border-radius: 6px; border: 1px solid #00000030;
  font-size: 12px; font-family: inherit;
}
.chat-form button {
  padding: 6px 10px; border-radius: 6px; border: none; background: var(--ember); color: var(--cream);
  font-weight: bold; font-size: 12px; cursor: pointer; font-family: inherit;
}
.chat-clear-btn {
  margin-top: 6px; padding: 5px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.25);
  background: transparent; color: var(--surface-text); opacity: 0.7; font-size: 11px; cursor: pointer; font-family: inherit;
}
.chat-clear-btn:hover { opacity: 1; }
.chat-abandon-btn {
  margin-top: 6px; padding: 6px 8px; border-radius: 6px; border: 1px solid var(--ember);
  background: rgba(181,67,43,0.15); color: #ffb3a0; font-size: 11px; font-weight: bold; cursor: pointer; font-family: inherit;
}
.chat-abandon-btn:hover { background: var(--ember); color: var(--cream); }

@media (max-width: 760px) {
  .app-shell { flex-direction: column-reverse; }
  .chat-col { width: 100%; position: static; max-height: 240px; }
  .chat-log { max-height: 140px; min-height: 100px; }
}

/* ---------- floating chat widget (replaces the old fixed sidebar) ---------- */
.chat-bubble {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  background: var(--ember); color: #fff8f0; border: none; border-radius: 24px;
  padding: 10px 18px; font-family: 'Cinzel', serif; font-weight: 700; font-size: 13px;
  cursor: pointer; box-shadow: 0 6px 16px rgba(0,0,0,0.4);
}
.chat-bubble .badge {
  display: inline-block; background: #fff8f0; color: var(--ember); border-radius: 50%;
  width: 18px; height: 18px; line-height: 18px; text-align: center; font-size: 11px; margin-left: 6px;
}
.chat-panel {
  position: fixed; right: 18px; bottom: 78px; z-index: 50; width: 300px; max-width: calc(100vw - 36px);
  background: var(--wood); border: 2px solid var(--brass); border-radius: 14px; box-shadow: 0 10px 26px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; max-height: 60vh;
}
.chat-panel-head {
  display: flex; justify-content: space-between; align-items: center; padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.15); font-family: 'Cinzel', serif; font-weight: 700; color: var(--accent-text);
}
.chat-panel-head button { background: none; border: none; color: var(--surface-text); font-size: 16px; cursor: pointer; opacity: 0.7; }
.chat-panel-head button:hover { opacity: 1; }
.chat-panel .chat-log { padding: 10px 12px 0; margin-bottom: 0; flex: 1; max-height: none; }
.chat-panel .chat-form { padding: 10px 12px; }
.chat-panel .chat-clear-btn, .chat-panel .chat-abandon-btn { margin: 0 12px 10px; }

/* ---------- join screen with room list ---------- */
.join-shell { display: flex; gap: 16px; align-items: flex-start; max-width: 940px; margin: 40px auto; flex-wrap: wrap; justify-content: center; }
.rooms-panel {
  width: 320px; background: var(--wood); border: 1px solid var(--brass); border-radius: 10px; padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}
.rooms-panel h2 { font-family: 'Cinzel', serif; font-size: 15px; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.rooms-panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 8px; }
.rooms-sort-select { font-size: 11px; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--brass); background: var(--wood-light); color: var(--surface-text); font-family: inherit; }
.rooms-list-scroll { max-height: 420px; overflow-y: auto; padding-right: 4px; }
.room-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--brass); border-radius: 8px; padding: 10px 12px; margin-bottom: 10px;
}
.room-item .code { font-family: 'Cinzel', serif; font-weight: 700; color: var(--surface-text); font-size: 15px; }
.room-item .meta { font-size: 11px; opacity: 0.75; color: var(--surface-text); }
.room-item button { flex-shrink: 0; padding: 6px 12px; border-radius: 6px; border: none; background: var(--ember); color: #fff8f0; font-weight: 700; font-size: 11px; cursor: pointer; font-family: 'Cinzel', serif; }
.rooms-empty { font-size: 13px; opacity: 0.7; color: var(--surface-text); margin-bottom: 10px; }
.theme-toggle {
  position: fixed; top: 14px; right: 14px; z-index: 60;
  background: var(--wood); border: 1px solid var(--brass); color: var(--surface-text);
  border-radius: 16px; padding: 6px 14px; font-size: 12px; font-family: 'Cinzel', serif; cursor: pointer;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--cream); color: var(--ink); border-radius: 12px; padding: 22px;
  max-width: 340px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.modal-title { font-family: 'Cinzel', serif; font-weight: 700; margin: 0 0 12px; font-size: 15px; }
.modal-box input[type=text] { margin-bottom: 16px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.modal-actions .btn { width: auto; padding: 8px 16px; }

@media (max-width: 720px) {
  .join-shell { flex-direction: column; align-items: stretch; margin: 20px auto; }
  .rooms-panel { width: 100%; }
  .chat-panel { left: 18px; right: 18px; width: auto; }
}

h1, h2, .disp { font-family: 'Cinzel', Georgia, serif; letter-spacing: 0.02em; }

.card-panel {
  background: var(--cream); color: var(--ink); border-radius: 10px; padding: 22px;
  max-width: 380px; margin: 40px auto;
  border: 6px solid var(--wood); box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.title { font-family: 'Cinzel', Georgia, serif; font-size: 26px; font-weight: 700; color: var(--wood); margin: 0 0 4px; text-transform: uppercase; letter-spacing: 0.04em; }
.subtitle { font-size: 14px; opacity: 0.65; margin: 0 0 18px; }
label.field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.55; }
input[type=text], input[type=password] {
  width: 100%; margin: 4px 0 14px; padding: 10px 12px; border-radius: 6px;
  border: 1px solid #00000030; font-size: 15px; font-family: inherit; background: #fffdf8;
}
.auth-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.auth-tab {
  flex: 1; padding: 8px; border-radius: 6px; border: 1px solid #00000020; background: #00000008;
  color: var(--ink); font-family: 'Cinzel', serif; font-size: 12px; cursor: pointer;
}
.auth-tab.active { background: var(--ember); color: var(--cream); border-color: var(--ember); }
.account-row { margin-top: 6px; font-size: 11px; opacity: 0.75; text-align: center; }
.btn {
  display: block; width: 100%; text-align: center; padding: 12px; border-radius: 8px;
  border: none; font-weight: bold; font-size: 15px; cursor: pointer; font-family: 'Cinzel', Georgia, serif;
  letter-spacing: 0.03em; text-transform: uppercase;
}
.btn-primary { background: var(--ember); color: var(--cream); }
.btn-primary:hover:not(:disabled) { background: #c94f34; }
.btn-secondary { background: #00000012; color: var(--ink); }
.btn-on-dark { background: rgba(255,255,255,0.1); color: var(--cream); border: 1px solid var(--brass); }
.btn-on-dark:hover { background: var(--brass); color: var(--wood-dark); }
.btn-on-dark.danger { border-color: var(--ember); color: #ffb3a0; }
.btn-on-dark.danger:hover { background: var(--ember); color: var(--cream); }
.btn:disabled { opacity: 0.4; cursor: default; }
.error-text { color: var(--ember); background: #fff0ec; border: 1px solid var(--ember); border-radius: 6px; padding: 6px 10px; font-size: 13px; margin: 0 0 10px; }

.seat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.seat-box { border: 1px solid #00000025; border-radius: 10px; padding: 12px; text-align: left; background: none; cursor: pointer; font-family: inherit; }
.seat-box:disabled { opacity: 0.5; cursor: default; }
.seat-box .n { font-size: 11px; opacity: 0.6; }
.seat-box .v { font-weight: bold; }

.ranking-list { list-style: none; margin: 0 0 20px; padding: 0; font-family: 'Cinzel', serif; }
.ranking-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid rgba(0,0,0,0.12); }

.topbar { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; padding: 0 4px; }
.topbar .talie { font-size: 12px; opacity: 0.65; text-transform: uppercase; letter-spacing: 0.08em; }
.topbar .game { font-family: 'Cinzel', Georgia, serif; font-size: 22px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--accent-text); }
.hint { font-size: 12.5px; opacity: 0.75; margin: 0 0 10px; padding: 0 4px; }
.stovka-row { text-align: right; margin-bottom: 6px; padding: 0 4px; }
.stovka-btn { background: var(--brass); color: var(--wood-dark); border: none; border-radius: 6px; padding: 4px 10px; font-size: 11px; font-weight: bold; cursor: pointer; font-family: 'Cinzel', serif; letter-spacing: 0.03em; }

.table-frame {
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0.1) 0px, rgba(0,0,0,0.1) 1px, transparent 1px, transparent 4px),
    linear-gradient(155deg, var(--wood-light) 0%, var(--wood) 45%, var(--wood-dark) 100%);
  border-radius: 32px;
  padding: 20px;
  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.18),
    inset 0 -8px 14px rgba(0,0,0,0.5),
    inset 0 0 0 2px var(--brass),
    0 16px 34px rgba(0,0,0,0.55);
  margin-bottom: 10px;
  position: relative;
}
.table-frame::before {
  content: '';
  position: absolute; inset: 5px;
  border-radius: 26px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), inset 0 1px 2px rgba(255,255,255,0.12);
  pointer-events: none;
}
.table-felt {
  background-image:
    linear-gradient(180deg, rgba(0,0,0,0.38) 0%, transparent 30%, transparent 65%, rgba(255,255,255,0.05) 100%),
    linear-gradient(rgba(8,6,4,0.4), rgba(8,6,4,0.4)),
    var(--tablecloth-image, none),
    repeating-linear-gradient(0deg, var(--felt-dark) 0 20px, var(--felt) 20px 40px),
    repeating-linear-gradient(90deg, transparent 0 20px, rgba(0,0,0,0.12) 20px 40px),
    radial-gradient(ellipse at 50% 38%, var(--felt-light) 0%, transparent 70%);
  background-size: cover, cover, cover, auto, auto, auto;
  background-position: center;
  background-blend-mode: normal, normal, normal, normal, normal, soft-light;
  border-radius: 18px;
  box-shadow: inset 0 0 0 4px var(--brass), inset 0 20px 50px rgba(0,0,0,0.4);
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "tl top tr" "left mid right" "bl bottom br";
  min-height: 400px;
  padding: 16px 8px;
  gap: 6px;
}
.seat-top { grid-area: top; justify-self: center; align-self: start; }
.seat-left { grid-area: left; justify-self: center; align-self: center; }
.seat-right { grid-area: right; justify-self: center; align-self: center; }
.seat-bottom { grid-area: bottom; justify-self: center; align-self: end; }
.trick-mid { grid-area: mid; display: flex; align-items: center; justify-content: center; position: relative; min-height: 140px; }

.table-ad-banner {
  background: var(--ink); color: var(--brass);
  border-radius: 8px; padding: 5px 14px; margin: 0 0 10px;
  text-align: center; font-family: 'Cinzel', serif; font-size: 12px;
  letter-spacing: 0.05em; box-shadow: inset 0 0 0 1px var(--brass);
}
.table-ad-banner span { font-family: 'Lora', serif; font-weight: 400; opacity: 0.75; margin-left: 8px; }

.seat-figure { display: flex; flex-direction: column; align-items: center; margin-bottom: 2px; position: relative; }
.seat-figure::after {
  content: ''; display: block; width: 30px; height: 7px; margin: 3px auto 0;
  background: rgba(0,0,0,0.35); border-radius: 50%; filter: blur(1px);
}
.seat-top .seat-figure::after { width: 22px; height: 5px; }
.seat-bottom .seat-figure::after { width: 38px; height: 9px; }
.seat-avatar-badge {
  display: block; width: 44px; height: 44px; border-radius: 50%;
  border: 3px solid var(--brass); overflow: hidden;
  box-shadow: 0 3px 8px rgba(0,0,0,0.5);
}
.seat-top .seat-avatar-badge { width: 34px; height: 34px; border-width: 2px; }
.seat-left .seat-avatar-badge, .seat-right .seat-avatar-badge { width: 40px; height: 40px; }
.seat-bottom .seat-avatar-badge { width: 54px; height: 54px; border-width: 3px; }
.seat-avatar-photo { width: 100%; height: 100%; background-size: cover; background-position: center; }
.seat-avatar-fallback {
  display: flex; align-items: center; justify-content: center; height: 100%;
  color: #fff8f0; font-family: 'Cinzel', serif; font-weight: 700; font-size: 17px;
}
.seat-avatar-badge-lg { width: 74px; height: 74px; border-width: 4px; }
.seat-avatar-badge-lg .seat-avatar-fallback { font-size: 26px; }

.plaque {
  background: linear-gradient(180deg, #d9bd76, var(--brass));
  color: var(--wood-dark); border-radius: 8px; padding: 5px 12px;
  text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  font-family: 'Cinzel', serif; min-width: 84px;
  border: 1px solid #8a6a25;
}
.plaque.active { background: linear-gradient(180deg, var(--lamp), var(--brass-bright)); box-shadow: 0 0 0 2px #fff5da, 0 4px 10px rgba(0,0,0,0.5); }
.plaque .nm { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
.plaque .pt { font-size: 15px; font-weight: 700; }
.plaque .conn { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-left: 4px; vertical-align: middle; }
.plaque .conn.off { background: #8a3a3a; }
.plaque .conn.on { background: #4a8a52; }
.plaque.mine { box-shadow: 0 0 0 2px var(--ember), 0 2px 5px rgba(0,0,0,0.4); }
.plaque .tricks-won { font-size: 9px; opacity: 0.75; margin-top: 1px; }

.opp-cards { display: flex; justify-content: center; margin: 4px 0; height: 34px; position: relative; }
.opp-cards .back-mini {
  width: 22px; height: 31px; border-radius: 3px; position: absolute; top: 1px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.5);
  background: repeating-linear-gradient(45deg, var(--ember) 0 4px, #7d2c1c 4px 8px);
  border: 1px solid var(--brass);
}
.opp-count-badge {
  position: absolute; bottom: -6px; right: -8px; background: var(--ink); color: var(--cream);
  font-size: 10px; font-weight: bold; border-radius: 50%; width: 17px; height: 17px;
  display: flex; align-items: center; justify-content: center; border: 1px solid var(--brass);
}

/* ---------- avatar customization modal ---------- */
.avatar-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
}
.avatar-modal {
  background: var(--cream); color: var(--ink); border-radius: 12px;
  padding: 20px 22px; width: 100%; max-width: 440px; max-height: 88vh; overflow: auto;
}
.avatar-modal-layout { display: flex; align-items: center; gap: 16px; margin: 12px 0 16px; }
.avatar-modal-preview {
  flex-shrink: 0; width: 96px; height: 96px; border-radius: 10px;
  background: #00000010; display: flex; align-items: center; justify-content: center;
}
.avatar-clothes-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 16px; }
.avatar-swatch {
  aspect-ratio: 1; border-radius: 50%; border: 3px solid transparent;
  cursor: pointer;
}
.avatar-swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px var(--brass); }
.avatar-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

.trick-slot { position: absolute; text-align: center; }
.trick-slot.pos-top { top: 4px; left: 50%; transform: translateX(-50%); }
.trick-slot.pos-left { left: 6px; top: 50%; transform: translateY(-50%); }
.trick-slot.pos-right { right: 6px; top: 50%; transform: translateY(-50%); }
.trick-slot.pos-bottom { bottom: 4px; left: 50%; transform: translateX(-50%); }
.trick-slot .who { font-size: 10px; opacity: 0.75; margin-top: 2px; }
.trick-slot.led-card .pcard-wrap { box-shadow: 0 0 0 3px var(--brass-bright), 0 0 10px 2px rgba(232,198,103,0.7); border-radius: 6px; }
.trick-slot .led-tag {
  font-size: 9px; font-weight: bold; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--wood-dark); background: var(--brass-bright); border-radius: 4px; padding: 1px 5px;
  display: inline-block; margin-bottom: 2px;
}

.trick-card-anim {
  transition: transform 0.42s cubic-bezier(.22,.9,.35,1), opacity 0.3s ease;
}
.trick-card-anim.fly-in-start { transform: translateY(-26px) scale(0.5); opacity: 0; }
.trick-card-anim.fly-in-end { transform: translateY(0) scale(1); opacity: 1; }
.trick-card-anim.collect-start { transform: translate(0, 0) scale(1); opacity: 1; }
.trick-card-anim.collect-end { transform: var(--collect-to, translate(0,0)) scale(0.4); opacity: 0; }
.center-label { color: var(--center-label-color); font-family: 'Cinzel', serif; font-size: 13px; text-align: center; letter-spacing: 0.05em; }

.mid-info { color: var(--surface-text); font-size: 12.5px; text-align: center; max-width: 260px; }
.mid-info .row { margin-bottom: 3px; }

.hand-tray {
  background: var(--wood-light);
  background-image: repeating-linear-gradient(4deg, rgba(0,0,0,0.12) 0px, rgba(0,0,0,0.12) 2px, transparent 2px, transparent 10px);
  border-radius: 14px; padding: 16px 10px 10px;
  box-shadow: inset 0 0 0 2px var(--brass), 0 8px 18px rgba(0,0,0,0.4);
}
.hand-tray .box-label { font-size: 11px; opacity: 0.75; margin-bottom: 8px; text-align: center; text-transform: uppercase; letter-spacing: 0.08em; }
.hand-fan { display: flex; justify-content: center; flex-wrap: wrap; padding-bottom: 6px; }
.hand-fan .card-slot { margin: 0 -6px; transition: transform 0.15s ease; }
.hand-fan .card-slot:hover { z-index: 5; }

.turn-row { display: flex; justify-content: center; align-items: center; margin-bottom: 10px; font-size: 13px; opacity: 0.9; font-family: 'Cinzel', serif; letter-spacing: 0.03em; }
.turn-row.mine { color: var(--accent-text); }

.action-row { text-align: center; margin-bottom: 10px; }
.action-row .btn { display: inline-block; width: auto; padding: 8px 18px; margin: 0 4px; }

.desitky-seq-box { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 10px; }
.desitky-seq-item { text-align: center; }
.desitky-seq-item .lbl { font-size: 10px; opacity: 0.7; margin-bottom: 3px; }

.log-box { margin-top: 16px; font-size: 12px; opacity: 0.7; }
.log-box summary { cursor: pointer; font-family: 'Cinzel', serif; letter-spacing: 0.03em; }
.log-box ul { margin: 8px 0 0; padding-left: 18px; }
.log-box li { margin-bottom: 3px; }
.scoresheet-box { opacity: 1; overflow-x: auto; }
.scoresheet-table { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 11px; white-space: nowrap; }
.scoresheet-table th, .scoresheet-table td { padding: 4px 8px; text-align: center; border-bottom: 1px solid rgba(255,255,255,0.08); }
.scoresheet-table th:nth-child(2), .scoresheet-table td:nth-child(2) { text-align: left; }
.scoresheet-table thead th { font-family: 'Cinzel', serif; opacity: 0.8; }
.scoresheet-table tfoot td { font-weight: 700; border-top: 2px solid var(--brass); border-bottom: none; }

.footnote { margin-top: 22px; font-size: 10px; opacity: 0.4; line-height: 1.5; text-align: center; }

.pcard-wrap { display: inline-block; border-radius: 6px; overflow: hidden; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5)); background: none; border: none; padding: 0; cursor: default; transition: transform 0.12s ease; vertical-align: top; }
.pcard-wrap + .pcard-wrap { margin-left: -16px; }
.pcard-wrap.sz-hand { width: 68px; height: 95px; margin-left: 0; }
.pcard-wrap.sz-trick { width: 54px; height: 76px; }
.pcard-wrap.sz-mini { width: 40px; height: 56px; }
.pcard-wrap.playable { cursor: pointer; }
.pcard-wrap:disabled { filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35)) grayscale(0.55) brightness(0.75); }
.pcard-wrap.playable:hover { transform: translateY(-10px) scale(1.04); }
.pcard-wrap.renonc-risk { cursor: pointer; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.5)) sepia(0.4) hue-rotate(-40deg) saturate(1.6); }
.pcard-wrap.renonc-risk:hover { transform: translateY(-6px); box-shadow: 0 0 0 2px var(--ember); }
.pcard-wrap.staged { transform: translateY(-14px); filter: drop-shadow(0 6px 10px rgba(0,0,0,0.6)) drop-shadow(0 0 0 2px var(--brass-bright)); }
.pcard-img { width: 100%; height: 100%; object-fit: contain; display: block; background: #F7F0E1; border-radius: 6px; }
.pcard-placeholder {
  width: 100%; height: 100%; border-radius: 6px; border: 2px solid; background: #F7F0E1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: 'Cinzel', serif;
}
.pcard-placeholder .ph-rank { font-size: 20px; font-weight: 700; }
.pcard-placeholder .ph-suit { font-size: 9px; text-transform: uppercase; letter-spacing: 0.05em; }
.back-img { width: 100%; height: 100%; object-fit: cover; border-radius: 3px; display: block; }
