.is-hidden { display: none !important; }

/* Card system matched to The Hidden Ace reference */
.card-face {
  border-radius: 7px;
}

.card-back {
  border: 2px solid #b78f3d;
  background:
    linear-gradient(45deg, transparent 46%, rgba(232,195,111,.16) 47% 49%, transparent 50%),
    linear-gradient(-45deg, transparent 46%, rgba(232,195,111,.12) 47% 49%, transparent 50%),
    radial-gradient(circle at center, #20201c 0 16%, #0c0d0b 17% 38%, #2a2923 39% 42%, #090a08 43%);
  background-size: 17px 17px, 17px 17px, auto;
}

.card-back::before {
  content: "AS";
  width: 49%;
  color: #e9c56f;
  font-size: clamp(.72rem, 1.45vw, 1rem);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
  letter-spacing: .04em;
}

.card-front {
  color: #111816;
  border: 1px solid #85918e;
  background:
    linear-gradient(135deg, rgba(255,255,255,.2), transparent 35%),
    #afbbb8;
  box-shadow: 0 7px 14px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.18);
}

.card-front.red { color: #a92f34; }

.card.flipped:not(.discarded) .card-front {
  border-color: #f0ca71;
  box-shadow:
    0 7px 14px rgba(0,0,0,.28),
    inset 0 0 0 3px #e8bd60,
    inset 0 0 0 4px rgba(255,255,255,.72);
}

.card.discarded .card-front {
  filter: grayscale(.7) brightness(.7);
  opacity: .48;
}

.card .corner {
  top: 6px;
  left: 7px;
  color: currentColor;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.7rem, 1.45vw, .94rem);
  text-shadow: 0 1px rgba(255,255,255,.5);
}

.card .corner.bottom {
  top: auto;
  left: auto;
  right: 7px;
  bottom: 6px;
}

.card-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: Georgia, "Times New Roman", serif;
}

.pip-face {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  filter: drop-shadow(0 1px rgba(255,255,255,.45));
}

.court-face {
  font-family: "Apple Symbols", "Noto Sans Symbols 2", "Segoe UI Symbol", serif;
  font-size: clamp(2.35rem, 5vw, 3.6rem);
  line-height: 1;
  transform: translateY(1px);
  filter: drop-shadow(0 1px rgba(255,255,255,.45));
}

.ace-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #10201c;
  font-size: clamp(2rem, 4.6vw, 3.2rem);
  line-height: .75;
}

.ace-face small {
  margin-top: 9px;
  font-size: .23em;
  font-weight: 900;
  letter-spacing: .16em;
}

.card.replaceable .card-front {
  animation: replacePulse 1.1s ease-in-out infinite;
  cursor: pointer;
}

.card.flipped.replaceable:hover .card-inner {
  transform: rotateY(180deg) translateY(-4px);
}

@keyframes replacePulse {
  0%, 100% { box-shadow: inset 0 0 0 3px #e8bd60, 0 0 0 rgba(232,189,96,0); }
  50% { box-shadow: inset 0 0 0 3px #f3d991, 0 0 20px rgba(232,189,96,.48); }
}

.hand-ranking {
  display: grid;
  gap: 6px;
}

.hand-ranking > div {
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 9px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.065);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255,255,255,.022);
  font-size: .76rem;
}

.hand-ranking strong {
  color: var(--gold-light);
  font-family: Georgia, serif;
  text-align: center;
}

.hand-preview {
  display: inline-flex;
  gap: 4px;
  margin-top: 6px;
}

.hand-chip {
  min-width: 27px;
  padding: 4px 5px;
  border: 1px solid rgba(215,173,85,.28);
  border-radius: 5px;
  color: var(--gold-light);
  background: rgba(0,0,0,.22);
  text-align: center;
  font-family: Georgia, serif;
  font-weight: 800;
}

.mode-card.variant-card { min-height: 108px; }

@media (max-width: 700px) {
  .card .corner { top: 4px; left: 5px; font-size: .62rem; }
  .card .corner.bottom { right: 5px; bottom: 4px; }
  .court-face { font-size: 2rem; }
  .pip-face { font-size: 1.65rem; }
  .ace-face { font-size: 1.9rem; }
  .mode-card.variant-card { min-height: 86px; }
}

