/* Base: variables, reset, pantallas, botones, menú y fondo animado */
:root {
  --bg: #0b3c49; --bg2: #0f5364; --sand: #f6ecd2; --sand2: #eadcb6; --ink: #1d2b2f;
  --coral: #ff6b4a; --gold: #ffc914; --teal: #17bebb; --line: rgba(0,0,0,.28); --radius: 16px;
  --bw: min(100vw - 20px, 540px); /* lado del tablero */
  --glass: rgba(255,255,255,.09); --glass2: rgba(255,255,255,.16);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: #fff; font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; overscroll-behavior: none; }
body { background: radial-gradient(1200px 700px at 50% -10%, #17788c 0%, var(--bg) 62%); background-attachment: fixed; }
#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#bg i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; animation: drift 22s ease-in-out infinite alternate; }
#bg i:nth-child(1) { width: 380px; height: 380px; background: #17bebb; left: -120px; top: 10%; }
#bg i:nth-child(2) { width: 320px; height: 320px; background: #ff6b4a; right: -120px; top: 45%; animation-duration: 28s; opacity: .22; }
#bg i:nth-child(3) { width: 300px; height: 300px; background: #ffc914; left: 30%; bottom: -160px; animation-duration: 34s; opacity: .18; }
@keyframes drift { to { transform: translate(60px, -50px) scale(1.15); } }
#app { position: relative; z-index: 1; max-width: 560px; margin: 0 auto; min-height: 100vh; padding: max(10px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
.screen { display: flex; flex-direction: column; gap: 12px; animation: screenIn .35s ease-out; }
@keyframes screenIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
h1, h2 { margin: 0; }
.mini { font-size: 12px; opacity: .75; margin: 0; text-align: center; }
.i { width: 1.1em; height: 1.1em; vertical-align: -0.18em; flex: none; }

/* logo 3D: moneda girando hecha con capas */
.logo { text-align: center; padding: 18px 0 4px; }
.coin3d { width: 86px; height: 86px; margin: 0 auto 12px; perspective: 500px; }
.coin3d .coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; animation: coinSpin 5.5s linear infinite; }
.coin3d .coin b { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; font-size: 34px; font-weight: 900; color: #0b3c49; background: radial-gradient(circle at 35% 30%, #ffe27a, #ffc914 55%, #d9a300); border: 4px solid #e0a800; box-shadow: inset 0 0 0 4px rgba(255,255,255,.35); }
.coin3d .coin b:nth-child(1) { transform: translateZ(7px); }
.coin3d .coin b:nth-child(2) { transform: translateZ(3.5px); filter: brightness(.82); font-size: 0; }
.coin3d .coin b:nth-child(3) { transform: translateZ(0); filter: brightness(.7); font-size: 0; }
.coin3d .coin b:nth-child(4) { transform: translateZ(-3.5px); filter: brightness(.82); font-size: 0; }
.coin3d .coin b:nth-child(5) { transform: translateZ(-7px) rotateY(180deg); }
@keyframes coinSpin { to { transform: rotateY(360deg); } }
.logo h1 { font-size: 36px; letter-spacing: .5px; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.logo h1 span { color: var(--gold); }
.tag { margin: 6px 0 0; opacity: .85; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; opacity: .95; }
input, select { font: inherit; padding: 12px 14px; border-radius: 12px; border: 2px solid transparent; background: #fff; color: var(--ink); outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255,201,20,.25); }

.btn { font: inherit; font-weight: 800; padding: 12px 14px; border-radius: 13px; border: 0; background: linear-gradient(#25859a, #1b6d80); color: #fff; cursor: pointer; box-shadow: 0 4px 0 rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .08s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.btn.primary { background: linear-gradient(#ff8366, #ff6b4a); }
.btn.good { background: linear-gradient(#3ec47d, #2fa866); }
.btn.warn { background: linear-gradient(#d9503f, #c0392b); }
.btn.gold { background: linear-gradient(#ffd93d, #ffc914); color: var(--ink); }
.btn.ghost { background: transparent; box-shadow: none; border: 2px solid rgba(255,255,255,.25); }
.btn.big { padding: 16px; font-size: 18px; }
.btn.small { padding: 9px 8px; font-size: 12px; flex: 1; }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 0 0 rgba(255,107,74,.6); } 50% { box-shadow: 0 4px 0 rgba(0,0,0,.3), 0 0 0 10px rgba(255,107,74,0); } }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }

.code { background: var(--gold); color: var(--ink); padding: 2px 10px; border-radius: 8px; letter-spacing: 3px; font-weight: 900; }
.seats { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.seats li { background: var(--glass); border-radius: 12px; padding: 12px 14px; display: flex; align-items: center; gap: 10px; animation: screenIn .3s ease-out; }
.seats li.empty { opacity: .45; border: 2px dashed rgba(255,255,255,.3); background: transparent; }
.dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; flex: none; }
.tagx { font-size: 10px; background: rgba(0,0,0,.3); color: #fff; padding: 1px 6px; border-radius: 6px; font-weight: 600; margin-left: 4px; display: inline-flex; align-items: center; gap: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
