:root {
  --bg: #FFF4E6;
  --bg2: #FFE8CC;
  --ink: #2B1B17;
  --muted: #7A5C4F;
  --card: #FFFFFF;
  --coffee: #6F4E37;
  --accent: #FF6B6B;
  --accent2: #4ECDC4;
  --yellow: #FFD93D;
  --line: #EAD7C3;
  --shadow: 0 6px 0 #2B1B17;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 20%, #FFE1C2 0 120px, transparent 121px),
    radial-gradient(circle at 90% 70%, #FFE1C2 0 160px, transparent 161px),
    repeating-linear-gradient(45deg, transparent 0 28px, rgba(111,78,55,.035) 28px 30px);
  min-height: 100vh;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }

/* ---------- fondo de tazas flotando ---------- */
#floaters { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floater { position: absolute; width: 70px; opacity: .22; animation: floatUp linear infinite; }
@keyframes floatUp {
  from { transform: translateY(110vh) rotate(0deg); }
  to   { transform: translateY(-160px) rotate(360deg); }
}

/* ---------- layout ---------- */
.wrap { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 24px 16px 60px; }
header.hero { text-align: center; padding: 10px 0 18px; }
.logo-mug { width: 120px; margin: 0 auto; animation: bounce 2.2s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
h1 { font-size: clamp(30px, 6vw, 56px); margin: 6px 0 2px; line-height: 1; letter-spacing: -.5px; }
h1 .pop { color: var(--accent); display: inline-block; animation: wobble 3s ease-in-out infinite; }
@keyframes wobble { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) scale(1.05); } }
.tagline { color: var(--muted); font-size: 18px; margin: 6px 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: var(--card); border: 2px solid var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 600; box-shadow: 0 3px 0 var(--ink); }

.card {
  background: var(--card); border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 22px; align-items: start; }
@media (max-width: 780px) { .grid2 { grid-template-columns: 1fr; } }
h2 { margin: 0 0 6px; font-size: 26px; }
.sub { margin: 0 0 16px; color: var(--muted); }

/* ---------- formularios ---------- */
label { display: block; font-weight: 600; margin: 12px 0 6px; }
.hint-text { font-weight: 400; color: var(--muted); font-size: 14px; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border: 2.5px solid var(--ink); border-radius: 14px; background: #FFFCF8;
  outline: none; transition: transform .1s, box-shadow .1s;
}
input:focus, select:focus, textarea:focus { box-shadow: 0 0 0 4px rgba(255,107,107,.35); }
textarea { resize: vertical; min-height: 70px; }
.pin-input { letter-spacing: 14px; text-align: center; font-size: 28px; font-weight: 700; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--accent); color: #fff; border: 3px solid var(--ink); border-radius: 16px;
  padding: 12px 22px; font-weight: 700; font-size: 18px; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink); transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.big { font-size: 22px; padding: 16px 30px; }
