:root {
  --ink: #1d1d1b;
  --ink-2: #262624;
  --cream: #f4f1dc;
  --cream-2: #e9e4c6;
  --navy: #263964;
  --wine: #8e3a46;
  --sage: #7d9a5c;
  --gold: #e6c65a;
  --glow: #f6d34a;
  --card-w: clamp(50px, min(7.2vw, 9.2vh), 104px);
  --opp-w: clamp(28px, min(3vw, 4.6vh), 46px);
  --radius: 8%;
  --display: 'Archivo', 'Arial Black', system-ui, sans-serif;
  --body: 'Barlow', 'Bahnschrift', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--body);
  color: var(--cream);
  background: radial-gradient(ellipse at 50% 40%, #2c2c29 0%, #1d1d1b 55%, #121211 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; }
.display { font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; }

/* ---------- Marco ornamental (como en el instructivo y las cartas) ---------- */
.frame {
  position: relative;
  border: 2px solid var(--cream);
  outline: 1px solid var(--cream);
  outline-offset: -9px;
  border-radius: 4px;
}
.frame::before, .frame::after {
  content: ''; position: absolute; width: 22px; height: 22px; border: 2px solid var(--cream);
}
.frame::before { top: -8px; left: -8px; border-right: none; border-bottom: none; }
.frame::after { bottom: -8px; right: -8px; border-left: none; border-top: none; }
.frame.light { border-color: var(--ink); outline-color: var(--ink); }
.frame.light::before, .frame.light::after { border-color: var(--ink); }

/* ---------- Botones ---------- */
.btn {
  border: 2px solid var(--cream); background: var(--cream); color: var(--ink);
  padding: .7em 1.4em; border-radius: 999px;
  font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: .82rem; letter-spacing: .04em;
  transition: transform .12s, background .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.btn.ghost { background: transparent; color: var(--cream); }
.btn.ghost:hover { background: rgba(244,241,220,.08); }
.btn.dark { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.btn.small { padding: .45em 1em; font-size: .7rem; }
.btn.glow { animation: pulse 1.4s infinite; }
.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }

/* ---------- Login ---------- */
.screen-center { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login {
  width: min(440px, 100%); padding: 48px 40px 36px; text-align: center; background: var(--ink);
}
.login img.logo { width: 82%; margin: 6px auto 4px; display: block; }
.login .sub { font-size: 1.05rem; letter-spacing: .08em; margin: 4px 0 28px; opacity: .9; }
.field { text-align: left; margin-bottom: 14px; }
.field label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 6px; opacity: .8; }
.field input {
  width: 100%; padding: 12px 14px; border-radius: 6px; border: 2px solid var(--cream); background: var(--cream); color: var(--ink);
  font: 600 1rem var(--body);
}
.field input:focus { outline: 3px solid var(--glow); outline-offset: 1px; }
.login .btn { width: 100%; margin-top: 10px; padding: 1em; }
.login .error { color: #ffb4a8; min-height: 1.3em; margin-top: 12px; font-size: .9rem; }
.login .foot { margin-top: 26px; font-size: .78rem; opacity: .6; letter-spacing: .06em; }

/* ---------- Barra superior ---------- */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 22px; border-bottom: 1px solid rgba(244,241,220,.12); }
.topbar img { height: 34px; }
.topbar .spacer { flex: 1; }
.topbar .who-btn { font-size: .9rem; font-weight: 600; color: var(--cream); background: none; border: none; opacity: .9; padding: 4px 6px; border-radius: 6px; }
.topbar .who-btn:hover { background: rgba(244,241,220,.1); opacity: 1; }
.topbar .round { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }

/* ---------- Sala ---------- */
.lobby { max-width: 760px; margin: 40px auto; padding: 0 20px; text-align: center; }
.lobby .panel { background: var(--cream); color: var(--ink); padding: 44px 36px; }
.lobby h2 { margin: 0 0 6px; font-size: 1.5rem; }
.lobby p { margin: 0 0 26px; font-size: 1.02rem; }
.size-pick { display: flex; gap: 14px; justify-content: center; margin: 10px 0 28px; flex-wrap: wrap; }
.size-pick button {
  width: 96px; height: 120px; border-radius: 10px; border: 3px solid var(--ink); background: transparent; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 2.4rem;
  transition: all .12s;
}
.size-pick button small { font: 600 .7rem var(--body); text-transform: uppercase; letter-spacing: .12em; }
.size-pick button.on, .size-pick button:hover { background: var(--ink); color: var(--cream); }
.seats { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 6px 0 26px; }
.seat {
  width: 108px; padding: 14px 8px; border-radius: 10px; border: 2px dashed rgba(29,29,27,.35); font-weight: 600; font-size: .9rem;
}
.seat.filled { border: 2px solid var(--ink); background: var(--ink); color: var(--cream); }
.seat .ico { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.lobby .row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Cartas ---------- */
.card {
  position: relative; width: var(--card-w); aspect-ratio: 5 / 7; border-radius: var(--radius);
  background: var(--cream) center / cover no-repeat; box-shadow: 0 2px 0 rgba(0,0,0,.25), 0 6px 14px rgba(0,0,0,.35);
  overflow: hidden; flex: none; transition: transform .15s, box-shadow .15s;
}
.card.sm { width: var(--opp-w); box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 3px 6px rgba(0,0,0,.35); }
.card.lg { width: clamp(76px, min(8vw, 13vh), 140px); }
.card.xl { width: clamp(96px, min(11vw, 17vh), 180px); }
.hand-area .card.xl { width: clamp(76px, min(8.6vw, 14vh), 150px); }
.card.slot-empty {
  background: rgba(244,241,220,.04); box-shadow: none; border: 2px dashed rgba(244,241,220,.28);
  display: grid; place-items: center; color: rgba(244,241,220,.45); font-family: var(--display); font-stretch: 125%; font-weight: 800;
}
.card.slot-off { opacity: .14; background: transparent; border: 2px solid rgba(244,241,220,.4); box-shadow: none; }
.card .num {
  position: absolute; top: 4px; left: 4px; font: 700 .62rem var(--body); background: rgba(29,29,27,.75); color: var(--cream);
  border-radius: 999px; padding: 1px 6px; pointer-events: none;
}
.card.sm .num { display: none; }
.card.target { cursor: pointer; box-shadow: 0 0 0 3px var(--glow), 0 0 22px 4px rgba(246,211,74,.55); animation: lift 1.2s ease-in-out infinite; }
.card.target:hover { transform: translateY(-6px) scale(1.04); }
.card.flip { animation: flip .5s ease-out; }
@keyframes flip { from { transform: rotateY(90deg) scale(.9); filter: brightness(.6); } to { transform: none; } }
@keyframes lift { 50% { transform: translateY(-3px); } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(246,211,74,.7); } 50% { box-shadow: 0 0 0 8px rgba(246,211,74,0); } }

.pile { position: relative; }
.pile .card + .card { position: absolute; }
.stack { box-shadow: 2px 2px 0 #d9d4b8, 3px 3px 0 #1d1d1b, 5px 5px 0 #c9c4a6, 6px 6px 0 #1d1d1b, 8px 8px 0 #b7b294, 0 10px 22px rgba(0,0,0,.45); }
.stack.navy { box-shadow: 2px 2px 0 #34497a, 3px 3px 0 #111, 5px 5px 0 #2b3f6c, 6px 6px 0 #111, 8px 8px 0 #22345a, 0 10px 22px rgba(0,0,0,.45); }
.stack.target { box-shadow: 0 0 0 3px var(--glow), 0 0 22px 4px rgba(246,211,74,.55), 5px 5px 0 #c9c4a6; }

/* ---------- Mesa ---------- */
.table { display: grid; grid-template-columns: 1fr 300px; gap: 0; min-height: calc(100vh - 60px); }
.felt { padding: 14px 22px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side { border-left: 1px solid rgba(244,241,220,.12); padding: 18px; display: flex; flex-direction: column; gap: 14px; min-height: 0; }

.opponents { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.board {
  border-radius: 14px; padding: 12px 14px 12px; background: rgba(0,0,0,.22); border: 1px solid rgba(244,241,220,.14);
  transition: box-shadow .2s, border-color .2s;
}
.board.active { border-color: var(--glow); box-shadow: 0 0 0 1px var(--glow), 0 0 30px rgba(246,211,74,.18); }
.board.shielded { background-image: repeating-linear-gradient(135deg, rgba(244,241,220,.03) 0 10px, transparent 10px 20px); }
.board-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.board-head .name { font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: .82rem; letter-spacing: .05em; }
.board-head .tag { font-size: .68rem; padding: 2px 8px; border-radius: 999px; background: var(--glow); color: var(--ink); font-weight: 700; }
.board-head .tag.shield { background: var(--cream); }
.board-head .spacer { flex: 1; }
.grid5 { display: grid; grid-template-columns: repeat(5, auto); gap: 6px; justify-content: start; }
.mine .grid5 { gap: 10px; }
.extras { display: flex; gap: 14px; align-items: flex-end; margin-top: 10px; flex-wrap: wrap; }
.board:not(.mine) .board-body { display: flex; gap: 12px; align-items: flex-start; }
.board:not(.mine) .extras { flex-direction: column; align-items: flex-start; margin-top: 0; gap: 6px; }
.board:not(.mine) .tracker { width: clamp(84px, 7vw, 120px); }
.extras .group { display: flex; flex-direction: column; gap: 4px; }
.extras .label { font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; opacity: .6; }
.extras .cards { display: flex; gap: 4px; min-height: 10px; }
.fan .card + .card { margin-left: calc(var(--opp-w) * -0.55); }
.mine .fan .card + .card { margin-left: calc(var(--opp-w) * -0.2); }

/* Marcador de progreso */
.tracker { position: relative; width: clamp(110px, 10vw, 150px); aspect-ratio: 851 / 468; border-radius: 6px; flex: none;
  background: url(/cards/tracker.webp) center / cover; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.tracker .cube {
  position: absolute; width: 15%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #4a4a46 0%, #1d1d1b 55%, #000 100%);
  border: 2px solid #fff; border-radius: 3px;
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--glow), 0 0 14px 4px rgba(246,211,74,.85), 2px 3px 0 rgba(0,0,0,.5);
  transition: left .4s, top .4s; animation: cube 1.8s ease-in-out infinite;
}
.tracker .cube::after { content: ''; position: absolute; left: 18%; top: 14%; width: 34%; height: 22%; border-radius: 2px; background: rgba(255,255,255,.55); }
@keyframes cube { 50% { box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--glow), 0 0 22px 8px rgba(246,211,74,.95), 2px 3px 0 rgba(0,0,0,.5); } }
.board.mine .tracker { width: clamp(140px, 13vw, 190px); }

/* Centro de la mesa */
.center { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 3vw, 44px); flex-wrap: wrap; padding: 6px 0; }
.center .spot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.center .spot .label { font-size: .66rem; text-transform: uppercase; letter-spacing: .14em; opacity: .7; }
.center .count { font: 700 .72rem var(--body); opacity: .7; }
.hand-area { min-width: 320px; display: flex; align-items: center; gap: 16px; text-align: left; }
.hand-area .hand-text { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.hand-area .actions { justify-content: flex-start; }
.prompt { max-width: 300px; font-size: .95rem; line-height: 1.35; }
.prompt b { color: var(--glow); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.clickable { cursor: pointer; }

.board.mine { align-self: center; padding: 16px 20px 16px; }
.mine-wrap { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }

/* Panel lateral */
.side h3 { margin: 0; font-size: .78rem; letter-spacing: .12em; }
.scores { display: flex; flex-direction: column; gap: 8px; }
.score { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(0,0,0,.25); font-size: .88rem; }
.score.active { outline: 2px solid var(--glow); }
.score .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(244,241,220,.25); }
.score.active .dot { background: var(--glow); }
.score .spacer { flex: 1; }
.score .keys { display: flex; gap: 3px; }
.score .keys i { width: 12px; height: 17px; border-radius: 2px; background: var(--navy) url(/cards/key-back.webp) center / cover; border: 1px solid rgba(244,241,220,.5); }
.log { flex: 1; overflow: auto; font-size: .82rem; line-height: 1.4; display: flex; flex-direction: column-reverse; gap: 6px; min-height: 160px; max-height: calc(100vh - 380px); padding-right: 4px; }
.log div { padding: 6px 9px; border-radius: 6px; background: rgba(0,0,0,.2); opacity: .85; }
.log div:first-child { opacity: 1; background: rgba(244,241,220,.08); }

/* ---------- Modales ---------- */
.overlay { position: fixed; inset: 0; background: rgba(10,10,9,.78); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .2s; backdrop-filter: blur(3px); }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--cream); color: var(--ink); padding: 34px 34px 28px; max-width: 760px; width: 100%; text-align: center; max-height: 90vh; overflow: auto; }
.modal.dark { background: var(--ink); color: var(--cream); }
.modal h2 { margin: 0 0 8px; font-size: 1.35rem; }
.modal p { margin: 0 0 18px; }
.modal .cards-row { display: flex; gap: 18px; justify-content: center; margin: 14px 0 22px; flex-wrap: wrap; }
.modal .choice { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.opp-pick { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 14px 0 20px; }
.opp-pick button { border: 3px solid var(--ink); background: transparent; border-radius: 12px; padding: 14px 18px; min-width: 130px; color: var(--ink); }
.opp-pick button:hover { background: var(--ink); color: var(--cream); }
.opp-pick .name { font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; display: block; margin-bottom: 8px; }
.opp-pick .keys { display: flex; gap: 4px; justify-content: center; }
.opp-pick .keys i { width: 22px; height: 31px; border-radius: 3px; background: url(/cards/key-back.webp) center / cover; }

.rules { text-align: left; font-size: .95rem; line-height: 1.45; }
.rules h3 { font-size: .9rem; margin: 20px 0 6px; }
.rules .power { display: grid; grid-template-columns: 74px 1fr; gap: 14px; align-items: center; margin: 10px 0; }
.rules .power .card { width: 74px; }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--cream); color: var(--ink); padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .25s; z-index: 80; }
#toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 1100px) {
  .table { grid-template-columns: 1fr; }
  .side { border-left: none; border-top: 1px solid rgba(244,241,220,.12); }
  .log { max-height: 260px; }
}

/* Aviso de carta */
#notice {
  position: fixed; left: 50%; top: 74px; transform: translate(-50%, -24px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 16px; width: min(560px, calc(100vw - 32px));
  background: var(--cream); color: var(--ink); padding: 14px 44px 14px 14px; border-radius: 14px;
  border: 3px solid var(--ink); box-shadow: 0 0 0 2px var(--cream), 0 18px 40px rgba(0,0,0,.55);
  transition: transform .25s, opacity .25s; z-index: 70; cursor: pointer;
}
#notice.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
#notice.mine { box-shadow: 0 0 0 3px var(--glow), 0 0 30px rgba(246,211,74,.45), 0 18px 40px rgba(0,0,0,.55); }
#notice.victim { background: #f6dcd6; box-shadow: 0 0 0 3px #c0473b, 0 18px 40px rgba(0,0,0,.55); }
#notice .n-card { width: 64px; aspect-ratio: 5 / 7; border-radius: 6px; background: center / cover; flex: none; box-shadow: 0 3px 8px rgba(0,0,0,.35); }
#notice .n-who { font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: .7rem; letter-spacing: .12em; opacity: .7; }
#notice .n-text { font-size: 1.02rem; font-weight: 600; line-height: 1.35; margin-top: 3px; }
#notice .n-close { position: absolute; top: 6px; right: 10px; border: none; background: none; font-size: 1.4rem; color: var(--ink); opacity: .6; }

.login .account { margin: -12px 0 22px; font-size: .9rem; opacity: .85; }
.login .account b { color: var(--glow); }

.lobby .hint { margin: 16px 0 0; font-size: .85rem; opacity: .7; }

/* ---------- Entrar: pestañas código / cuenta ---------- */
.tabs { display: flex; gap: 6px; background: rgba(244,241,220,.08); padding: 5px; border-radius: 999px; margin: 0 0 22px; }
.tabs button { flex: 1; border: none; background: transparent; color: var(--cream); padding: .65em .8em; border-radius: 999px;
  font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: .7rem; letter-spacing: .05em; opacity: .7; }
.tabs button.on { background: var(--cream); color: var(--ink); opacity: 1; }
.code-input { text-transform: uppercase; letter-spacing: .35em; font-family: var(--display) !important; font-stretch: 125%; font-weight: 800 !important; font-size: 1.25rem !important; text-align: center; }

/* Código en la barra y en la sala */
.code-chip { font-size: .78rem; padding: 4px 12px; border-radius: 999px; border: 1px solid rgba(244,241,220,.4); letter-spacing: .06em; }
.code-chip b { font-family: var(--display); font-stretch: 125%; letter-spacing: .2em; color: var(--glow); margin-left: 4px; }
.big-code { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: clamp(2.4rem, 7vw, 3.6rem); letter-spacing: .3em;
  padding: 10px 10px 10px calc(10px + .3em); margin: 4px auto 14px; display: inline-block; border: 3px dashed var(--ink); border-radius: 14px; background: #fff8; }

.join-panel { margin-top: 22px; padding: 30px 36px !important; }
.join-panel h2 { margin-bottom: 14px !important; }
.join-row { display: flex; gap: 10px; justify-content: center; max-width: 420px; margin: 0 auto; }
.join-row input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 8px; border: 2px solid var(--ink); background: #fff; color: var(--ink); }

/* ---------- Panel de administrador ---------- */
.admin { max-width: 1000px; margin: 32px auto; padding: 0 20px; display: flex; flex-direction: column; gap: 26px; }
.admin .panel { background: var(--cream); color: var(--ink); padding: 32px 34px; }
.admin h2 { margin: 0 0 6px; font-size: 1.3rem; }
.admin p { margin: 0 0 18px; }
.acc-form { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.acc-form .field { margin: 0; }
.acc-form .field label { color: var(--ink); opacity: .7; }
.acc-form input { width: 100%; padding: 10px 12px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 600 .95rem var(--body); }
.admin .error { color: #b3261e; min-height: 1.2em; margin: 8px 0 6px; font-size: .9rem; }
.acc-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.acc-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; opacity: .6; padding: 8px 10px; border-bottom: 2px solid var(--ink); }
.acc-table td { padding: 10px; border-bottom: 1px solid rgba(29,29,27,.15); vertical-align: middle; }
.acc-table code { font-size: .9rem; background: rgba(29,29,27,.08); padding: 2px 6px; border-radius: 4px; }
.acc-actions { text-align: right; white-space: nowrap; }
.acc-actions .btn { margin-left: 6px; }
.btn.danger { color: #b3261e; border-color: #b3261e; }
.pill { font-size: .66rem; padding: 2px 8px; border-radius: 999px; background: var(--ink); color: var(--cream); margin-left: 6px; vertical-align: 2px; }
.cred { text-align: left; background: #fff; border: 2px dashed var(--ink); border-radius: 10px; padding: 14px 18px; margin: 4px 0 18px; line-height: 1.8; font-size: 1rem; }
.modal .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (max-width: 760px) { .acc-form { grid-template-columns: 1fr; } }

.topbar .btn, .topbar .who-btn, .topbar .code-chip { white-space: nowrap; }
.topbar { flex-wrap: wrap; row-gap: 8px; }
.admin .acc-table td { overflow-wrap: anywhere; }
.acc-actions { white-space: normal; display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.acc-actions .btn { margin-left: 0; }
@media (max-width: 760px) { .admin .panel { padding: 24px 18px; } .acc-table th:nth-child(3), .acc-table td:nth-child(3) { display: none; } }

.pw-cell { white-space: nowrap; }
.pw-cell .pw { margin-right: 4px; }
.icon-btn { border: 1.5px solid rgba(29,29,27,.3); background: #fff; border-radius: 6px; padding: 2px 6px; font-size: .85rem; line-height: 1.2; vertical-align: middle; }
.icon-btn:hover { border-color: var(--ink); }
.pw-input { width: 100%; padding: 12px 14px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 600 1.05rem var(--body); }
.admin { max-width: 1180px; }
.acc-table code { white-space: nowrap; overflow-wrap: normal; }
.acc-table td:first-child { min-width: 130px; }

/* Iconos (Bootstrap Icons) en el panel de admin */
.admin .bi, .topbar .bi { vertical-align: -0.125em; }
.btn .bi { margin-right: 4px; font-size: 1.05em; }
.admin h2 .bi { margin-right: 6px; font-size: .95em; }
.icon-btn .bi { font-size: .95rem; }
.admin .gems { opacity: .6; white-space: nowrap; }
.admin .trophy { color: #c9a227; }
.admin .bi-robot { opacity: .75; }

.icon-btn.lg { padding: 6px 9px; font-size: 1rem; border-radius: 8px; }
.icon-btn.lg .bi { font-size: 1rem; }
.icon-btn.danger { color: #b3261e; border-color: rgba(179,38,30,.4); }
.icon-btn.danger:hover { border-color: #b3261e; }
.acc-actions { align-items: center; }
.edit-form { text-align: left; margin-top: 10px; }
.edit-form .field label { color: var(--ink); opacity: .7; }
.edit-form input { width: 100%; padding: 11px 13px; border-radius: 6px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font: 600 1rem var(--body); }
.edit-form .error { color: #b3261e; min-height: 1.2em; margin: 4px 0 10px; font-size: .9rem; }

/* Nueva partida: elegir modo */
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.mode-pick button { border: 3px solid var(--ink); background: transparent; color: var(--ink); border-radius: 14px; padding: 24px 18px;
  display: flex; flex-direction: column; align-items: center; gap: 8px; transition: all .12s; }
.mode-pick button:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }
.mode-pick .mode-ico { font-size: 2rem; }
.mode-pick b { font-family: var(--display); font-stretch: 125%; font-weight: 800; text-transform: uppercase; font-size: 1rem; letter-spacing: .03em; }
.mode-pick small { font-size: .88rem; line-height: 1.35; opacity: .85; }
@media (max-width: 600px) { .mode-pick { grid-template-columns: 1fr; } }

/* Iconos Bootstrap en toda la app */
.bi { vertical-align: -0.125em; }
.seat .ico .bi { font-size: 1.5rem; }
.mode-pick .mode-ico .bi { font-size: 2.2rem; }
.score .bi-flag-fill { opacity: .8; }
.board-head .bi-robot, .score .bi-robot { opacity: .85; }


#notice .n-ok { margin-top: 10px; }
#notice { padding-right: 18px; }

/* Las cartas en español traen esquinas redondeadas transparentes */
.card { background-color: transparent; }
.card.slot-empty { background-color: rgba(244,241,220,.04); }

/* ---------- Guía rápida ---------- */
.ob-overlay { z-index: 90; }
.onboard { max-width: 640px; }
.ob-step { font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; opacity: .6; margin-bottom: 6px; }
.onboard h2 { margin-bottom: 18px !important; font-size: 1.5rem !important; }
.ob-cards { display: flex; justify-content: center; gap: 10px; margin: 6px 0 20px; }
.ob-cards .card { width: clamp(70px, 14vw, 110px); }
.ob-cards .tilt-l { transform: rotate(-6deg) translateY(6px); }
.ob-cards .tilt-r { transform: rotate(6deg) translateY(6px); }
.ob-powers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 18px; }
.ob-powers > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ob-powers .card { width: 100%; max-width: 96px; }
.ob-powers span { font-size: .74rem; font-weight: 600; line-height: 1.2; }
.ob-text { font-size: 1.02rem; line-height: 1.5; max-width: 520px; margin: 0 auto 16px !important; }
.ob-dots { display: flex; gap: 8px; justify-content: center; margin-bottom: 18px; }
.ob-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(29,29,27,.25); }
.ob-dots i.on { background: var(--ink); width: 24px; border-radius: 5px; }
@media (max-width: 560px) { .ob-powers { grid-template-columns: repeat(3, 1fr); } }

.onboard { position: relative; }
.ob-close { position: absolute; top: 12px; right: 14px; border: none; background: none; color: var(--ink); font-size: 1.15rem; opacity: .55; padding: 6px; border-radius: 6px; }
.ob-close:hover { opacity: 1; background: rgba(29,29,27,.08); }

/* Guía paso 2: cada carta tiene su lugar */
.ob-board-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; margin: 4px 0 14px; }
.ob-hand { display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; }
.ob-hand .card { width: 62px; box-shadow: 0 0 0 3px var(--glow), 0 6px 14px rgba(0,0,0,.3); }
.ob-tag { font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; opacity: .7; }
.ob-arrow { position: absolute; right: -16px; top: 50%; font-size: 1.3rem; animation: nudge 1.2s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(5px); } }
.ob-board { display: grid; grid-template-columns: repeat(5, 52px); gap: 6px 8px; padding: 10px 12px; border-radius: 12px; background: rgba(29,29,27,.07); }
.ob-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ob-slot .card { width: 52px; box-shadow: 0 2px 5px rgba(0,0,0,.25); }
.ob-slot b { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: .72rem; }
.ob-slot.goal .ob-empty { background: rgba(246,211,74,.25); border: 2px dashed var(--ink); box-shadow: 0 0 0 3px var(--glow); animation: pulse 1.4s infinite; }
.ob-slot.goal b { background: var(--ink); color: var(--cream); border-radius: 999px; padding: 0 7px; }
.ob-flow { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 2px 0 14px; flex-wrap: wrap; }
.ob-flow > div { display: flex; flex-direction: column; align-items: center; gap: 4px; max-width: 120px; }
.ob-flow > div > .bi { font-size: 1.9rem; line-height: 1; }
.ob-flow .card { width: 40px; }
.ob-flow span { font-size: .72rem; font-weight: 600; line-height: 1.2; }
.ob-flow .ob-sep { font-size: 1.1rem; opacity: .5; }
.ob-pair { display: grid !important; grid-template-columns: auto auto auto; align-items: center; column-gap: 4px; max-width: 150px !important; }
.ob-pair em { font-style: normal; font-size: .75rem; font-weight: 700; }
.ob-pair span { grid-column: 1 / -1; text-align: center; margin-top: 4px; }
@media (max-width: 600px) { .ob-board { grid-template-columns: repeat(5, 40px); } .ob-slot .card { width: 40px; } .ob-board-wrap { flex-direction: column; } .ob-arrow { display: none; } }

/* Guía simple: una imagen y una frase por pantalla */
.ob-hero { display: flex; justify-content: center; margin: 6px 0 22px; }
.ob-hero .card { width: 150px; transform: rotate(-3deg); box-shadow: 0 10px 26px rgba(0,0,0,.3); }
.ob-doors { display: grid; grid-template-columns: repeat(5, 64px); gap: 10px 12px; justify-content: center; margin: 6px 0 22px; }
.ob-doors > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ob-doors .card { width: 64px; box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.ob-doors b { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: .85rem; }
.ob-specials { display: flex; justify-content: center; gap: 10px; margin: 6px 0 22px; }
.ob-specials .card { width: 96px; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.onboard .ob-text { font-size: 1.12rem; }
@media (max-width: 600px) { .ob-doors { grid-template-columns: repeat(5, 48px); } .ob-doors .card { width: 48px; } .ob-specials { flex-wrap: wrap; } .ob-specials .card { width: 70px; } }

.ob-key { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 6px 0 22px; }
.ob-key .card { width: 92px; box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.ob-key .ob-key-card { width: 112px; }
.ob-key > .bi { font-size: 1.6rem; animation: nudge 1.2s ease-in-out infinite; }
.ob-key em { font-style: normal; font-weight: 700; }
@keyframes nudge { 50% { transform: translateX(5px); } }

.rules-links { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 4px 0 18px; }
a.btn { text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }

.seat .ready-tag { display: block; font-size: .7rem; font-weight: 600; opacity: .7; margin-top: 4px; }
