/* Routsetter Club — estética "cromo/pegatina" oscura, adulta, móvil primero */
:root {
  --brand: #ff5a36;
  --bg: #121212;
  --bg2: #181818;
  --card: #1c1c1c;
  --ink: #f6f1e7;
  --muted: #9d9d9d;
  --line: #0a0a0a;
  --yellow: #e8d9b0;
  --teal: #5cc4a4;
  --pink: #cfa3b8;
  --danger: #ff6b6b;
  --radius: 18px;
  --shadow: 4px 4px 0 var(--line);
  --font: ui-rounded, "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(circle at 15% -10%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 45%),
    radial-gradient(circle at 100% 30%, rgba(255, 255, 255, .04), transparent 40%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--yellow); }
h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: .02em; }
h1 { font-size: 1.9rem; text-transform: uppercase; font-weight: 900; }
h2 { font-size: 1.15rem; text-transform: uppercase; font-weight: 800; letter-spacing: .06em; }
p { margin: .3rem 0; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.mono { font-family: var(--mono); }

#app { max-width: 520px; margin: 0 auto; padding: 0 16px 108px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 14px 0 6px; }
.topbar .logo { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; border: 3px solid var(--line); background: var(--card); }
.topbar .gname { font-weight: 900; text-transform: uppercase; letter-spacing: .06em; flex: 1; font-size: 1rem; }
.topbar select { background: var(--card); color: var(--ink); border: 3px solid var(--line); border-radius: 10px; padding: 6px; font: inherit; max-width: 45%; }

.view { animation: rise .35s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Tarjetas tipo cromo */
.card {
  background: var(--card); border: 3px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 14px 0; position: relative; overflow: hidden;
}
.card::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 40%, rgba(255,255,255,.05) 50%, transparent 60%); }
.card.brand { background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #000)); color: #fff; }
.card.gold { background: linear-gradient(135deg, var(--yellow), #c9b98d); color: #2a1a00; }
.card.hero { text-align: center; padding: 26px 18px; }
.card h2 { margin-bottom: 6px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

.hello { display: flex; align-items: center; gap: 14px; margin: 10px 0 4px; }
.hello .avatar { width: 64px; height: 64px; flex: none; filter: drop-shadow(3px 3px 0 var(--line)); }
.hello h1 { font-size: 1.5rem; text-transform: none; }

.bigpoints { font-family: var(--mono); font-weight: 900; font-size: 3rem; line-height: 1; }
.bigpoints small { font-size: 1rem; letter-spacing: .2em; margin-left: 6px; }
.stat { text-align: center; padding: 12px 6px; }
.stat b { display: block; font-family: var(--mono); font-size: 1.7rem; }
.stat span { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* Barras de progreso */
.bar { height: 16px; background: rgba(0,0,0,.35); border: 3px solid var(--line); border-radius: 99px; overflow: hidden; margin: 8px 0; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 99px; transition: width .9s cubic-bezier(.2,.9,.3,1);
  background: repeating-linear-gradient(45deg, var(--teal) 0 10px, #4aa88a 10px 20px); }
.bar.brand > i { background: repeating-linear-gradient(45deg, var(--brand) 0 10px, color-mix(in srgb, var(--brand) 75%, #fff) 10px 20px); }
.bar.gold > i { background: repeating-linear-gradient(45deg, var(--yellow) 0 10px, #c9b98d 10px 20px); }

/* Botones */
.btn {
  display: block; width: 100%; padding: 14px 18px; border: 3px solid var(--line); border-radius: 14px;
  background: var(--brand); color: #fff; font: inherit; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  text-align: center; text-decoration: none; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .08s, box-shadow .08s;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--line); }
.btn.alt { background: var(--yellow); color: #2a1a00; }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.danger { background: var(--danger); }
.btn.small { display: inline-block; width: auto; padding: 8px 12px; font-size: .75rem; box-shadow: 2px 2px 0 var(--line); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn + .btn { margin-top: 12px; }
.big-cta { font-size: 1.15rem; padding: 20px; animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { box-shadow: 4px 4px 0 var(--line), 0 0 0 8px color-mix(in srgb, var(--brand) 30%, transparent); } }

/* Formularios */
label { display: block; font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; margin: 14px 0 6px; color: var(--muted); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 13px 14px; background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem;
  border: 3px solid var(--line); border-radius: 12px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--teal); }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: .9rem; color: var(--ink); }
.check input { width: 22px; height: 22px; flex: none; accent-color: var(--brand); }
.error { background: rgba(255,107,107,.15); border: 3px solid var(--danger); border-radius: 12px; padding: 10px 12px; margin: 12px 0; font-weight: 700; }

/* Avatares */
.avatar { display: block; }
.avatar-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.avatar-opt { padding: 4px; background: none; border: 3px solid transparent; border-radius: 18px; cursor: pointer; }
.avatar-opt svg { width: 100%; height: auto; }
.avatar-opt[aria-pressed=true] { border-color: var(--yellow); background: rgba(232,217,176,.12); transform: scale(1.05); }

/* Navegación inferior */
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  background: var(--bg2); border-top: 3px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav-inner { display: flex; width: 100%; max-width: 520px; }
.nav a { flex: 1; text-align: center; padding: 8px 2px 10px; color: var(--muted); text-decoration: none; font-size: .68rem;
  font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.nav a span { display: block; font-size: 1.45rem; margin-bottom: 2px; }
.nav a[aria-current=page] { color: var(--yellow); }
.nav a[aria-current=page] span { transform: translateY(-3px) scale(1.15); }

/* Retos, insignias, listas */
.pill { display: inline-block; padding: 3px 10px; border: 2px solid var(--line); border-radius: 99px; font-size: .7rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; background: var(--bg); color: var(--ink); }
.pill.gold { background: var(--yellow); color: #2a1a00; }
.pill.teal { background: var(--teal); color: #0a2a22; }
.ch-icon { font-size: 1.8rem; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { text-align: center; padding: 12px 6px; border: 3px solid var(--line); border-radius: 16px; background: var(--bg2); box-shadow: 3px 3px 0 var(--line); }
.badge .ico { font-size: 2rem; display: block; }
.badge b { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; display: block; margin-top: 4px; }
.badge.off { opacity: .4; filter: grayscale(1); }
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 2px dashed rgba(255,255,255,.1); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .avatar { width: 44px; height: 44px; flex: none; }
.pts-plus { color: var(--teal); font-family: var(--mono); font-weight: 900; }
.pts-minus { color: var(--danger); font-family: var(--mono); font-weight: 900; }
.news-item { border-left: 5px solid var(--yellow); padding: 4px 0 4px 12px; margin: 10px 0; }

/* Landing */
.landing { text-align: center; padding-top: 28px; }
.landing .gimg { width: 100%; max-height: 190px; object-fit: cover; border: 3px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.landing .glogo { width: 96px; height: 96px; border-radius: 24px; border: 4px solid var(--line); box-shadow: var(--shadow); object-fit: cover; background: var(--card); margin-bottom: 14px; }
.landing h1 { font-size: 2.4rem; text-shadow: 3px 3px 0 var(--line); word-break: break-word; }
.landing .tag { font-size: 1.1rem; color: var(--yellow); margin: 8px 0 26px; font-weight: 700; }
.powered { text-align: center; color: var(--muted); font-size: .72rem; letter-spacing: .15em; text-transform: uppercase; margin: 28px 0 0; }

/* Celebración */
.toast-wrap { position: fixed; top: 12px; left: 0; right: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--yellow); color: #2a1a00; border: 3px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 18px; font-weight: 900; animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; max-width: 90vw; }
@keyframes pop { from { transform: scale(.4) translateY(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-bg { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.78); display: flex; align-items: center; justify-content: center; padding: 18px; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border: 3px solid var(--line); border-radius: 22px; box-shadow: 6px 6px 0 var(--line); padding: 22px; width: 100%; max-width: 420px; max-height: 88vh; overflow: auto; animation: pop .4s cubic-bezier(.2,1.5,.4,1) both; text-align: center; }
.modal .emoji { font-size: 4.5rem; display: block; animation: wiggle 1s ease 2; }
@keyframes wiggle { 25% { transform: rotate(-12deg) scale(1.1); } 75% { transform: rotate(12deg) scale(1.1); } }
#confetti { position: fixed; inset: 0; z-index: 70; pointer-events: none; }
.spinner { width: 34px; height: 34px; margin: 40px auto; border: 5px solid rgba(255,255,255,.15); border-top-color: var(--yellow); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.locked-card { background: repeating-linear-gradient(135deg, var(--card) 0 14px, #181818 14px 28px); }
.big-emoji { font-size: 3.2rem; line-height: 1; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
