:root {
  --ink: #f4f0e7;
  --muted: #aab6ad;
  --panel: rgba(9, 26, 22, 0.9);
  --panel-soft: rgba(15, 39, 33, 0.78);
  --line: rgba(255, 255, 255, 0.1);
  --green-950: #04110e;
  --green-900: #071c17;
  --green-800: #0b2a21;
  --green-700: #104333;
  --gold: #d9b66f;
  --gold-bright: #f0cf83;
  --red: #ce645e;
  --blue: #76a8ba;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --card-w: clamp(68px, 7.1vw, 104px);
  --card-h: calc(var(--card-w) * 1.716);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--green-950);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 16% 4%, rgba(36, 104, 78, 0.22), transparent 30rem),
    radial-gradient(circle at 80% 70%, rgba(218, 182, 111, 0.08), transparent 28rem),
    var(--green-950);
  overflow-x: hidden;
}

button, select, input { font: inherit; }

button { color: inherit; }

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(240, 207, 131, 0.6);
  outline-offset: 3px;
}

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.025;
  pointer-events: none;
  z-index: 99;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E");
}

.topbar {
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 17, 14, 0.72);
  backdrop-filter: blur(22px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #152017;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 900;
  background: linear-gradient(145deg, var(--gold-bright), #ad8242);
  box-shadow: inset 0 1px rgba(255,255,255,.55), 0 8px 24px rgba(0,0,0,.25);
}

.brand strong {
  display: block;
  letter-spacing: .08em;
  font-size: 15px;
}

.brand small {
  display: block;
  font-size: 9px;
  letter-spacing: .28em;
  color: var(--gold);
  margin-top: 2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button, .soft-button, .primary-button, .text-button, .exchange-button, .draw-button {
  border: 0;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}

.icon-button:hover, .soft-button:hover, .primary-button:hover, .exchange-button:hover, .draw-button:hover {
  transform: translateY(-2px);
}

.icon-button {
  width: 39px;
  height: 39px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}

.soft-button {
  height: 39px;
  padding: 0 17px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  font-weight: 750;
  font-size: 13px;
}

.primary-button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 13px;
  color: #151a14;
  background: linear-gradient(145deg, var(--gold-bright), #c89c54);
  box-shadow: 0 10px 30px rgba(210, 169, 93, 0.18), inset 0 1px rgba(255,255,255,.5);
  font-weight: 900;
}

.primary-button.compact {
  min-height: 39px;
  padding: 0 17px;
  font-size: 13px;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 16px;
  width: min(1780px, 100%);
  margin: 0 auto;
  padding: 16px;
  min-height: calc(100vh - 78px);
}

.table-panel {
  min-height: 760px;
  overflow: hidden;
  position: relative;
  display: grid;
  grid-template-rows: 190px minmax(360px, 1fr) 210px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 28px;
  background:
    radial-gradient(ellipse at center, rgba(30, 115, 80, .32), transparent 60%),
    linear-gradient(145deg, #0a3428, #071e19 70%);
  box-shadow: var(--shadow), inset 0 0 90px rgba(0,0,0,.22);
}

.table-panel::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(217, 182, 111, .17);
  border-radius: 20px;
  pointer-events: none;
}

.table-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.013) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.013) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle, black, transparent 82%);
}

.table-glow {
  position: absolute;
  width: 48%;
  aspect-ratio: 1;
  border-radius: 50%;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  background: rgba(124, 204, 162, .06);
  filter: blur(45px);
  pointer-events: none;
}

.opponent-zone, .player-zone {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.opponent-zone {
  padding-top: 20px;
  justify-content: flex-start;
}

.player-zone {
  justify-content: flex-end;
  padding-bottom: 16px;
}

.player-badge {
  min-width: 236px;
  min-height: 54px;
  padding: 7px 12px 7px 7px;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(3, 15, 12, .64);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0,0,0,.2);
}

.player-badge.opponent { margin-bottom: 12px; }

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .04em;
}

.ai-avatar {
  color: #13221e;
  background: linear-gradient(145deg, #9ccabb, #5f9986);
}

.human-avatar {
  color: #201c13;
  background: linear-gradient(145deg, var(--gold-bright), #b98c48);
}

.eyebrow {
  display: block;
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
  margin-bottom: 2px;
}

.player-badge strong {
  display: block;
  font-size: 14px;
}

.turn-pill {
  opacity: 0;
  padding: 5px 7px;
  border-radius: 99px;
  color: #d9f7e9;
  background: rgba(87, 177, 136, .16);
  border: 1px solid rgba(108, 210, 162, .24);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .08em;
  transition: opacity .2s ease;
}

.turn-pill.visible { opacity: 1; }

.hand {
  display: flex;
  justify-content: center;
  min-height: var(--card-h);
  padding-inline: 60px;
}

.opponent-hand {
  transform: scale(.72);
  transform-origin: top center;
  min-height: calc(var(--card-h) * .72);
  margin-bottom: -42px;
}

.opponent-hand .playing-card {
  margin-left: calc(var(--card-w) * -.5);
}

.opponent-hand .playing-card:first-child { margin-left: 0; }

.player-hand {
  width: 100%;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  padding-top: 16px;
  min-height: calc(var(--card-h) + 34px);
}

.player-hand .playing-card {
  margin-left: calc(var(--card-w) * -.22);
}

.player-hand .playing-card:first-child { margin-left: 0; }

.playing-card {
  width: var(--card-w);
  height: var(--card-h);
  flex: 0 0 auto;
  position: relative;
  padding: 0;
  border: 0;
  border-radius: calc(var(--card-w) * .1);
  color: #161713;
  background: #f8f3e8;
  box-shadow:
    0 15px 24px rgba(0,0,0,.3),
    inset 0 0 0 1px rgba(35,25,10,.13),
    inset 0 0 24px rgba(118,82,28,.06);
  overflow: hidden;
  transform-origin: bottom center;
  transition: transform .18s ease, filter .18s ease, opacity .18s ease, box-shadow .18s ease;
}

button.playing-card { cursor: pointer; }

.player-hand .playing-card,
.opponent-hand .playing-card {
  transform: translateX(var(--rest-x, 0px)) translateY(var(--rest-y, 0px)) rotate(var(--rest-rotate, 0deg));
}

button.playing-card:hover:not(:disabled) {
  transform: translateX(var(--rest-x, 0px)) translateY(calc(var(--rest-y, 0px) - 20px)) rotate(var(--rest-rotate, 0deg)) scale(1.02);
  box-shadow: 0 24px 35px rgba(0,0,0,.4), 0 0 0 2px var(--gold-bright);
  z-index: 20;
}

button.playing-card:disabled {
  cursor: not-allowed;
}

button.playing-card.illegal {
  filter: saturate(.65) brightness(.67);
  opacity: .78;
}

.dragging-card {
  opacity: .38 !important;
  transform: translateX(var(--rest-x, 0px)) translateY(calc(var(--rest-y, 0px) - 26px)) rotate(var(--rest-rotate, 0deg)) scale(1.05) !important;
}

.playing-card.selected-play {
  animation: cardPlay .38s ease both;
}

@keyframes cardPlay {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(-40px) scale(.9); opacity: .25; }
}

.card-face {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255,255,255,.75), transparent 45%),
    #f7f1e3;
}

.card-face::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(45, 32, 17, .16);
  border-radius: calc(var(--card-w) * .065);
}

.card-corner {
  position: absolute;
  top: 9%;
  left: 10%;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: .9;
  z-index: 2;
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: calc(var(--card-w) * .19);
}

.card-corner.bottom {
  top: auto;
  left: auto;
  right: 10%;
  bottom: 9%;
  transform: rotate(180deg);
}

.card-corner svg {
  width: calc(var(--card-w) * .18);
  height: calc(var(--card-w) * .18);
  margin-top: 3px;
}

.card-art {
  position: absolute;
  inset: 18% 13%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4%;
  z-index: 1;
}

.card-art svg {
  width: 54%;
  height: 54%;
  filter: drop-shadow(0 4px 2px rgba(0,0,0,.12));
}

.card-art .rank-word {
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: calc(var(--card-w) * .16);
  letter-spacing: .08em;
}

.card-art .court-badge {
  width: 72%;
  aspect-ratio: .8;
  border: 2px solid currentColor;
  display: grid;
  place-items: center;
  border-radius: 50% 50% 46% 46%;
  font-family: Georgia, serif;
  font-weight: 900;
  font-size: calc(var(--card-w) * .36);
  background: rgba(255,255,255,.36);
}

.card-art .pip-row {
  width: 92%;
  display: flex;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}

.card-art .pip-row svg {
  width: 28%;
  height: auto;
}

