/* Adelante — papel picado, lotería and Talavera, on a student's planner. */
:root {
  --paper: #FBF4E9; --paper-2: #F3E6D2; --card: #FFFBF4;
  --ink: #2B2118; --ink-2: #6B5B4B; --line: rgba(43, 33, 24, .16);
  --terracota: #C8553D; --cempasuchil: #F2A541; --cobalto: #1D4E89;
  --agave: #3E7C59; --rosa: #E4007C; --buganvilia: #8B3A62;
  --ok: #3E7C59; --bad: #B8322A; --warn: #C77D12;
  --shadow: 3px 3px 0 var(--ink);
  --slab: "Rockwell", "Rockwell Nova", "Roboto Slab", "Sitka Heading", Georgia, serif;
  --sans: "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1C1612; --paper-2: #28201A; --card: #241C16;
    --ink: #F3E6D2; --ink-2: #BFAE96; --line: rgba(243, 230, 210, .16);
    --terracota: #E0765F; --cobalto: #6E9BD6; --agave: #6FB58A; --buganvilia: #D07BA6;
    --ok: #6FB58A; --bad: #EE7B6F; --warn: #F2A541;
    --shadow: 3px 3px 0 #000;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; font: 17px/1.6 var(--sans); color: var(--ink); background: var(--paper); }
a { color: var(--cobalto); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--slab); line-height: 1.15; letter-spacing: -.01em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: .4em 0 .5em; }
h1 .hl, h2 .hl { background: linear-gradient(transparent 58%, rgba(242, 165, 65, .55) 58% 92%, transparent 92%); padding: 0 .12em; }
h2 { font-size: 1.3rem; margin: 0 0 .6rem; }
h3 { font-size: 1.05rem; margin: 1.2rem 0 .4rem; }
p { margin: .5rem 0; }
.muted { color: var(--ink-2); font-size: .93em; }
.small { font-size: .85em; }
code { font-family: Consolas, monospace; background: var(--paper-2); padding: .05em .35em; border-radius: 4px; }

/* ---- papel picado, header, tile band ---- */
.papel { display: block; }
.top { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .6rem 2rem; padding: .2rem clamp(1rem, 4vw, 2.5rem) .7rem; }
.brand { font-family: var(--slab); font-size: 2rem; font-weight: 700; color: var(--terracota); text-decoration: none; line-height: 1; }
.brand__tag { display: block; font-family: var(--sans); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-top: .35rem; }
.tabs { display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin-left: auto; }
.tabs a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: .2rem 0; border-bottom: 3px solid transparent; }
.tabs a:hover { border-bottom-color: var(--line); }
.tabs a.on { border-bottom-color: var(--cempasuchil); }
.tile-band {
  height: 22px; border-block: 2px solid var(--ink);
  background: #F7EEDC url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 22 22'%3E%3Crect width='22' height='22' fill='%23F7EEDC'/%3E%3Cpath d='M11 3c2 3 2 5 0 8-2-3-2-5 0-8zM11 19c-2-3-2-5 0-8 2 3 2 5 0 8zM3 11c3-2 5-2 8 0-3 2-5 2-8 0zM19 11c-3 2-5 2-8 0 3-2 5-2 8 0z' fill='%231D4E89'/%3E%3Ccircle cx='11' cy='11' r='1.8' fill='%23F2A541'/%3E%3Cpath d='M0 0h3a3 3 0 0 1-3 3zM22 0h-3a3 3 0 0 0 3 3zM0 22h3a3 3 0 0 0-3-3zM22 22h-3a3 3 0 0 1 3-3z' fill='%231D4E89'/%3E%3C/svg%3E") repeat-x center / 22px 22px;
}
main { max-width: 1040px; margin: 0 auto; padding: 1.2rem clamp(1rem, 4vw, 2.5rem) 3rem; }
.foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; padding: 1.2rem clamp(1rem, 4vw, 2.5rem); border-top: 1px dashed var(--line); color: var(--ink-2); font-size: .85rem; }

