/* ================================================================
   LABORATORIO DE RETOS — Estilos
   ================================================================ */

:root {
  --bg-0: #0b1026;
  --bg-1: #141a3a;
  --card: #1c2350;
  --card-2: #232b63;
  --ink: #eef1ff;
  --ink-soft: #a9b2e0;
  --accent: #6d5efc;
  --accent-2: #22d3ee;
  --pink: #f472b6;
  --gold: #fbbf24;
  --green: #22c55e;
  --orange: #f59e0b;
  --purple: #a855f7;
  --radius: 22px;
  --shadow: 0 18px 40px rgba(0,0,0,.35);
  --font: "Baloo 2", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: rgba(255,255,255,.08); }
button, .mission, .profile-card, .photo-label, .badge, .reward-card { touch-action: manipulation; }

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 15% -10%, #29225e 0%, transparent 60%),
    radial-gradient(1000px 700px at 110% 10%, #123a52 0%, transparent 55%),
    linear-gradient(160deg, var(--bg-0), var(--bg-1));
  min-height: 100vh;
  overflow-x: hidden;
}

/* --------- Fondo de estrellas --------- */
.stars { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #fff; opacity: .6; animation: twinkle 3s infinite ease-in-out;
}
@keyframes twinkle { 0%,100%{opacity:.15; transform:scale(.7)} 50%{opacity:.9; transform:scale(1.3)} }

/* --------- Pantallas --------- */
.screen { display: none; position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding: 26px 18px 80px; }
.screen.active { display: block; animation: fadeUp .4s ease; }
@keyframes fadeUp { from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none} }

/* ================= PANTALLA DE CONTRASEÑA ================= */
.lock-wrap { display: flex; align-items: center; justify-content: center; min-height: 78vh; }
.lock-card {
  text-align: center; max-width: 380px; width: 100%;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--radius);
  padding: 36px 28px; box-shadow: var(--shadow);
}
.lock-card h1 { font-size: 32px; line-height: 1; margin-top: 4px; }
.lock-card h1 span { color: var(--accent-2); }
.lock-input {
  width: 100%; margin-top: 20px; background: rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px; color: var(--ink);
  font-family: var(--font); font-size: 18px; padding: 14px 16px; text-align: center;
}
.lock-input:focus { outline: none; border-color: var(--accent-2); }
.lock-error { color: var(--pink); min-height: 22px; margin-top: 12px; font-weight: 700; }
.lock-loading { color: var(--ink-soft); padding: 40px 10px; font-size: 17px; }

/* ================= PANTALLA PERFILES ================= */
.brand { text-align: center; margin: 30px 0 26px; }
.brand-logo { font-size: 74px; filter: drop-shadow(0 6px 18px rgba(109,94,252,.6)); animation: float 4s ease-in-out infinite; }
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-12px)} }
.brand h1 { font-size: clamp(34px, 7vw, 56px); line-height: 1; letter-spacing: -1px; }
.brand h1 span { color: var(--accent-2); }
.tagline { color: var(--ink-soft); margin-top: 10px; font-size: 17px; }

.pick-title { text-align: center; margin: 24px 0 18px; font-size: 22px; color: var(--ink-soft); font-weight: 600; }
.profiles-grid { display: flex; gap: 22px; justify-content: center; flex-wrap: wrap; }

.profile-card {
  width: 210px; background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 2px solid rgba(255,255,255,.06); border-radius: var(--radius);
  padding: 26px 18px; text-align: center; cursor: pointer;
  transition: transform .18s, box-shadow .18s, border-color .18s; box-shadow: var(--shadow);
}
.profile-card:hover { transform: translateY(-8px) scale(1.02); border-color: var(--accent); box-shadow: 0 24px 50px rgba(109,94,252,.35); }
.profile-avatar { font-size: 66px; line-height: 1; }
.profile-card h3 { font-size: 24px; margin: 12px 0 4px; }
.profile-card .p-sub { color: var(--ink-soft); font-size: 14px; }
.profile-card .p-level { margin-top: 12px; display: inline-block; background: rgba(109,94,252,.2); color: var(--accent-2); padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: 14px; }

