/* PINBALL CREDITS v2 — tema oscuro arcade */
:root {
  --bg: #0b0b14; --panel: #151525; --panel2: #1d1d33; --line: #2a2a47;
  --text: #ecebfa; --muted: #9391b5;
  --pink: #ff2e88; --cyan: #19e3ff; --purple: #8b5cf6; --ok: #2ee59d; --bad: #ff5470; --warn: #ffc34d;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, #2a1150 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #0d2f4a 0%, transparent 55%), var(--bg);
  background-attachment: fixed;
  color: var(--text); font: 17px/1.45 'Rajdhani', system-ui, sans-serif; min-height: 100vh;
}
h1, h2, h3, .brand, .btn, .big { font-family: 'Orbitron', system-ui, sans-serif; letter-spacing: .04em; }
h1 { font-size: 1.5rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 12px; color: var(--cyan); text-transform: uppercase; }
a { color: var(--cyan); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 16px; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Cabecera */
.top { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line);
       background: rgba(11,11,20,.85); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 20; }
.brand { font-weight: 800; font-size: 1.05rem; background: linear-gradient(90deg, var(--pink), var(--cyan));
         -webkit-background-clip: text; background-clip: text; color: transparent; text-decoration: none; }
.top .spacer { flex: 1; }
.top img.avatar { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--purple); }
.top select { max-width: 46vw; }

/* Botones y campos */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
       border: 0; border-radius: 10px; padding: 11px 16px; font-size: .82rem; font-weight: 700; text-decoration: none;
       color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple)); text-transform: uppercase;
       transition: transform .08s, filter .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.6); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.cyan { background: linear-gradient(135deg, #0aa6c9, var(--cyan)); color: #04121a; }
.btn.danger { background: transparent; border: 1px solid var(--bad); color: var(--bad); }
.btn.small { padding: 7px 10px; font-size: .7rem; }
.btn.block { width: 100%; }
input, select, textarea {
  background: #0e0e1c; color: var(--text); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font: inherit; width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--purple); border-color: transparent; }
label { display: block; font-size: .9rem; color: var(--muted); margin: 10px 0 4px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 140px; }
.row > .fit { flex: 0 0 auto; }

/* Paneles */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat b { display: block; font: 800 1.6rem 'Orbitron', sans-serif; color: var(--cyan); }
.stat span { color: var(--muted); font-size: .9rem; }

/* Acceso */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px; text-align: center; }
.login .box { max-width: 420px; width: 100%; background: var(--panel); border: 1px solid var(--line);
              border-radius: 20px; padding: 34px 24px; box-shadow: 0 0 60px rgba(139,92,246,.25); }
.login h1 { font-size: 1.7rem; margin-bottom: 8px; }
.gbtn { display: inline-flex; align-items: center; gap: 12px; background: #fff; color: #1f1f1f; border-radius: 10px;
        padding: 12px 20px; font: 600 1rem system-ui, sans-serif; text-decoration: none; margin-top: 22px; }
.notice { border: 1px solid var(--cyan); color: var(--cyan); border-radius: 10px; padding: 10px; margin-top: 16px; }
.notice.bad { border-color: var(--bad); color: var(--bad); }

/* Cliente: saldo y canje */
.balance { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.balance .big { font-size: 3rem; font-weight: 900; line-height: 1; color: var(--ok); text-shadow: 0 0 24px rgba(46,229,157,.4); }
.redeem input { font: 700 1.3rem 'Orbitron', monospace; letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { cursor: pointer; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent;
       color: var(--muted); font: 700 .78rem 'Orbitron', sans-serif; text-transform: uppercase; }
.tab.on { color: #fff; border-color: var(--pink); background: rgba(255,46,136,.15); }

/* Tarjetas de máquina */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.machine { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
           display: flex; flex-direction: column; }
.machine .pic { aspect-ratio: 16/10; background: linear-gradient(135deg, #2b1055, #0d2f4a) center/cover no-repeat;
                display: grid; place-items: center; font: 900 1.1rem 'Orbitron', sans-serif; color: rgba(255,255,255,.25); }
.machine .body { padding: 14px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.machine h3 { margin: 0; font-size: 1rem; }
.machine p { margin: 0; color: var(--muted); font-size: .95rem; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); margin-right: 6px; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.qty { display: flex; gap: 8px; }
.qty button { flex: 1; cursor: pointer; padding: 10px 0; border-radius: 10px; border: 1px solid var(--line);
              background: #0e0e1c; color: var(--text); font: 800 1rem 'Orbitron', sans-serif; }
.qty button.on { border-color: var(--cyan); color: var(--cyan); box-shadow: inset 0 0 0 1px var(--cyan); }
.state { min-height: 1.4em; font-size: .95rem; }
.state.ok { color: var(--ok); } .state.bad { color: var(--bad); } .state.wait { color: var(--warn); }

/* Tablas */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; }
td.wrapok { white-space: normal; }
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: var(--ok); } .pill.bad { color: var(--bad); border-color: var(--bad); }
.pill.wait { color: var(--warn); border-color: var(--warn); } .pill.info { color: var(--cyan); border-color: var(--cyan); }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--panel2); border-radius: 999px; padding: 3px 10px; margin: 2px; font-size: .88rem; }
.chip button { background: none; border: 0; color: var(--bad); cursor: pointer; font-size: 1rem; padding: 0; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* Diálogos y avisos */
dialog { background: var(--panel); color: var(--text); border: 1px solid var(--purple); border-radius: 16px;
         padding: 20px; width: min(520px, 94vw); }
dialog::backdrop { background: rgba(5,5,12,.75); }
dialog h2 { margin-bottom: 4px; }
dialog .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
textarea.code { font: .8rem/1.3 ui-monospace, monospace; height: 130px; word-break: break-all; }
#toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--panel2);
         border: 1px solid var(--cyan); color: var(--text); padding: 12px 18px; border-radius: 12px; z-index: 99;
         max-width: 92vw; box-shadow: 0 8px 30px rgba(0,0,0,.5); transition: opacity .25s; }
#toast.bad { border-color: var(--bad); } #toast.ok { border-color: var(--ok); }
#toast.off { opacity: 0; pointer-events: none; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .balance .big { font-size: 2.4rem; }
  .wrap { padding: 12px; }
}
.qty button[disabled] { opacity: .35; cursor: not-allowed; }