.suit-oros { color: #b67d16; }
.suit-copas { color: #a83f36; }
.suit-espadas { color: #315a6b; }
.suit-bastos { color: #4f7544; }

.card-back {
  position: absolute;
  inset: 0;
  padding: 8%;
  background: #efe8d7;
}

.card-back::before {
  content: "";
  position: absolute;
  inset: 7%;
  border-radius: calc(var(--card-w) * .065);
  border: 2px solid rgba(234, 202, 132, .85);
  background:
    radial-gradient(circle at center, transparent 0 13%, rgba(236,202,126,.75) 13.5% 15%, transparent 15.5%),
    repeating-conic-gradient(from 45deg, #153d31 0 12.5%, #0b2b23 0 25%);
  box-shadow: inset 0 0 0 4px #12362b, inset 0 0 0 6px rgba(234, 202, 132, .8);
}

.card-back::after {
  content: "T";
  position: absolute;
  inset: 30%;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ead096;
  border: 2px solid #d8b96f;
  background: #0c2f26;
  font-family: Georgia, serif;
  font-size: calc(var(--card-w) * .3);
  font-weight: 900;
  box-shadow: 0 0 0 4px #0c2f26, 0 0 0 6px #d8b96f;
}

.table-center {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
}

.status-strip {
  min-height: 31px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(2,12,10,.45);
  backdrop-filter: blur(12px);
}

.status-strip span {
  padding: 3px 7px;
  border-radius: 99px;
  color: #d5f4e5;
  background: rgba(88,177,135,.15);
  font-size: 8px;
  letter-spacing: .08em;
  font-weight: 900;
}

.status-strip span.strict {
  color: #ffe4c3;
  background: rgba(204, 130, 68, .17);
}

.status-strip strong {
  font-size: 11px;
  font-weight: 750;
  color: #dbe6df;
}

.play-area {
  flex: 1;
  width: min(820px, 95%);
  display: grid;
  grid-template-columns: 155px minmax(320px, 1fr) 70px;
  align-items: center;
}

.deck-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.deck-stack {
  width: calc(var(--card-w) * .58);
  height: calc(var(--card-h) * .58);
  position: relative;
}

.deck-stack::before, .deck-stack::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: #e8e0ce;
  border: 1px solid rgba(0,0,0,.25);
}

.deck-stack::before { transform: translate(6px, -5px); }
.deck-stack::after { transform: translate(3px, -2px); }

.mini-card {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: 7px;
  overflow: hidden;
  background:
    radial-gradient(circle at center, transparent 0 13%, rgba(236,202,126,.75) 13.5% 15%, transparent 15.5%),
    repeating-conic-gradient(from 45deg, #153d31 0 12.5%, #0b2b23 0 25%);
  border: 4px solid #e6decf;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}

.deck-count {
  position: absolute;
  z-index: 4;
  bottom: -8px;
  right: -8px;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border-radius: 99px;
  color: #1c1b14;
  background: var(--gold-bright);
  font-size: 11px;
  font-weight: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}

.trump-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.trump-wrap > span {
  color: var(--gold);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
}

.trump-wrap .playing-card {
  width: calc(var(--card-w) * .58);
  height: calc(var(--card-h) * .58);
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}

.trump-wrap .card-corner {
  font-size: calc(var(--card-w) * .11);
}

.trump-wrap .card-corner svg {
  width: calc(var(--card-w) * .11);
  height: calc(var(--card-w) * .11);
}

.trump-wrap .card-art .rank-word { font-size: calc(var(--card-w) * .09); }
.trump-wrap .card-art .court-badge { font-size: calc(var(--card-w) * .2); }

.trick-area {
  display: grid;
  grid-template-columns: 1fr 30px 1fr;
  align-items: center;
  justify-items: center;
  gap: 8px;
}

.trick-slot {
  width: calc(var(--card-w) * 1.15);
  height: calc(var(--card-h) * 1.02);
  display: grid;
  place-items: center;
  position: relative;
  border: 1px dashed rgba(255,255,255,.13);
  border-radius: 16px;
  background: rgba(1, 12, 9, .13);
}

.trick-slot .playing-card {
  --card-w: clamp(72px, 7.5vw, 110px);
  transform: rotate(var(--play-rotation, 0deg));
  animation: tableDrop .34s cubic-bezier(.2,.8,.2,1) both;
}

.opponent-slot .playing-card { --play-rotation: 2.5deg; }
.player-slot .playing-card { --play-rotation: -2deg; }

@keyframes tableDrop {
  from { opacity: 0; transform: translateY(var(--drop-y, -24px)) rotate(var(--play-rotation)) scale(.8); }
  to { opacity: 1; transform: translateY(0) rotate(var(--play-rotation)) scale(1); }
}

.slot-label {
  color: rgba(255,255,255,.27);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.versus-mark {
  color: rgba(255,255,255,.27);
  font-family: Georgia, serif;
  font-size: 22px;
}

.action-dock {
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.action-dock p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.cante-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cante-button, .pass-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(240,207,131,.32);
  background: rgba(217,182,111,.12);
  color: #f6e4b7;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.pass-button {
  border-color: var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
}

.exchange-button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  color: #d8f1e3;
  background: rgba(77, 151, 116, .17);
  border: 1px solid rgba(105, 192, 150, .25);
  font-size: 11px;
  font-weight: 850;
}

.hidden { display: none !important; }

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.score-card, .intel-card, .log-card {
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(17,48,40,.94), rgba(7,26,22,.94));
  box-shadow: 0 18px 50px rgba(0,0,0,.18);
}

.score-card { padding: 22px; }
.intel-card { padding: 20px; }
.log-card { padding: 20px; flex: 1; min-height: 220px; }

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 700;
}

.section-heading.small h2 { font-size: 19px; }

.round-number {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .08em;
}

.match-score {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin: 22px 0;
  text-align: center;
}

.match-score span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
}

.match-score strong {
  display: block;
  font-family: Georgia, serif;
  color: var(--gold-bright);
  font-size: 44px;
  line-height: 1;
  margin-top: 4px;
}

.score-divider {
  color: rgba(255,255,255,.25);
  font-size: 24px;
}

.score-detail {
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.12);
}

.score-row {
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.score-row strong { color: var(--ink); }

.score-row.total {
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 850;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin: 16px 0 8px;
  color: var(--muted);
  font-size: 10px;
}

.progress-labels strong { color: var(--ink); }

.round-pips {
  display: grid;
  grid-template-columns: repeat(var(--pip-count, 3), 1fr);
  gap: 6px;
}

.round-pip {
  height: 5px;
  border-radius: 99px;
  background: rgba(255,255,255,.08);
}

.round-pip.player { background: var(--gold); }
.round-pip.ai { background: #6e9f91; }

.intel-card > p {
  margin: 10px 0 17px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.live-dot {
  width: 8px;
  height: 8px;
  margin-top: 10px;
  border-radius: 50%;
  background: #6cc99f;
  box-shadow: 0 0 0 5px rgba(108,201,159,.1);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}

.mini-stats div {
  padding: 10px 6px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(0,0,0,.11);
}

.mini-stats span {
  display: block;
  color: var(--muted);
  font-size: 8px;
}

.mini-stats strong {
  display: block;
  margin-top: 3px;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 18px;
}

.game-log {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
  scrollbar-width: thin;
}

.log-entry {
  position: relative;
  padding: 8px 8px 8px 18px;
  border-bottom: 1px solid rgba(255,255,255,.055);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.log-entry::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(217,182,111,.55);
}

.log-entry strong { color: var(--ink); }

.modal {
  width: min(760px, calc(100% - 28px));
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  overflow: visible;
}

.modal::backdrop {
  background: rgba(1,8,6,.79);
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 28px;
  background:
    radial-gradient(circle at 80% 0%, rgba(217,182,111,.1), transparent 19rem),
    linear-gradient(145deg, #11372d, #071c17 68%);
  box-shadow: 0 40px 100px rgba(0,0,0,.58);
}

.close-modal {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
}

.modal-card h1 {
  margin: 5px 0 8px;
  font-family: Georgia, serif;
  font-size: clamp(34px, 6vw, 58px);
  line-height: .98;
  font-weight: 700;
}

.modal-copy {
  max-width: 580px;
  margin: 0 0 26px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}

.choice-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}

.choice-group legend {
  width: 100%;
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.choice-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.1);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

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

.choice-card.selected {
  border-color: rgba(240,207,131,.58);
  background: rgba(217,182,111,.09);
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-icon {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--gold-bright);
  background: rgba(217,182,111,.1);
  font-size: 10px;
  font-weight: 900;
}

.choice-card strong {
  display: block;
  font-size: 13px;
}

.choice-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.setup-grid {
  display: grid;
  grid-template-columns: .85fr 1.15fr;
  gap: 10px;
  margin-bottom: 18px;
}

.setup-grid > label {
  min-height: 70px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0,0,0,.1);
}

.setup-grid > label > span:first-child,
.toggle-row > span > strong {
  display: block;
  font-size: 11px;
  font-weight: 850;
}

.setup-grid select {
  width: 100%;
  margin-top: 7px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12px;
}

.setup-grid select option { color: #111; }

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.toggle-row small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-size: 9px;
}

.toggle-row input {
  appearance: none;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 99px;
  background: rgba(255,255,255,.12);
  position: relative;
  cursor: pointer;
  transition: background .18s ease;
}

.toggle-row input::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}

.toggle-row input:checked { background: #5d9c80; }
.toggle-row input:checked::after { transform: translateX(18px); }

.start-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
}

.rules-content { width: 100%; }

.rules-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 24px 0;
}

.rules-grid article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(0,0,0,.1);
}

.rule-number {
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 12px;
}

.rules-grid h3 {
  margin: 8px 0 6px;
  font-size: 13px;
}

.rules-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.result-modal { width: min(520px, calc(100% - 28px)); }
.result-card { text-align: center; }

.result-kicker {
  color: var(--gold);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .18em;
}

.result-emblem {
  width: 72px;
  height: 72px;
  margin: 18px auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #172018;
  background: linear-gradient(145deg, var(--gold-bright), #ad8041);
  font-family: Georgia, serif;
  font-size: 35px;
  font-weight: 900;
  box-shadow: 0 14px 35px rgba(0,0,0,.35);
}

.result-card h1 {
  font-size: clamp(33px, 7vw, 50px);
}

.result-card > p {
  color: var(--muted);
  line-height: 1.55;
  font-size: 12px;
}

.result-score {
  margin: 22px 0;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.12);
}

.result-score span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
}