.btn-ghost {
  display: block; margin: 34px auto 0; background: transparent; color: var(--ink-soft);
  border: 1px dashed rgba(255,255,255,.25); border-radius: 999px; padding: 12px 22px;
  font-family: var(--font); font-size: 15px; cursor: pointer; transition: .2s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--accent); }

/* ================= TOPBAR JUGADOR ================= */
.topbar {
  display: flex; align-items: center; gap: 14px; background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid rgba(255,255,255,.06); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
}
.avatar-btn { font-size: 40px; background: rgba(255,255,255,.06); border: none; border-radius: 16px; width: 60px; height: 60px; cursor: pointer; transition: .2s; }
.avatar-btn:hover { transform: scale(1.08); }
.player-info { flex: 1; min-width: 0; }
.player-name { font-size: 20px; font-weight: 700; }
.level-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.level-badge { background: linear-gradient(90deg, var(--accent), var(--pink)); padding: 3px 11px; border-radius: 999px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.xp-bar { flex: 1; height: 12px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; min-width: 60px; }
.xp-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: 999px; transition: width .6s ease; }
.xp-text { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.streak { background: rgba(245,158,11,.15); color: var(--gold); border-radius: 14px; padding: 8px 12px; font-weight: 800; font-size: 16px; }
.icon-btn { background: rgba(255,255,255,.06); border: none; border-radius: 14px; width: 46px; height: 46px; font-size: 20px; cursor: pointer; color: var(--ink); transition: .2s; }
.icon-btn:hover { background: rgba(255,255,255,.14); }

/* ================= STATS ================= */
.stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 18px 0; }
.stat-card { background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 18px; padding: 16px; text-align: center; }
.stat-num { font-size: 30px; font-weight: 800; color: var(--accent-2); }
.stat-lbl { color: var(--ink-soft); font-size: 13px; margin-top: 2px; }

/* ================= PROGRESO GLOBAL ================= */
.progress-global { background: var(--card); border: 1px solid rgba(255,255,255,.06); border-radius: 18px; padding: 16px 18px; }
.progress-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 10px; }
.progress-head span:last-child { color: var(--accent-2); }
.progress-track { height: 16px; background: rgba(255,255,255,.09); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--accent-2), var(--accent)); border-radius: 999px; transition: width .7s ease; }

