/* Detecta el riesgo, con los colores de Grupo Arbo (marca inventada). */
:root {
  --dark: #1b4332;
  --dark-2: #2d6a4f;
  --dark-3: #24543f;
  --accent: #ffd60a;
  --accent-ink: #1b4332;
  --accent-shadow: #1b4332;
  --mint: #eef4f0;
  --sage: #d8e3dc;
  --muted: #4f6b5c;
  --bg: var(--mint);
  --ink: var(--dark);
  --page: #10291f;
  --line: var(--dark);
  --field: #fff;
  --field-ink: var(--dark);
  --focus: #1b4332;
}
.spacer { flex: 1; }
.btn { border: 2px solid var(--dark); box-shadow: 4px 4px 0 var(--dark); border-radius: 18px; }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--dark); }
.btn-ghost { background: #fff; color: var(--dark); border: 2px solid var(--dark); box-shadow: 4px 4px 0 var(--dark); }

/* Marca */
.logo { display: flex; align-items: center; gap: 12px; color: #fff; }
.logo span { font: 800 1.6rem/1 "Jakarta", sans-serif; letter-spacing: .16em; }
.logo-sm { gap: 8px; }
.logo-sm span { font-size: 1.2rem; }
.kicker { font-size: 1.05rem; opacity: .9; }

/* Fondo oscuro que llega a los bordes de la columna */
.screen-name, .hero, .game-head, .result-hero { background: var(--dark); color: #fff; }
.hero, .game-head, .result-hero { margin: -20px -20px 0; padding: 22px 20px 20px; }
.square-btn {
  display: grid; place-items: center; flex: none; width: 48px; height: 48px;
  border-radius: 12px; border: 1.5px solid rgb(255 255 255 / .18); background: var(--dark-3);
}
:where(.screen-name, .hero, .game-head, .result-hero, .sheet) :focus-visible { outline-color: var(--accent); }
.sheet :focus-visible { outline-color: var(--dark); }

/* Nombre */
.screen-name { padding-top: 36px; gap: 14px; }
.name-title { font-size: 2.4rem; font-weight: 800; margin-top: 18px; }
.name-lead { opacity: .9; }
.name-form { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.name-form .field input { border-color: var(--accent); }
.name-form .btn { border-color: var(--accent); box-shadow: 4px 4px 0 #0c2118; }
.name-foot { font-size: .85rem; opacity: .7; text-align: center; }

/* Escenas */
.screen-scenes { gap: 0; padding-bottom: 0; }
.hero { padding-bottom: 64px; }
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.avatar {
  width: 52px; height: 52px; border-radius: 50%; border: 2.5px solid var(--accent);
  background: var(--dark-3); color: #fff; font: 800 1.1rem/1 "Jakarta", sans-serif;
}
.hello { font-size: 2.6rem; font-weight: 800; margin: 6px 0 22px; overflow-wrap: anywhere; }
.progress-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.progress-row strong { font: 800 1.15rem/1 "Jakarta", sans-serif; }
.bar { height: 14px; border-radius: 999px; background: #10291f; border: 1.5px solid #3f6b56; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s ease; }
.rank-card {
  display: flex; align-items: center; gap: 14px; margin-top: -44px; padding: 14px 16px;
  background: #fff; border: 2px solid var(--dark); border-radius: 18px; box-shadow: 4px 4px 0 var(--dark);
}
.rank-icon { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: 12px; background: var(--accent); }
.rank-main { flex: 1; min-width: 0; }
.rank-label { font-size: .9rem; }
.rank-value { font: 800 1.2rem/1.2 "Jakarta", sans-serif; }
.rank-of { text-align: right; font-size: .85rem; color: var(--muted); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; }
.section-head h2 { font-size: 1.6rem; font-weight: 800; }
.text-link { min-height: 44px; padding: 0 2px; border: 0; background: none; font: 800 1rem/1 "Jakarta", sans-serif; text-decoration: underline; text-underline-offset: 3px; }
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; list-style: none; margin: 0 0 18px; padding: 0; }
.cards li { display: flex; }
.card {
  flex: 1; display: flex; flex-direction: column; padding: 0; text-align: left; overflow: hidden;
  background: #fff; border: 2px solid var(--dark); border-radius: 16px;
}
.card-art { position: relative; display: block; aspect-ratio: 2 / 1; border-bottom: 0; }
.card-art > svg { display: block; width: 100%; height: 100%; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 12px; }
.card-name { font: 800 1.05rem/1.2 "Jakarta", sans-serif; }
.card-stars { display: flex; align-items: center; gap: 2px; font-size: .85rem; color: var(--muted); }
.card-stars svg { color: var(--muted); }
.card-stars span { margin-left: 4px; }
.card-note { font-size: .82rem; color: var(--muted); line-height: 1.3; }
.card.is-off { background: #e6ede8; }
.card.is-locked { border-style: dashed; border-color: #7d9488; }
.card.is-off .card-art { opacity: .75; }
.card-lock { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--dark); }
.btn-play { margin-bottom: 14px; }
.tabs {
  position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(3, 1fr);
  margin: auto -20px 0; padding: 8px 8px 12px; background: #fff; border-top: 1px solid #cfdcd4;
}
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 56px; border: 0; background: none; color: var(--muted); font-size: .85rem; }
.tab-icon { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 999px; }
.tab.is-on { color: var(--dark); font-weight: 800; }
.tab.is-on .tab-icon { background: var(--accent); }

/* Jugando */
.screen-game { position: relative; gap: 0; padding-bottom: 20px; }
.game-head { padding-top: 16px; padding-bottom: 14px; }
.game-top { display: flex; align-items: center; gap: 12px; }
.game-name { flex: 1; min-width: 0; }
.game-name h2 { font-size: 1.3rem; font-weight: 800; }
.game-name p { font-size: .9rem; opacity: .9; }
.timer {
  display: flex; align-items: center; gap: 6px; flex: none; padding: 8px 14px; border-radius: 999px;
  background: var(--accent); color: var(--dark); border: 2px solid var(--accent);
}
.timer strong { font: 800 1.35rem/1 "Jakarta", sans-serif; font-variant-numeric: tabular-nums; }
.timer-icon { display: grid; }
.timer.is-paused { background: #fff; }
.timer.is-low { animation: latido 1s ease infinite; }
@keyframes latido { 50% { transform: scale(1.06); } }
.found-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.found-label { font-size: .9rem; opacity: .9; }
.found-value { font: 800 1.7rem/1.1 "Jakarta", sans-serif; }
.dots { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
.dots li { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px dashed rgb(255 255 255 / .55); }
.dots li.is-on { border: 0; background: var(--accent); }

.stage { position: relative; margin: 0 -20px; background: #e4ede7; touch-action: manipulation; transition: filter .2s ease; }
.stage.is-dim { filter: brightness(.55) saturate(.8); }
.stage.is-shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.scene { display: block; width: 100%; height: auto; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.labels, .zones { position: absolute; inset: 0; pointer-events: none; }
.zone { position: absolute; padding: 0; border: 0; border-radius: 50%; background: transparent; }
.zone:focus-visible { outline: 3px dashed var(--dark); outline-offset: 0; box-shadow: 0 0 0 6px rgb(255 214 10 / .7); }
.label {
  position: absolute; padding: 4px 10px; border-radius: 999px; background: var(--dark); color: #fff;
  font: 800 .78rem/1.2 "Jakarta", sans-serif; white-space: nowrap; animation: aparece .25s ease;
}
@keyframes aparece { from { opacity: 0; transform: translateY(4px); } }
.miss {
  position: absolute; transform: translate(-50%, -120%); padding: 6px 12px; border-radius: 999px;
  background: #fff; border: 2px solid var(--dark); font-size: .85rem; font-weight: 700; white-space: nowrap;
  pointer-events: none; animation: sube 1.3s ease forwards;
}
@keyframes sube { 70% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -190%); } }
.hint-ring { fill: rgb(255 214 10 / .25); stroke: var(--dark); stroke-width: 3; stroke-dasharray: 8 6; animation: pista 1.3s ease 2; transform-box: fill-box; transform-origin: center; }
@keyframes pista { 50% { transform: scale(.8); } }
.game-foot { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; }
.instructions { font-size: 1.05rem; }
.btn-hint { font-size: 1.1rem; }
.cost { padding: 2px 8px; border: 1.5px solid currentColor; border-radius: 999px; font: 700 .78rem/1.2 "Inter", sans-serif; }

/* Hojas sobre la escena */
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; flex-direction: column; gap: 14px;
  padding: 24px 20px 24px; background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -8px 30px rgb(0 0 0 / .25);
  animation: hoja .25s ease;
}
@keyframes hoja { from { transform: translateY(30px); opacity: 0; } }
.badge { align-self: flex-start; display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: var(--accent); font: 800 .95rem/1.2 "Jakarta", sans-serif; }
.explain-head, .missed-head { display: flex; align-items: center; gap: 16px; }
.risk-icon { display: grid; place-items: center; flex: none; width: 60px; height: 60px; border-radius: 14px; background: #e4ede7; border: 2px solid var(--dark); }
.explain-head h2 { font-size: 1.8rem; font-weight: 800; }
.explain-text { font-size: 1.1rem; line-height: 1.5; }
.explain-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.pause-title { font-size: 1.8rem; font-weight: 800; }
.sheet .link { align-self: center; }

/* Resultado */
.result-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-bottom: 22px; text-align: center; }
.result-hero .hero-top { align-self: stretch; margin-bottom: 14px; }
.result-title { font-size: 2.1rem; font-weight: 800; }
.result-scene { font-size: 1.1rem; opacity: .9; }
.stars { display: flex; align-items: flex-end; gap: 10px; margin: 18px 0 6px; }
.stars svg:nth-child(2) { margin-bottom: 8px; }
.stars-text { font: 800 1.35rem/1.2 "Jakarta", sans-serif; }
.stat-row { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; text-align: left; }
.stat { padding: 12px 16px; border-radius: 16px; background: var(--dark-3); border: 1.5px solid #3f6b56; }
.stat p { font-size: .95rem; opacity: .9; }
.stat strong { display: block; font: 800 1.8rem/1.2 "Jakarta", sans-serif; }
.unlock { display: flex; align-items: center; gap: 8px; margin-top: 14px; padding: 8px 18px; border-radius: 999px; background: var(--accent); color: var(--dark); font: 800 1rem/1.2 "Jakarta", sans-serif; }
.missed { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: #fff; border: 2px solid var(--dark); border-radius: 22px; }
.missed-kicker { display: flex; align-items: center; gap: 8px; font: 800 .95rem/1 "Jakarta", sans-serif; letter-spacing: .1em; text-transform: uppercase; }
.missed-head h2 { font-size: 1.45rem; font-weight: 800; }
.missed .risk-icon { border: 0; }
.missed-text { font-size: 1.02rem; line-height: 1.5; }
.missed-more { font-size: .9rem; color: var(--muted); }
.missed-more:empty { display: none; }
.found-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chip { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border: 2px solid var(--dark); border-radius: 999px; background: #fff; font-size: .95rem; }
.chip-empty { padding-left: 14px; color: var(--muted); }
.result-actions { display: grid; grid-template-columns: auto 1fr; gap: 14px; margin-top: 4px; }
.result-actions .btn { padding: 14px 18px; font-size: 1.1rem; }
.panel-link { align-self: center; padding: 10px; color: var(--muted); font-weight: 600; font-size: .9rem; }

@media (max-width: 374px) {
  .hello { font-size: 2.2rem; }
  .dots li { width: 26px; height: 26px; }
  .found-value { font-size: 1.45rem; }
  .result-title { font-size: 2rem; }
  .result-actions .btn { font-size: 1rem; padding: 14px 12px; }
}
h1[tabindex="-1"]:focus-visible, h2[tabindex="-1"]:focus-visible { outline: none; }
