[data-juego="clave3"] {
  --bg: #061923;
  --panel: #0a2532dc;
  --panel-strong: #0d3141f2;
  --purple: #32cfa4;
  --purple-light: #a3ead7;
  --gold: #f4cd76;
  --green: #5ce0b8;
  --red: #ff8776;
  --muted: #b9d6d8;
  --line: #70c8b64d;
  --clave3-fondo: url("/assets/clave3-bg.webp?v=2");
}

[data-juego="clave3"] body {
  background: #061923;
}

[data-juego="clave3"] body::before {
  background:
    linear-gradient(90deg, #03101970, #041a2790 55%, #03101948),
    var(--clave3-fondo) center / cover no-repeat;
}

[data-juego="clave3"] body::after {
  background: linear-gradient(0deg, #020d15aa, transparent 65%);
}

[data-juego="clave3"] .panel {
  background: linear-gradient(145deg, #0c3243e0, #061923ea);
  border-color: var(--line);
}

[data-juego="clave3"] .stage {
  background: linear-gradient(130deg, #0b2733d6, #062a32a8 62%, #04192380);
}

[data-juego="clave3"] .stage::before {
  content: "3";
  color: #69deba0c;
}

[data-juego="clave3"] .digits {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: min(100%, 36rem);
}

[data-juego="clave3"] .digit {
  border-color: #77d3b878;
  background: radial-gradient(ellipse at 50% 1%, #215d5b, transparent 73%),
    linear-gradient(155deg, #163b4d, #081b29 76%);
  box-shadow: inset 0 1px 0 #c5f5e64d, inset 0 -3px 0 #46b39330, 0 10px 20px #020d16a0;
}

[data-juego="clave3"] .digit.waiting {
  animation-name: respirar-clave3;
}

@keyframes respirar-clave3 {
  from { border-color: #5ed3af40; transform: translateY(0); }
  to { border-color: #9de2cdb5; transform: translateY(-4px); }
}

[data-juego="clave3"] .digit.revealed {
  border-color: var(--gold);
  background: radial-gradient(ellipse at 50% 5%, #9d765a96, transparent 72%),
    linear-gradient(155deg, #1f544c, #08272f 76%);
  box-shadow: inset 0 1px 0 #fff2ca86, inset 0 -3px 0 #e2b95557, 0 0 22px #e6b34b24;
  text-shadow: 0 0 16px #ffd48344;
}

[data-juego="clave3"] .prize-row:first-child,
[data-juego="clave3"] .history-item.latest {
  background: linear-gradient(130deg, #a77b3433, #227e6639);
}

[data-juego="clave3"] .prize-list {
  grid-template-rows: repeat(3, auto);
}

[data-juego="clave3"] .start-overlay.hidden {
  display: none;
}

[data-juego="clave3"] .start-card {
  background: linear-gradient(145deg, #123749, #071f2c);
  border-color: var(--line);
}

[data-juego="clave3"] .start-primary {
  background: linear-gradient(135deg, #9aebca, #31bf98);
  color: #041e20;
  box-shadow: 0 10px 24px #02282f9c;
}

[data-juego="clave3"] [data-entrada-clave] {
  --entrada-fondo: #102e3b;
  --entrada-borde: #5bb8a6;
}

[data-juego="clave3"] .wallet-panel :is(input, button, select) {
  background: #102f40;
  color: var(--white);
}

[data-juego="clave3"] .wallet-panel :is(button[type="submit"], #salir) {
  background: var(--gold);
  color: #112126;
}

[data-juego="clave3"] .wallet-ticket {
  grid-template-columns: repeat(3, minmax(0, 2.15em)) minmax(0, 1fr);
  background: #103344;
}

[data-juego="clave3"] .wallet-ticket [data-numero]:not(.acierto) {
  background: #1b4952;
}

[data-juego="clave3"] .wallet-ticket-hits {
  font-size: .92em;
}

[data-juego="clave3"] .wallet-history {
  margin-top: .75em;
  padding-top: .6em;
  border-top: 1px solid var(--line);
}

[data-juego="clave3"] .wallet-history summary {
  cursor: pointer;
  color: var(--purple-light);
}

[data-juego="clave3"] .wallet-history select {
  width: 100%;
  margin: .4em 0;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
}

[data-juego="clave3"] .wallet-history p {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

[data-juego="clave3"] .brand-copy {
  display: grid;
  gap: 0.2em;
}

[data-juego="clave3"] .brand-kicker {
  line-height: 1.2;
}

[data-juego="clave3"] .top-meta {
  min-width: 0;
}

[data-juego="clave3"] .rotate-overlay {
  background: var(--bg);
}

@media (orientation: portrait) and (max-width: 600px) {
  [data-juego="clave3"] { --clave3-fondo: url("/assets/clave3-bg-mobile.webp?v=2"); }
  [data-juego="clave3"] body::before { background-position: center top; }
}
