/* ============ Mr Arcade — estilo arcade frenético ============ */
:root {
  --panel: rgba(24, 34, 41, 0.94);
  --panel2: #22323b;
  --edge: #3d5a68;
  --edge-dark: #0e1519;
  --text: #ffffff;
  --muted: #a8bec8;
  --blue: #0b8bf0;
  --blue-d: #075a9e;
  --red: #f0464d;
  --red-d: #9b2329;
  --orange: #ff9a16;
  --orange-d: #b05f00;
  --green: #36b97c;
  --green-d: #1d7048;
  --grey: #4f6672;
  --grey-d: #2b3a42;
  --gold: #ffd23f;
  --ok: #5dff9d;
  --bad: #ff5f55;
  --font: 'Pixelify Sans', 'Silkscreen', 'Courier New', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 17px;
  color: var(--text);
  min-height: 100vh;
  background: #0b0812;
  overflow-x: hidden;
  -webkit-font-smoothing: none;
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0;
}
body.no-webgl { background: radial-gradient(circle at 30% 20%, #5a1b3a, #0b0812 70%); }

/* Capas de fondo y efectos */
#bg { position: fixed; inset: 0; width: 100vw; height: 100vh; image-rendering: pixelated; z-index: -2; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }
#pops { position: fixed; inset: 0; pointer-events: none; z-index: 45; overflow: hidden; }
#flash { position: fixed; inset: 0; pointer-events: none; z-index: 44; opacity: 0; }
#flash.on { animation: flash .45s ease-out; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }
.crt {
  position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.13) 0 1px, transparent 1px 3px);
  box-shadow: inset 0 0 160px rgba(0,0,0,.7);
}
body.hurry .crt { animation: hurry 1s infinite; }
@keyframes hurry { 50% { box-shadow: inset 0 0 200px rgba(200,0,30,.55); } }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.block { display: block; margin-top: 12px; }
a { color: var(--muted); }

/* Texto con sombra dura, como en los arcades */
h1, h2, h3, .prompt, .big-num, .hud-box b, .brand, .btn { text-shadow: 0 3px 0 rgba(0,0,0,.45); }
h1 { font-size: 30px; margin: 0 0 12px; line-height: 1.15; }
h2 { font-size: 22px; margin: 0 0 12px; }
h3 { font-size: 18px; margin: 18px 0 10px; }