.btn.alt { background: var(--accent2); color: var(--ink); }
.btn.ghost { background: var(--card); color: var(--ink); }
.btn.block { width: 100%; margin-top: 18px; }
.err { color: #C0262D; font-weight: 600; min-height: 1.3em; margin-top: 10px; }
.ok-msg { color: #2E7D32; font-weight: 600; }

/* ---------- muro de tazas ---------- */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.wall-item { text-align: center; animation: popIn .45s cubic-bezier(.3,1.6,.5,1) both; }
.wall-item .mini { width: 72px; margin: 0 auto; transition: transform .2s; }
.wall-item:hover .mini { transform: rotate(-10deg) scale(1.12); }
.wall-item .nm { font-weight: 700; font-size: 15px; line-height: 1.1; word-break: break-word; }
.wall-item .sc { font-size: 12px; color: var(--muted); }
@keyframes popIn { from { opacity: 0; transform: scale(.3) translateY(20px); } to { opacity: 1; transform: none; } }
.empty { color: var(--muted); text-align: center; padding: 30px 10px; }
.sector-bar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.sector-pill { font-size: 13px; background: var(--bg2); border-radius: 999px; padding: 3px 10px; font-weight: 600; }

/* ---------- ¿quién sos? ---------- */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.person {
  background: var(--card); border: 3px solid var(--ink); border-radius: 18px; padding: 10px 8px 12px;
  text-align: center; cursor: pointer; box-shadow: 0 4px 0 var(--ink); transition: transform .12s;
  animation: popIn .4s cubic-bezier(.3,1.6,.5,1) both;
}
.person:hover { transform: translateY(-4px) rotate(-1.5deg); }
.person .mini { width: 64px; margin: 0 auto; }
.person .nm { font-weight: 700; }
.person .sc { font-size: 12px; color: var(--muted); }
.person .tag { display: inline-block; margin-top: 6px; font-size: 12px; background: #E8F7EE; color: #2E7D32; border-radius: 999px; padding: 2px 8px; font-weight: 600; }

/* ---------- progreso ---------- */
.progress { height: 18px; border: 2.5px solid var(--ink); border-radius: 999px; overflow: hidden; background: #fff; margin-top: 8px; }
.progress > div { height: 100%; background: repeating-linear-gradient(45deg, var(--accent2) 0 12px, #7EDDD6 12px 24px); transition: width .8s; animation: slide 1s linear infinite; background-size: 34px 100%; }
@keyframes slide { to { background-position: 34px 0; } }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(43,27,23,.55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; animation: fade .2s; }
.modal .card { width: 100%; max-width: 400px; animation: popIn .35s cubic-bezier(.3,1.6,.5,1); }
@keyframes fade { from { opacity: 0; } }
.shake { animation: shakeX .4s; }
@keyframes shakeX { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-10px); } 40%,80% { transform: translateX(10px); } }

/* ---------- escenario del reveal ---------- */
.stage { text-align: center; padding: 10px 0; }
.stage h2 { font-size: clamp(24px, 4.5vw, 36px); }
.big-mug { width: min(280px, 70vw); margin: 0 auto; position: relative; }
.big-mug.rattle { animation: rattle .12s linear infinite; }
@keyframes rattle { 0% { transform: rotate(-6deg) translateY(0); } 50% { transform: rotate(6deg) translateY(-6px); } 100% { transform: rotate(-6deg) translateY(0); } }
.big-mug.tip { animation: tip .9s cubic-bezier(.5,-0.5,.5,1.5) forwards; }
@keyframes tip { to { transform: rotate(-110deg) translate(-30px, -20px) scale(.9); } }
.qmark {
  position: absolute; top: -4%; right: -6%; width: 76px; height: 76px; line-height: 70px; text-align: center;
  font-size: 50px; font-weight: 800; color: var(--accent); background: #fff; border: 3px solid var(--ink); border-radius: 50%;
  box-shadow: 0 4px 0 var(--ink); animation: wobble 1s ease-in-out infinite;
}

.reel-wrap { margin: 18px auto; width: min(520px, 100%); height: 92px; overflow: hidden; border: 4px solid var(--ink); border-radius: 20px; background: var(--yellow); box-shadow: var(--shadow); position: relative; }
.reel-wrap::before, .reel-wrap::after { content: ''; position: absolute; left: 0; right: 0; height: 22px; z-index: 2; pointer-events: none; }
.reel-wrap::before { top: 0; background: linear-gradient(var(--yellow), transparent); }
.reel-wrap::after { bottom: 0; background: linear-gradient(transparent, var(--yellow)); }
.reel { will-change: transform; }
.reel div { height: 84px; line-height: 84px; font-size: clamp(22px, 5vw, 34px); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 12px; }

.result { display: none; }
.result.show { display: block; animation: popIn .6s cubic-bezier(.3,1.6,.5,1); }
.result .who { font-size: clamp(36px, 8vw, 64px); font-weight: 800; color: var(--accent); line-height: 1.05; margin: 4px 0; text-shadow: 3px 3px 0 var(--ink); -webkit-text-stroke: 1px var(--ink); }
.result .sector { display: inline-block; background: var(--accent2); border: 2.5px solid var(--ink); border-radius: 999px; padding: 4px 14px; font-weight: 700; }
.hintbox { margin: 18px auto 0; max-width: 520px; background: #FFFBEA; border: 3px dashed var(--coffee); border-radius: 18px; padding: 14px 16px; text-align: left; }
.hintbox b { color: var(--coffee); }
.idea { margin: 14px auto 0; max-width: 520px; color: var(--muted); }
.secret-note { margin-top: 16px; font-size: 15px; color: var(--muted); }

/* ---------- selector de taza ---------- */
.mug-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mug-opt { background: #FFFCF8; border: 2.5px solid var(--line); border-radius: 14px; padding: 6px 4px 2px; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.mug-opt:hover { transform: translateY(-3px) rotate(-4deg); }
.mug-opt[aria-checked="true"] { border-color: var(--ink); background: var(--yellow); box-shadow: 0 3px 0 var(--ink); animation: pick .5s cubic-bezier(.3,1.8,.5,1); }
@keyframes pick { 0% { transform: scale(.8); } 100% { transform: scale(1); } }
.mug-caption { text-align: center; font-weight: 700; color: var(--coffee); margin-top: 8px; min-height: 1.3em; }

/* ---------- cuenta regresiva ---------- */
.countdown { background: var(--yellow); border: 3px solid var(--ink); border-radius: 18px; padding: 12px; margin-bottom: 6px; text-align: center; box-shadow: 0 4px 0 var(--ink); }
.countdown.urgent { background: #FFB4B4; animation: wobble 1.2s ease-in-out infinite; }
.cd-title { font-weight: 700; margin-bottom: 8px; }
.cd-boxes { display: flex; justify-content: center; gap: 8px; }
.cd-box { background: #fff; border: 2.5px solid var(--ink); border-radius: 12px; min-width: 60px; padding: 6px 4px; }
.cd-box b { display: block; font-size: 26px; line-height: 1; }
.cd-box span { font-size: 12px; color: var(--muted); }
.closed-box { text-align: center; padding: 10px 0; }

/* ---------- reglas ---------- */
.rules { margin-bottom: 22px; padding: 16px 22px; }
.rules summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; }
.rules summary::-webkit-details-marker { display: none; }
.rules summary::after { content: '▾'; font-size: 22px; transition: transform .2s; }
.rules:not([open]) summary::after { transform: rotate(-90deg); }
.rules h2 { margin: 0; }
.rules-list { list-style: none; padding: 0; margin: 14px 0 4px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.rules-list li { display: flex; gap: 10px; align-items: flex-start; background: var(--bg); border: 2px dashed var(--line); border-radius: 16px; padding: 12px; line-height: 1.35; }
.rules-list li:hover .rn { transform: rotate(-12deg) scale(1.1); }
.rn { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--yellow); border: 2.5px solid var(--ink); display: grid; place-items: center; font-weight: 800; transition: transform .2s; }

footer { text-align: center; color: var(--muted); font-size: 14px; margin-top: 40px; }
footer a { color: var(--muted); }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
.hidden { display: none !important; }
.sound-btn { position: fixed; right: 14px; bottom: 14px; z-index: 40; width: 48px; height: 48px; border-radius: 50%; border: 3px solid var(--ink); background: var(--card); box-shadow: 0 3px 0 var(--ink); cursor: pointer; font-size: 22px; }

/* ---------- animaciones internas de las tazas ---------- */
.mug-svg { display: block; width: 100%; height: auto; overflow: visible; }
.mug-svg .steam path { animation: steam 2.4s ease-in-out infinite; transform-origin: center bottom; }
.mug-svg .steam .s2 { animation-delay: .5s; }
.mug-svg .steam .s3 { animation-delay: 1s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-14px); } }
.mug-svg .zzz { animation: zzz 2s ease-in-out infinite; }
.mug-svg .z2 { animation-delay: .6s; }
@keyframes zzz { 0% { opacity: 0; transform: translate(0,0); } 50% { opacity: 1; } 100% { opacity: 0; transform: translate(8px,-12px); } }
.mug-svg .beat { animation: beat .8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes beat { 50% { transform: scale(1.25); } }
.mug-svg .eye-roll { animation: roll 1.4s linear infinite; transform-box: view-box; }
.mug-svg .r2 { animation-direction: reverse; }
@keyframes roll { 0% { transform: translate(0,0); } 25% { transform: translate(3px,-3px); } 50% { transform: translate(0,-5px); } 75% { transform: translate(-3px,-2px); } 100% { transform: translate(0,0); } }
.mug-svg .wiggle { animation: wig 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes wig { 0%,100% { transform: rotate(0); } 25% { transform: rotate(6deg); } 75% { transform: rotate(-6deg); } }
.mug-svg .sweat { animation: sweat 1.8s ease-in infinite; }
@keyframes sweat { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(16px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  #floaters { display: none; }
}