.result-score strong {
  display: block;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 32px;
}

.result-score-separator { color: rgba(255,255,255,.23); }

.text-button {
  margin-top: 15px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.toast-region {
  position: fixed;
  top: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  min-width: 250px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(5,24,19,.94);
  box-shadow: 0 15px 38px rgba(0,0,0,.38);
  color: var(--ink);
  font-size: 11px;
  animation: toastIn .25s ease both;
}

.toast strong { color: var(--gold-bright); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .log-card { grid-column: 1 / -1; }
  .table-panel { min-height: 720px; }
}

@media (max-width: 720px) {
  :root { --card-w: clamp(61px, 18vw, 88px); }

  .topbar { height: 66px; padding-inline: 12px; }
  .brand small { display: none; }
  .soft-button { display: none; }
  .primary-button.compact { font-size: 0; width: 40px; padding: 0; }
  .primary-button.compact::after { content: "+"; font-size: 22px; }
  .app-shell { min-height: calc(100vh - 66px); padding: 8px; }
  .table-panel {
    min-height: 690px;
    grid-template-rows: 160px minmax(330px, 1fr) 190px;
    border-radius: 20px;
  }
  .table-panel::before { inset: 10px; border-radius: 14px; }
  .player-badge { min-width: 205px; }
  .hand { padding-inline: 9px; }
  .player-hand .playing-card { margin-left: calc(var(--card-w) * -.34); }
  .opponent-hand .playing-card { margin-left: calc(var(--card-w) * -.58); }
  .play-area {
    grid-template-columns: 95px minmax(210px, 1fr);
    width: 97%;
  }
  .deck-area { gap: 8px; }
  .trick-area { grid-template-columns: 1fr 15px 1fr; }
  .trick-slot {
    width: calc(var(--card-w) * 1.02);
    height: calc(var(--card-h) * 1.02);
  }
  .action-dock p { max-width: 270px; text-align: center; }
  .side-panel { grid-template-columns: 1fr; }
  .log-card { grid-column: auto; }
  .choice-group, .rules-grid, .setup-grid { grid-template-columns: 1fr; }
  .choice-card { min-height: 84px; flex-direction: row; align-items: center; }
  .modal-card { padding: 27px 20px; }
}

@media (max-width: 430px) {
  :root { --card-w: 65px; }
  .brand strong { font-size: 13px; }
  .topbar-actions { gap: 6px; }
  .table-panel { min-height: 650px; grid-template-rows: 145px minmax(315px, 1fr) 175px; }
  .opponent-zone { padding-top: 12px; }
  .player-zone { padding-bottom: 8px; }
  .player-hand { overflow-x: auto; justify-content: flex-start; padding-inline: 14px; }
  .player-hand .playing-card { margin-left: -16px; }
  .player-hand .playing-card:first-child { margin-left: 0; }
  .play-area { grid-template-columns: 78px minmax(190px, 1fr); }
  .deck-area { transform: scale(.88); transform-origin: left center; }
  .status-strip strong { max-width: 190px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}


/* Baraja personalizada integrada desde las cuatro láminas del usuario · v8 */
.playing-card {
  background: transparent;
  box-shadow: 0 18px 28px rgba(0,0,0,.36);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), filter .22s ease, opacity .22s ease, box-shadow .22s ease;
}
.card-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
  user-select: none;
  pointer-events: none;
}
.trump-wrap .card-image { border-radius: 6px; }


/* ─────────────────────────────────────────────
   Flujo manual: reparto y robo físico
   ───────────────────────────────────────────── */
.deck-stack {
  cursor: default;
  transition: transform .2s ease, filter .2s ease, opacity .2s ease;
}

.deck-stack.draw-ready {
  cursor: pointer;
  animation: drawDeckPulse 1.05s ease-in-out infinite;
  filter: drop-shadow(0 0 14px rgba(240, 207, 131, .52));
}

.deck-stack.draw-ready .mini-card {
  box-shadow:
    0 8px 18px rgba(0,0,0,.28),
    0 0 0 3px rgba(240, 207, 131, .55),
    0 0 26px rgba(240, 207, 131, .32);
}

.deck-stack.draw-ready::after {
  content: "ROBAR";
  position: absolute;
  left: 50%;
  bottom: -34px;
  transform: translateX(-50%);
  padding: 5px 8px;
  border-radius: 99px;
  color: #211b10;
  background: var(--gold-bright);
  box-shadow: 0 5px 16px rgba(0,0,0,.34);
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: .11em;
  z-index: 8;
}

@keyframes drawDeckPulse {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-6px) rotate(-1deg) scale(1.045); }
}

.draw-button {
  min-height: 42px;
  padding: 0 17px 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 13px;
  border: 1px solid rgba(240,207,131,.48);
  color: #261d0f;
  background: linear-gradient(145deg, #f1d18a, #c99442);
  box-shadow: 0 10px 26px rgba(204,151,65,.22), inset 0 1px rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .025em;
}

.draw-button-card {
  width: 20px;
  height: 29px;
  border-radius: 3px;
  background:
    radial-gradient(circle at center, transparent 0 16%, rgba(236,202,126,.82) 17% 20%, transparent 21%),
    repeating-conic-gradient(from 45deg, #153d31 0 12.5%, #0b2b23 0 25%);
  border: 2px solid #f4ead6;
  box-shadow: 2px 2px 0 rgba(10,37,29,.42);
  transform: rotate(-7deg);
}

.flight-card {
  position: fixed !important;
  z-index: 1000 !important;
  width: clamp(66px, 7vw, 100px) !important;
  height: calc(clamp(66px, 7vw, 100px) * 1.716) !important;
  margin: 0 !important;
  pointer-events: none !important;
  will-change: transform, opacity;
  filter: drop-shadow(0 24px 24px rgba(0,0,0,.46));
}

.table-flight {
  z-index: 1100 !important;
}

.newly-drawn {
  animation: newlyDrawnCard .86s cubic-bezier(.2,.78,.18,1) both;
  box-shadow:
    0 18px 30px rgba(0,0,0,.34),
    0 0 0 3px rgba(240,207,131,.7),
    0 0 30px rgba(240,207,131,.34) !important;
  z-index: 40 !important;
}

@keyframes newlyDrawnCard {
  0% { transform: translateX(var(--rest-x, 0px)) translateY(calc(var(--rest-y, 0px) - 34px)) rotate(calc(var(--rest-rotate, 0deg) - 6deg)) scale(.82); opacity: .25; }
  55% { transform: translateX(var(--rest-x, 0px)) translateY(calc(var(--rest-y, 0px) - 18px)) rotate(calc(var(--rest-rotate, 0deg) + 3deg)) scale(1.08); opacity: 1; }
  100% { transform: translateX(var(--rest-x, 0px)) translateY(var(--rest-y, 0px)) rotate(var(--rest-rotate, 0deg)) scale(1); opacity: 1; }
}

.trump-wrap .playing-card {
  animation: revealTrump .52s cubic-bezier(.2,.75,.18,1) both;
  transform-origin: center;
}

@keyframes revealTrump {
  from { transform: rotateY(88deg) scale(.75); opacity: .2; }
  to { transform: rotateY(0deg) scale(1); opacity: 1; }
}

@media (max-width: 720px) {
  .flight-card {
    width: 68px !important;
    height: 101px !important;
  }

  .draw-button {
    min-height: 46px;
    font-size: 12px;
  }

  .deck-stack.draw-ready::after {
    bottom: -31px;
  }
}

/* Créditos de la baraja fotográfica */
.art-credit {
  margin: 2px 0 18px;
  padding: 12px 14px;
  border: 1px solid rgba(255,255,255,.09);
  border-radius: 13px;
  background: rgba(0,0,0,.12);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}
.art-credit a {
  color: var(--gold-bright);
  text-underline-offset: 3px;
}

.player-zone { position: relative; }
.player-hand::after {
  content: "Arrastra para ordenar tu mano";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.38);
  font-size: 9px;
  letter-spacing: .08em;
  font-weight: 700;
  pointer-events: none;
}

/* =========================================================
   V7 — Mesa física, baraja artesanal y movimiento natural
   ========================================================= */
:root {
  --card-w: clamp(76px, 7.4vw, 112px);
  --card-h: calc(var(--card-w) * 1.716);
}

.table-panel {
  background:
    radial-gradient(ellipse at 50% 46%, rgba(57, 141, 99, .22), transparent 50%),
    radial-gradient(circle at 18% 14%, rgba(255,255,255,.035), transparent 22rem),
    repeating-linear-gradient(0deg, rgba(255,255,255,.008) 0 1px, transparent 1px 4px),
    linear-gradient(145deg, #0a392b, #06261e 72%, #041b16);
  box-shadow:
    0 28px 80px rgba(0,0,0,.44),
    inset 0 0 0 8px rgba(5,18,15,.45),
    inset 0 0 110px rgba(0,0,0,.32);
}

.table-panel::before {
  inset: 16px;
  border: 2px solid rgba(217,182,111,.2);
  box-shadow: inset 0 0 0 5px rgba(0,0,0,.16), 0 0 0 1px rgba(255,255,255,.025);
}

.table-panel::after {
  opacity: .58;
  background-image:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.018) 0 1px, transparent 1.4px),
    linear-gradient(90deg, rgba(255,255,255,.009) 1px, transparent 1px);
  background-size: 7px 7px, 31px 31px;
}

