/* Neo-Quiniela MVP v2 — Modern UI (light + purple header) */

:root{
  --bg:#f2f3f6;
  --surface:#ffffff;
  --surface2:#f4f6fb;
  --text:#111827;
  --muted:#6b7280;
  --line:rgba(17,24,39,.10);

  --purple:#5a2bd9;
  --purple2:#3e1aa6;

  --green:#16a34a;
  --red:#dc2626;

  --blue:#2563eb;

  --shadow-sm: 0 6px 14px rgba(17,24,39,.08);
  --shadow-md: 0 12px 28px rgba(17,24,39,.12);
  --shadow-lg: 0 18px 50px rgba(0,0,0,.25);

  --radius-10: 10px;
  --radius-12: 12px;
  --radius-14: 14px;
  --radius-16: 16px;
  --radius-18: 18px;
  --radius-22: 22px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  font-family:var(--font);
  background:radial-gradient(1200px 500px at 50% 0%, rgba(90,43,217,.10) 0%, rgba(242,243,246,1) 55%) , var(--bg);
  color:var(--text);
  display:flex;
  justify-content:center;
  align-items:flex-start;
}

/* ===== Frame (phone) ===== */
.phone{
  width:390px;
  height:844px;
  background:var(--surface);
  border-radius:28px;
  margin:18px 0;
  overflow:hidden;
  box-shadow:0 22px 70px rgba(0,0,0,.18);
  border:1px solid rgba(17,24,39,.06);
  position:relative;
}

.safe{
  height:100%;
  display:flex;
  flex-direction:column;
}

.hidden{display:none !important}

/* ===== Header ===== */
.header{
  background:linear-gradient(180deg, var(--purple) 0%, var(--purple2) 100%);
  color:#fff;
  padding:10px 14px 12px 14px;
  position:relative;
}

.header:after{
  content:"";
  position:absolute;
  inset:auto 0 -28px 0;
  height:28px;
  background:linear-gradient(180deg, rgba(62,26,166,0.00), rgba(62,26,166,0.00));
  pointer-events:none;
}

.header-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  opacity:.98;
}

.iconbtn{
  width:34px;height:34px;
  border-radius:12px;
  background:rgba(255,255,255,.14);
  border:1px solid rgba(255,255,255,.22);
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 10px 22px rgba(0,0,0,.12);
  transition: transform .06s ease, background .18s ease;
}

.iconbtn:hover{ background:rgba(255,255,255,.18); }
.iconbtn:active{ transform:translateY(1px); }

.iconbtn svg{width:18px;height:18px;fill:#fff}

.h-title{
  font-size:12px;
  opacity:.92;
  letter-spacing:.2px;
}

/* Header card (glass) */
.header-card{
  margin-top:10px;
  background:rgba(255,255,255,.10);
  border:1px solid rgba(255,255,255,.18);
  border-radius:var(--radius-18);
  padding:12px;
  display:flex;
  align-items:center;
  gap:12px;
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
  backdrop-filter: blur(10px);
}

.circle{
  width:42px;height:42px;
  border-radius:999px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow: 0 8px 18px rgba(17,24,39,.14);
}

.circle:before{
  content:"";
  display:block;
  width:20px;height:20px;
  border-radius:999px;
  border:3px solid var(--purple);
}

.header-card .wc{
  width:46px;height:46px;
  background:#fff;
  border-radius:12px;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  box-shadow: 0 8px 18px rgba(17,24,39,.12);
}

.header-card .wc img{width:38px;height:auto}

.h-balance{
  margin-left:auto;
  text-align:right;
}

.h-balance .amt{
  font-size:18px;
  font-weight:900;
  line-height:1;
}

.h-balance .lbl{
  font-size:11px;
  opacity:.9;
  margin-top:2px;
}

/* ===== Content ===== */
.content{
  flex:1;
  overflow:auto;
  background:var(--surface2);
  padding:12px 12px 78px 12px;
}

.section-title{
  font-weight:900;
  color:var(--purple);
  font-style:italic;
  margin:6px 0 10px 0;
}

/* ===== Cards ===== */
.card{
  background:var(--surface);
  border:1px solid rgba(17,24,39,.10);
  border-radius:var(--radius-16);
  padding:14px;
  box-shadow: var(--shadow-sm);
}

.notice{
  border:1px solid rgba(17,24,39,.10);
  background:#fff;
  padding:12px;
  border-radius:var(--radius-14);
  box-shadow: 0 6px 14px rgba(17,24,39,.06);
}

/* ===== KPI ===== */
.kpi{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px;
  align-items:center;
  margin-top:10px;
}

.kpi .k{
  font-size:12px;
  color:var(--muted);
}

.kpi .v{
  font-weight:900;
}

/* ===== Table ===== */
.table{
  width:100%;
  border-collapse:separate;
  border-spacing:0;
  margin-top:10px;
  overflow:hidden;
  border-radius:var(--radius-14);
  box-shadow: inset 0 0 0 1px rgba(17,24,39,.10);
}

.table td{
  border:0;
  padding:9px 10px;
  font-weight:800;
  font-size:12px;
  background:#fff;
}

.table tr + tr td{
  border-top:1px solid rgba(17,24,39,.08);
}

.table td:last-child{
  text-align:right;
}

.table .total td{
  background: rgba(37,99,235,.06);
  font-weight:900;
}

/* ===== Buttons ===== */
.btn{
  width:100%;
  border-radius:var(--radius-14);
  border:1px solid rgba(17,24,39,.12);
  background:#fff;
  padding:13px 12px;
  font-weight:900;
  letter-spacing:.25px;
  cursor:pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .06s ease, box-shadow .18s ease, background .18s ease, color .18s ease;
}

.btn:hover{
  box-shadow: 0 10px 22px rgba(17,24,39,.12);
}

.btn:active{
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(17,24,39,.10);
}

/* Primary morado */
.btn.primary{
  border:0;
  color:#fff;
  background: linear-gradient(180deg, var(--purple) 0%, var(--purple2) 100%);
  box-shadow: 0 12px 26px rgba(90,43,217,.32);
}

.btn.primary:hover{
  box-shadow: 0 16px 30px rgba(90,43,217,.36);
}

.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  box-shadow:none;
}

