:root {
  --bg: #08110d;
  --panel: #111a16;
  --panel-2: #17231d;
  --felt: #15573a;
  --felt-hi: #20734c;
  --felt-dark: #0d3d29;
  --ink: #edf5ef;
  --muted: #97aa9f;
  --gold: #d7b45e;
  --gold-dark: #7d6328;
  --line: rgba(255,255,255,.10);
  --danger: #ff8f8f;
  --club: #1e9d4a;
  --spade: #14191d;
  --heart: #bf2435;
  --diamond: #236ae0;
  --shadow: 0 24px 70px rgba(0,0,0,.46);
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  overflow: hidden;
  height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 50% -10%, rgba(111,82,35,.28), transparent 34%),
    linear-gradient(180deg,#0a1510 0,#060c09 100%);
}
button, select, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.app-shell { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* ---------- Topbar ---------- */
.topbar {
  flex: 0 0 auto;
  min-height: 92px;
  display: grid;
  grid-template-columns: 210px minmax(420px, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg,rgba(11,18,15,.96),rgba(7,13,10,.92));
  box-shadow: 0 8px 25px rgba(0,0,0,.22);
  position: relative;
  z-index: 20;
}
.eyebrow { font-size: 10px; letter-spacing: .18em; color: var(--gold); font-weight: 900; }
h1 { margin: 2px 0 0; font: 800 30px/1 Georgia, serif; letter-spacing: .12em; text-shadow: 0 2px 8px #000; }
.top-stats { display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px; align-items:stretch; }
.top-stat {
  display:flex; flex-direction:column; justify-content:center;
  min-height:58px; padding:10px 14px; border-radius:14px;
  border:1px solid rgba(255,255,255,.08);
  background:linear-gradient(180deg,rgba(255,255,255,.02),rgba(255,255,255,.01));
  box-shadow: inset 0 1px rgba(255,255,255,.03);
}
.top-stat > span { display:block; color:var(--muted); font-size:10px; text-transform:uppercase; letter-spacing:.09em; }
.top-stat > b { display:flex; align-items:center; gap:8px; margin-top:5px; font-size:16px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.top-stat > small { display:block; margin-top:4px; color:#84978c; font-size:9px; text-transform:uppercase; letter-spacing:.08em; }
.top-stat-primary b { font-size:22px; font-weight:900; }
.top-stat.hot {
  border-color: rgba(216,179,95,.32);
  background: linear-gradient(180deg, rgba(216,179,95,.12), rgba(216,179,95,.04));
  box-shadow: 0 0 0 1px rgba(216,179,95,.08) inset, 0 8px 18px rgba(0,0,0,.18);
}
.top-stat.hot > span { color:#e5cea0; }
.trump-icon { display:inline-grid; place-items:center; width:34px; height:34px; border-radius:12px; font:900 20px/1 Georgia,serif; border:1px solid rgba(255,255,255,.14); box-shadow:0 6px 14px rgba(0,0,0,.22), inset 0 1px rgba(255,255,255,.10); }
.trump-icon.suit-C { color:#42d774; background:rgba(31,146,68,.24); }
.trump-icon.suit-S { color:#ffffff; background:rgba(255,255,255,.14); }
.trump-icon.suit-H { color:#ff89a1; background:rgba(188,38,56,.26); }
.trump-icon.suit-D { color:#78abff; background:rgba(32,92,214,.24); }
.top-actions { display: flex; align-items: center; gap: 10px; }
.phase-chip {
  align-self:center; white-space:nowrap; padding:8px 11px; border-radius:999px;
  color:#e5d49f; background:rgba(216,179,95,.08); border:1px solid rgba(216,179,95,.18);
  font-size:9px; font-weight:900; text-transform:uppercase; letter-spacing:.08em;
}
.speed-control { display: grid; gap: 4px; }
.speed-control span { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.speed-control select, .select-row select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #18231e;
  color: var(--ink);
  padding: 9px 11px;
}
.speed-control select { min-width: 130px; }
.ghost-button, .icon-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255,255,255,.025);
  border-radius: 10px;
  padding: 10px 13px;
  cursor: pointer;
}
.ghost-button:hover, .icon-button:hover { background: rgba(255,255,255,.08); }

/* ---------- Layout ---------- */
.game-layout {
  display: grid;
  grid-template-columns: 350px minmax(0,1fr);
  flex: 1 1 auto;
  min-height: 0;
}
.helper-panel {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,.09);
  background:
    radial-gradient(circle at 50% 0,rgba(216,179,95,.07),transparent 30%),
    linear-gradient(180deg,#101914,#090f0c);
  box-shadow: 16px 0 45px rgba(0,0,0,.22);
}
.helper-head {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:16px 16px 12px; border-bottom:1px solid rgba(255,255,255,.07);
}
.helper-head strong { display:block; margin-top:3px; font:800 21px/1 Georgia,serif; }
.helper-tabs { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; padding:10px 12px; border-bottom:1px solid rgba(255,255,255,.07); }
.helper-tab {
  border:1px solid rgba(255,255,255,.08); border-radius:10px; padding:9px 5px;
  background:rgba(255,255,255,.025); color:#9fb0a6; cursor:pointer; font-weight:850; font-size:10px;
}
.helper-tab:hover { background:rgba(255,255,255,.055); color:#fff; }
.helper-tab.active { color:#261e0b; background:linear-gradient(180deg,#e4c86f,#b88d37); border-color:transparent; }
.helper-pane { flex:1; min-height:0; overflow:auto; padding:14px; }

.score-list { display: grid; gap: 9px; }
.player-panel {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: linear-gradient(145deg,#17231d,#101814);
  box-shadow: inset 0 1px rgba(255,255,255,.03), 0 6px 14px rgba(0,0,0,.14);
}
.player-panel.active { outline: 2px solid rgba(216,179,95,.72); box-shadow: 0 0 28px rgba(216,179,95,.12); }
.player-panel.is-attacker { background: linear-gradient(145deg,rgba(216,179,95,.15),#111914); }
.player-panel.is-defender { background: linear-gradient(145deg,rgba(64,124,214,.16),#111914); }
.player-panel.is-out { opacity:.55; }
.avatar {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%,#40584d,#1d2c25 68%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: inset 0 2px 5px rgba(255,255,255,.07), 0 5px 12px rgba(0,0,0,.22);
  font-weight: 900; font-size: 11px;
}
.player-panel b, .player-panel span { display: block; }
.player-name { font-size:14px; font-weight:900; }
.player-role { display: block; color: var(--muted); font-size: 10px; margin-top: 3px; text-transform:uppercase; letter-spacing:.06em; }
.player-count {
  align-self:center; padding:6px 9px; border:1px solid rgba(255,255,255,.08); border-radius:9px;
  background:rgba(0,0,0,.20); color:#f5e8bc; font-size:11px; font-variant-numeric:tabular-nums; font-weight:800;
}
.seat-badge {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 3px 7px;
  border-radius: 999px; font-size: 8px; line-height: 1; letter-spacing: .08em; font-weight: 950;
  border: 1px solid rgba(255,255,255,.12);
}
.seat-badge.attack { color: #231b08; background: linear-gradient(180deg,#f1d782,#c89b37); box-shadow: 0 0 18px rgba(216,179,95,.28); }
.seat-badge.defend { color: #d9e6ff; background: rgba(40,84,164,.42); }
.seat-badge.out { color: #c8d5cd; background: rgba(8,16,12,.66); }

.helper-explainer { margin-top:14px; padding:14px; border-radius:14px; border:1px solid rgba(255,255,255,.07); background:rgba(255,255,255,.02); }
.helper-explainer b { display:block; margin-top:5px; font-size:14px; }
.helper-explainer p { margin:7px 0 0; color:#9eaea5; font-size:11px; line-height:1.5; }
.calc-label { display:block; color:#91a098; text-transform:uppercase; letter-spacing:.1em; font-size:8px; font-weight:900; }
.rule-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.rule-badge { font-size: 9px; color: #c4d0c9; border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 999px; padding: 4px 7px; }
.rule-badge.on { color:#f0dda5; border-color:rgba(216,179,95,.3); background:rgba(216,179,95,.09); }
.rules-summary h4 { margin:16px 0 6px; font:800 14px/1.2 Georgia,serif; color:#f0e0b3; }
.rules-summary h4:first-child { margin-top:0; }
.rules-summary p { margin:0; color:#a9b8af; font-size:11px; line-height:1.55; }
.log { border-top: 1px solid var(--line); }
.log > div { padding: 9px 3px; border-bottom: 1px solid rgba(255,255,255,.055); color: #b7c6bd; font-size: 11px; line-height: 1.4; }
.log > div b { color:#eadfbb; }
.helper-log-head { padding:2px 2px 8px; border-bottom:1px solid rgba(255,255,255,.07); }

/* ---------- Table ---------- */
.table-wrap {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.felt-table {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  border-style: solid;
  border-width: 12px 16px 20px;
  border-color: #74492d;
  border-bottom-color: #50301e;
  background:
    radial-gradient(ellipse at 50% 8%, rgba(255,244,199,.075), transparent 30%),
    radial-gradient(circle at 50% 46%, #20845a 0%, #176a48 42%, #0e4932 72%, #093424 100%);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.055),
    inset 0 0 180px rgba(0,0,0,.30),
    inset 0 28px 70px rgba(255,255,255,.025),
    0 0 0 1px #2d1b12;
}
.felt-table::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(255,222,161,.20);
  box-shadow: inset 0 0 0 1px rgba(51,28,16,.34);
  pointer-events: none;
}
.felt-table::after {
  content: "";
  position: absolute;
  inset: 25px 27px 29px;
  border: 1px solid rgba(255,255,255,.075);
  border-radius: 10px;
  box-shadow: inset 0 0 100px rgba(0,0,0,.10);
  pointer-events: none;
}
.table-stage { position: relative; z-index: 1; flex: 1 1 auto; min-height: 0; padding: 12px 14px 10px; }
.action-bar { position: relative; z-index: 1; flex: 0 0 200px; align-self: center; width: min(680px, 78%); margin: 0; overflow: visible; }
.human-hand-slot { position: relative; z-index: 1; flex: 0 0 190px; margin: 0 14px 10px; display: flex; align-items: flex-end; overflow: visible; }
.human-hand { width: 100%; height: auto; }
.center-brand {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  font:900 62px/1 Georgia,serif; letter-spacing:.20em; color:rgba(255,255,255,.032);
  pointer-events:none; user-select:none;
}

.talon-zone, .discard-zone { position:absolute; bottom:14px; z-index:3; text-align:center; }
.talon-zone { left:30px; width:150px; }
.discard-zone { right:30px; width:130px; }
.zone-label { display:block; margin-bottom:8px; font-size:9px; font-weight:900; letter-spacing:.12em; color:rgba(255,255,255,.6); text-transform:uppercase; white-space:nowrap; }
.talon-stack { position:relative; height:104px; display:flex; align-items:center; justify-content:center; }
.talon-stack .trump-card { position:absolute; left:6px; top:50%; transform:translateY(-50%) rotate(90deg); z-index:1; }
.talon-stack .talon-back { position:absolute; left:34px; top:50%; transform:translateY(-50%); z-index:2; }
.talon-count { display:inline-block; margin-top:10px; padding:4px 10px; border-radius:999px; background:rgba(4,12,8,.6); border:1px solid rgba(255,255,255,.12); font-size:11px; font-weight:900; color:#f0e2b8; }
.talon-empty { display:grid; place-items:center; width:74px; height:104px; margin:0 auto; border:1px dashed rgba(255,255,255,.22); border-radius:10px; color:rgba(255,255,255,.32); font-size:9px; letter-spacing:.1em; }
.discard-stack { position:relative; height:104px; }
.discard-stack .card-back { position:absolute; left:50%; top:50%; }

.table-cards {
  position:absolute; left:50%; top:53%; transform:translate(-50%,-50%);
  z-index:5; width:min(760px, 74%);
  display:flex; flex-wrap:wrap; gap:16px 20px; align-items:center; justify-content:center;
}
.table-pair { position:relative; width:112px; height:160px; }
.table-pair .card { position:absolute; left:0; top:0; width:112px; height:160px; margin:0; }
.table-pair .card.defense-card { transform:translate(23px,24px) rotate(7deg); box-shadow:0 12px 22px rgba(0,0,0,.4); }
.table-pair.unbeaten .attack-card { box-shadow:0 0 0 2px rgba(255,140,140,.5), 0 10px 20px rgba(0,0,0,.34); }
.table-pair.targeted .attack-card { box-shadow:0 0 0 3px var(--gold), 0 12px 24px rgba(0,0,0,.4); }
.table-pair.selectable { cursor:pointer; }
.table-empty { color:rgba(255,255,255,.34); font-size:12px; letter-spacing:.08em; text-transform:uppercase; font-weight:800; }

.bot-seat { position:absolute; z-index:12; display:grid; gap:8px; justify-items:center; width:246px; }
.bot-seat.slot-top { left:50%; top:6px; transform:translateX(-50%); }
.bot-seat.slot-left { left:10px; top:6px; }
.bot-seat.slot-right { right:10px; top:6px; }
.nameplate {
  display:grid; grid-template-columns:38px minmax(0,1fr) auto; gap:9px; align-items:center;
  width:100%; padding:8px 11px; border-radius:14px;
  background:linear-gradient(145deg,rgba(28,43,35,.98),rgba(9,17,13,.98));
  border:1px solid rgba(255,255,255,.14);
  box-shadow:0 14px 30px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.05);
}
.nameplate .avatar { width:38px; height:38px; }
.nameplate .player-name { font-size:15px; }
.nameplate .player-role { font-size:9px; }
.bot-seat.active .nameplate {
  border-color:rgba(239,204,111,.78);
  box-shadow:0 0 0 2px rgba(216,179,95,.15), 0 16px 36px rgba(0,0,0,.4), 0 0 30px rgba(216,179,95,.16);
}
.bot-seat.is-defender .nameplate { border-color:rgba(112,166,232,.6); }
.bot-seat.is-out .nameplate { opacity:.5; }
.bot-hand { display:flex; align-items:flex-start; justify-content:center; height:76px; overflow:visible; }
.bot-hand .card-back {
  width:50px; height:72px; margin-right:-27px; border-radius:7px;
  transform:translateY(var(--fan-y,0)) rotate(var(--fan-angle,0deg));
  transform-origin:50% 118%;
  box-shadow:0 8px 15px rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.08);
}
.seat-bubble {
  position:absolute; left:50%; bottom:-14px; transform:translateX(-50%);
  padding:4px 10px; border-radius:999px; white-space:nowrap;
  color:#20190a; background:linear-gradient(180deg,#f5dfa0,#d4ac50);
  border:1px solid rgba(255,255,255,.5); box-shadow:0 7px 18px rgba(0,0,0,.3);
  font-size:9px; font-weight:950; letter-spacing:.06em;
  animation:reactionPop .2s cubic-bezier(.2,.9,.3,1.25);
}

/* ---------- Action bar + hand ---------- */
.action-bar {
  min-height: 108px; padding: 14px 16px;
  background: linear-gradient(180deg,rgba(20,31,26,.96),rgba(11,17,14,.98));
  border: 1px solid var(--line); border-radius: 16px;
  display: flex; align-items: center;
  box-shadow: 0 12px 26px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.035);
}
.action-content { width: 100%; }
.status-text { min-height: 22px; font-size: 15px; font-weight: 850; color: #e3ece7; margin-bottom: 10px; }
.beginner-tip { margin: 0 0 10px; padding: 9px 12px; border-radius: 10px; border-left: 3px solid var(--gold); background: rgba(216,179,95,.07); color:#c8d3cc; font-size:11.5px; line-height:1.45; }
.controls { display: flex; flex-wrap: wrap; gap: 11px; }
.action {
  min-height: 50px;
  border: 1px solid rgba(255,255,255,.13);
  background: linear-gradient(180deg,#2a4035,#21332a);
  color: var(--ink); border-radius: 12px; padding: 13px 20px; cursor: pointer;
  font-weight: 900; font-size: 15px;
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 4px 9px rgba(0,0,0,.16);
}
.action:hover { filter: brightness(1.12); transform: translateY(-1px); }
.action.primary { background: linear-gradient(180deg,#e1c36e,#bf9641); color: #211b0c; border-color: transparent; box-shadow: 0 10px 22px rgba(191,150,65,.18), inset 0 1px rgba(255,255,255,.22); }
.action.secondary { background: transparent; box-shadow:none; }
.action.danger { border-color: rgba(255,110,110,.28); color:#ffb3b3; background:rgba(111,22,22,.22); }
.action.info { border-color: rgba(120,171,255,.3); color:#bcd6ff; background:rgba(28,60,120,.28); }
.action.disabled, .action:disabled { opacity: .38; cursor: not-allowed; transform:none; }
.action.wide { width: 100%; margin-top: 14px; }

.human-hand { min-height: 190px; display: flex; justify-content: center; align-items: flex-end; padding: 36px 8px 2px; overflow-x: auto; overflow-y: hidden; }
.card {
  position: relative; width: 94px; height: 134px; flex: 0 0 auto; margin-left: -22px;
  border: 1px solid #c9cfcb; border-radius: 10px;
  background: linear-gradient(145deg,#fff,#f2f1ec 67%,#e4e1d9);
  box-shadow: 0 9px 18px rgba(0,0,0,.25), inset 0 1px #fff;
  color: #171b19; overflow: hidden;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
  transform-origin: 50% 118%;
}
.human-hand .card { transform: translateY(var(--fan-y,0)) rotate(var(--fan-angle,0deg)); }
.card:first-child { margin-left: 0; }
button.card { padding: 0; }
.card.suit-C { color: var(--club); }
.card.suit-S { color: var(--spade); }
.card.suit-H { color: var(--heart); }
.card.suit-D { color: var(--diamond); }
.card.playable { cursor: pointer; }
.human-hand .card.playable:hover { transform: translateY(calc(var(--fan-y,0px) - 14px)) rotate(var(--fan-angle,0deg)); box-shadow: 0 20px 28px rgba(0,0,0,.34), 0 0 0 2px rgba(216,179,95,.3); }
.card.selected { transform: translateY(calc(var(--fan-y,0px) - 20px)) rotate(var(--fan-angle,0deg)) !important; box-shadow: 0 0 0 3px var(--gold), 0 20px 30px rgba(0,0,0,.34); }
.card.dimmed { filter: brightness(.55) saturate(.4); }
.card.trump-mark::after { content:""; position:absolute; inset:auto 0 0 0; height:5px; background:linear-gradient(90deg,rgba(216,179,95,0),var(--gold),rgba(216,179,95,0)); }
.corner { position: absolute; display: grid; justify-items: center; line-height: 1; font-family: Georgia, serif; }
.corner b { font-size: 18px; line-height:.92; font-weight:900; letter-spacing:-.04em; text-shadow: 0 1px rgba(255,255,255,.7); }
.corner i { margin-top:2px; font-size: 16px; line-height:.9; font-style: normal; font-weight:800; }
.corner.top { top: 7px; left: 8px; }
.corner.bottom { bottom: 7px; right: 8px; transform: rotate(180deg); }
.pip { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); font-size: 48px; font-family: Georgia, "Times New Roman", serif; filter: drop-shadow(0 1px 0 rgba(255,255,255,.45)); }
.table-pair .card .corner b { font-size:22px; }
.table-pair .card .corner i { font-size:19px; }
.table-pair .card .pip { font-size:56px; }
.card-back {
  position:relative; width:74px; height:104px; display: grid; place-items: center; border-radius:8px;
  border: 2px solid #efe6d0;
  background: repeating-linear-gradient(45deg,#19375d 0 6px,#244d80 6px 12px);
  color: rgba(255,255,255,.83);
  box-shadow: 0 8px 16px rgba(0,0,0,.3);
}
.card-back::before { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255,255,255,.6); border-radius: 5px; }
.card-back span { font: 800 9px/1 Georgia, serif; letter-spacing: .1em; z-index: 2; pointer-events:none; user-select:none; }
.trump-card .card { width:74px; height:104px; margin:0; }
.trump-card .card .corner b { font-size:15px; }
.trump-card .card .corner i { font-size:13px; }
.trump-card .card .pip { font-size:38px; }

/* ---------- Modals ---------- */
.result-modal, .settings-modal { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.68); z-index: 60; padding: 18px; backdrop-filter: blur(7px); }
.result-card, .settings-card { background: linear-gradient(180deg,#1a2821,#101914); border: 1px solid rgba(255,255,255,.13); border-radius: 18px; box-shadow: var(--shadow); }
.result-card { width: min(520px,100%); padding: 26px; text-align:center; }
.result-card h2, .settings-card h2 { margin: 7px 0 12px; font: 800 28px/1.15 Georgia,serif; }
.result-mark { width:76px; height:76px; margin:4px auto 10px; display:grid; place-items:center; border-radius:50%; font:900 34px/1 Georgia,serif; color:#f0d47e; background:radial-gradient(circle at 35% 28%,#4c6758,#14231c 68%); border:1px solid rgba(255,255,255,.14); box-shadow:0 12px 26px rgba(0,0,0,.34), inset 0 2px rgba(255,255,255,.09); }
.result-mark.bad { color:#ffb0b0; background:radial-gradient(circle at 35% 28%,#68403f,#241416 68%); }
.result-body { color: #c5d2ca; line-height: 1.55; font-size: 13px; }
.result-body p { margin: 7px 0; }
.danger { color: var(--danger); }
.settings-card { width:min(880px,100%); max-height:calc(100vh - 36px); overflow:auto; padding:24px; }
.settings-head { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; }
.icon-button { width:38px; height:38px; padding:0; font-size:24px; line-height:1; }
.settings-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
.settings-grid section { padding:15px; border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.025); }
.settings-grid h3 { margin:0 0 10px; font-size:11px; text-transform:uppercase; letter-spacing:.12em; color:var(--muted); }
.toggle-row, .select-row { display:flex; gap:11px; align-items:flex-start; padding:10px 0; border-top:1px solid rgba(255,255,255,.055); }
.toggle-row:first-of-type, .select-row:first-of-type { border-top:0; }
.toggle-row input { margin-top:3px; accent-color:#d8b35f; width:17px; height:17px; }
.toggle-row span, .select-row span { flex:1; }
.toggle-row b, .select-row b, .toggle-row small, .select-row small { display:block; }
.toggle-row b, .select-row b { font-size:12px; }
.toggle-row small, .select-row small { margin-top:3px; color:var(--muted); font-size:10px; line-height:1.35; }
.select-row { align-items:center; }
.select-row select { min-width:150px; }
.settings-note { margin-top:12px; color:var(--muted); font-size:10px; }

/* ---------- Main menu ---------- */
.main-menu {
  position: fixed; z-index: 120; inset: 0; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 50% 36%, rgba(41,139,91,.28), transparent 38%),
    linear-gradient(150deg, rgba(4,11,8,.96), rgba(6,18,12,.985));
  backdrop-filter: blur(12px);
}
.main-menu::before {
  content: ""; position: absolute; inset: 18px; border: 12px solid #70472c;
  box-shadow: inset 0 0 0 2px rgba(255,222,161,.16), 0 0 80px rgba(0,0,0,.48); pointer-events: none;
}
.menu-card {
  position: relative; width: min(520px, calc(100vw - 48px)); padding: 34px 38px 30px;
  border: 1px solid rgba(239,215,145,.24); border-radius: 24px;
  background:
    radial-gradient(circle at 50% 0, rgba(233,205,115,.09), transparent 42%),
    linear-gradient(160deg, rgba(24,39,31,.985), rgba(7,14,10,.99));
  box-shadow: 0 28px 90px rgba(0,0,0,.58), inset 0 1px rgba(255,255,255,.07);
  text-align: center;
}
.menu-mark {
  width: 66px; height: 66px; margin: 0 auto 12px; display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.14); border-radius: 50%; color: #f0d47e;
  background: radial-gradient(circle at 35% 28%,#4c6758,#14231c 68%);
  box-shadow: 0 12px 26px rgba(0,0,0,.34), inset 0 2px rgba(255,255,255,.09);
  font: 900 31px/1 Georgia,serif;
}
.menu-card h2 { margin: 0; font: 900 42px/1 Georgia,serif; letter-spacing: .14em; text-shadow: 0 4px 14px rgba(0,0,0,.55); }
.menu-subtitle { margin: 10px 0 24px; color: #aebdb4; font-size: 12px; letter-spacing: .06em; }
.menu-actions { display: grid; gap: 11px; }
.menu-button {
  min-height: 58px; display: grid; grid-template-columns: 34px 1fr 34px; align-items: center;
  width: 100%; padding: 12px 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 14px;
  color: #edf5ef; background: linear-gradient(180deg,rgba(42,64,53,.94),rgba(24,40,32,.96));
  box-shadow: inset 0 1px rgba(255,255,255,.055), 0 7px 16px rgba(0,0,0,.22);
  cursor: pointer; font-size: 16px; font-weight: 850;
}
.menu-button:hover { filter: brightness(1.10); transform: translateY(-1px); }
.menu-button.primary { color:#231c0b; border-color:transparent; background:linear-gradient(180deg,#e7cd78,#bd9137); }
.menu-button .menu-icon { font-size: 20px; }
.menu-button .menu-arrow { opacity:.42; }
.menu-language {
  display: grid; grid-template-columns: 1fr 190px; align-items: center; gap: 14px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.09); text-align: left;
}
.menu-language span { color:#aebdb4; font-size:11px; font-weight:800; text-transform:uppercase; letter-spacing:.09em; }
.menu-language select { width: 100%; padding: 10px 12px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: #edf5ef; background: #101c16; }
.menu-session-info { display:block; min-height:16px; margin-top:12px; color:#82948a; font-size:10px; }

/* ---------- New game modal ---------- */
#new-game-modal { z-index:140; }
.new-game-card { width:min(820px,100%); max-height:calc(100vh - 36px); overflow:auto; }
.new-game-lead { margin:4px 0 18px; color:#aebdb4; font-size:12px; line-height:1.55; }
.new-game-section { padding:14px; border:1px solid rgba(255,255,255,.08); border-radius:14px; background:rgba(4,13,9,.32); }
.new-game-section + .new-game-section { margin-top:14px; }
.new-game-section h3 { margin:0 0 10px; font:800 15px/1.2 Georgia,serif; }
.bot-rows { display:grid; gap:10px; }
.bot-row { display:grid; grid-template-columns:36px minmax(0,1fr) 170px; gap:11px; align-items:center; padding:9px 10px; border:1px solid rgba(255,255,255,.07); border-radius:12px; background:rgba(255,255,255,.02); }
.bot-row select { width:100%; border:1px solid var(--line); border-radius:10px; background:#18231e; color:var(--ink); padding:9px 10px; }
.bot-row b { font-size:13px; }
.bot-row small { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.new-game-footer { display:flex; justify-content:flex-end; gap:10px; margin-top:18px; }
.custom-rules { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }

/* ---------- Tutorial ---------- */
.tutorial-modal { position: fixed; z-index: 130; inset: 0; display: grid; place-items: center; padding: 22px; background: rgba(2,8,5,.82); backdrop-filter: blur(12px); }
.tutorial-card {
  width: min(720px, 100%); max-height: calc(100vh - 44px); overflow: auto; padding: 28px;
  border: 1px solid rgba(235,207,125,.24); border-radius: 22px;
  background: linear-gradient(160deg,#1b2d24,#09120d);
  box-shadow: 0 30px 90px rgba(0,0,0,.62), inset 0 1px rgba(255,255,255,.06);
}
.tutorial-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.tutorial-head h2 { margin:5px 0 0; font:800 30px/1.1 Georgia,serif; }
.tutorial-progress { display:flex; gap:7px; margin:22px 0 18px; }
.tutorial-progress i { flex:1; height:5px; border-radius:999px; background:rgba(255,255,255,.09); }
.tutorial-progress i.done { background:linear-gradient(90deg,#b48835,#ead079); box-shadow:0 0 10px rgba(216,179,95,.18); }
.tutorial-visual {
  min-height: 170px; display:grid; place-items:center; gap:10px; margin-bottom:20px;
  border:1px solid rgba(255,255,255,.08); border-radius:18px; color:#f0d47e;
  background:radial-gradient(circle at 50% 44%,rgba(35,126,82,.28),rgba(3,10,7,.46));
  font:900 62px/1 Georgia,serif;
}
.tutorial-visual .mini-cards { display:flex; gap:8px; }
.tutorial-visual .mini-card {
  width:44px; height:62px; border-radius:6px; border:1px solid #c9cfcb; display:grid; place-items:center;
  background:linear-gradient(145deg,#fff,#e9e7e0); font:900 20px/1 Georgia,serif;
  box-shadow:0 6px 12px rgba(0,0,0,.3);
}
.tutorial-visual .mini-card.suit-H { color:var(--heart); }
.tutorial-visual .mini-card.suit-S { color:var(--spade); }
.tutorial-visual .mini-card.suit-C { color:var(--club); }
.tutorial-visual .mini-card.suit-D { color:var(--diamond); }
.tutorial-visual .mini-card.back { background:repeating-linear-gradient(45deg,#19375d 0 5px,#244d80 5px 10px); border-color:#efe6d0; }
.tutorial-copy h3 { margin:0 0 10px; font:800 24px/1.15 Georgia,serif; }
.tutorial-copy p { margin:0; color:#c4d1c9; font-size:14px; line-height:1.65; }
.tutorial-actions { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-top:24px; }
.tutorial-actions .action { min-width:130px; }

.tutorial-coach {
  margin: 10px 12px 0; padding: 13px 14px;
  border: 1px solid rgba(220,181,92,.48); border-radius: 14px;
  background:
    radial-gradient(circle at 92% 8%,rgba(225,186,91,.16),transparent 38%),
    linear-gradient(145deg,rgba(13,35,24,.98),rgba(5,18,12,.98));
  box-shadow:0 18px 42px rgba(0,0,0,.34), inset 0 1px rgba(255,255,255,.05);
}
.coach-kicker { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.tutorial-coach small { color:#d9bc69; font-size:9px; font-weight:900; letter-spacing:.10em; text-transform:uppercase; }
.coach-round { padding:4px 8px; border:1px solid rgba(221,183,92,.34); border-radius:999px; color:#f1d98f; background:rgba(180,136,50,.12); font-size:9px; font-weight:900; letter-spacing:.08em; }
.tutorial-coach b { display:block; margin-top:6px; font:800 17px/1.2 Georgia,serif; }
.tutorial-coach p { margin:7px 0 10px; color:#c7d2cb; font-size:12px; line-height:1.55; }
.coach-plan { display:grid; gap:7px; margin:10px 0 8px; }
.coach-step { padding:9px 10px; border:1px solid rgba(255,255,255,.08); border-radius:9px; background:rgba(255,255,255,.025); }
.coach-step small { display:block; margin-bottom:4px; }
.coach-step p { margin:0; color:#cbd6cf; font-size:11px; line-height:1.48; }
.coach-step strong { display:block; color:#f3e3ac; font-size:13px; line-height:1.4; }
.coach-move { border-color:rgba(220,181,92,.38); background:rgba(218,177,82,.08); }
.coach-why { border-left:3px solid #d7ae52; }
.coach-actions { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.tutorial-coach button { border:0; padding:6px 9px; color:#b6c3bb; background:transparent; cursor:pointer; font-size:9px; font-weight:800; }
.tutorial-coach button.coach-primary {
  padding:9px 13px; border:1px solid rgba(237,204,122,.45); border-radius:8px; color:#152117;
  background:linear-gradient(#efd886,#bd8f36); box-shadow:0 6px 18px rgba(0,0,0,.22); font-size:10px;
}
.card.coach-target { animation:coachPulse 1.25s ease-in-out infinite; }
@keyframes coachPulse {
  0%,100% { filter:drop-shadow(0 0 0 rgba(238,207,119,0)); }
  50% { filter:drop-shadow(0 0 12px rgba(238,207,119,.85)); }
}

/* ---------- Animations ---------- */
.deal-card { animation: dealIn .5s cubic-bezier(.16,.78,.26,1) both; animation-delay: calc(var(--card-index, 0) * 55ms); }
.table-enter { animation: cardDrop .28s cubic-bezier(.2,.8,.3,1) both; }
.table-cards.collect-discard .table-pair,
.table-cards.collect-take .table-pair {
  animation: collectToTarget var(--collect-duration,500ms) cubic-bezier(.32,0,.18,1) forwards;
  will-change: transform, opacity;
}
@keyframes dealIn { from { opacity:0; transform:translateY(-180px) scale(.6) rotate(-9deg); } to { opacity:1; transform:translateY(0) scale(1) rotate(0); } }
@keyframes cardDrop { from { opacity:.15; transform:translateY(-60px) scale(.86) rotate(6deg); } to { opacity:1; transform:translateY(0) scale(1) rotate(0); } }
@keyframes collectToTarget {
  0% { transform:translate(0,0) scale(1) rotate(0); opacity:1; }
  82% { opacity:1; }
  100% { transform:translate(var(--collect-x,0px),var(--collect-y,0px)) scale(.46) rotate(var(--collect-rotation,0deg)); opacity:0; }
}
@keyframes reactionPop { from { opacity:0; transform:translateX(-50%) translateY(5px) scale(.82); } to { opacity:1; transform:translateX(-50%) translateY(0) scale(1); } }
.no-animations *, .no-animations *::before, .no-animations *::after {
  animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important;
}

/* ---------- Scrollbars ---------- */
.helper-pane, .settings-card, .log, .tutorial-card, .new-game-card {
  scrollbar-width: thin; scrollbar-color: #b88d37 rgba(5,13,9,.55);
}
.helper-pane::-webkit-scrollbar, .settings-card::-webkit-scrollbar, .log::-webkit-scrollbar, .tutorial-card::-webkit-scrollbar { width: 10px; height: 10px; }
.helper-pane::-webkit-scrollbar-track, .settings-card::-webkit-scrollbar-track, .log::-webkit-scrollbar-track, .tutorial-card::-webkit-scrollbar-track {
  margin: 5px; border: 1px solid rgba(255,255,255,.045); border-radius: 999px;
  background: rgba(4,12,8,.58); box-shadow: inset 0 1px 4px rgba(0,0,0,.45);
}
.helper-pane::-webkit-scrollbar-thumb, .settings-card::-webkit-scrollbar-thumb, .log::-webkit-scrollbar-thumb, .tutorial-card::-webkit-scrollbar-thumb {
  min-height: 42px; border: 2px solid rgba(6,14,10,.82); border-radius: 999px;
  background: linear-gradient(180deg,#d8ba62,#9b702b);
  box-shadow: inset 0 1px rgba(255,255,255,.30), 0 2px 7px rgba(0,0,0,.35);
}

/* ---------- Desktop table geometry ---------- */
@media (min-width: 1181px) {
  .human-hand-slot { transform:translateY(-17px); }
  .card { width:102px; height:145px; margin-left:-24px; }
  .table-pair, .table-pair .card { width:102px; height:145px; }
  .table-pair .card.defense-card { transform:translate(21px,22px) rotate(7deg); }
  .table-pair .card .corner b { font-size:18px; }
  .table-pair .card .corner i { font-size:16px; }
  .table-pair .card .pip { font-size:48px; }
  .bot-seat.slot-top { top:34px; }
  .bot-seat.slot-left { left:34px; top:34px; }
  .bot-seat.slot-right { right:34px; top:34px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1400px) {
  .game-layout { grid-template-columns: 320px minmax(0,1fr); }
  .bot-seat { width: 208px; }
  .table-cards { width: min(560px, 64%); }
  .talon-zone { left:18px; width:132px; }
  .discard-zone { right:18px; width:112px; }
}
@media (max-width: 1180px) {
  html, body { overflow-y: auto; height: auto; min-height: 100%; }
  .app-shell { height: auto; min-height: 100vh; overflow: visible; }
  .topbar { grid-template-columns: 1fr; }
  .top-actions { justify-content: space-between; flex-wrap: wrap; }
  .game-layout { grid-template-columns: 1fr; flex: none; }
  .helper-panel { position: relative; height: auto; min-height: 0; order: 2; border-right: 0; border-top: 1px solid rgba(255,255,255,.09); }
  .table-wrap { order: 1; height: auto; }
  .table-stage { flex: none; min-height: 420px; }
  .helper-pane { max-height: 460px; }
}
@media (max-width: 900px) {
  .top-stats { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .custom-rules { grid-template-columns: 1fr; }
  .bot-row { grid-template-columns: 32px minmax(0,1fr); }
  .bot-row select { grid-column: 1/-1; }
  .table-stage { min-height: 460px; }
  .bot-seat { width: 140px; }
  .bot-seat.slot-left { left:2px; top:4px; }
  .bot-seat.slot-right { right:2px; top:4px; }
  .bot-seat.slot-top { top:4px; }
  .nameplate { grid-template-columns: 30px minmax(0,1fr); padding:6px 8px; }
  .nameplate .avatar { width:30px; height:30px; }
  .nameplate .player-count { display:none; }
  .bot-hand { height:56px; }
  .bot-hand .card-back { width:36px; height:52px; margin-right:-20px; }
  .talon-zone { left:6px; width:96px; }
  .discard-zone { right:6px; width:84px; }
  .talon-stack, .discard-stack { height:76px; }
  .card-back { width:54px; height:76px; }
  .talon-stack .talon-back { left:24px; }
  .table-cards { width: min(360px, 74%); gap:6px 8px; top:50%; }
  .table-pair, .table-pair .card { width:56px; height:80px; }
  .table-pair .card .pip { font-size:28px; }
  .table-pair .card .corner b { font-size:12px; }
  .table-pair .card .corner i { font-size:11px; }
  .center-brand { font-size: 40px; }
  .card { width: 70px; height: 100px; margin-left: -24px; }
  .pip { font-size: 34px; }
  .human-hand { min-height: 120px; }
  .menu-card { width: calc(100vw - 24px); padding: 26px 20px 22px; }
  .menu-card h2 { font-size: 34px; }
  .menu-language { grid-template-columns: 1fr; }
  .tutorial-card { padding: 20px; }
  .tutorial-visual { min-height: 130px; font-size: 46px; }
  .settings-card { padding: 17px; }
}

/* ---------- Phone landscape: compact one-screen table ---------- */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1000px) {
  .main-menu { place-items: start center; padding: 6px; overflow-y: auto; }
  .main-menu::before { inset: 5px; border-width: 6px; }
  .menu-card { width: min(680px, calc(100vw - 18px)); padding: 9px 14px 8px; border-radius: 14px; }
  .menu-card > .eyebrow { display: none; }
  .menu-mark { width: 34px; height: 34px; margin: 0 auto 2px; font-size: 18px; }
  .menu-card h2 { font-size: 25px; letter-spacing: .1em; }
  .menu-subtitle { margin: 3px 0 7px; font-size: 9px; }
  .menu-actions { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 5px; }
  .menu-button { min-height: 40px; padding: 5px 7px; grid-template-columns: 20px minmax(0,1fr) 14px; border-radius: 9px; font-size: 11px; }
  .menu-button .menu-icon { font-size: 15px; }
  .menu-language { grid-template-columns: 1fr 145px; gap: 8px; margin-top: 6px; padding-top: 6px; }
  .menu-language span { font-size: 8px; }
  .menu-language select { padding: 5px 7px; font-size: 10px; }
  .menu-session-info { min-height: 10px; margin-top: 2px; font-size: 8px; }
  html, body { height: 100%; min-height: 100%; overflow: hidden; }
  body { height: 100vh; }
  .app-shell { height: 100vh; min-height: 0; overflow: hidden; }

  .topbar {
    min-height: 48px; height: 48px; padding: 4px 8px; gap: 8px;
    grid-template-columns: 92px minmax(0,1fr) auto;
  }
  .brand-block .eyebrow { display: none; }
  h1 { margin: 0; font-size: 19px; letter-spacing: .08em; }
  .top-stats { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 4px; }
  .top-stat { min-height: 38px; padding: 4px 7px; border-radius: 8px; }
  .top-stat > span { font-size: 8px; letter-spacing: .05em; }
  .top-stat > b { gap: 4px; margin-top: 2px; font-size: 11px; }
  .top-stat > small { margin-top: 1px; font-size: 8px; }
  .top-stat-primary b { font-size: 13px; }
  .trump-icon { width: 24px; height: 24px; border-radius: 7px; font-size: 15px; }
  .top-actions { gap: 4px; flex-wrap: nowrap; justify-content: flex-end; }
  .phase-chip { max-width: 92px; overflow: hidden; text-overflow: ellipsis; padding: 5px 7px; font-size: 8px; }
  .speed-control { gap: 0; }
  .speed-control span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
  .speed-control select { min-width: 74px; padding: 5px 7px; font-size: 10px; border-radius: 8px; }
  .ghost-button { min-height: 34px; padding: 6px 8px; font-size: 10px; border-radius: 8px; }

  .game-layout {
    grid-template-columns: 148px minmax(0,1fr);
    flex: 1 1 auto; min-height: 0; height: calc(100vh - 48px);
  }
  .helper-panel {
    order: 1; position: relative; height: 100%; min-height: 0; overflow: hidden;
    border-right: 1px solid rgba(255,255,255,.09); border-top: 0;
  }
  .helper-head { padding: 5px 7px 4px; gap: 4px; }
  .helper-head .eyebrow { display: none; }
  .helper-head strong { margin: 0; font-size: 14px; }
  .rule-badges { margin-top: 0; gap: 2px; justify-content: flex-end; }
  .rule-badge { padding: 2px 4px; font-size: 7px; }
  .helper-tabs { gap: 3px; padding: 4px; }
  .helper-tab { min-height: 29px; padding: 5px 2px; border-radius: 6px; font-size: 9px; }
  .helper-pane { max-height: none; padding: 5px; overflow-y: auto; }
  .score-list { gap: 4px; }
  .player-panel { grid-template-columns: 25px minmax(0,1fr) auto; gap: 5px; padding: 4px; border-radius: 8px; }
  .avatar { width: 25px; height: 25px; font-size: 8px; }
  .player-name { font-size: 10px; }
  .player-role { margin-top: 1px; font-size: 8px; }
  .player-count { padding: 3px 5px; font-size: 9px; }
  .seat-badge { margin-left: 2px; padding: 2px 4px; font-size: 7px; }
  .helper-explainer { margin-top: 5px; padding: 6px; border-radius: 8px; }
  .helper-explainer b { margin-top: 2px; font-size: 10px; }
  .helper-explainer p { margin-top: 3px; font-size: 9px; line-height: 1.25; }
  .calc-label { font-size: 8px; }
  .log > div { padding: 5px 2px; font-size: 9px; line-height: 1.25; }
  .rules-summary h4 { margin: 8px 0 3px; font-size: 11px; }
  .rules-summary p { font-size: 9px; line-height: 1.3; }
  .tutorial-coach { margin: 4px; padding: 6px; border-radius: 8px; }
  .tutorial-coach p, .coach-rule { font-size: 9px; line-height: 1.25; }

  .table-wrap {
    order: 2; height: 100%; min-height: 0; gap: 3px; overflow: hidden;
    display: grid; grid-template-rows: minmax(0,1fr) auto 84px;
  }
  .felt-table { border-width: 7px 9px 10px; }
  .felt-table::after { inset: 14px 15px 16px; }
  .table-stage { min-height: 0; padding: 3px 5px; }
  .center-brand { font-size: 28px; letter-spacing: .12em; }

  .bot-seat { width: 116px; gap: 2px; }
  .bot-seat.slot-left { left: 3px; top: 2px; }
  .bot-seat.slot-right { right: 3px; top: 2px; }
  .bot-seat.slot-top { top: 2px; }
  .nameplate { grid-template-columns: 24px minmax(0,1fr); gap: 4px; padding: 3px 5px; border-radius: 7px; }
  .nameplate .avatar { width: 24px; height: 24px; font-size: 8px; }
  .nameplate .player-name { font-size: 9px; }
  .nameplate .player-role { font-size: 7px; }
  .nameplate .player-count { display: none; }
  .bot-hand { height: 34px; }
  .bot-hand .card-back { width: 25px; height: 36px; margin-right: -14px; border-width: 1px; border-radius: 4px; }
  .seat-bubble { bottom: -8px; padding: 2px 5px; font-size: 7px; }

  .talon-zone, .discard-zone { bottom: 2px; }
  .talon-zone { left: 4px; width: 70px; }
  .discard-zone { right: 4px; width: 60px; }
  .zone-label { margin-bottom: 2px; font-size: 7px; }
  .talon-stack, .discard-stack { height: 45px; }
  .card-back { width: 31px; height: 44px; border-width: 1px; border-radius: 4px; }
  .card-back span { font-size: 6px; }
  .talon-stack .talon-back { left: 18px; }
  .trump-card .card { width: 31px; height: 44px; border-radius: 4px; }
  .trump-card .card .corner b { font-size: 8px; }
  .trump-card .card .corner i { font-size: 7px; }
  .trump-card .card .pip { font-size: 17px; }
  .talon-count { margin-top: 2px; padding: 2px 5px; font-size: 8px; }
  .talon-empty { width: 31px; height: 44px; font-size: 6px; }

  .table-cards { width: min(330px,62%); top: 57%; gap: 3px 5px; }
  .table-pair, .table-pair .card { width: 40px; height: 56px; }
  .table-pair .card { border-radius: 5px; }
  .table-pair .card.defense-card { transform: translate(9px,10px) rotate(7deg); }
  .table-pair .card .corner b { font-size: 9px; }
  .table-pair .card .corner i { font-size: 8px; }
  .table-pair .card .pip { font-size: 20px; }
  .table-empty { font-size: 9px; }

  .action-bar {
    flex: none; width: calc(100% - 10px); min-height: 0; height: auto;
    padding: 5px 7px; border-radius: 9px;
  }
  .action-content { display: grid; grid-template-columns: minmax(130px,1fr) auto; align-items: center; column-gap: 6px; }
  .status-text { min-height: 0; margin: 0; font-size: 11px; line-height: 1.2; }
  .beginner-tip { grid-column: 1/-1; margin: 3px 0 0; padding: 3px 6px; max-height: 28px; overflow-y: auto; font-size: 9px; line-height: 1.2; }
  .controls { justify-content: flex-end; gap: 4px; flex-wrap: nowrap; }
  .action { min-height: 34px; padding: 6px 9px; border-radius: 8px; font-size: 10px; white-space: nowrap; }

  .human-hand-slot { flex: none; height: 84px; margin: 0 6px 4px; min-height: 0; }
  .human-hand { min-height: 0; height: 84px; padding: 6px 4px 6px; align-items: flex-end; }
  .card { width: 50px; height: 70px; margin-left: -13px; border-radius: 6px; }
  .corner.top { top: 4px; left: 5px; }
  .corner.bottom { bottom: 4px; right: 5px; }
  .corner b { font-size: 11px; }
  .corner i { font-size: 10px; }
  .pip { font-size: 25px; }
  .human-hand .card.playable:hover { transform: translateY(calc(var(--fan-y,0px) - 6px)) rotate(var(--fan-angle,0deg)); }
  .card.selected { transform: translateY(calc(var(--fan-y,0px) - 8px)) rotate(var(--fan-angle,0deg)) !important; }

  .settings-modal, .result-modal { padding: 6px; }
  .settings-card { max-height: calc(100vh - 12px); padding: 10px; }
  .settings-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
  .settings-grid section { padding: 8px; }
  .toggle-row, .select-row { padding: 6px 0; }
  .toggle-row input { width: 20px; height: 20px; }
  .toggle-row b, .select-row b { font-size: 11px; }
  .toggle-row small, .select-row small { font-size: 9px; }
}

/* shared-menu additions */
.menu-button .menu-copy{display:grid;gap:2px;min-width:0;text-align:left}
.menu-button .menu-copy b{font:inherit;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.menu-button .menu-copy small{display:block;color:#82948a;font-size:9px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
@media (orientation:landscape) and (max-height:520px) and (max-width:1000px){.menu-button .menu-copy small{display:none}}