/* ---------- Barra superior ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; position: relative; z-index: 5; }
.brand { color: #fff; text-decoration: none; font-size: 22px; letter-spacing: 1px; }
.brand b { color: var(--gold); }
.brand-icon { display: inline-block; animation: wobble 2.4s ease-in-out infinite; }
.top-right { display: flex; align-items: center; gap: 10px; }
.badge { background: var(--panel); border: 2px solid var(--edge); padding: 4px 10px; border-radius: 8px; letter-spacing: 2px; font-size: 14px; }
.conn { font-size: 14px; }
.conn.on { color: var(--ok); }
.conn.off { color: var(--bad); animation: blink 1s infinite; }
.ping { font-size: 12px; min-width: 52px; margin-left: -6px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ping.good { color: var(--ok); }
.ping.meh { color: var(--gold); }
.ping.bad { color: var(--bad); }
.conn.meh { color: var(--gold); }
.conn.bad { color: var(--bad); }
@keyframes blink { 50% { opacity: .3; } }

main { max-width: 1140px; margin: 0 auto; padding: 6px 18px 60px; position: relative; z-index: 2; }

/* ---------- Paneles ---------- */
.panel {
  background: var(--panel);
  border: 3px solid var(--edge);
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 6px 0 var(--edge-dark), 0 14px 30px rgba(0,0,0,.45);
}
.narrow { max-width: 480px; margin: 30px auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- Botones gordos ---------- */
button, .btn {
  font-family: var(--font);
  font-size: 17px;
  color: #fff;
  background: var(--grey);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--grey-d);
  transition: transform .08s, box-shadow .08s, filter .15s;
  position: relative;
}
button:hover:not(:disabled) { transform: translateY(-2px) rotate(-1deg) scale(1.03); filter: brightness(1.12); }
button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--grey-d); }
button:disabled { opacity: .45; cursor: not-allowed; filter: saturate(.4); }
.btn.blue, button.primary { background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.btn.blue:active, button.primary:active { box-shadow: 0 1px 0 var(--blue-d); }
.btn.red { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.btn.orange { background: var(--orange); box-shadow: 0 5px 0 var(--orange-d); }
.btn.green { background: var(--green); box-shadow: 0 5px 0 var(--green-d); }
.btn.grey { background: var(--grey); box-shadow: 0 5px 0 var(--grey-d); }
.btn.big { width: 100%; padding: 14px; font-size: 22px; margin-top: 12px; letter-spacing: 1px; }
.btn.small { padding: 7px 12px; font-size: 15px; }
.btn.tiny { padding: 5px 9px; font-size: 13px; box-shadow: 0 3px 0 var(--grey-d); border-radius: 7px; }
.btn.tiny.red { box-shadow: 0 3px 0 var(--red-d); }
.btn.tiny.blue { box-shadow: 0 3px 0 var(--blue-d); }
#btn-start { animation: throb 1.2s ease-in-out infinite; }
@keyframes throb { 50% { transform: scale(1.03) rotate(-.6deg); } }

/* ---------- Formularios ---------- */
label { display: block; margin: 12px 0; font-size: 15px; color: var(--muted); }
input, select {
  font-family: var(--font);
  font-size: 17px;
  color: #fff;
  background: #0f171c;
  border: 3px solid var(--edge);
  border-radius: 10px;
  padding: 9px 12px;
}
label > input:not([type]), label > select, input:not([type]) { display: block; width: 100%; margin-top: 6px; }
input:focus, select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255,210,63,.25); }
input[type=range] { width: 100%; accent-color: var(--orange); margin-top: 6px; padding: 0; border: none; background: none; }
input[type=checkbox] { accent-color: var(--orange); width: 20px; height: 20px; }
.code-input { text-transform: uppercase; letter-spacing: 5px; font-weight: 700; text-align: center; }
.tag { background: #0f171c; border: 2px solid var(--edge); padding: 1px 8px; border-radius: 6px; letter-spacing: 3px; color: var(--gold); }
.pill { background: #0f171c; padding: 1px 9px; border-radius: 99px; font-size: 14px; color: var(--gold); margin-left: 6px; border: 2px solid var(--edge); }
kbd { font-family: var(--font); font-size: 11px; background: rgba(0,0,0,.35); border-radius: 4px; padding: 1px 5px; margin-left: 4px; }

/* ---------- Menú principal ---------- */
.mega-title { text-align: center; font-size: clamp(46px, 10vw, 104px); margin: 10px 0 0; line-height: .95; letter-spacing: 4px; }
.mega-title span { display: block; }
.mega-title i { display: inline-block; font-style: normal; animation: wave 1.6s ease-in-out infinite; }
.mega-title .w1 i { color: var(--red); text-shadow: 0 6px 0 var(--red-d), 0 12px 0 rgba(0,0,0,.4); }
.mega-title .w2 i { color: var(--blue); text-shadow: 0 6px 0 var(--blue-d), 0 12px 0 rgba(0,0,0,.4); }
@keyframes wave { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
.subtitle { text-align: center; font-size: 20px; margin: 18px 0 22px; text-shadow: 0 2px 0 #000; }
.name-panel { max-width: 460px; margin: 0 auto 22px; padding: 12px 18px; }
.name-panel label { margin: 0; }
.game-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 22px; perspective: 900px; }
.game-card {
  background: var(--panel);
  border: 4px solid var(--edge);
  border-radius: 18px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 8px 0 var(--edge-dark), 0 18px 40px rgba(0,0,0,.5);
  transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  transition: transform .12s;
  animation: deal-in .5s backwards cubic-bezier(.2,1.4,.4,1);
  display: flex; flex-direction: column;
}
.game-card.theme-captcha { border-color: #2c7fd6; }
.game-card.theme-casino { border-color: #2fae6a; }
.game-card.soon { opacity: .7; border-style: dashed; }
.game-card h2 { font-size: 28px; margin: 6px 0; }
.game-card p { color: var(--muted); margin: 0 0 10px; flex: 1; }
.gc-emoji { font-size: 74px; animation: float 3s ease-in-out infinite; }
.gc-types { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; font-size: 22px; }
.join-panel { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; max-width: 560px; margin: 26px auto 0; padding: 14px; }
.join-panel input { width: 160px; margin: 0; }
@keyframes float { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
@keyframes wobble { 0%,100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes deal-in { from { transform: translateY(60px) rotate(-8deg) scale(.8); opacity: 0; } }

/* ---------- Unirse ---------- */
.join-game { display: flex; align-items: center; gap: 12px; font-size: 22px; margin-bottom: 8px; }
.big-emoji { font-size: 52px; display: inline-block; animation: float 3s ease-in-out infinite; }
.robot-check {
  display: flex; align-items: center; gap: 12px; background: #f6f6f6; color: #222;
  border: 3px solid #cfcfcf; border-radius: 6px; padding: 16px; cursor: pointer; font-size: 18px;
  box-shadow: 0 4px 0 #9a9a9a;
}
.robot-check input { width: 28px; height: 28px; margin: 0; accent-color: #1a73e8; }
.robot-check em { margin-left: auto; font-size: 10px; color: #777; font-style: normal; }

/* ---------- Sala de espera ---------- */
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.lobby-game { display: flex; align-items: center; gap: 14px; }
.lobby-game h2 { margin: 0; font-size: 28px; }
.lobby-game p { margin: 2px 0 0; }
.game-switch { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.game-switch .on { outline: 3px solid var(--gold); }
.share { display: flex; gap: 8px; }
.share input { margin: 0; font-size: 14px; }
.players { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow: auto; }
.players li {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; margin-bottom: 6px;
  background: var(--panel2); border: 2px solid var(--edge); animation: deal-in .35s backwards cubic-bezier(.2,1.4,.4,1);
}
.players li.me { border-color: var(--gold); }
.players li.off { opacity: .45; }
.players li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.settings label { margin: 10px 0; }
.settings output { float: right; color: var(--gold); }
.settings .check { display: flex; gap: 10px; align-items: center; color: #fff; }
.settings .check input { flex: none; }
.settings select { width: 100%; }
.settings.locked input, .settings.locked select, .settings.locked .chip { pointer-events: none; }
.settings.locked { opacity: .85; }
.group-title { font-size: 16px; color: #fff; margin: 4px 0 8px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.type-chips .chip { margin: 0; cursor: pointer; }
.type-chips .chip input { display: none; }
.type-chips .chip span {
  display: inline-block; padding: 6px 10px; border-radius: 9px; border: 2px solid var(--edge);
  background: #0f171c; color: var(--muted); font-size: 14px; transition: transform .1s; user-select: none;
  box-shadow: 0 3px 0 var(--edge-dark);
}
.type-chips .chip:hover span { transform: translateY(-2px) rotate(-2deg); }
.type-chips .chip input:checked + span { background: var(--blue); border-color: #5cb5ff; color: #fff; }
body[data-theme=casino] .type-chips .chip input:checked + span { background: var(--green); border-color: #7be3b0; }
fieldset { border: 2px solid var(--edge); border-radius: 12px; padding: 4px 12px 8px; margin: 12px 0 0; }
legend { color: #fff; font-size: 15px; padding: 0 6px; }
.practice { margin-top: 18px; }
.practice-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* ---------- Partida ---------- */
.game-layout { display: grid; grid-template-columns: 1fr 300px; gap: 18px; }
@media (max-width: 860px) { .game-layout { grid-template-columns: 1fr; } }
.hud { display: flex; justify-content: space-around; gap: 10px; }
.hud-box {
  flex: 1; text-align: center; background: #0f171c; border: 3px solid var(--edge); border-radius: 12px; padding: 6px 4px;
  box-shadow: 0 4px 0 var(--edge-dark);
}
.hud-box span { display: block; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.hud-box b { font-size: 36px; font-variant-numeric: tabular-nums; display: inline-block; }
.score-box b { color: var(--gold); }
.hud-box:nth-child(1) { border-color: #2c7fd6; }
.hud-box:nth-child(2) { border-color: #d6a62c; }
.hud-box:nth-child(3) { border-color: #c2412c; }
.hud-box.danger { border-color: var(--red); animation: alarm .5s infinite; }
.hud-box.danger b { color: var(--red); }
@keyframes alarm { 50% { background: #3a0d12; transform: rotate(-1.5deg) scale(1.04); } }
.timebar { height: 12px; background: #0f171c; border: 2px solid var(--edge); border-radius: 8px; overflow: hidden; margin: 12px 0; }
#timebar-fill { height: 100%; width: 100%; background: repeating-linear-gradient(45deg, var(--gold) 0 10px, var(--orange) 10px 20px); transition: width .25s linear; animation: stripes .6s linear infinite; background-size: 28px 28px; }
@keyframes stripes { to { background-position: 28px 0; } }
.countdown { font-size: 160px; text-align: center; padding: 30px 0; color: var(--gold); text-shadow: 0 10px 0 var(--orange-d); }
.frenzy {
  text-align: center; font-size: 22px; padding: 8px; border-radius: 10px; margin-bottom: 10px;
  background: repeating-linear-gradient(-45deg, #ff5a1f 0 16px, #ff9a16 16px 32px); background-size: 45px 45px;
  animation: stripes .5s linear infinite, alarm .6s infinite; text-shadow: 0 3px 0 #000;
}
.combo {
  position: absolute; right: 18px; top: 108px; z-index: 3;
  background: linear-gradient(#ffb23f, #ff4f1f); padding: 6px 12px; border-radius: 10px; font-size: 20px;
  box-shadow: 0 4px 0 #8a2a00; transform: rotate(4deg); animation: float 1.2s ease-in-out infinite;
  filter: saturate(calc(1 + var(--heat, 0)));
}
.game-main { position: relative; }
.out-msg { text-align: center; font-size: 30px; padding: 50px 0; }
.prompt { text-align: center; font-size: 22px; margin: 6px 0 12px; min-height: 26px; }
.challenge-body { display: flex; flex-direction: column; align-items: center; gap: 12px; border-radius: 14px; padding: 6px; }
.challenge-body > * { width: 100%; }
.pop-in { animation: pop-in .38s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop-in { from { transform: scale(.7) rotate(-3deg); opacity: 0; } }
.game-actions { display: flex; justify-content: center; margin-top: 12px; }
.feedback { text-align: center; min-height: 26px; margin-top: 12px; font-size: 19px; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }
.feedback.skip { color: var(--muted); }
#btn-stop { margin-top: 14px; }
.board-panel h3 { margin-top: 0; }
.board { list-style: none; padding: 0; margin: 0; max-height: 560px; overflow: auto; }
.board li {
  display: flex; gap: 8px; padding: 7px 10px; border-radius: 10px; margin-bottom: 5px; background: var(--panel2);
  border: 2px solid var(--edge); align-items: center; font-variant-numeric: tabular-nums;
}
.board li .pos { width: 28px; color: var(--muted); }
.board li .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li .score { color: var(--gold); }
.board li.me { border-color: var(--gold); background: #3a3214; }
.board li.off, .board li.out { opacity: .5; }
.board li.sep { background: none; border: none; justify-content: center; }

/* Animaciones reutilizables */
.bump { animation: bump .3s cubic-bezier(.2,1.8,.4,1); }
@keyframes bump { 0% { transform: scale(1.45) rotate(-5deg); } 100% { transform: none; } }
main.shake-1 { animation: shake1 .35s; }
main.shake-2 { animation: shake2 .4s; }
main.shake-3 { animation: shake3 .45s; }
@keyframes shake1 { 25% { transform: translate(-4px, 2px); } 75% { transform: translate(4px, -2px); } }
@keyframes shake2 { 20% { transform: translate(-9px, 3px) rotate(-.6deg); } 40% { transform: translate(8px, -4px) rotate(.6deg); } 60% { transform: translate(-6px, 2px); } 80% { transform: translate(5px, -1px); } }
@keyframes shake3 { 15% { transform: translate(-14px, 6px) rotate(-1deg); } 30% { transform: translate(12px, -8px) rotate(1deg); } 50% { transform: translate(-10px, 4px); } 70% { transform: translate(8px, -3px); } 85% { transform: translate(-4px, 2px); } }
.pop-text {
  position: absolute; transform: translate(-50%, -50%); font-size: 34px; white-space: nowrap;
  text-shadow: 0 4px 0 rgba(0,0,0,.7), 0 0 14px rgba(0,0,0,.5); animation: pop-up 1.1s ease-out forwards;
}
.pop-text.big { font-size: 64px; animation-duration: 1.8s; }
@keyframes pop-up {
  0% { transform: translate(-50%, -50%) scale(.3) rotate(var(--rot)); opacity: 0; }
  15% { transform: translate(-50%, -70%) scale(1.25) rotate(var(--rot)); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(1) rotate(var(--rot)); opacity: 0; }
}

/* ---------- Resultados ---------- */
.results-title { font-size: 46px; animation: wave 1.6s ease-in-out infinite; color: var(--gold); text-shadow: 0 5px 0 var(--orange-d); }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 24px 0 28px; }
.podium .step { text-align: center; width: 150px; animation: deal-in .6s backwards cubic-bezier(.2,1.4,.4,1); }
.podium .block {
  border-radius: 12px 12px 0 0; display: flex; align-items: flex-start; justify-content: center;
  font-size: 40px; padding-top: 10px; border: 3px solid rgba(0,0,0,.3); border-bottom: none;
}
.podium .p1 .block { height: 150px; background: linear-gradient(#ffe066, #c98f12); color: #4a3200; }
.podium .p2 .block { height: 105px; background: linear-gradient(#eef1f6, #8d95a8); color: #222; }
.podium .p3 .block { height: 75px; background: linear-gradient(#f0b07a, #93582c); color: #2a1500; }
.podium .p1 .pname { font-size: 22px; color: var(--gold); }
.podium .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium .pscore { color: var(--muted); font-size: 14px; margin: 4px 0 6px; }
.table-wrap { overflow-x: auto; }
table.results { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
table.results th, table.results td { padding: 8px; border-bottom: 2px solid var(--edge); text-align: left; }
table.results th { color: var(--muted); font-weight: 500; }
table.results td.strong { color: var(--gold); }
table.results tr.me td { background: #3a3214; }
#btn-again { max-width: 360px; }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--panel); border: 3px solid var(--gold); padding: 12px 18px; border-radius: 12px;
  box-shadow: 0 5px 0 var(--edge-dark); z-index: 60; font-size: 18px; text-align: center; max-width: 90vw;
}
.toast.pop { animation: toast-in .35s cubic-bezier(.2,1.6,.4,1); }
@keyframes toast-in { from { transform: translate(-50%, 40px) scale(.7); opacity: 0; } }

/* ============ Captchas ============ */
.captcha-frame {
  background: #fff; border-radius: 12px; padding: 10px; display: flex; justify-content: center; align-items: center;
  min-height: 120px; overflow: hidden; user-select: none; border: 3px solid #d9dde8; box-shadow: 0 5px 0 rgba(0,0,0,.4);
}
.captcha-frame img { max-width: 100%; height: 120px; width: auto; object-fit: contain; pointer-events: none; }
.answer { display: flex; gap: 8px; }
.answer-input { font-size: 24px !important; letter-spacing: 3px; text-align: center; margin: 0 !important; }
.row-actions { display: flex; justify-content: center; gap: 10px; }
.row-actions button { min-width: 130px; }
.question-box {
  background: #fff; color: #1b1f33; border-radius: 12px; padding: 22px 18px; font-size: 24px;
  text-align: center; line-height: 1.45; user-select: none; box-shadow: 0 5px 0 rgba(0,0,0,.4); font-family: system-ui, sans-serif; font-weight: 600;
}
.emoji-grid { display: grid; gap: 5px; max-width: 430px; background: #fff; padding: 7px; border-radius: 12px; box-shadow: 0 5px 0 rgba(0,0,0,.4); }
.emoji-grid .cell {
  aspect-ratio: 1; border: 3px solid transparent; border-radius: 8px; padding: 0; font-size: clamp(26px, 6vw, 46px);
  display: flex; align-items: center; justify-content: center; overflow: hidden; box-shadow: none;
}
.emoji-grid .cell:hover { transform: scale(1.04); }
.emoji-grid .cell span { display: inline-block; transition: transform .1s; }
.emoji-grid .cell.on { border-color: #1a73e8; }
.emoji-grid .cell.on span { scale: .78; }
.emoji-grid .cell.on::after {
  content: '✓'; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #1a73e8; color: #fff; font-size: 14px; line-height: 22px;
}
.slider-stage { position: relative; border-radius: 12px; overflow: hidden; user-select: none; box-shadow: 0 5px 0 rgba(0,0,0,.4); }
.slider-stage img { display: block; }
.slider-bg { width: 100%; height: 100%; }
.slider-piece { position: absolute; filter: drop-shadow(0 3px 4px #000c); pointer-events: none; }
.big-range { width: 100%; max-width: 460px; height: 30px; }
.draw-canvas { width: 100%; border-radius: 12px; touch-action: none; cursor: crosshair; display: block; box-shadow: 0 5px 0 rgba(0,0,0,.4); }
.rotate-wrap {
  width: 210px !important; height: 210px; border-radius: 50%; background: radial-gradient(#fff, #dfe4f5);
  display: flex; align-items: center; justify-content: center; cursor: grab; touch-action: none; user-select: none;
  box-shadow: inset 0 0 0 5px #c9cfe8, 0 6px 0 rgba(0,0,0,.4);
}
.rotate-face { font-size: 120px; line-height: 1; pointer-events: none; }
.seq-stage { position: relative; width: 100%; background: #fbfbff; border-radius: 12px; box-shadow: 0 5px 0 rgba(0,0,0,.4); }
.seq-dot {
  position: absolute; transform: translate(-50%, -50%); width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue); font-size: 20px; padding: 0; box-shadow: 0 4px 0 var(--blue-d);
}
.seq-dot:hover:not(:disabled) { transform: translate(-50%, -55%) scale(1.08); }
.seq-dot.on { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.seq-dot.on::after {
  content: attr(data-n); position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; color: #222; font-size: 12px; line-height: 22px; text-shadow: none;
}
.hold-target { text-align: center; color: var(--muted); }
.hold-btn {
  width: 220px !important; height: 220px; border-radius: 50%; font-size: 20px;
  background: radial-gradient(#5b9bff, #2a4fd0); box-shadow: 0 8px 0 #172d80; user-select: none; touch-action: none;
}
.hold-btn.on { background: radial-gradient(#ff8a5b, #c93a5a); box-shadow: 0 2px 0 #6e1830; transform: translateY(6px) scale(.97) !important; animation: alarm .3s infinite; }
.hold-timer { text-align: center; font-size: 32px; font-variant-numeric: tabular-nums; }

/* ============ Casino ============ */
.betbar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #0f171c; border: 3px solid #b8901c; border-radius: 12px; padding: 8px 12px; box-shadow: 0 4px 0 #5e4709;
}
.betbar.locked { opacity: .65; pointer-events: none; }
.bet-chips { font-size: 18px; }
.bet-chips b { color: var(--gold); }
.bet-ctrl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.bet-value { min-width: 70px; text-align: center; font-size: 24px; color: var(--gold); display: inline-block; }
.betbar .on { outline: 3px solid var(--gold); }
.casino-body { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.casino-body > * { max-width: 100%; }
.felt {
  width: 100%; background: radial-gradient(ellipse at center, #1f8a4c, #0d4d29 75%); border: 6px solid #6b3f1d;
  border-radius: 22px; padding: 16px; box-shadow: inset 0 0 40px rgba(0,0,0,.5), 0 6px 0 #3a210d;
}
.opts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn.opt { display: flex; flex-direction: column; align-items: center; min-width: 120px; background: #7a2a8f; box-shadow: 0 5px 0 #431450; }
.btn.opt .pay { color: var(--gold); font-size: 14px; }
.btn.opt.chosen, .chosen { outline: 4px solid var(--gold); outline-offset: 2px; }
.roulette-opts .btn.opt { min-width: 92px; }
.vs { font-size: 34px; color: var(--gold); align-self: center; }

/* Cartas */
.pcard {
  width: 66px; height: 94px; background: #fff; border-radius: 9px; color: #1b1b1f; position: relative;
  display: inline-flex; align-items: center; justify-content: center; font-size: 38px; flex: none;
  box-shadow: 0 5px 0 rgba(0,0,0,.45); border: 2px solid #ddd; font-family: Georgia, serif; user-select: none;
}
.pcard.red { color: #d6333b; }
.pcard .pc-r { position: absolute; top: 3px; left: 6px; font-size: 18px; font-weight: 700; }
.pcard .pc-r2 { position: absolute; bottom: 3px; right: 6px; font-size: 18px; font-weight: 700; transform: rotate(180deg); }
.pcard.back { background: repeating-linear-gradient(45deg, #c0392b 0 7px, #9e2b20 7px 14px); border: 4px solid #fff; }
.pcard.deal { animation: deal .45s backwards cubic-bezier(.2,1.4,.4,1); }
.pcard.flipping { animation: flipx .3s ease-in-out; }
@keyframes deal { from { transform: translate(-80px, -60px) rotate(-30deg); opacity: 0; } }
@keyframes flipx { 50% { transform: scaleX(0); } }
.cards-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: center; }
.cards-row.small .pcard { width: 48px; height: 68px; font-size: 26px; }
.cards-row.small .pcard .pc-r, .cards-row.small .pcard .pc-r2 { font-size: 13px; }
.glow-win { box-shadow: 0 0 0 4px var(--gold), 0 0 26px var(--gold) !important; animation: bump .4s; }
.glow-lose { box-shadow: 0 0 0 4px var(--bad), 0 0 20px var(--bad) !important; }

/* Tragamonedas */
.slot-machine { background: linear-gradient(#d6333b, #8c1a20); border-radius: 18px; padding: 10px 16px 16px; border: 4px solid var(--gold); box-shadow: 0 7px 0 #5a1014; }
.slot-top { text-align: center; color: var(--gold); font-size: 20px; animation: blink 1s infinite; margin-bottom: 8px; }
.reels { display: flex; gap: 8px; }
.reel { width: 90px; height: 100px; background: #fff; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 56px; overflow: hidden; box-shadow: inset 0 8px 10px rgba(0,0,0,.35), inset 0 -8px 10px rgba(0,0,0,.35); }
.reel.spinning span { filter: blur(2px); animation: reel .1s linear infinite; }
.reel.landed span { animation: bump .3s; }
.reel.win { background: #fff6c2; box-shadow: 0 0 0 4px var(--gold), 0 0 20px var(--gold); }
@keyframes reel { from { transform: translateY(-20px); } to { transform: translateY(20px); } }
.paytable { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; color: var(--muted); font-size: 15px; }
.paytable b { color: var(--gold); }
.lever { max-width: 320px; }

/* Ruleta */
.wheel-wrap { position: relative; width: 230px !important; height: 230px; margin: 6px auto; }
.wheel { position: absolute; inset: 0; border-radius: 50%; border: 8px solid #6b3f1d; box-shadow: 0 6px 0 #3a210d, inset 0 0 0 3px var(--gold); }
.wheel-num { position: absolute; left: 50%; top: 50%; width: 20px; margin: -8px 0 0 -10px; text-align: center; font-size: 10px; font-family: system-ui, sans-serif; color: #fff; transform-origin: center center; }
.wheel-hub { position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px; border-radius: 50%; background: #2a1a0c; border: 4px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 30px; z-index: 2; }
.wheel-hub.landed { animation: bump .4s; }
.wheel-pointer { position: absolute; left: 50%; top: -10px; margin-left: -12px; width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 24px solid var(--gold); z-index: 3; filter: drop-shadow(0 3px 0 #000); }

/* Dados */
.dice-row { display: flex; justify-content: center; gap: 24px; }
.die { width: 76px; height: 76px; background: #fff; border-radius: 14px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 9px; gap: 2px; box-shadow: 0 6px 0 #aaa; }
.die i { border-radius: 50%; }
.die i.pip { background: #1b1b1f; }
.die.rolling { animation: roll .14s linear infinite; }
.die.landed { animation: bump .35s; }
@keyframes roll { 0% { transform: rotate(0) translateY(-6px); } 50% { transform: rotate(180deg) translateY(6px); } 100% { transform: rotate(360deg) translateY(-6px); } }

/* Blackjack */
.bj { display: flex; flex-direction: column; gap: 8px; }
.bj-label { text-align: center; font-size: 18px; }
.bj-total { display: inline-block; background: #0f171c; padding: 0 10px; border-radius: 8px; color: var(--gold); margin-left: 6px; }

/* Trilero */
.cups-stage { position: relative; height: 190px; }
.cup {
  position: absolute; bottom: 30px; width: 86px; height: 110px; margin-left: -43px; padding: 0;
  background: linear-gradient(90deg, #a5161f, #e4414b 45%, #a5161f); clip-path: polygon(16% 0, 84% 0, 100% 100%, 0 100%);
  border-radius: 6px 6px 0 0; box-shadow: none; z-index: 2;
}
.cup:hover:not(:disabled) { transform: none; }
.cup .cup-shine { position: absolute; left: 30%; top: 8%; width: 10%; height: 80%; background: rgba(255,255,255,.35); }
.cup.lifted { transform: translateY(-70px) !important; }
.cup.hop { transform: translateY(-14px) scale(1.05) !important; }
.cup.hop-down { transform: translateY(6px) scale(.95) !important; }
.cups-stage.pickable .cup { cursor: pointer; animation: throb .8s infinite; }
.cup.chosen { outline: none; filter: drop-shadow(0 0 8px var(--gold)); }
.ball { position: absolute; bottom: 32px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #bbb); z-index: 1; transition: opacity .2s; }
.shell-info { text-align: center; }

/* Probabilidades y póker */
.odds-row { display: flex; gap: 12px; align-items: stretch; perspective: 800px; }
.odds-card {
  flex: 1; background: #fffdf3; color: #2a1d00; border-radius: 14px; padding: 16px 12px; text-shadow: none;
  box-shadow: 0 6px 0 #a08a4a; font-size: 19px; transform: rotateX(var(--rx, 0)) rotateY(var(--ry, 0));
  display: flex; flex-direction: column; gap: 8px; align-items: center; font-family: system-ui, sans-serif; font-weight: 600;
}
.odds-card:hover:not(:disabled) { transform: translateY(-3px) rotateX(var(--rx, 0)) rotateY(var(--ry, 0)); }
.odds-tag { background: #7a2a8f; color: #fff; border-radius: 50%; width: 34px; height: 34px; line-height: 34px; font-family: var(--font); }
.odds-pct { font-size: 26px; color: #7a2a8f; opacity: 0; font-family: var(--font); }
.odds-pct.show { opacity: 1; animation: bump .4s; }
.big-vs { font-size: 30px; }
.hands { display: flex; flex-direction: column; gap: 10px; }
.hand { background: rgba(0,0,0,.2); border-radius: 12px; padding: 10px; box-shadow: none; display: flex; flex-direction: column; gap: 6px; align-items: center; }
.hand:hover:not(:disabled) { background: rgba(255,255,255,.08); }
.hand-tag { font-size: 16px; color: var(--gold); }
.hand-name { font-size: 18px; min-height: 22px; }

/* Fichas */
.chip-legend { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.chip-legend span { display: flex; align-items: center; gap: 6px; }
.chip-dot { width: 18px; height: 18px; border-radius: 50%; border: 3px dashed rgba(255,255,255,.8); display: inline-block; }
.chip-table { display: flex; gap: 16px; justify-content: center; align-items: flex-end; min-height: 170px; flex-wrap: wrap; }
.chip-stack { display: flex; flex-direction: column-reverse; align-items: center; }
.poker-chip {
  width: 58px; height: 16px; border-radius: 50%; margin-top: -6px; border: 3px dashed rgba(255,255,255,.85);
  box-shadow: 0 3px 0 rgba(0,0,0,.45); animation: deal-in .3s backwards;
}
.chip-total { text-align: center; font-size: 26px; color: var(--gold); opacity: 0; }
.chip-total.show { opacity: 1; animation: bump .4s; }

/* Memoria */
.mem-q { margin: 0; }
.q-card { background: #fff; color: #1b1b1f; padding: 0 8px; border-radius: 6px; font-family: Georgia, serif; text-shadow: none; }
.q-card.red { color: #d6333b; }
.mem-bar { width: 100%; height: 8px; background: #0f171c; border-radius: 6px; overflow: hidden; }
.mem-bar div { height: 100%; background: var(--gold); animation: shrink linear forwards; }
@keyframes shrink { from { width: 100%; } to { width: 0; } }
.memory-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.mem-slot { padding: 0; background: none; box-shadow: none; border-radius: 9px; }
.memory-grid.pickable .mem-slot { animation: throb .9s infinite; }
.mem-slot.chosen { outline: 4px solid var(--gold); }

@media (max-width: 600px) {
  .hud-box b { font-size: 26px; }
  .reel { width: 70px; height: 80px; font-size: 42px; }
  .odds-row { flex-direction: column; }
  .countdown { font-size: 110px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; }
}
.seq-dot:active:not(:disabled) { transform: translate(-50%, -45%); }
input, select, button { font-variant-ligatures: none; font-feature-settings: "liga" 0, "clig" 0; }

/* ============ Música ============ */
.btn.off { opacity: .45; text-decoration: line-through; }

/* ============ Espectador y fantasmas ============ */
#play-area { position: relative; }
.spectate { display: flex; flex-direction: column; gap: 10px; }
.spec-head { display: flex; align-items: center; gap: 12px; }
.spec-head b { display: block; font-size: 24px; }
.ghost-me { font-size: 52px; animation: ghost-float 2.2s ease-in-out infinite; filter: drop-shadow(0 0 10px #b89cff); }
@keyframes ghost-float { 0%,100% { transform: translate(0, 0) rotate(-6deg); } 50% { transform: translate(6px, -8px) rotate(6deg); } }
.spec-nav { display: flex; align-items: center; gap: 10px; }
.spec-target { flex: 1; text-align: center; font-size: 20px; background: #0f171c; border: 3px solid #8a6cff; border-radius: 10px; padding: 6px; }
.spec-players { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.powers { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.btn.power {
  background: #5b3bb5; box-shadow: 0 5px 0 #2f1c6b; display: flex; flex-direction: column; align-items: center;
  min-width: 96px; overflow: hidden; padding: 8px 10px 6px;
}
.btn.power .pw-emoji { font-size: 26px; }
.btn.power kbd { position: absolute; top: 4px; right: 4px; }
.btn.power .pw-cd { position: absolute; left: 0; bottom: 0; height: 100%; width: calc(var(--cd, 0) * 100%); background: rgba(0,0,0,.55); pointer-events: none; }
.btn.power:disabled { opacity: .8; }
.spec-view { position: relative; border: 3px dashed #8a6cff; border-radius: 14px; padding: 8px; background: rgba(60,30,120,.15); }
.spec-layer { position: absolute; inset: 0; cursor: crosshair; /* sprites.js pone el cursor de fantasma */ z-index: 5; }
.spec-view .betbar { opacity: .8; }

.ghost-layer, .haunt-layer { position: absolute; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.ghost-sprite {
  position: absolute; transform: translate(-50%, -50%); transition: left .1s linear, top .1s linear, opacity .5s;
  display: flex; flex-direction: column; align-items: center; opacity: .85;
}
.ghost-sprite .gs-body { font-size: 44px; animation: ghost-float 1.6s ease-in-out infinite; filter: drop-shadow(0 0 8px #c8b6ff); }
.ghost-sprite small { background: rgba(60,30,120,.8); padding: 0 6px; border-radius: 6px; font-size: 12px; }
.ghost-sprite.gone { opacity: 0; }
.fogged .challenge-body { filter: blur(5px) grayscale(.5); transition: filter .4s; }
.fogged::after {
  content: ''; position: absolute; inset: -20px; pointer-events: none; z-index: 15;
  background: radial-gradient(circle at 30% 40%, rgba(220,220,240,.75), transparent 45%), radial-gradient(circle at 70% 60%, rgba(200,200,230,.7), transparent 50%), radial-gradient(circle at 50% 20%, rgba(230,230,250,.6), transparent 40%);
  animation: fog-drift 4s ease-in-out forwards;
}
@keyframes fog-drift { 0% { opacity: 0; transform: translateX(-30px); } 15% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(30px); } }
.challenge-body.flipped { transform: rotate(180deg); transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.challenge-body { transition: transform .5s; }
.quaking { animation: quake .12s linear infinite; }
@keyframes quake { 0% { transform: translate(3px, -2px) rotate(.8deg); } 50% { transform: translate(-4px, 3px) rotate(-.8deg); } 100% { transform: translate(2px, 2px); } }
.rain-drop { position: absolute; top: -60px; animation: rain-fall linear forwards; }
@keyframes rain-fall { to { transform: translateY(900px) rotate(540deg); } }
.jumpscare {
  position: fixed; inset: 0; z-index: 48; pointer-events: none; display: flex; flex-direction: column;
  align-items: center; justify-content: center; background: radial-gradient(circle, rgba(40,0,60,.55), rgba(0,0,0,.9));
}
.jumpscare span { font-size: 40vmin; line-height: 1; filter: drop-shadow(0 0 40px #fff); }
.jumpscare b { font-size: 44px; color: #fff; text-shadow: 0 4px 0 #000; }
.jumpscare.go { animation: scare .95s ease-out forwards; }
.jumpscare.go span { animation: scare-pop .95s cubic-bezier(.2,2,.4,1); }
@keyframes scare { 0% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes scare-pop { 0% { transform: scale(.1) rotate(-30deg); } 30% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }

/* ============ Feria ============ */
.feria-wrap { width: 100%; display: flex; justify-content: center; }
.feria-canvas {
  width: 100%; max-width: 680px; aspect-ratio: 480 / 320; border-radius: 14px; display: block; touch-action: none;
  border: 5px solid #ffd23f; box-shadow: 0 6px 0 #a3700c, 0 0 0 3px #e63946 inset; cursor: crosshair; user-select: none;
}
.game-card.theme-feria { border-color: #ff922b; }
body[data-theme=feria] .type-chips .chip input:checked + span { background: var(--orange); border-color: #ffc078; }

/* ============ Chat ============ */
.chat { position: fixed; right: 16px; bottom: 16px; z-index: 55; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.chat-toggle { font-size: 24px; width: 58px; height: 58px; border-radius: 50%; padding: 0; background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); }
.unread {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font-size: 12px; min-width: 22px; height: 22px;
  border-radius: 11px; line-height: 22px; padding: 0 5px; box-shadow: 0 2px 0 var(--red-d);
}
.chat-panel {
  order: -1; width: min(360px, calc(100vw - 32px)); height: min(440px, 60vh); display: flex; flex-direction: column;
  background: var(--panel); border: 3px solid var(--edge); border-radius: 14px; box-shadow: 0 6px 0 var(--edge-dark), 0 14px 30px rgba(0,0,0,.5);
  animation: pop-in .25s cubic-bezier(.2,1.6,.4,1); overflow: hidden;
}
.chat-tabs { display: flex; gap: 4px; padding: 6px; border-bottom: 2px solid var(--edge); }
.chat-tab, .chat-close { flex: 1; font-size: 14px; padding: 6px 8px; box-shadow: 0 3px 0 var(--grey-d); }
.chat-close { flex: none; background: var(--red); box-shadow: 0 3px 0 var(--red-d); }
.chat-tab.on { background: var(--blue); box-shadow: 0 3px 0 var(--blue-d); }
.chat-tab[data-unread]:not([data-unread=""])::after {
  content: attr(data-unread); background: var(--red); border-radius: 9px; font-size: 11px; padding: 0 5px; margin-left: 4px;
}
.chat-log { flex: 1; overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.chat-line { line-height: 1.3; word-wrap: break-word; animation: deal-in .2s; }
.chat-line b { margin-right: 6px; }
.chat-line.mine { background: rgba(11,139,240,.12); border-radius: 6px; padding: 2px 4px; }
.chat-line.system { color: var(--muted); font-size: 13px; font-style: italic; }
.chat-time { color: #6c8794; font-size: 11px; margin-right: 6px; }
.chat-room { font-size: 10px; background: #0f171c; border: 1px solid var(--edge); border-radius: 4px; padding: 0 4px; margin-right: 6px; color: var(--gold); }
.chat-text { font-family: system-ui, sans-serif; font-size: 14px; }
.chat-form { display: flex; gap: 6px; padding: 6px; border-top: 2px solid var(--edge); }
.chat-form input { margin: 0; padding: 7px 10px; font-size: 15px; }

/* ============ Créditos ============ */
.credits-btn { position: fixed; left: 16px; bottom: 16px; z-index: 55; background: #7a2a8f; box-shadow: 0 5px 0 #431450; }
.credits-overlay { position: fixed; inset: 0; z-index: 70; background: rgba(5,3,12,.7); display: flex; align-items: center; justify-content: center; }
.credits-card { text-align: center; max-width: 420px; width: calc(100% - 32px); border-color: var(--gold); }
.credits-card h2 { font-size: 30px; margin: 4px 0 14px; }
.credits-card h2 b { color: var(--gold); }
.credits-card p { margin: 6px 0; font-size: 18px; }
.credits-icon { font-size: 64px; animation: float 3s ease-in-out infinite; }
.credits-name { font-size: 40px !important; margin: 4px 0 20px !important; }
.credits-name i { display: inline-block; font-style: normal; color: var(--gold); text-shadow: 0 4px 0 var(--orange-d); animation: wave 1.6s ease-in-out infinite; }

/* Sprites pixel art */
.spr { filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .35)); }
.emoji-grid .spr, .rotate-face .spr, .reel .spr { filter: none; }
.emoji-grid .spr { width: 1.6em; height: 1.6em; vertical-align: middle; }
.reel .spr { width: 1em; height: 1em; }

/* ---------- Reloj de cada reto ---------- */
.ch-timer {
  position: relative; height: 14px; margin: -4px auto 10px; max-width: 520px;
  background: #0f171c; border: 2px solid var(--edge); border-radius: 8px; overflow: hidden;
}
.ch-timer i {
  display: block; height: 100%; width: 100%; transform-origin: left center;
  background: linear-gradient(90deg, #36b97c, #8fe05a);
  animation: ch-shrink var(--dur, 10s) linear forwards, ch-color var(--dur, 10s) linear forwards;
}
.ch-timer b {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 11px; line-height: 1; text-shadow: 0 1px 0 #000;
}
@keyframes ch-shrink { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes ch-color {
  0%, 55% { background: linear-gradient(90deg, #36b97c, #8fe05a); }
  75% { background: linear-gradient(90deg, #f5a524, #ffd23f); }
  100% { background: linear-gradient(90deg, #f0464d, #ff7b3f); }
}
.ch-timer.urgent { border-color: var(--red); animation: ch-pulse .5s infinite; }
@keyframes ch-pulse { 50% { box-shadow: 0 0 14px rgba(240,70,77,.8); transform: scale(1.02); } }
.ch-timer.paused i { animation-play-state: paused; }
#challenge-body.timed-out { pointer-events: none; filter: grayscale(.7) brightness(.7); transition: filter .2s; }

/* ---------- Monedas ---------- */
.wallet { display: inline-flex; align-items: center; gap: 4px; color: #d8c4ff; border-color: #6c4bc4; }
.wallet b { color: #fff; min-width: 1ch; }
.wallet.gain { animation: wallet-gain .9s ease-out; }
@keyframes wallet-gain {
  0% { transform: scale(1); }
  25% { transform: scale(1.35) rotate(-4deg); box-shadow: 0 0 22px rgba(161,116,255,.9); background: #3b2a6e; }
  100% { transform: scale(1); }
}
.coin-award {
  text-align: center; font-size: 22px; margin: 4px auto 14px; padding: 10px 16px; max-width: 560px;
  border: 2px solid #6c4bc4; border-radius: 12px; background: rgba(59,42,110,.55);
}
.coin-award.win { font-size: 28px; color: #fff; animation: pop-in .5s cubic-bezier(.2,1.6,.4,1), coin-glow 1.4s ease-in-out infinite; }
.coin-award.none { color: var(--muted); font-size: 18px; border-color: var(--edge); background: rgba(15,23,28,.6); }
.coin-award .spr { width: 1.3em; height: 1.3em; }
@keyframes coin-glow { 50% { box-shadow: 0 0 26px rgba(161,116,255,.75); } }