.player-zone,
.opponent-zone {
  overflow: visible;
}

.hand {
  position: relative;
  overflow: visible;
  isolation: isolate;
}

.player-hand {
  width: min(96%, 980px);
  min-height: calc(var(--card-h) + 52px);
  align-items: flex-end;
  justify-content: center;
  padding: 22px 40px 2px;
  touch-action: none;
}

.player-hand .playing-card {
  margin-left: calc(var(--card-w) * -.23);
  transform:
    translateX(var(--rest-x, 0px))
    translateY(var(--rest-y, 0px))
    rotate(var(--rest-rotate, 0deg));
  transform-origin: 50% 118%;
  cursor: grab;
  touch-action: none;
  transition:
    transform .28s cubic-bezier(.18,.82,.18,1),
    filter .22s ease,
    opacity .2s ease,
    box-shadow .22s ease;
}

.player-hand .playing-card:first-child { margin-left: 0; }
.player-hand .playing-card:active,
.player-hand .playing-card.card-pressed { cursor: grabbing; }

.player-hand .playing-card:hover:not(.gesture-source) {
  transform:
    translateX(var(--rest-x, 0px))
    translateY(calc(var(--rest-y, 0px) - 24px))
    rotate(calc(var(--rest-rotate, 0deg) * .58))
    scale(1.035);
  box-shadow: 0 28px 40px rgba(0,0,0,.48), 0 0 0 2px rgba(240,207,131,.72);
  z-index: 80 !important;
}

.player-hand .playing-card.illegal {
  opacity: .72;
  filter: saturate(.68) brightness(.78);
}

.player-hand .playing-card.illegal:hover {
  opacity: .9;
  filter: saturate(.88) brightness(.92);
}

.gesture-source {
  opacity: .2 !important;
  filter: grayscale(.2) !important;
}

.source-in-flight {
  opacity: 0 !important;
  transition: opacity .08s linear !important;
}

.hand-drag-ghost {
  position: fixed !important;
  z-index: 1600 !important;
  margin: 0 !important;
  pointer-events: none !important;
  transform: translate(-50%, -88%) rotate(-3deg) scale(1.08) !important;
  transform-origin: center !important;
  opacity: .98 !important;
  filter: drop-shadow(0 28px 30px rgba(0,0,0,.55)) !important;
  box-shadow: 0 0 0 3px rgba(240,207,131,.68) !important;
}

.hand-drop-marker {
  position: absolute;
  z-index: 1500;
  bottom: 25px;
  width: 4px;
  height: calc(var(--card-h) * .72);
  border-radius: 99px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, transparent, var(--gold-bright) 18% 82%, transparent);
  box-shadow: 0 0 18px rgba(240,207,131,.8);
  pointer-events: none;
  animation: markerPulse .65s ease-in-out infinite alternate;
}

@keyframes markerPulse {
  from { opacity: .55; scale: .9 1; }
  to { opacity: 1; scale: 1.2 1; }
}

.reordering-hand,
.reordering-hand * { cursor: grabbing !important; }