/* EL GRAN GOLPE — cross-section bank board */
.heist-ladder { display: grid; gap: 6px; }
.heist-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 9px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: .75rem;
}
.heist-step strong { color: var(--gold-light); font-family: Georgia, serif; text-align: center; }
.heist-step.reached { color: #d9f6e5; border-color: rgba(88,200,138,.48); background: rgba(88,200,138,.09); }
.heist-step.danger { border-color: rgba(190,63,72,.42); }

body.mode-heist {
  background:
    radial-gradient(circle at 50% -10%, rgba(132, 96, 43, .2), transparent 32rem),
    linear-gradient(90deg, rgba(255,255,255,.013) 1px, transparent 1px),
    linear-gradient(#0b1010, #020606 76%);
  background-size: auto, 5px 5px, auto;
}
body.mode-heist .table-shell {
  background:
    linear-gradient(90deg, rgba(218,180,99,.055) 1px, transparent 1px),
    linear-gradient(rgba(218,180,99,.035) 1px, transparent 1px),
    radial-gradient(ellipse at center, rgba(75, 77, 64, .23), transparent 64%),
    #080d0d;
  background-size: 36px 36px, 36px 36px, auto, auto;
}
body.mode-heist .table-shell::after {
  content: "BANCO CENTRAL · ACCESO RESTRINGIDO";
  position: absolute;
  z-index: 0;
  top: 78px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(224,190,111,.1);
  font: 800 clamp(.72rem, 1.5vw, 1.1rem) Georgia, serif;
  letter-spacing: .22em;
  white-space: nowrap;
  pointer-events: none;
}
body.mode-heist .board { gap: 8px; padding-top: 18px; }

.bank-floor {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 118px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 12px;
  min-height: 108px;
  padding: 9px 14px;
  border: 1px solid rgba(213,173,89,.15);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(0,0,0,.2), transparent 18%, transparent 82%, rgba(0,0,0,.2)),
    linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)),
    rgba(12,21,19,.84);
  transition: opacity .2s ease, border-color .2s ease, transform .2s ease;
}
.bank-floor::before,
.bank-floor::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 7px;
  background: repeating-linear-gradient(180deg, rgba(210,177,103,.2) 0 8px, transparent 8px 13px);
}
.bank-floor::before { left: 6px; }
.bank-floor::after { right: 6px; }
.bank-floor.active {
  border-color: rgba(239,200,112,.66);
  background: linear-gradient(90deg, rgba(215,173,85,.04), rgba(215,173,85,.14), rgba(215,173,85,.04)), #0c1714;
  box-shadow: 0 0 28px rgba(215,173,85,.1), inset 0 0 0 1px rgba(215,173,85,.15);
}
.bank-floor.passed { border-color: rgba(88,200,138,.32); }
.bank-floor.locked { opacity: .37; filter: saturate(.5); }
.bank-floor.failed { border-color: rgba(190,63,72,.6); background-color: rgba(49,11,16,.52); }
.bank-floor.vault-floor {
  border-width: 2px;
  background:
    radial-gradient(circle at 82% 50%, rgba(215,173,85,.12), transparent 19%),
    linear-gradient(180deg, #151917, #090d0c);
}

.floor-sign { text-align: right; text-transform: uppercase; }
.floor-number { display: block; color: var(--gold-light); font: 700 1.55rem Georgia, serif; }
.floor-name { display: block; color: var(--muted); font-size: .66rem; font-weight: 850; letter-spacing: .1em; }
.floor-odds { display: block; margin-top: 4px; color: rgba(215,173,85,.8); font-size: .64rem; }
.floor-cards { display: flex; align-items: center; justify-content: center; gap: clamp(5px, .75vw, 9px); min-width: 0; }
.floor-loot { text-align: center; color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.floor-loot strong { display: block; color: var(--gold-light); font: 700 1.5rem Georgia, serif; letter-spacing: 0; }
.vault-floor .floor-loot::before { content: "◆"; display: block; color: var(--gold); font-size: 1.35rem; margin-bottom: 2px; }

.heist-card-wrap { width: clamp(43px, 5vw, 62px); aspect-ratio: 5 / 7; flex: 0 1 62px; perspective: 700px; }
.heist-card {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
}
.heist-card.active { cursor: pointer; }
.heist-card.active .card-back { animation: heistPulse 1.25s ease-in-out infinite; }
.heist-card.active:hover .card-inner { transform: translateY(-5px) rotateX(4deg); }
.heist-card:focus-visible { outline: 3px solid var(--gold-light); outline-offset: 3px; }
.heist-card.flipped .card-inner { transform: rotateY(180deg); }
.heist-card.dimmed { opacity: .2; }
.heist-card .card-front { background: #f4efe3; }
.heist-card .card-front.thief-face { border-color: #d3ad59; box-shadow: inset 0 0 0 3px #d7b25e, 0 7px 15px rgba(0,0,0,.4); }
.heist-card .card-front.security-face { border-color: #7e2730; box-shadow: inset 0 0 0 3px #8d2d37, 0 7px 15px rgba(0,0,0,.4); }
.heist-card .court-art { inset: 7% 13% 19%; width: 74%; height: 75%; }
.heist-card-label {
  position: absolute;
  z-index: 4;
  left: 8%;
  right: 8%;
  bottom: 6%;
  display: block;
  padding: 2px 1px;
  color: #191610;
  border-top: 1px solid rgba(0,0,0,.25);
  font: 900 clamp(.35rem, .66vw, .52rem) Georgia, serif;
  letter-spacing: .08em;
  text-align: center;
}
.security-mark { position: absolute; inset: 8% 6% 18%; display: grid; place-items: center; font-size: clamp(1.45rem, 3vw, 2.25rem); filter: grayscale(.15); }
.security-face .heist-card-label { color: #8c2530; }
@keyframes heistPulse {
  0%,100% { box-shadow: 0 6px 12px rgba(0,0,0,.3), 0 0 0 rgba(215,173,85,0); }
  50% { box-shadow: 0 8px 17px rgba(0,0,0,.35), 0 0 20px rgba(215,173,85,.42); }
}

.alarm-strip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #ef9b9f;
  font-size: .7rem;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.alarm-strip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #c83d49; box-shadow: 0 0 13px #c83d49; }
.mode-card.heist-choice { grid-column: 1 / -1; min-height: 86px; background: linear-gradient(110deg, rgba(125,36,44,.12), rgba(215,173,85,.08)); }

@media (max-width: 700px) {
  body.mode-heist .board { gap: 5px; padding-top: 10px; }
  body.mode-heist .table-shell::after { top: 66px; font-size: .55rem; }
  .bank-floor { grid-template-columns: 48px minmax(0,1fr) 40px; gap: 4px; min-height: 82px; padding: 6px 7px; }
  .floor-number { font-size: 1rem; }
  .floor-name { font-size: .5rem; letter-spacing: .03em; }
  .floor-odds { display: none; }
  .floor-loot { font-size: .49rem; }
  .floor-loot strong { font-size: 1rem; }
  .floor-cards { gap: 3px; }
  .heist-card-wrap { width: min(11vw, 44px); flex-basis: 44px; }
  .heist-card-label { font-size: .28rem; letter-spacing: .02em; }
  .security-mark { font-size: 1.2rem; }
}

/* Exact face artwork reused from El As Oculto. */
.card-back {
  background:
    repeating-linear-gradient(45deg, transparent 0, transparent 5px, rgba(223,184,106,.045) 5px, rgba(223,184,106,.045) 6px),
    linear-gradient(135deg, #65252a, #371317);
  border-color: #b48f54;
}

.card-back::before {
  content: "";
  position: absolute;
  inset: 6px;
  width: auto;
  aspect-ratio: auto;
  transform: none;
  border: 1px solid rgba(202,161,93,.48);
  border-radius: 3px;
  background: transparent;
}

.card-back::after {
  inset: 10px;
  border-color: rgba(202,161,93,.16);
}

.back-emblem {
  position: relative;
  z-index: 1;
  width: 47%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: #d7b478;
  border: 1px solid #b78f57;
  background: #44171c;
  transform: rotate(45deg);
  font: 700 clamp(.95rem, 2.2vw, 1.45rem) Georgia, serif;
}

.back-emblem > span { transform: rotate(-45deg); }

.card-front {
  color: #242820;
  border-color: #e3d7bb;
  background: #f2eee3;
}

.card-front.red { color: #a22f3b; }

.card-front .corner {
  z-index: 3;
  top: 6px;
  left: 6px;
  font-size: clamp(.68rem, 1.35vw, .9rem);
  line-height: .9;
}

.card-front .corner.bottom {
  top: auto;
  left: auto;
  right: 6px;
  bottom: 6px;
}

.court-art {
  position: absolute;
  inset: 5% 17% 13%;
  width: 66%;
  height: 82%;
  object-fit: contain;
  mix-blend-mode: normal;
  pointer-events: none;
}

.ace-card {
  overflow: hidden;
  border-color: #d8b65d;
  background: #fffdf8;
}

.ace-card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 6px;
  pointer-events: none;
}

.ace-royal-label {
  position: absolute;
  z-index: 4;
  left: 30%;
  right: 30%;
  bottom: 2.5%;
  height: 11%;
  display: grid;
  place-items: center;
  color: #15130f;
  background: #fffdf8;
  font: 800 clamp(.36rem, .72vw, .52rem) Georgia, serif;
  letter-spacing: .08em;
}

.pip-face {
  font-size: clamp(1.75rem, 3.8vw, 2.65rem);
}

@media (max-width: 700px) {
  .court-art { inset: 6% 18% 14%; width: 64%; height: 80%; }
  .ace-royal-label { font-size: .32rem; }
}