/* ================= RECOMPENSAS ================= */
.rewards-section { margin-top: 26px; }
.rewards-section h3 { font-size: 20px; margin-bottom: 14px; }
.rewards-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.reward-card {
  flex: 0 0 170px; background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid rgba(255,255,255,.08); border-radius: 18px; padding: 16px 14px; text-align: center; position: relative;
}
.reward-card.unlocked { border-color: var(--gold); box-shadow: 0 0 22px rgba(251,191,36,.3); }
.reward-card .rw-emoji { font-size: 42px; }
.reward-card.unlocked .rw-emoji { animation: pop .5s ease; }
.reward-card:not(.unlocked) .rw-emoji { filter: grayscale(.6) opacity(.7); }
.rw-name { font-weight: 700; font-size: 15px; margin: 8px 0 10px; line-height: 1.15; }
.rw-track { height: 10px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.rw-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent-2)); border-radius: 999px; transition: width .6s ease; }
.rw-foot { margin-top: 8px; font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.reward-card.unlocked .rw-foot { color: var(--gold); }

/* ================= INSIGNIAS ================= */
.badges-section, .missions-section { margin-top: 26px; }
.badges-section h3, .missions-section h3 { font-size: 20px; margin-bottom: 14px; }
.badges-row { display: flex; gap: 12px; flex-wrap: wrap; }
.badge {
  width: 82px; height: 96px; border-radius: 16px; background: var(--card);
  border: 1px solid rgba(255,255,255,.06); display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 8px; position: relative;
}
.badge .b-emoji { font-size: 34px; filter: grayscale(1) opacity(.35); transition: .3s; }
.badge.earned .b-emoji { filter: none; animation: pop .5s ease; }
.badge .b-name { font-size: 10px; color: var(--ink-soft); margin-top: 6px; line-height: 1.1; }
.badge.earned { border-color: var(--gold); box-shadow: 0 0 18px rgba(251,191,36,.25); }
@keyframes pop { 0%{transform:scale(.4)} 70%{transform:scale(1.25)} 100%{transform:scale(1)} }

/* ================= MISIONES ================= */
.missions-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 14px; }
.mission {
  position: relative; background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid rgba(255,255,255,.06); border-radius: 18px; padding: 16px 14px;
  cursor: pointer; transition: transform .16s, box-shadow .16s; min-height: 148px;
  display: flex; flex-direction: column; overflow: hidden;
}
.mission:hover { transform: translateY(-6px); box-shadow: 0 18px 34px rgba(0,0,0,.4); }
.mission .m-day { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.mission .m-emoji { font-size: 42px; margin: 6px 0; }
.mission .m-title { font-size: 15px; font-weight: 700; line-height: 1.15; }
.mission .m-cat { position: absolute; top: 12px; right: 12px; font-size: 18px; }
.mission .m-status { margin-top: auto; padding-top: 10px; font-size: 12px; font-weight: 700; }

.mission.locked { cursor: not-allowed; opacity: .55; }
.mission.locked .m-emoji { filter: grayscale(1); }
.mission.locked::after { content: "🔒"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; background: rgba(11,16,38,.55); }
.mission.available { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(34,211,238,.15); }
.mission.available .m-status { color: var(--accent-2); }
.mission.submitted { border-color: var(--gold); }
.mission.submitted .m-status { color: var(--gold); }
.mission.approved { border-color: var(--green); }
.mission.approved .m-status { color: var(--green); }
.mission.redo { border-color: var(--pink); }
.mission.redo .m-status { color: var(--pink); }
.mission .m-stars { color: var(--gold); font-size: 14px; letter-spacing: 1px; }
.mission.soon { opacity: .4; cursor: default; }
.mission.soon:hover { transform: none; box-shadow: none; }
/* Reto de MAÑANA: sorpresa pero con materiales visibles */
.mission.next { cursor: pointer; border-color: var(--accent); border-style: dashed; }
.mission.next .m-emoji { filter: none; opacity: .9; }
.mission.next .m-title { color: var(--ink-soft); }
.mission.next .m-status { color: var(--accent-2); }
.mission.next:hover { transform: translateY(-6px); box-shadow: 0 18px 34px rgba(0,0,0,.4); }

/* ================= MODALES ================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(6,9,24,.72); backdrop-filter: blur(4px);
  display: none; align-items: flex-start; justify-content: center; z-index: 50; padding: 24px 14px; overflow-y: auto;
}
.modal-overlay.open { display: flex; animation: fadeUp .25s ease; }
.modal {
  background: linear-gradient(180deg, var(--bg-1), var(--card)); border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 620px; padding: 26px; position: relative; margin: auto;
}
.modal-close { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.08); border: none; color: var(--ink); width: 38px; height: 38px; border-radius: 12px; font-size: 16px; cursor: pointer; z-index: 2; }
.modal-close:hover { background: rgba(255,255,255,.18); }

/* --------- Detalle de reto --------- */
.reto-header { display: flex; align-items: center; gap: 14px; padding-right: 40px; }
.reto-header .r-emoji { font-size: 54px; }
.reto-header h2 { font-size: 26px; line-height: 1.05; }
.reto-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.tag { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); }
.tag.cat { color: #0b1026; }
.reto-intro { margin: 16px 0; font-size: 16px; color: var(--ink-soft); background: rgba(255,255,255,.04); border-left: 3px solid var(--accent-2); padding: 12px 14px; border-radius: 10px; }
.reto-block { margin-top: 18px; }
.reto-block h4 { font-size: 16px; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.reto-block ul, .reto-block ol { padding-left: 22px; }
.reto-block li { margin: 6px 0; line-height: 1.4; }
.science-box { background: linear-gradient(135deg, rgba(109,94,252,.15), rgba(34,211,238,.1)); border: 1px solid rgba(109,94,252,.3); border-radius: 14px; padding: 14px 16px; line-height: 1.5; }

/* Vídeo */
.video-block h4 { color: var(--accent-2); }
.video-frame { position: relative; width: 100%; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,.1); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-link { display: inline-block; margin-top: 8px; color: var(--accent-2); font-weight: 700; font-size: 14px; text-decoration: none; }
.video-link:hover { text-decoration: underline; }

/* App recomendada */
.app-box { background: linear-gradient(135deg, rgba(59,130,246,.15), rgba(34,211,238,.08)); border: 1px solid rgba(59,130,246,.35); border-radius: 14px; padding: 14px 16px; }
.app-name { font-weight: 800; font-size: 17px; margin-bottom: 8px; }
.app-box p { margin: 10px 0; line-height: 1.45; color: var(--ink-soft); }
.app-link { display: inline-block; background: #3b82f6; color: #fff; text-decoration: none; font-weight: 700; padding: 10px 16px; border-radius: 12px; font-size: 14px; }
.app-link:hover { filter: brightness(1.1); }

/* Casilla "he visto el vídeo" */
.video-check { display: flex; align-items: center; gap: 10px; background: rgba(34,211,238,.1); border: 1px solid rgba(34,211,238,.3); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; cursor: pointer; font-weight: 700; }
.video-check input { width: 22px; height: 22px; accent-color: var(--accent-2); cursor: pointer; }
.extra-box { background: rgba(251,191,36,.1); border: 1px dashed var(--gold); border-radius: 14px; padding: 12px 14px; color: #ffe9b0; }

/* --------- Formulario de respuesta --------- */
.answer-zone { margin-top: 22px; background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 16px; }
.answer-zone h4 { margin-bottom: 12px; }
.q-item { margin-bottom: 14px; }
.q-item label { display: block; font-size: 14px; margin-bottom: 6px; color: var(--ink-soft); }
.answer-zone textarea, .answer-zone input[type=text] {
  width: 100%; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  color: var(--ink); font-family: var(--font); font-size: 15px; padding: 10px 12px; resize: vertical;
}
.answer-zone textarea:focus, .answer-zone input:focus { outline: none; border-color: var(--accent-2); }
.photo-drop { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.photo-label { background: rgba(34,211,238,.15); color: var(--accent-2); border: 1px solid rgba(34,211,238,.3); padding: 10px 16px; border-radius: 12px; cursor: pointer; font-weight: 700; font-size: 14px; }
.photo-preview { max-width: 90px; max-height: 90px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15); }

.btn-primary {
  display: block; width: 100%; margin-top: 18px; background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #06122a; border: none; border-radius: 14px; padding: 15px; font-family: var(--font); font-size: 18px; font-weight: 800;
  cursor: pointer; transition: transform .15s, filter .15s; box-shadow: 0 10px 24px rgba(109,94,252,.4);
}
.btn-primary:hover { transform: translateY(-2px); filter: brightness(1.08); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.status-note { text-align: center; padding: 14px; border-radius: 12px; font-weight: 700; margin-top: 10px; }
.status-note.wait { background: rgba(251,191,36,.12); color: var(--gold); }
.status-note.ok { background: rgba(34,197,94,.12); color: var(--green); }
.status-note.redo { background: rgba(244,114,182,.12); color: var(--pink); }
.feedback-bubble { margin-top: 12px; background: rgba(255,255,255,.05); border-radius: 12px; padding: 12px 14px; font-style: italic; }
.feedback-bubble b { font-style: normal; }

/* ================= PANEL DE PADRE ================= */
.pin-pad { text-align: center; }
.pin-pad h2 { font-size: 24px; margin-bottom: 6px; }
.pin-pad p { color: var(--ink-soft); margin-bottom: 16px; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin-bottom: 18px; }
.pin-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--ink-soft); }
.pin-dot.filled { background: var(--accent-2); border-color: var(--accent-2); }
.keys { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; max-width: 260px; margin: 0 auto; }
.keys button { background: var(--card-2); border: none; color: var(--ink); font-size: 24px; font-family: var(--font); border-radius: 14px; padding: 16px; cursor: pointer; transition: .15s; }
.keys button:hover { background: var(--accent); }
.pin-error { color: var(--pink); min-height: 20px; margin-top: 12px; }

.parent-review { max-height: 78vh; overflow-y: auto; }
.parent-review h2 { margin-bottom: 6px; }
.parent-sub { color: var(--ink-soft); margin-bottom: 16px; }
.child-tabs { display: flex; gap: 10px; margin-bottom: 16px; }
.child-tab { flex: 1; padding: 10px; border-radius: 12px; background: var(--card); border: 1px solid rgba(255,255,255,.08); cursor: pointer; font-family: var(--font); color: var(--ink); font-weight: 700; }
.child-tab.active { border-color: var(--accent-2); background: var(--card-2); }

.review-card { background: var(--card); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.review-card h4 { font-size: 17px; margin-bottom: 4px; }
.review-card .rc-meta { color: var(--ink-soft); font-size: 13px; margin-bottom: 10px; }
.rc-answer { background: rgba(0,0,0,.2); border-radius: 10px; padding: 10px 12px; margin: 6px 0; font-size: 14px; line-height: 1.4; }
.rc-answer .rc-q { color: var(--accent-2); font-weight: 700; display: block; margin-bottom: 2px; font-size: 13px; }
.rc-photo { max-width: 160px; border-radius: 10px; margin: 8px 0; border: 1px solid rgba(255,255,255,.12); display: block; }
.star-pick { font-size: 34px; cursor: pointer; user-select: none; letter-spacing: 4px; margin: 8px 0; }
.star-pick span { filter: grayscale(1) opacity(.4); transition: .15s; }
.star-pick span.on { filter: none; transform: scale(1.1); }
.review-card textarea { width: 100%; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: var(--ink); font-family: var(--font); padding: 8px 10px; margin: 6px 0; resize: vertical; }
.review-actions { display: flex; gap: 10px; margin-top: 8px; }
.btn-approve { flex: 2; background: linear-gradient(90deg, var(--green), #16a34a); color: #04140a; border: none; border-radius: 12px; padding: 12px; font-family: var(--font); font-weight: 800; font-size: 15px; cursor: pointer; }
.btn-redo { flex: 1; background: rgba(244,114,182,.15); color: var(--pink); border: 1px solid var(--pink); border-radius: 12px; padding: 12px; font-family: var(--font); font-weight: 700; cursor: pointer; }
.empty-state { text-align: center; color: var(--ink-soft); padding: 40px 20px; }
.empty-state .es-emoji { font-size: 54px; }

.parent-tools { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.08); padding-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.mini-btn { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: var(--ink-soft); border-radius: 10px; padding: 8px 12px; font-family: var(--font); cursor: pointer; font-size: 13px; }
.mini-btn:hover { color: var(--ink); }

/* ================= CELEBRACIÓN ================= */
.celebrate-modal { text-align: center; max-width: 420px; }
.celebrate-modal .cel-emoji { font-size: 80px; animation: pop .6s ease; }
.celebrate-modal h2 { font-size: 28px; margin: 8px 0; }
.celebrate-modal p { color: var(--ink-soft); font-size: 16px; }
.cel-xp { display: inline-block; margin: 14px 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #06122a; font-weight: 800; font-size: 22px; padding: 8px 20px; border-radius: 999px; }

/* ================= TOASTS (avisos integrados) ================= */
.toast-layer { position: fixed; left: 0; right: 0; bottom: 24px; z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 14px; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; max-width: 460px; width: fit-content;
  background: linear-gradient(180deg, var(--card-2), var(--card)); color: var(--ink);
  border: 1px solid rgba(255,255,255,.12); border-left-width: 5px; border-radius: 14px;
  padding: 14px 18px; box-shadow: var(--shadow); font-weight: 700; font-size: 15px; line-height: 1.35;
  opacity: 0; transform: translateY(20px) scale(.96); transition: opacity .25s, transform .25s; pointer-events: auto;
}
.toast.show { opacity: 1; transform: none; }
.toast .toast-ico { font-size: 22px; flex: 0 0 auto; }
.toast.warn { border-left-color: var(--gold); }
.toast.error { border-left-color: var(--pink); }
.toast.success { border-left-color: var(--green); }
.toast.info, .toast.video { border-left-color: var(--accent-2); }

/* Sacudida de la casilla del vídeo cuando falta marcarla */
.video-check.shake { animation: shake .5s; }
@keyframes shake {
  10%,90% { transform: translateX(-2px); }
  20%,80% { transform: translateX(4px); }
  30%,50%,70% { transform: translateX(-8px); }
  40%,60% { transform: translateX(8px); }
}

/* Diálogo de confirmación integrado */
.confirm-modal { max-width: 400px; text-align: center; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions button { flex: 1; }

/* ================= CONFETI ================= */
.confetti-layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; overflow: hidden; }
.confetti-piece { position: absolute; width: 10px; height: 14px; top: -20px; opacity: .9; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); opacity: 0; } }

/* ================= VISTA PREVIA / EDITOR (PADRE) ================= */
.preview-list { display: flex; flex-direction: column; gap: 10px; }
.preview-reto {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  background: var(--card); border: 1px solid rgba(255,255,255,.08); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; color: var(--ink); font-family: var(--font); transition: .15s;
}
.preview-reto:hover { border-color: var(--accent-2); transform: translateX(3px); }
.pr-emoji { font-size: 30px; }
.pr-info { font-size: 14px; line-height: 1.35; }

.exp-editor { display: flex; flex-direction: column; gap: 14px; }
.exp-row { display: flex; gap: 8px; align-items: center; }
.exp-editor input { background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; color: var(--ink); font-family: var(--font); padding: 10px; font-size: 15px; }
.ex-emoji { width: 54px; text-align: center; flex: 0 0 auto; }
.ex-nombre { flex: 1; min-width: 0; }
.ex-xp { width: 88px; flex: 0 0 auto; }
.ex-desc { width: 100%; margin-top: -6px; }

/* ================= RESPONSIVE ================= */

/* --------- iPad y tablets (el aparato de la familia) --------- */
@media (min-width: 640px) and (max-width: 1200px) {
  .screen { max-width: 900px; padding: 26px 22px 90px; }
  .missions-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  .mission { min-height: 165px; }
  .mission .m-emoji { font-size: 48px; }
  .mission .m-title { font-size: 16px; }
  .btn-primary { padding: 17px; font-size: 19px; }   /* botón grande para tocar con el dedo */
  .keys button { padding: 20px; font-size: 26px; }   /* teclado del PIN más grande */
  .modal { max-width: 680px; }
  .reto-block li { margin: 9px 0; font-size: 16px; }
  .btn-approve, .btn-redo { padding: 15px; font-size: 16px; }
  .mini-btn { padding: 11px 14px; font-size: 14px; }
  .photo-label { padding: 14px 20px; font-size: 16px; }
}
/* En iPad, las zonas con scroll deben deslizar con el dedo suavemente */
.modal-overlay, .parent-review, .rewards-row { -webkit-overflow-scrolling: touch; }

@media (max-width: 560px) {
  .stats-row { grid-template-columns: repeat(3,1fr); gap: 8px; }
  .stat-num { font-size: 22px; }
  .profiles-grid { gap: 14px; }
  .profile-card { width: 45%; min-width: 150px; }
  .modal { padding: 20px 16px; }
  .reto-header h2 { font-size: 22px; }
  .missions-grid { grid-template-columns: repeat(2, 1fr); }
}