/* Small button bar (SI / NO) */
.btnbar{
  display:flex;
  gap:10px;
  margin-top:12px;
}

.btnsm{
  flex:1;
  border-radius:var(--radius-12);
  border:1px solid rgba(17,24,39,.12);
  background:#fff;
  padding:10px 10px;
  font-weight:900;
  cursor:pointer;
  box-shadow: 0 8px 18px rgba(17,24,39,.10);
  transition: transform .06s ease, box-shadow .18s ease;
}

.btnsm:active{ transform: translateY(1px); }

.btnsm.ok{
  border:0;
  color:#fff;
  background: linear-gradient(180deg, #22c55e 0%, var(--green) 100%);
  box-shadow: 0 12px 24px rgba(34,197,94,.25);
}

.btnsm.no{
  border:0;
  color:#fff;
  background: linear-gradient(180deg, #ef4444 0%, var(--red) 100%);
  box-shadow: 0 12px 24px rgba(239,68,68,.25);
}

/* ===== Center / logo ===== */
.center{
  display:flex;
  justify-content:center;
  align-items:center;
  flex-direction:column;
  gap:10px;
}

.wc-big img{ width:80px;height:auto; }

/* ===== Inputs ===== */
.input{
  width:100%;
  border-radius:var(--radius-14);
  border:1px solid rgba(17,24,39,.14);
  padding:12px 12px;
  font-weight:900;
  text-align:center;
  background:#fff;
  box-shadow: inset 0 1px 0 rgba(17,24,39,.04);
  transition: box-shadow .18s ease, border-color .18s ease;

  font-size:16px; /* ✅ esto evita el auto-zoom en iOS */
}

html { -webkit-text-size-adjust: 100%; }

.input::placeholder{ color: rgba(107,114,128,.75); }

.input:focus{
  outline:none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.16);
}

/* ===== Typography helpers ===== */
.small{
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

.link{
  color:#1d4ed8;
  font-weight:900;
  text-decoration:underline;
  cursor:pointer;
}

/* ===== Modals (modern overlay) ===== */
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(10,15,30,.45);
  backdrop-filter: blur(8px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
}

.modal{
  width:100%;
  max-width:340px;
  background:#fff;
  border:1px solid rgba(17,24,39,.10);
  border-radius:var(--radius-18);
  padding:14px;
  box-shadow: var(--shadow-lg);
}

.modal h3{
  margin:0 0 10px 0;
  font-size:16px;
}

.modal p{
  margin:0;
  color:#111827;
  font-size:13px;
  line-height:1.35;
}

/* ===== Check rows ===== */
.checkrow{
  display:flex;
  gap:10px;
  align-items:flex-start;
  margin-top:10px;
  border:1px solid rgba(17,24,39,.10);
  border-radius:var(--radius-14);
  padding:10px;
  background:#fff;
  box-shadow: 0 6px 14px rgba(17,24,39,.06);
}

.box{
  width:22px;height:22px;
  border:2px solid rgba(17,24,39,.50);
  border-radius:8px;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
}

.box.on{
  background: rgba(34,197,94,.14);
  border-color: rgba(22,163,74,.70);
}

.box.on:after{
  content:"✓";
  color: rgba(22,163,74,.95);
}

/* ===== Matches ===== */
.matches{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:10px;
}

.match{
  background:#fff;
  border:1px solid rgba(17,24,39,.10);
  padding:12px;
  border-radius:var(--radius-14);
  box-shadow: 0 6px 14px rgba(17,24,39,.06);
}

.match .head{
  display:flex;
  justify-content:space-between;
  font-weight:900;
}

.match .meta{
  margin-top:6px;
  font-size:11px;
  color:var(--muted);
}

.score{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:center;
}

.score input{
  width:56px;
  height:40px;
  border:1px solid rgba(17,24,39,.16);
  border-radius:12px;
  text-align:center;
  font-weight:900;
  font-size:16px;
  background:#fff;
  box-shadow: inset 0 1px 0 rgba(17,24,39,.05);
}

.score input:focus{
  outline:none;
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.16);
}

/* ===== Bottom nav ===== */
.nav{
  position:absolute;
  left:0;right:0;bottom:0;
  height:62px;
  background:rgba(255,255,255,.92);
  border-top:1px solid rgba(17,24,39,.10);
  display:flex;
  backdrop-filter: blur(10px);
}

.nav button{
  flex:1;
  border:none;
  background:transparent;
  cursor:pointer;
  font-weight:800;
  font-size:10px;
  color:#6b7280;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  transition: color .18s ease;
}

.nav svg{
  width:18px;height:18px;
  fill:#6b7280;
  transition: fill .18s ease;
}

.nav button.active{color:#111827}
.nav button.active svg{fill:#111827}