/* ---- cards & surfaces ---- */
.card { background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: var(--shadow); padding: 1.1rem 1.3rem; margin: 1.2rem 0; }
.card.plain { box-shadow: none; border-color: var(--line); }
.ok { border-left: 6px solid var(--ok); }
.bad { border-left: 6px solid var(--bad); }
.warn { border-left: 6px solid var(--warn); }
.intro { font-style: italic; color: var(--ink-2); border-left: 3px solid var(--cempasuchil); padding-left: .8rem; }
.passage { font-size: 1.05rem; line-height: 1.75; max-width: 72ch; }
.passage p:first-child::first-letter { font-family: var(--slab); font-size: 2.6em; float: left; line-height: .9; margin: .08em .1em 0 0; color: var(--terracota); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 0 1.2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1rem; }
.grow { flex: 1; min-width: 260px; }
.narrow { max-width: 440px; margin: 2rem auto; }

/* ---- buttons ---- */
button, .btn {
  display: inline-flex; align-items: center; gap: .45rem; font: 600 1rem var(--sans); cursor: pointer;
  background: var(--terracota); color: #fff; border: 1.5px solid var(--ink); border-radius: 6px;
  padding: .6rem 1.15rem; box-shadow: 2px 2px 0 var(--ink); text-decoration: none; transition: transform .06s, box-shadow .06s;
}
button:hover, .btn:hover { filter: brightness(1.06); }
button:active, .btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
button.alt, .btn.alt { background: var(--card); color: var(--ink); }
.bad-btn { background: var(--bad) !important; color: #fff !important; }
.icon { width: 1.1em; height: 1.1em; flex: none; }

.signout { display: inline; margin: 0; }
button.link { background: none; border: 0; box-shadow: none; padding: .2rem 0; color: var(--ink-2); font-weight: 600; font-size: .95rem; border-bottom: 3px solid transparent; border-radius: 0; }
button.link:hover { color: var(--ink); filter: none; }
.signin { text-align: center; }
.btn.google { background: #fff; color: #1F1F1F; font-size: 1.05rem; padding: .75rem 1.4rem; margin: 1rem 0 .4rem; }
.btn.google .icon { width: 1.3em; height: 1.3em; }

/* ---- forms ---- */
label { display: block; margin: .7rem 0; }
fieldset { border: 0; margin: 0 0 1.4rem; padding: 0; }
legend { font-weight: 700; margin-bottom: .4rem; }
fieldset label { display: flex; gap: .6rem; align-items: flex-start; margin: .25rem 0; padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
fieldset label:hover { background: var(--paper-2); }
fieldset label:has(input:checked) { border-color: var(--cobalto); background: color-mix(in srgb, var(--cobalto) 10%, transparent); }
input[type=radio] { accent-color: var(--cobalto); margin-top: .35rem; }
textarea, input:not([type=radio]) { width: 100%; font: inherit; color: var(--ink); background: var(--paper); border: 1.5px solid var(--ink); border-radius: 6px; padding: .6rem .75rem; }
textarea { background-image: repeating-linear-gradient(transparent 0 1.55em, var(--line) 1.55em calc(1.55em + 1px)); line-height: 1.55em; background-attachment: local; }
textarea:focus, input:focus { outline: 3px solid color-mix(in srgb, var(--cempasuchil) 70%, transparent); outline-offset: 1px; }
.accents { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0; }
button.accent { padding: .2rem .6rem; background: var(--card); color: var(--ink); font-family: var(--slab); box-shadow: 1px 1px 0 var(--ink); }

/* ---- progress ---- */
progress { width: 100%; height: 12px; appearance: none; border: 1.5px solid var(--ink); border-radius: 20px; background: var(--paper-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--paper-2); }
progress::-webkit-progress-value { background: var(--agave); }
progress::-moz-progress-bar { background: var(--agave); }
.bar { display: grid; grid-template-columns: minmax(8rem, 1.3fr) 2fr 4.5rem; gap: .8rem; align-items: center; margin: .55rem 0; }
.bar > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- tables ---- */
table.data { border-collapse: collapse; width: 100%; margin: .6rem 0; font-size: .95rem; }
table.data caption { text-align: left; font-weight: 700; padding-bottom: .4rem; }
table.data th { font-family: var(--slab); text-align: left; background: var(--paper-2); }
table.data td, table.data th { border: 1px solid var(--line); padding: .45rem .7rem; }

/* ---- lotería cards ---- */
.loteria {
  --c: var(--terracota);
  position: relative; display: flex; flex-direction: column; align-items: center; aspect-ratio: 3 / 4;
  padding: 1.6rem .8rem .8rem; background: var(--card); color: var(--ink); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 8px; box-shadow: var(--shadow);
  outline: 1.5px solid var(--ink); outline-offset: -8px;
  transition: transform .12s;
}
a.loteria:hover { transform: rotate(-1.2deg) translateY(-3px); }
.loteria__n { position: absolute; top: 12px; left: 16px; font-family: var(--slab); font-size: 1.3rem; font-weight: 700; color: var(--c); }
.loteria .glyph { width: 62%; flex: 1; color: var(--c); }
.loteria__name { width: calc(100% - 8px); text-align: center; font-family: var(--slab); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .95rem; border-top: 1.5px solid var(--ink); padding-top: .45rem; }
.loteria__sub { font-size: .8rem; color: var(--ink-2); text-align: center; margin-top: .15rem; }
.loteria--familias { --c: var(--terracota); } .loteria--identidades { --c: var(--rosa); }
.loteria--belleza { --c: var(--warn); } .loteria--ciencia { --c: var(--cobalto); }
.loteria--vida { --c: var(--agave); } .loteria--desafios { --c: var(--buganvilia); }
.loteria-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1rem; margin: 1rem 0 1.6rem; }
@media (max-width: 900px) { .loteria-row { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .loteria-row { grid-template-columns: repeat(2, 1fr); } }

/* ---- sello (score stamp) ---- */
.sello { display: inline-grid; place-items: center; width: 7.5rem; height: 7.5rem; border-radius: 50%; border: 3px double var(--terracota); color: var(--terracota); transform: rotate(-8deg); font-family: var(--slab); text-align: center; line-height: 1; flex: none; }
.sello b { font-size: 2.6rem; display: block; }
.sello span { font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; }
.sello--ok { border-color: var(--agave); color: var(--agave); }

/* ---- dashboard ---- */
.greet { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; }
.greet h1 { margin-bottom: .2rem; }
.chips { display: flex; gap: .8rem; flex-wrap: wrap; }
.chip { display: flex; align-items: center; gap: .5rem; background: var(--card); border: 1.5px solid var(--ink); border-radius: 30px; padding: .35rem .9rem .35rem .6rem; font-weight: 600; box-shadow: 2px 2px 0 var(--ink); }
.chip .icon { color: var(--terracota); }
.calendar { display: grid; width: 6.2rem; text-align: center; background: var(--card); border: 1.5px solid var(--ink); border-radius: 6px; box-shadow: var(--shadow); overflow: hidden; }
.calendar small { background: var(--terracota); color: #fff; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; padding: .2rem 0; }
.calendar b { font-family: var(--slab); font-size: 2.1rem; line-height: 1.1; padding-top: .2rem; }
.calendar span { font-size: .72rem; color: var(--ink-2); padding-bottom: .3rem; }
.dash { display: grid; grid-template-columns: 1.15fr 1fr; gap: 0 1.4rem; }
@media (max-width: 820px) { .dash { grid-template-columns: 1fr; } }
.score-card { display: flex; gap: 1.1rem; align-items: center; }
.score-card .sello { width: 6.6rem; height: 6.6rem; }
.score-card .sello b { font-size: 2.2rem; }
.sections { flex: 1; min-width: 0; font-size: .92rem; }
.sections .row { display: grid; grid-template-columns: 1fr auto 3rem; gap: .7rem; align-items: center; padding: .3rem 0; border-bottom: 1px dashed var(--line); }
@media (max-width: 480px) { .score-card { flex-direction: column; align-items: stretch; } .score-card .sello { align-self: center; } }
.sections .row:last-child { border-bottom: 0; }
.sections .w { font-size: .78rem; color: var(--ink-2); text-align: right; }
.sections .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.todo { list-style: none; padding: 0; margin: 0; }
.todo li { display: flex; gap: .75rem; align-items: flex-start; padding: .6rem 0; border-bottom: 1px dashed var(--line); }
.todo li:last-child { border-bottom: 0; }
.todo .box { flex: none; width: 1.2rem; height: 1.2rem; margin-top: .25rem; border: 2px solid var(--ink); border-radius: 3px; }
.todo a { font-weight: 700; text-decoration: none; }
.todo a:hover { text-decoration: underline; }
.empty { text-align: center; padding: 1.5rem; color: var(--ink-2); }

/* ---- practice lists ---- */
.set-list { list-style: none; padding: 0; margin: 0; }
.set-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.set-list li:last-child { border-bottom: 0; }
.set-list a { font-weight: 600; text-decoration: none; }
.set-list a:hover { text-decoration: underline; }
.tag { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap; }
.badge { font-size: .78rem; font-weight: 700; padding: .1rem .5rem; border-radius: 20px; border: 1.5px solid var(--agave); color: var(--agave); white-space: nowrap; }
.theme-block { display: grid; grid-template-columns: 150px 1fr; gap: 1.4rem; align-items: start; margin: 1.6rem 0; }
@media (max-width: 640px) {
  .theme-block { grid-template-columns: 1fr; gap: .8rem; }
  .theme-block .loteria { flex-direction: row; aspect-ratio: auto; gap: .8rem; padding: .7rem 1rem; outline-offset: -6px; }
  .theme-block .loteria__n { position: static; }
  .theme-block .loteria .glyph { width: 2.6rem; flex: none; }
  .theme-block .loteria__name { width: auto; border-top: 0; padding: 0; text-align: left; }
  .theme-block .loteria__sub { display: none; }
}
.theme-block .card { margin: 0; }

/* ---- task pages ---- */
.sticky { position: sticky; top: 0; z-index: 5; display: flex; gap: .8rem; align-items: center; background: var(--card); border: 1.5px solid var(--ink); border-top: 0; padding: .5rem 1rem; border-radius: 0 0 8px 8px; box-shadow: var(--shadow); }
.urgent { color: var(--bad); }
.rec { color: var(--bad) !important; font-weight: 700; }
.rec::before { content: ""; display: inline-block; width: .7em; height: .7em; margin-right: .45em; border-radius: 50%; background: var(--bad); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .25; } }
.player { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.stage { text-align: center; margin: 1.2rem 0; padding: 1rem; border: 1.5px dashed var(--line); border-radius: 8px; }
.big-timer { font-family: var(--slab); font-size: 3.8rem; font-weight: 700; color: var(--terracota); font-variant-numeric: tabular-nums; }
.question { font-size: 1.2rem; font-weight: 700; }
.flash { text-align: center; max-width: 560px; margin: 1.2rem auto; padding: 2rem 1.5rem; }
.word { font-family: var(--slab); font-size: 2.6rem; font-weight: 700; margin: .4rem 0 .8rem; }
.gloss { font-size: 1.3rem; font-weight: 600; }
#grades, #actions { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.choices { display: flex; gap: .5rem; flex-wrap: wrap; }
.item .fill { width: auto; min-width: 12rem; }
.feedback { margin: .5rem 0 0; }
.prompt { font-size: 1.08rem; }
.rule { background: var(--paper-2); }
.deck { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.deck > div { flex: 1; }
.strike { text-decoration: line-through; color: var(--bad); }
.bad-text { color: var(--bad); }
.phrases { columns: 2; padding-left: 1.1rem; }
.phrases li { break-inside: avoid; margin-bottom: .3rem; }
.tile { display: flex; flex-direction: column; gap: .3rem; text-decoration: none; color: var(--ink); margin: 0; }
.tile:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.hero { display: flex; gap: 2rem; flex-wrap: wrap; align-items: center; }
.big { font-family: var(--slab); font-size: 4rem; font-weight: 700; color: var(--terracota); line-height: 1; }
.label { font-weight: 700; }

@media (max-width: 640px) {
  body { font-size: 16px; }
  .tabs { margin-left: 0; gap: .2rem .9rem; }
  .phrases { columns: 1; }
  .bar { grid-template-columns: 1fr 4rem; } .bar progress { grid-column: 1 / -1; grid-row: 2; }
}
