/* Boba Pals pages: one stylesheet for the pupil page and the teacher page. Bright, big buttons, readable on a small phone and on a projector. */
:root { --ink: #2a2350; --card: #ffffffee; --pop: #ff6fb1; --sun: #ffc233; --sky: #46b5ff; --good: #2fbf71; --bad: #f2555a; --glass: #ffffffcc; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif; color: var(--ink); }
body { background: #7fd1ff url("/live/art/bg_lobby.webp") center / cover fixed; }
body.dark { background: #1d2250 url("/live/art/bg_game.webp") center / cover fixed; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.15; }
button { font: inherit; cursor: pointer; border: 0; border-radius: 16px; padding: .7em 1.1em; font-weight: 800; color: #fff; background: var(--pop); box-shadow: 0 4px 0 #0003; transition: transform .08s; }
button:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #0003; }
button:disabled { opacity: .45; cursor: default; }
button.alt { background: var(--sky); } button.go { background: var(--good); } button.quiet { background: #ffffffd0; color: var(--ink); } button.bad { background: var(--bad); }
button.big { font-size: 1.4rem; padding: .8em 1.6em; }
input[type=text], input[type=number] { font: inherit; font-size: 1.3rem; padding: .55em .7em; border-radius: 14px; border: 3px solid #fff; background: #fff; color: var(--ink); width: 100%; text-align: center; }
.wrap { max-width: 560px; margin: 0 auto; padding: 14px; }
.wide { max-width: 1100px; }
.card input[type=text] { border-color: #d3cbf3; }
.card { background: var(--card); border-radius: 22px; padding: 16px; box-shadow: 0 8px 22px #0002; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.spread { justify-content: space-between; }
.logo { display: block; margin: 8px auto 12px; max-width: 78%; max-height: 190px; filter: drop-shadow(0 6px 8px #0003); }
.muted { opacity: .75; font-size: .9em; }
.hide { display: none !important; }
.banner { position: sticky; top: 0; z-index: 70; text-align: center; padding: 10px 14px; font-weight: 800; } .banner.warn { background: #ffe08a; color: #3a2d00; } .banner.bad { background: #f2555a; color: #fff; } .banner.info { background: #46b5ff; color: #06223a; } .banner a { color: inherit; } .banner button { margin-left: 8px; padding: .25em .8em; background: #fff; color: #06223a; box-shadow: none; }
:focus-visible { outline: 4px solid #1d6bff; outline-offset: 2px; }
.notice { background: #2a2350d9; color: #fff; border-radius: 14px; padding: 8px 14px; font-size: .85rem; line-height: 1.4; margin: 12px auto; max-width: 520px; } .notice a { color: #ffd966; }
.err { color: var(--bad); font-weight: 800; min-height: 1.4em; }

/* pupil HUD */
.hud { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; align-items: center; justify-content: space-between; background: var(--glass); backdrop-filter: blur(6px); padding: 8px 10px; border-radius: 0 0 20px 20px; box-shadow: 0 4px 14px #0003; flex-wrap: wrap; }
.hud .st { display: flex; align-items: center; gap: 4px; font-weight: 900; font-size: 1.05rem; }
.hud img { width: 28px; height: 28px; object-fit: contain; }
.hud .time { font-size: 1.25rem; min-width: 3.4em; text-align: center; background: var(--ink); color: #fff; border-radius: 12px; padding: 2px 8px; }
.hud .time.low { background: var(--bad); animation: pulse .8s infinite; }
.goalbar { display: flex; align-items: center; gap: 8px; width: 100%; background: #fff; color: var(--ink); box-shadow: none; padding: 3px 10px; border-radius: 12px; font-size: .85rem; } .goalbar img { width: 26px; height: 26px; object-fit: contain; } .goaltrack { flex: 1; height: 10px; background: #0002; border-radius: 6px; overflow: hidden; } .goaltrack i { display: block; height: 100%; background: var(--good); width: 0; transition: width .4s; } .goalbar.ready { animation: pulse .9s infinite; }
.hud .st.bad { color: var(--bad); }
.shieldbar { height: 5px; background: #0002; border-radius: 4px; overflow: hidden; width: 100%; } .shieldbar i { display: block; height: 100%; background: var(--sky); }

/* chest choice */
.chests { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.chestbtn { background: var(--card); color: var(--ink); border-radius: 20px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.chestbtn img { width: 92%; max-width: 130px; animation: bob 2.4s ease-in-out infinite; }
.chestbtn:nth-child(2) img { animation-delay: .4s; } .chestbtn:nth-child(3) img { animation-delay: .8s; }
.chestbtn b { font-size: 1.05rem; } .chestbtn small { font-weight: 700; opacity: .8; }
.chestbtn:disabled img { filter: grayscale(1); animation: none; }

/* question */
.qcard { background: #fff; border-radius: 22px; padding: 16px; box-shadow: 0 8px 22px #0003; font-size: 1.25rem; }
.qcard .qb-q { font-size: 1.15rem; }
.qcard .qb-fig { max-width: 100%; } .qcard .qb-fig svg { max-height: 240px; width: auto; }
.qcard .qb-blank { min-width: 3.2em; background: #f1efff; border-color: #b9b0e8; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.choices button { font-size: 1.5rem; padding: .9em .4em; background: var(--sky); }
.choices button.right { background: var(--good); animation: pop .35s; } .choices button.wrong { background: var(--bad); animation: shake .4s; }
.typebox { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; } .typebox input { flex: 1 1 8em; min-width: 6em; }
.verdict { margin-top: 12px; font-size: 1.3rem; font-weight: 900; text-align: center; } .verdict.ok { color: var(--good); } .verdict.no { color: var(--bad); }
.tierchip { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: .85rem; color: #fff; }
.tierchip.t1 { background: #a8743b; } .tierchip.t2 { background: #d9a400; } .tierchip.t3 { background: #19a7d4; }

/* opening a chest */
.opener { text-align: center; padding: 10px; }
.chestbtn2 { background: none; border: 0; box-shadow: none; padding: 0; cursor: pointer; } .chestbtn2:disabled { cursor: default; }
.opener img.chest { width: min(70vw, 300px); cursor: pointer; user-select: none; touch-action: manipulation; }
.opener img.chest.hit { animation: shake .25s; }
.dots { display: flex; gap: 8px; justify-content: center; margin: 10px 0; } .dots i { width: 16px; height: 16px; border-radius: 50%; background: #fff7; border: 2px solid #fff; } .dots i.on { background: var(--sun); }
.coinburst { position: relative; height: 0; } .coinburst span { position: absolute; left: 50%; font-size: 1.7rem; font-weight: 900; color: #fff; text-shadow: 0 2px 0 #000a; animation: rise 1.1s ease-out forwards; }
.gain { font-size: 2.6rem; font-weight: 900; color: var(--sun); text-shadow: 0 3px 0 #000a; animation: pop .5s; }

/* tabs and sheets */
.nav { position: fixed; bottom: 0; left: 0; right: 0; max-width: 560px; margin: 0 auto; z-index: 8; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 10px 12px; background: var(--glass); backdrop-filter: blur(6px); border-radius: 20px 20px 0 0; box-shadow: 0 -4px 14px #0003; margin-top: 12px; }
.nav button { background: #fff; color: var(--ink); padding: .5em .2em; font-size: .95rem; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nav button img { width: 30px; height: 30px; object-fit: contain; }
.badge { position: absolute; top: -6px; right: -4px; background: var(--bad); color: #fff; border-radius: 999px; font-size: .75rem; padding: 1px 7px; }
.sheet { position: fixed; inset: 0; z-index: 20; background: #0008; display: flex; align-items: flex-end; justify-content: center; }
.sheet > .inner { background: #fff; width: min(640px, 100%); max-height: 88vh; overflow: auto; border-radius: 24px 24px 0 0; padding: 16px; animation: slide .25s; }
.sheet h2 .x { float: right; background: #eee; color: var(--ink); padding: .1em .6em; border-radius: 12px; box-shadow: none; }
.eggs { display: grid; gap: 10px; } .egg { display: grid; grid-template-columns: 70px 1fr auto; gap: 10px; align-items: center; background: #f6f3ff; border-radius: 18px; padding: 8px 10px; }
.egg img { width: 66px; height: 66px; object-fit: contain; animation: bob 2.6s ease-in-out infinite; } .egg .name { font-weight: 900; } .egg .odds { font-size: .8rem; opacity: .75; }
.petgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; } .pet { position: relative; background: #f6f3ff; border-radius: 16px; padding: 6px 4px; text-align: center; font-size: .72rem; font-weight: 800; border: 3px solid transparent; }
.pet img { width: 100%; aspect-ratio: 1; object-fit: contain; } .pet.locked img { filter: brightness(0) opacity(.25); } .pet .n { position: absolute; top: 2px; right: 6px; background: var(--ink); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .75rem; } .pet.star { box-shadow: 0 0 0 3px var(--sun) inset; }
.targets { display: grid; gap: 8px; } .target { display: flex; justify-content: space-between; align-items: center; background: #f6f3ff; border-radius: 16px; padding: 10px 14px; font-weight: 800; } .target.safe { opacity: .55; }
.wildbtn { display: flex; align-items: center; gap: 10px; width: 100%; background: var(--good); margin-bottom: 10px; text-align: left; } .wildbtn img { width: 52px; }
.board { display: grid; gap: 6px; } .brow { display: grid; grid-template-columns: 2.2em 40px 1fr auto; gap: 8px; align-items: center; background: #f6f3ff; border-radius: 14px; padding: 6px 10px; font-weight: 800; } .brow.me { background: #fff2c2; outline: 3px solid var(--sun); } .brow img { width: 38px; height: 38px; object-fit: contain; }
.brow .dot { width: 9px; height: 9px; border-radius: 50%; background: #bbb; display: inline-block; margin-right: 6px; } .brow .dot.on { background: var(--good); }

/* hatch / fight overlays */
#s-game { padding-bottom: 104px; }
.overlay { position: fixed; inset: 0; z-index: 40; background: #000e; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #fff; text-align: center; padding: 20px; }
.overlay .hatch { width: min(60vw, 280px); }
.overlay .hatch.wobble { animation: wobble .5s infinite; }
.overlay .hatch.reveal { animation: reveal .7s; }
.overlay .rar { font-size: 1.6rem; font-weight: 900; margin-top: 8px; text-shadow: 0 3px 0 #000a; }
.flash { position: fixed; inset: 0; background: #fff; z-index: 41; animation: flash .6s forwards; pointer-events: none; }
.versus { display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 1.4rem; font-weight: 900; } .versus img { width: 110px; height: 110px; object-fit: contain; animation: bob 1.4s infinite; } .versus .num { font-size: 2.2rem; }
.resulttext { font-size: 2.2rem; font-weight: 900; margin: 14px 0; } .resulttext.win { color: #6dffa8; } .resulttext.lose { color: #ff9a9a; }
.toast { position: fixed; left: 50%; top: 70px; transform: translateX(-50%); background: var(--ink); color: #fff; border-radius: 16px; padding: 10px 16px; font-weight: 800; z-index: 60; box-shadow: 0 6px 18px #0006; animation: slide .3s; max-width: 92vw; text-align: center; }
.confetti { position: fixed; top: -20px; width: 10px; height: 16px; z-index: 45; animation: fall 3.2s linear forwards; }

/* teacher */
.code { font-size: clamp(3rem, 14vw, 8rem); font-weight: 900; letter-spacing: .12em; color: #fff; text-shadow: 0 6px 0 #0004; background: var(--ink); border-radius: 24px; padding: .1em .4em; display: inline-block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; } .chip { background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; display: inline-flex; align-items: center; gap: 6px; animation: pop .3s; } .chip.off { opacity: .45; } .chip button { padding: 0 .45em; border-radius: 50%; box-shadow: none; background: #eee; color: var(--ink); }
.units details { background: #fff; border-radius: 14px; margin: 6px 0; padding: 8px 12px; } .units summary { font-weight: 900; cursor: pointer; } .units label { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-weight: 700; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; } .opts label { display: block; font-weight: 800; margin-bottom: 4px; } .opts select { font: inherit; padding: .5em; border-radius: 12px; border: 3px solid #fff; width: 100%; }
.bigtime { font-size: clamp(2.5rem, 9vw, 5rem); font-weight: 900; background: var(--ink); color: #fff; border-radius: 22px; padding: .1em .5em; display: inline-block; }
table.res { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; } table.res th, table.res td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #0001; } table.res th { background: var(--ink); color: #fff; }
.hardbar { display: grid; grid-template-columns: 1fr 70px; gap: 8px; align-items: center; margin: 4px 0; } .hardbar i { display: block; height: 14px; border-radius: 8px; background: var(--bad); }
.podium { position: relative; max-width: 620px; margin: 0 auto; } .pdpet { animation: bob 2.6s ease-in-out infinite; } .podium img { width: 100%; display: block; } .podium .nm { position: absolute; font-weight: 900; text-align: center; background: #fffe; border-radius: 12px; padding: 2px 8px; font-size: clamp(.8rem, 2.6vw, 1.1rem); transform: translateX(-50%); white-space: nowrap; }

@keyframes bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
@keyframes pop { 0% { transform: scale(.5); opacity: 0 } 70% { transform: scale(1.15) } 100% { transform: scale(1); opacity: 1 } }
@keyframes shake { 0%, 100% { transform: translateX(0) } 25% { transform: translateX(-8px) rotate(-3deg) } 75% { transform: translateX(8px) rotate(3deg) } }
@keyframes wobble { 0%, 100% { transform: rotate(-8deg) } 50% { transform: rotate(8deg) } }
@keyframes reveal { 0% { transform: scale(.2) rotate(-30deg); opacity: 0 } 70% { transform: scale(1.2) rotate(6deg) } 100% { transform: scale(1) rotate(0); opacity: 1 } }
@keyframes flash { 0% { opacity: 0 } 25% { opacity: 1 } 100% { opacity: 0 } }
@keyframes rise { 0% { transform: translate(-50%, 0) scale(.6); opacity: 1 } 100% { transform: translate(-50%, -120px) scale(1.2); opacity: 0 } }
@keyframes slide { from { transform: translate(var(--tx, 0), 30px); opacity: 0 } to { transform: translate(var(--tx, 0), 0); opacity: 1 } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg) } }
@keyframes pulse { 50% { transform: scale(1.08) } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