.manual-order-hint {
  min-height: 22px;
  margin-top: 2px;
  padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 999px;
  color: rgba(236,244,238,.42);
  background: rgba(1,13,10,.2);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .045em;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.manual-order-hint.visible {
  opacity: 1;
  transform: translateY(0);
}

.manual-order-hint span {
  margin-right: 5px;
  color: var(--gold);
  font-size: 13px;
}

.opponent-hand {
  transform: scale(.76);
  transform-origin: top center;
}

.opponent-hand .playing-card {
  transform: translateY(var(--rest-y, 0px)) rotate(var(--rest-rotate, 0deg));
  transform-origin: 50% -20%;
  transition: transform .28s cubic-bezier(.18,.82,.18,1), opacity .2s ease;
}

.playing-card {
  height: var(--card-h);
  border-radius: calc(var(--card-w) * .075);
  background: transparent;
  box-shadow: 0 17px 30px rgba(0,0,0,.38);
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: inherit;
}

/* Baraja con profundidad física */
.deck-area {
  gap: 18px;
  perspective: 900px;
}

.deck-stack {
  width: calc(var(--card-w) * .63);
  height: calc(var(--card-h) * .63);
  transform-style: preserve-3d;
  filter: drop-shadow(0 12px 15px rgba(0,0,0,.3));
}

.deck-layer,
.deck-stack .mini-card {
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: #f3ead8;
  border: 1px solid rgba(38,26,12,.36);
  transition: opacity .25s ease, transform .3s cubic-bezier(.2,.8,.2,1);
}

.deck-layer.layer-four { transform: translate(9px, -8px) rotate(.8deg); }
.deck-layer.layer-three { transform: translate(7px, -6px) rotate(.55deg); }
.deck-layer.layer-two { transform: translate(5px, -4px) rotate(.3deg); }
.deck-layer.layer-one { transform: translate(3px, -2px) rotate(.12deg); }

.deck-stack::before,
.deck-stack::after { display: none; }

.deck-stack .mini-card {
  z-index: 6;
  overflow: hidden;
  border: 3px solid #f2eadb;
  background: transparent;
  box-shadow: 0 8px 20px rgba(0,0,0,.34);
}

.deck-stack .mini-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.deck-stack.deck-drawing .mini-card {
  animation: deckRelease .34s cubic-bezier(.2,.8,.2,1);
}

@keyframes deckRelease {
  0% { transform: translate(0,0) rotate(0); }
  45% { transform: translate(-7px,-9px) rotate(-3deg); }
  100% { transform: translate(0,0) rotate(0); }
}

.deck-stack.draw-ready {
  animation: deckReady 1.2s ease-in-out infinite;
}

@keyframes deckReady {
  0%,100% { transform: translateY(0) rotate(0); filter: drop-shadow(0 12px 15px rgba(0,0,0,.3)); }
  50% { transform: translateY(-7px) rotate(-1.2deg); filter: drop-shadow(0 15px 24px rgba(240,207,131,.42)); }
}

.deck-count {
  z-index: 12;
  bottom: -12px;
  right: -12px;
  min-width: 29px;
  height: 29px;
  font-size: 11px;
  border: 2px solid rgba(8,29,23,.8);
}

/* Cartas en mesa: pequeñas imperfecciones, no rejilla rígida */
.trick-area {
  gap: 16px;
}

.trick-slot {
  width: calc(var(--card-w) * 1.24);
  height: calc(var(--card-h) * 1.08);
  border-radius: 20px;
  border-color: rgba(255,255,255,.095);
  background: radial-gradient(circle, rgba(255,255,255,.028), transparent 70%);
}

.trick-slot .playing-card {
  --card-w: clamp(82px, 8vw, 118px);
  transform: translate(var(--play-x, 0px), var(--play-y, 0px)) rotate(var(--play-rotation, 0deg));
  animation: tableSettle .44s cubic-bezier(.15,.85,.2,1) both;
}

@keyframes tableSettle {
  0% { opacity: .15; scale: .82; translate: 0 -18px; }
  70% { opacity: 1; scale: 1.035; translate: 0 2px; }
  100% { opacity: 1; scale: 1; translate: 0 0; }
}

/* Vuelos con giro real de la carta */
.flight-card.flight-shell {
  position: fixed !important;
  z-index: 1400 !important;
  width: clamp(70px, 7.3vw, 108px) !important;
  height: calc(clamp(70px, 7.3vw, 108px) * 1.716) !important;
  margin: 0 !important;
  pointer-events: none !important;
  perspective: 950px;
  background: transparent !important;
  box-shadow: none !important;
  filter: drop-shadow(0 26px 26px rgba(0,0,0,.48));
  will-change: transform;
}

.flight-flipper {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.flight-flipper.show-back { transform: rotateY(180deg); }

.flight-face {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  backface-visibility: hidden;
  box-shadow: none !important;
}

.flight-back { transform: rotateY(180deg); }
.table-flight { z-index: 1450 !important; }

.capture-flight-card {
  position: fixed !important;
  z-index: 1350 !important;
  margin: 0 !important;
  pointer-events: none !important;
  filter: drop-shadow(0 20px 20px rgba(0,0,0,.4));
  will-change: transform, opacity;
}

/* Montones de bazas */
.capture-pile {
  position: absolute;
  z-index: 8;
  width: 50px;
  height: 68px;
  opacity: .5;
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}

.capture-pile.ai-capture { top: 104px; right: 44px; }
.capture-pile.player-capture { bottom: 112px; left: 44px; }

.capture-card {
  position: absolute;
  width: 34px;
  height: 50px;
  left: 7px;
  top: 6px;
  border-radius: 4px;
  border: 2px solid #eee3cd;
  background:
    radial-gradient(circle at center, transparent 0 15%, rgba(218,184,109,.75) 16% 19%, transparent 20%),
    repeating-conic-gradient(from 45deg, #12372c 0 12.5%, #09291f 0 25%);
  box-shadow: 0 7px 12px rgba(0,0,0,.28);
}

.capture-card.one { transform: rotate(-12deg); }
.capture-card.two { transform: translate(7px,3px) rotate(8deg); }
.capture-pile strong {
  position: absolute;
  right: -3px;
  bottom: -1px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #1b1b12;
  background: var(--gold-bright);
  border: 2px solid #0a2b22;
  font-size: 10px;
  font-weight: 1000;
  box-shadow: 0 5px 12px rgba(0,0,0,.35);
}

.capture-pile.has-cards { opacity: .95; }
.capture-pile.capture-bump { animation: captureBump .42s cubic-bezier(.2,.85,.2,1); }
@keyframes captureBump {
  0% { transform: scale(.88) rotate(-3deg); }
  58% { transform: scale(1.13) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

/* Pequeños acabados de interfaz */
.status-strip {
  box-shadow: 0 8px 22px rgba(0,0,0,.18), inset 0 1px rgba(255,255,255,.035);
}

.player-badge {
  box-shadow: 0 12px 30px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.035);
}

.score-card,
.intel-card,
.log-card {
  background:
    radial-gradient(circle at 90% 0%, rgba(217,182,111,.055), transparent 12rem),
    linear-gradient(145deg, rgba(17,48,40,.96), rgba(6,24,20,.96));
}

@media (max-width: 1100px) {
  .capture-pile.ai-capture { right: 30px; }
  .capture-pile.player-capture { left: 30px; }
}

@media (max-width: 720px) {
  :root {
    --card-w: clamp(62px, 18.5vw, 86px);
  }
  .player-hand {
    width: 100%;
    padding-inline: 12px;
    min-height: calc(var(--card-h) + 42px);
  }
  .player-hand .playing-card { margin-left: calc(var(--card-w) * -.34); }
  .manual-order-hint { margin-top: -4px; font-size: 8px; }
  .capture-pile { transform: scale(.8); }
  .capture-pile.ai-capture { top: 92px; right: 10px; }
  .capture-pile.player-capture { bottom: 92px; left: 10px; }
  .flight-card.flight-shell {
    width: 72px !important;
    height: 111px !important;
  }
  .trick-slot .playing-card { --card-w: 72px; }
}

@media (max-width: 430px) {
  .player-hand {
    overflow: visible;
    justify-content: center;
    padding-inline: 4px;
  }
  .player-hand .playing-card { margin-left: -23px; }
  .capture-pile { display: none; }
}

/* Ajustes finales de respiración y responsive */
.player-hand::after { content: none !important; }
.player-zone { padding-bottom: 34px; }
.player-hand { transform: translateY(-8px); }
.manual-order-hint { transform: translateY(-7px); }
.manual-order-hint.visible { transform: translateY(-7px); }

@media (max-width: 720px) {
  .table-panel {
    min-height: 780px;
    grid-template-rows: 185px 330px 265px;
  }
  .opponent-zone { padding-top: 14px; }
  .table-center { min-height: 330px; }
  .play-area {
    min-height: 235px;
    flex: 0 0 235px;
    align-items: center;
  }
  .action-dock {
    min-height: 78px;
    justify-content: flex-start;
    padding-top: 7px;
  }
  .action-dock p {
    max-width: 290px;
    line-height: 1.35;
  }
  .player-zone {
    justify-content: flex-start;
    padding: 2px 0 26px;
  }
  .player-zone .player-badge {
    margin-top: 0;
    margin-bottom: 2px;
  }
  .player-hand {
    width: 100%;
    min-height: 150px;
    padding: 12px 6px 0;
    transform: none;
  }
  .manual-order-hint,
  .manual-order-hint.visible {
    transform: translateY(-2px);
    margin-top: 0;
  }
}

@media (max-width: 430px) {
  :root { --card-w: 61px; }
  .table-panel {
    min-height: 765px;
    grid-template-rows: 180px 325px 260px;
  }
  .player-hand {
    min-height: 142px;
    padding-top: 10px;
  }
  .player-hand .playing-card { margin-left: -25px; }
  .player-hand .playing-card:first-child { margin-left: 0; }
  .player-hand .playing-card:hover:not(.gesture-source) {
    transform:
      translateX(var(--rest-x, 0px))
      translateY(calc(var(--rest-y, 0px) - 14px))
      rotate(calc(var(--rest-rotate, 0deg) * .62))
      scale(1.02);
  }
  .manual-order-hint { font-size: 7.5px; padding: 3px 8px; }
  .action-dock p { font-size: 10px; }
}

@media (min-width: 721px) {
  .table-panel {
    min-height: 840px;
    grid-template-rows: 190px minmax(320px, 1fr) 270px;
  }
  .player-zone {
    padding-bottom: 24px;
    justify-content: flex-start;
  }
  .player-zone .player-badge { margin-top: 4px; }
  .player-hand {
    transform: none;
    padding-top: 16px;
  }
  .manual-order-hint,
  .manual-order-hint.visible { transform: translateY(-2px); }
}

@media (min-width: 721px) {
  :root { --card-w: clamp(72px, 6.7vw, 102px); }
  .player-zone { padding-bottom: 38px; }
}

@media (min-width: 721px) {
  .table-panel { grid-template-rows: 190px minmax(300px, 1fr) 310px; }
  .player-zone { padding-bottom: 22px; }
}

/* V8 — cartas finales proporcionadas por el usuario */
.card-image {
  object-fit: fill;
  image-rendering: auto;
}
.playing-card {
  background: #fbf8ef;
}

/* =========================================================
   V10 — interacción física, hueco visible y mesa estable
   ========================================================= */

/* La carta original sale del flujo durante el arrastre y el hueco ocupa su lugar. */
.player-hand .gesture-source {
  width: 0 !important;
  min-width: 0 !important;
  flex-basis: 0 !important;
  margin-left: 0 !important;
  opacity: 0 !important;
  overflow: visible !important;
  pointer-events: none !important;
  box-shadow: none !important;
}

.hand-drop-slot {
  position: relative;
  align-self: flex-end;
  flex: 0 0 calc(var(--card-w) * .68);
  width: calc(var(--card-w) * .68);
  height: calc(var(--card-h) * .86);
  margin: 0 8px 8px 5px;
  border: 2px dashed rgba(240, 207, 131, .78);
  border-radius: calc(var(--card-w) * .075);
  background:
    linear-gradient(145deg, rgba(240,207,131,.11), rgba(240,207,131,.025)),
    rgba(3,19,15,.28);
  box-shadow:
    inset 0 0 0 3px rgba(240,207,131,.055),
    0 0 24px rgba(240,207,131,.2);
  pointer-events: none;
  animation: handSlotBreath .72s ease-in-out infinite alternate;
}

.hand-drop-slot b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
  color: rgba(250,229,180,.82);
  font-size: 8px;
  letter-spacing: .2em;
  font-weight: 1000;
  white-space: nowrap;
}

@keyframes handSlotBreath {
  from { opacity: .65; transform: translateY(5px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.hand-drag-ghost {
  transition: filter .16s ease, box-shadow .16s ease;
}

.dragging-to-table .hand-drag-ghost {
  filter: drop-shadow(0 34px 34px rgba(0,0,0,.62)) !important;
  box-shadow: 0 0 0 3px rgba(240,207,131,.82), 0 0 30px rgba(240,207,131,.28) !important;
}

/* Zona de juego amplia y explícita al arrastrar una carta hacia el tapete. */
.trick-area {
  position: relative;
}

.play-drop-indicator {
  position: absolute;
  z-index: 90;
  inset: -42px -68px;
  display: grid;
  place-items: center;
  border: 2px dashed transparent;
  border-radius: 30px;
  background: transparent;
  opacity: 0;
  transform: scale(.94);
  pointer-events: none;
  transition:
    opacity .18s ease,
    transform .22s cubic-bezier(.2,.8,.2,1),
    border-color .18s ease,
    background .18s ease,
    box-shadow .18s ease;
}

.play-drop-indicator span {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 13px;
  border-radius: 999px;
  color: #152017;
  background: var(--gold-bright);
  box-shadow: 0 10px 30px rgba(0,0,0,.32);
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: .12em;
  transform: translateY(2px);
}

.trick-area.play-drop-active .play-drop-indicator {
  opacity: 1;
  transform: scale(1);
}

.trick-area.play-drop-valid .play-drop-indicator {
  border-color: rgba(240,207,131,.72);
  background: radial-gradient(circle, rgba(240,207,131,.12), rgba(240,207,131,.025) 64%, transparent 72%);
  box-shadow: inset 0 0 44px rgba(240,207,131,.1), 0 0 34px rgba(240,207,131,.12);
}

.trick-area.play-drop-valid .player-slot {
  border-color: rgba(240,207,131,.8);
  background: rgba(240,207,131,.09);
  box-shadow: 0 0 28px rgba(240,207,131,.2);
}

.trick-area.play-drop-invalid .play-drop-indicator {
  border-color: rgba(211,91,82,.8);
  background: radial-gradient(circle, rgba(211,91,82,.12), rgba(211,91,82,.02) 64%, transparent 72%);
}

.trick-area.play-drop-invalid .play-drop-indicator span {
  color: #fff1ef;
  background: #a8423d;
}

.trick-area.play-drop-invalid .player-slot {
  border-color: rgba(211,91,82,.82);
  background: rgba(211,91,82,.09);
  box-shadow: 0 0 28px rgba(211,91,82,.18);
}

.trick-slot {
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

/* Las animaciones de entrada solo ocurren al crear una carta nueva; el nodo se conserva después. */
#trumpCard > .playing-card,
.trick-slot > .playing-card {
  contain: layout paint;
}

@media (max-width: 720px) {
  .play-drop-indicator { inset: -34px -30px; }
  .hand-drop-slot {
    flex-basis: calc(var(--card-w) * .58);
    width: calc(var(--card-w) * .58);
    margin-inline: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hand-drop-slot,
  .deck-stack.draw-ready {
    animation: none !important;
  }
  .play-drop-indicator,
  .trick-slot,
  .player-hand .playing-card {
    transition-duration: .01ms !important;
  }
}

/* Ajustes de lectura final de las zonas de destino */
.hand-drop-slot b {
  top: auto;
  bottom: -20px;
  transform: translateX(-50%);
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(5,24,19,.88);
  box-shadow: 0 4px 12px rgba(0,0,0,.28);
}

.play-drop-indicator span {
  top: auto;
  bottom: 12px;
}

/* ─────────────────────────────────────────────
   v11 · Menú principal y tutorial clásico
   ───────────────────────────────────────────── */
.home-screen {
  position: relative;
  isolation: isolate;
  min-height: calc(100vh - 78px);
  overflow: hidden;
  padding: clamp(34px, 5vw, 76px) clamp(18px, 5vw, 84px) 54px;
  background:
    linear-gradient(180deg, rgba(5,24,19,.15), rgba(4,17,14,.7)),
    radial-gradient(circle at 76% 22%, rgba(36,119,83,.24), transparent 34rem),
    radial-gradient(circle at 15% 72%, rgba(217,182,111,.08), transparent 32rem),
    #061b16;
}

.home-screen.hidden { display: none !important; }

.home-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  opacity: .35;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 88%);
}

.home-ambient {
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  filter: blur(70px);
  pointer-events: none;
}
.home-ambient-one {
  width: 34rem;
  height: 34rem;
  right: -8rem;
  top: -8rem;
  background: rgba(72,166,118,.11);
}
.home-ambient-two {
  width: 28rem;
  height: 28rem;
  left: -12rem;
  bottom: -10rem;
  background: rgba(217,182,111,.07);
}

.home-hero {
  width: min(1480px, 100%);
  margin: 0 auto clamp(44px, 6vw, 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  align-items: center;
  gap: clamp(30px, 7vw, 110px);
}

.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: #c9ddcf;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .2em;
}
.home-kicker i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6cc99f;
  box-shadow: 0 0 0 6px rgba(108,201,159,.09), 0 0 18px rgba(108,201,159,.38);
}

.home-copy h1 {
  margin: 0;
  max-width: 760px;
  font-family: Georgia, serif;
  font-size: clamp(48px, 7vw, 102px);
  font-weight: 500;
  line-height: .9;
  letter-spacing: -.045em;
}
.home-copy h1 em {
  color: var(--gold-bright);
  font-weight: 500;
}
.home-copy > p {
  max-width: 650px;
  margin: 27px 0 24px;
  color: #b6c4ba;
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.65;
}
.home-features {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}
.home-features span {
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 999px;
  color: #b9c9bf;
  background: rgba(255,255,255,.025);
  font-size: 9px;
  font-weight: 750;
}
.home-features span::before {
  content: "✓";
  margin-right: 7px;
  color: var(--gold-bright);
}

.home-deck-showcase {
  min-height: 390px;
  position: relative;
  perspective: 1300px;
}
.showcase-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: clamp(145px, 13.5vw, 230px);
  aspect-ratio: 480 / 824;
  object-fit: cover;
  border-radius: 15px;
  box-shadow: 0 34px 65px rgba(0,0,0,.45);
  transform-origin: 50% 88%;
  animation: showcaseFloat 5.8s ease-in-out infinite;
}
.showcase-card.card-one {
  transform: translate(-118%, -48%) rotate(-17deg) translateZ(-30px);
  animation-delay: -.8s;
}
.showcase-card.card-two {
  z-index: 3;
  transform: translate(-50%, -55%) rotate(-1deg) translateZ(28px);
}
.showcase-card.card-three {
  transform: translate(17%, -47%) rotate(17deg) translateZ(-20px);
  animation-delay: -1.6s;
}
@keyframes showcaseFloat {
  0%,100% { margin-top: 0; }
  50% { margin-top: -10px; }
}
.showcase-seal {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 2%;
  width: 98px;
  height: 98px;
  transform: translateX(-50%) rotate(-4deg);
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  color: #1c2016;
  background: linear-gradient(145deg, #f1d18b, #b98a42);
  border: 1px solid rgba(255,255,255,.48);
  box-shadow: 0 18px 40px rgba(0,0,0,.42), inset 0 0 0 5px rgba(100,62,12,.11);
}
.showcase-seal strong {
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: .9;
}
.showcase-seal span {
  margin-top: 4px;
  font-size: 6px;
  font-weight: 1000;
  letter-spacing: .18em;
}

.mode-section {
  width: min(1480px, 100%);
  margin: auto;
}
.mode-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.mode-heading h2 {
  margin: 4px 0 0;
  font-family: Georgia, serif;
  font-size: clamp(29px, 3vw, 44px);
  font-weight: 500;
}
.mode-count {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .12em;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.mode-card {
  min-height: 285px;
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: clamp(21px, 3vw, 34px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 25px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background:
    radial-gradient(circle at 90% 0%, rgba(217,182,111,.09), transparent 20rem),
    linear-gradient(145deg, rgba(18,56,46,.96), rgba(7,28,23,.96));
  box-shadow: 0 22px 60px rgba(0,0,0,.2);
  transition: transform .26s cubic-bezier(.2,.8,.2,1), border-color .2s ease, box-shadow .25s ease;
}
.mode-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(135deg, rgba(240,207,131,.11), transparent 48%);
  transition: opacity .22s ease;
}
.mode-card:hover {
  transform: translateY(-8px);
  border-color: rgba(240,207,131,.38);
  box-shadow: 0 35px 75px rgba(0,0,0,.34);
}
.mode-card:hover::before { opacity: 1; }
.mode-card-tutorial {
  background:
    radial-gradient(circle at 92% 2%, rgba(101,166,142,.15), transparent 19rem),
    linear-gradient(145deg, rgba(15,50,43,.96), rgba(7,28,23,.96));
}
.mode-number {
  position: absolute;
  top: 21px;
  right: 23px;
  color: rgba(255,255,255,.14);
  font-family: Georgia, serif;
  font-size: 54px;
  line-height: 1;
}
.mode-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #202017;
  background: linear-gradient(145deg, var(--gold-bright), #ba8840);
  box-shadow: 0 11px 25px rgba(0,0,0,.25);
  font-size: 20px;
}
.mode-card-tutorial .mode-icon {
  color: #e6fff2;
  background: linear-gradient(145deg, #6eb598, #397a63);
}
.mode-card-copy {
  align-self: end;
  display: block;
  max-width: 590px;
  margin-top: 28px;
}
.mode-card-copy small {
  display: block;
  color: var(--gold);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .18em;
}
.mode-card-tutorial .mode-card-copy small { color: #8dc9af; }
.mode-card-copy strong {
  display: block;
  margin: 6px 0 10px;
  font-family: Georgia, serif;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 500;
}
.mode-card-copy > span {
  display: block;
  max-width: 540px;
  color: #aebdb3;
  font-size: 12px;
  line-height: 1.6;
}
.mode-meta {
  margin-top: 22px;
  padding-top: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,.075);
}
.mode-meta b {
  color: #9eafa5;
  font-size: 9px;
  font-weight: 800;
}
.mode-meta i {
  color: var(--gold-bright);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}
.mode-card-tutorial .mode-meta i { color: #92d3b8; }
.mode-card.tutorial-complete .mode-meta b {
  color: #98d9bc;
}
.mode-card.tutorial-complete .mode-meta b::before {
  content: "✓ ";
}

.future-modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 13px;
}
.future-modes article {
  padding: 17px 19px;
  border: 1px dashed rgba(255,255,255,.08);
  border-radius: 17px;
  background: rgba(255,255,255,.018);
}
.future-modes article > span {
  display: block;
  margin-bottom: 5px;
  color: rgba(217,182,111,.65);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .16em;
}
.future-modes strong {
  display: block;
  font-size: 12px;
}
.future-modes p {
  margin: 5px 0 0;
  color: #84958b;
  font-size: 9px;
  line-height: 1.5;
}

/* Tutorial coach */
.tutorial-coach {
  position: absolute;
  z-index: 80;
  top: 22px;
  left: 22px;
  width: min(390px, calc(100% - 44px));
  padding: 18px;
  border: 1px solid rgba(240,207,131,.24);
  border-radius: 19px;
  background:
    radial-gradient(circle at 100% 0%, rgba(217,182,111,.1), transparent 15rem),
    rgba(4,22,18,.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 55px rgba(0,0,0,.42);
}
.tutorial-coach.hidden { display: none !important; }
.tutorial-coach-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.tutorial-kicker {
  color: var(--gold);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .17em;
}
.tutorial-exit {
  padding: 0;
  border: 0;
  color: #91a198;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tutorial-progress {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
  margin: 13px 0 15px;
}
.tutorial-progress span {
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.09);
}
.tutorial-progress span.done { background: rgba(217,182,111,.5); }
.tutorial-progress span.current {
  background: var(--gold-bright);
  box-shadow: 0 0 12px rgba(240,207,131,.34);
}
.tutorial-coach h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 500;
}
.tutorial-coach > p {
  margin: 8px 0 14px;
  color: #bac8bf;
  font-size: 11px;
  line-height: 1.62;
}
.tutorial-tip {
  margin: 0 0 13px;
  padding: 10px 11px;
  border: 1px solid rgba(101,180,145,.18);
  border-radius: 11px;
  color: #bfe3d1;
  background: rgba(68,143,108,.1);
  font-size: 9px;
  line-height: 1.5;
}
.tutorial-tip.hidden { display: none; }
.tutorial-next {
  width: 100%;
  min-height: 39px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
}
.tutorial-next.hidden { display: none !important; }

.tutorial-focus {
  position: relative;
  z-index: 55 !important;
  filter: drop-shadow(0 0 18px rgba(240,207,131,.3));
}
.tutorial-focus::after {
  content: "";
  position: absolute;
  z-index: 100;
  inset: -9px;
  border: 2px solid rgba(240,207,131,.72);
  border-radius: 18px;
  pointer-events: none;
  animation: tutorialFocusPulse 1s ease-in-out infinite alternate;
}
@keyframes tutorialFocusPulse {
  from { opacity: .48; box-shadow: 0 0 0 0 rgba(240,207,131,.06); }
  to { opacity: 1; box-shadow: 0 0 0 8px rgba(240,207,131,.045), 0 0 24px rgba(240,207,131,.16); }
}

.tutorial-points-badge {
  position: absolute;
  z-index: 15;
  left: 50%;
  bottom: 7%;
  transform: translateX(-50%);
  padding: 4px 7px;
  border-radius: 999px;
  color: #172019;
  background: var(--gold-bright);
  box-shadow: 0 5px 15px rgba(0,0,0,.3);
  font-size: 8px;
  font-weight: 1000;
  white-space: nowrap;
  pointer-events: none;
}

body.tutorial-mode .score-card,
body.tutorial-mode .intel-card,
body.tutorial-mode .log-card {
  border-color: rgba(240,207,131,.11);
}
body.tutorial-mode #newMatchButton::before { content: ""; }

@media (max-width: 900px) {
  .home-hero { grid-template-columns: 1fr; }
  .home-copy { text-align: center; }
  .home-copy > p { margin-inline: auto; }
  .home-features { justify-content: center; }
  .home-deck-showcase { min-height: 330px; }
  .mode-grid { grid-template-columns: 1fr; }
  .future-modes { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .home-screen {
    min-height: calc(100vh - 66px);
    padding: 31px 12px 35px;
  }
  .home-copy h1 { font-size: clamp(45px, 14vw, 66px); }
  .home-deck-showcase { min-height: 280px; }
  .showcase-card { width: 138px; }
  .showcase-seal { width: 74px; height: 74px; }
  .showcase-seal strong { font-size: 29px; }
  .mode-card { min-height: 250px; border-radius: 20px; }
  .tutorial-coach {
    position: fixed;
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    max-height: 42vh;
    overflow: auto;
  }
  body.tutorial-mode .table-panel { padding-bottom: 205px; }
  .tutorial-progress { gap: 3px; }
}

@media (prefers-reduced-motion: reduce) {
  .showcase-card,
  .tutorial-focus::after { animation: none !important; }
}

.tutorial-card-target {
  box-shadow:
    0 24px 38px rgba(0,0,0,.42),
    0 0 0 3px rgba(240,207,131,.9),
    0 0 34px rgba(240,207,131,.38) !important;
  animation: tutorialCardTarget 1s ease-in-out infinite alternate;
  z-index: 45 !important;
}
@keyframes tutorialCardTarget {
  from { filter: brightness(1); }
  to { filter: brightness(1.08) drop-shadow(0 0 10px rgba(240,207,131,.24)); }
}
.round-pip.tutorial-current-pip {
  background: var(--gold-bright);
  box-shadow: 0 0 10px rgba(240,207,131,.4);
}

/* ─────────────────────────────────────────────
   v13 · Club offline, multijugador local y música
   ───────────────────────────────────────────── */
.mode-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.mode-grid-three .mode-card {
  min-height: 315px;
}
.mode-card-custom {
  background:
    radial-gradient(circle at 92% 2%, rgba(116,126,189,.15), transparent 19rem),
    linear-gradient(145deg, rgba(27,43,62,.96), rgba(8,25,26,.96));
}
.mode-card-custom .mode-icon {
  color: #eff2ff;
  background: linear-gradient(145deg, #7b89bd, #485878);
}
.mode-card-custom .mode-card-copy small,
.mode-card-custom .mode-meta i { color: #aeb8ed; }

.club-dashboard {
  display: grid;
  grid-template-columns: .7fr .7fr 1.1fr 2fr;
  gap: 12px;
  margin-top: 14px;
}
.club-stat,
.club-now-playing {
  min-height: 116px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 18px;
  background: rgba(255,255,255,.022);
}
.club-stat > span,
.club-now-playing div > span {
  display: block;
  color: #8da096;
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .16em;
}
.club-stat strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--gold-bright);
  font-family: Georgia, serif;
  font-size: 29px;
  font-weight: 500;
}
.club-stat small { color: #778a80; font-size: 8px; }
.club-now-playing {
  display: flex;
  align-items: center;
  gap: 13px;
}
.club-now-playing div { flex: 1; }
.club-now-playing strong {
  display: block;
  margin-top: 5px;
  font-size: 12px;
}
.club-now-playing button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(240,207,131,.28);
  border-radius: 11px;
  color: var(--gold-bright);
  background: rgba(217,182,111,.07);
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
}
.music-live-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #6cc99f;
  box-shadow: 0 0 0 6px rgba(108,201,159,.07), 0 0 18px rgba(108,201,159,.36);
}
.music-live-dot.paused {
  background: #7f8b84;
  box-shadow: none;
}

.music-control-wrap { position: relative; }
.music-popover {
  position: absolute;
  z-index: 300;
  top: 48px;
  right: 0;
  width: 245px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px;
  background: rgba(5,26,21,.97);
  box-shadow: 0 20px 55px rgba(0,0,0,.45);
  backdrop-filter: blur(18px);
}
.music-popover.hidden { display: none; }
.music-popover > div {
  display: flex;
  align-items: center;
  gap: 10px;
}
.music-popover strong { font-size: 12px; }
.music-popover small {
  display: block;
  margin: 7px 0 12px 19px;
  color: var(--muted);
  font-size: 9px;
}
.music-popover label {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 800;
}
.music-popover input { width: 100%; accent-color: var(--gold); }
.music-playing #musicButton {
  color: #142018;
  background: linear-gradient(145deg, var(--gold-bright), #bd8c43);
}

.wide-modal-card { width: min(1040px, calc(100vw - 30px)); }
.variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.variant-option {
  position: relative;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px;
  color: var(--ink);
  text-align: left;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.variant-option:hover {
  transform: translateY(-4px);
  border-color: rgba(240,207,131,.42);
  background: rgba(217,182,111,.06);
}
.variant-option.featured {
  border-color: rgba(240,207,131,.34);
  background: linear-gradient(145deg, rgba(217,182,111,.09), rgba(255,255,255,.02));
}
.variant-option .variant-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.variant-option .variant-code {
  color: var(--gold);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .16em;
}
.variant-option .variant-status {
  padding: 5px 7px;
  border-radius: 999px;
  color: #a7d8c2;
  background: rgba(105,184,146,.09);
  font-size: 7px;
  font-weight: 900;
}
.variant-option h3 {
  margin: 18px 0 8px;
  font-family: Georgia, serif;
  font-size: 28px;
  font-weight: 500;
}
.variant-option p {
  margin: 0;
  color: #a3b2a9;
  font-size: 11px;
  line-height: 1.55;
}
.variant-rule-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
}
.variant-rule-pills span {
  padding: 5px 7px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  color: #9eafa5;
  font-size: 7px;
  font-weight: 850;
}

.selected-variant-summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 22px;
  padding: 14px 16px;
  border: 1px solid rgba(240,207,131,.18);
  border-radius: 15px;
  background: rgba(217,182,111,.055);
}
.selected-variant-summary .summary-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 11px;
  color: #1d2119;
  background: var(--gold-bright);
  font-weight: 1000;
}
.selected-variant-summary strong { display: block; font-size: 13px; }
.selected-variant-summary p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }

.custom-rules-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin: 22px 0;
}
.custom-rules-layout section {
  padding: 18px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 17px;
  background: rgba(0,0,0,.08);
}
.custom-rules-layout h3 {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 9px;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.custom-rules-layout h3:not(:first-child) { margin-top: 20px; }
.rule-select,
.custom-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 58px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.rule-select span,
.custom-toggle strong { font-size: 11px; }
.rule-select select {
  max-width: 210px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #0c2c24;
}
.custom-toggle span { flex: 1; }
.custom-toggle strong { display: block; }
.custom-toggle small { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; line-height: 1.35; }
.custom-toggle input { width: 38px; height: 21px; accent-color: var(--gold); }

.variant-live-badge {
  padding: 4px 7px;
  border: 1px solid rgba(240,207,131,.2);
  border-radius: 7px;
  color: var(--gold-bright);
  background: rgba(217,182,111,.06);
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .1em;
  white-space: nowrap;
}
.capote-button {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid rgba(203,105,74,.45);
  border-radius: 13px;
  color: #ffe9d9;
  background: linear-gradient(145deg, rgba(159,64,39,.78), rgba(96,31,23,.86));
  cursor: pointer;
  font-size: 10px;
  font-weight: 900;
}
.capote-button.hidden { display: none; }

.rules-grid article.rule-emphasis {
  border-color: rgba(240,207,131,.28);
  background: rgba(217,182,111,.055);
}

@media (max-width: 1080px) {
  .mode-grid-three { grid-template-columns: 1fr 1fr; }
  .mode-grid-three .mode-card-custom { grid-column: 1 / -1; }
  .club-dashboard { grid-template-columns: repeat(2, 1fr); }
  .club-now-playing { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .mode-grid-three,
  .variant-grid,
  .custom-rules-layout,
  .club-dashboard { grid-template-columns: 1fr; }
  .mode-grid-three .mode-card-custom,
  .club-now-playing { grid-column: auto; }
  .wide-modal-card { width: calc(100vw - 18px); }
  .variant-option { min-height: 190px; }
  .club-now-playing { align-items: flex-start; flex-wrap: wrap; }
  .music-popover { right: -90px; width: min(245px, calc(100vw - 30px)); }
  .variant-live-badge { display: none; }
}

/* v13 · Multijugador local */
.mode-grid-four{grid-template-columns:repeat(2,minmax(0,1fr))}.mode-grid-four .mode-card{min-height:300px}.mode-card-local{background:radial-gradient(circle at 92% 2%,rgba(211,126,75,.17),transparent 19rem),linear-gradient(145deg,rgba(69,41,28,.96),rgba(10,31,27,.98));text-decoration:none}.mode-card-local .mode-icon{color:#fff1df;background:linear-gradient(145deg,#d88d5b,#965334)}.mode-card-local .mode-card-copy small,.mode-card-local .mode-meta i{color:#efae80}@media(max-width:760px){.mode-grid-four{grid-template-columns:1fr}}


/* V15 · mano rival fiel al número real de cartas */
.ai-hand-wrap{position:relative;width:min(76vw,680px);min-height:calc(var(--card-h)*.73 + 28px);display:grid;justify-items:center;overflow:visible}
.ai-hand-count{position:absolute;z-index:80;right:4%;top:4px;min-width:58px;padding:5px 9px;border:1px solid rgba(240,207,131,.28);border-radius:999px;color:#f3d58b;background:rgba(4,25,19,.86);box-shadow:0 8px 20px rgba(0,0,0,.28);font-size:8px;font-weight:950;letter-spacing:.1em;text-align:center;pointer-events:none}
.opponent-hand{position:relative;width:100%;height:calc(var(--card-h)*.76);min-height:calc(var(--card-h)*.76);padding:0!important;margin-bottom:-34px;transform:scale(.76);transform-origin:top center;overflow:visible}
.opponent-hand .playing-card{position:absolute;left:50%;top:0;margin-left:0!important;transform:translateX(calc(-50% + var(--ai-fan-x,0px))) translateY(var(--rest-y,0px)) rotate(var(--rest-rotate,0deg));transform-origin:50% -20%;transition:transform .28s cubic-bezier(.18,.82,.18,1),opacity .2s ease}
@media(max-width:720px){.ai-hand-wrap{width:min(94vw,560px);min-height:128px}.ai-hand-count{right:1%;top:-2px;font-size:7px}.opponent-hand{transform:scale(.62);height:132px;margin-bottom:-44px}}

/* =========================================================
   V16 · Sala Cero / selector de juegos
   ========================================================= */
.game-library{width:min(1380px,100%);margin:0 auto;padding:6px 0 24px}.game-library-heading{margin-bottom:14px}.game-library-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}.game-tile{position:relative;min-height:250px;padding:22px;display:grid;grid-template-columns:220px minmax(0,1fr);align-items:center;gap:22px;text-align:left;border:1px solid rgba(255,255,255,.09);border-radius:24px;color:var(--text);background:linear-gradient(145deg,rgba(18,48,40,.96),rgba(5,20,17,.98));box-shadow:0 22px 55px rgba(0,0,0,.2),inset 0 1px rgba(255,255,255,.035);overflow:hidden;text-decoration:none}.game-tile::after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at 95% 0,rgba(240,207,131,.1),transparent 43%)}.game-tile-generala{background:linear-gradient(145deg,#251a3e,#100d1d)}.game-tile-index{position:absolute;right:18px;top:16px;color:rgba(255,255,255,.32);font-size:8px;font-weight:900}.game-tile-art{position:relative;height:205px}.game-tile-art img{position:absolute;width:118px;border-radius:10px;box-shadow:0 22px 38px rgba(0,0,0,.36)}.game-tile-art img:first-child{left:5px;top:24px;transform:rotate(-12deg)}.game-tile-art img:nth-child(2){right:3px;top:10px;transform:rotate(10deg)}.game-tile-art span,.game-dice-art span{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:76px;height:76px;display:grid;place-items:center;border-radius:50%;color:#1e1a12;background:linear-gradient(145deg,#f0cf83,#b9853d);border:5px solid #0c3027;font:900 39px Georgia,serif;box-shadow:0 0 0 3px #d5b86f,0 15px 32px rgba(0,0,0,.36)}.game-tile-copy{position:relative;z-index:2}.game-tile-copy small{display:block;color:var(--gold);font-size:7px;font-weight:950;letter-spacing:.14em}.game-tile-copy strong{display:block;margin:5px 0 8px;font:650 42px Georgia,serif}.game-tile-copy p{max-width:470px;margin:0 0 18px;color:#94a89d;font-size:10px;line-height:1.7}.game-tile-copy b{color:#f0cf83;font-size:8px}.game-dice-art{position:relative;height:205px}.game-dice-art i{position:absolute;width:92px;height:92px;display:grid;place-items:center;border-radius:22px;color:#21172a;background:linear-gradient(145deg,#fff8e9,#d5c39d);font:900 42px Georgia,serif;box-shadow:0 20px 35px rgba(0,0,0,.36)}.game-dice-art i:nth-child(1){left:8px;top:12px;transform:rotate(-12deg)}.game-dice-art i:nth-child(2){right:10px;top:5px;transform:rotate(13deg)}.game-dice-art i:nth-child(3){left:61px;bottom:4px;transform:rotate(3deg)}.game-dice-art span{background:linear-gradient(145deg,#ffd98b,#ba7f3b);border-color:#241837}
@media(max-width:900px){.game-library-grid{grid-template-columns:1fr}.game-tile{grid-template-columns:190px 1fr}}
@media(max-width:640px){.game-library{padding:5px 0 18px}.game-library-grid{gap:10px}.game-tile{min-height:180px;grid-template-columns:120px minmax(0,1fr);gap:10px;padding:15px;border-radius:18px}.game-tile-art,.game-dice-art{height:140px}.game-tile-art img{width:76px}.game-tile-art span,.game-dice-art span{width:52px;height:52px;font-size:27px;border-width:3px}.game-dice-art i{width:59px;height:59px;border-radius:14px;font-size:28px}.game-dice-art i:nth-child(3){left:38px}.game-tile-copy strong{font-size:29px}.game-tile-copy p{font-size:7.5px;line-height:1.55;margin-bottom:10px}.game-tile-copy b{font-size:7px}}

/* v17: portada separada + menú propio de Tute */
.hub-back-link{display:inline-flex;align-items:center;justify-content:center}
.tute-home-dashboard{margin-top:26px}
.tute-deck-showcase .card-four{position:absolute;right:6%;top:42%;transform:rotate(15deg)}
.tute-heading-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.soft-action-link{display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:14px;border:1px solid rgba(255,255,255,.08);background:rgba(255,255,255,.03);text-decoration:none;color:var(--text);font-size:8px;font-weight:900;letter-spacing:.08em}
.tute-mode-section{padding-top:8px}
@media(max-width:900px){.tute-deck-showcase .card-four{right:0;top:53%}}
@media(max-width:640px){.hub-back-link{display:none}.tute-home-dashboard{margin-top:18px}.tute-heading-actions{justify-content:flex-start}.soft-action-link{font-size:7px;padding:8px 11px}.tute-deck-showcase .card-four{width:122px;right:-3px;top:58%}}
