:root { --font: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; --mint: #3fd6a6; --pink: #ff8caa; --ink: #6a2a4a; --panel-img: none; --btn-img: none; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #ffe6ec; font-family: var(--font); color: var(--ink); touch-action: none; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 20; }
#modal { background: rgba(106, 42, 74, 0.18); }
.cover { position: absolute; inset: 0; background: #ffd9e2 url(../assets/cover-bg.webp) center / cover no-repeat; }
.cover.dim::after { content: ""; position: absolute; inset: 0; background: rgba(255, 228, 236, 0.45); backdrop-filter: blur(3px); }
.out { color: #fff; text-shadow: -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink), 0 3px 0 var(--ink), 0 5px 0 rgba(106, 42, 74, 0.5); font-weight: 900; }

/* title */
#logo { position: absolute; top: 7%; left: 50%; width: 82%; max-height: 32%; object-fit: contain; transform: translateX(-50%); animation: logoIn 0.65s cubic-bezier(.3, 1.6, .5, 1) both, float 3.2s 0.7s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(106, 42, 74, 0.25)); }
@keyframes logoIn { from { transform: translate(-50%, -60%) scale(0.5); opacity: 0; } to { transform: translate(-50%, 0) scale(1); opacity: 1; } }
@keyframes float { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }
#startPrompt { position: absolute; bottom: 9%; left: 10%; right: 10%; text-align: center; font-size: 24px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.07); opacity: 0.8; } }
.round-btn { position: absolute; top: max(10px, env(safe-area-inset-top)); right: max(10px, env(safe-area-inset-right)); width: 48px; height: 48px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.8); background: rgba(255, 140, 170, 0.45); font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0; }
.round-btn:active { transform: scale(0.9); }

/* intro */
#intro { background: #ffd9e2 url(../assets/cover-bg.webp) center / cover no-repeat; z-index: 40; }
#introVid { width: 100%; height: 100%; object-fit: cover; }
#skipBtn { position: absolute; top: 12px; right: 12px; }

/* panels and buttons */
.panel { position: relative; z-index: 2; width: min(92%, 380px); max-height: 92%; overflow-y: auto; scrollbar-width: none; border-style: solid; border-width: 26px; border-color: transparent; border-image: var(--panel-img) 22% fill / 26px stretch; background-clip: padding-box; padding: 2px 4px; animation: pop 0.28s cubic-bezier(.3, 1.6, .5, 1) both; }
.panel::-webkit-scrollbar { display: none; }
@keyframes pop { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ptitle { font-size: 26px; text-align: center; margin: 0 0 10px; }
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 6px 26px; border-style: solid; border-width: 14px 24px; border-color: transparent; border-image: var(--btn-img) 46% 22% fill / 14px 24px stretch; background: none; font: 900 19px var(--font); color: #fff; cursor: pointer; text-shadow: -1.5px -1.5px 0 #a3304e, 1.5px -1.5px 0 #a3304e, -1.5px 1.5px 0 #a3304e, 1.5px 1.5px 0 #a3304e, 0 3px 0 #a3304e; transition: transform 0.12s, filter 0.12s; width: 100%; margin: 8px 0; line-height: 1.1; }
.btn.small { width: auto; min-height: 44px; font-size: 16px; padding: 4px 14px; margin: 0; }
.btn.alt { filter: hue-rotate(120deg) saturate(0.9); }
.btn:active { transform: scale(0.93); }
.btn.focus, .card.focus { filter: brightness(1.12); transform: scale(1.04); }
.btn.alt.focus { filter: hue-rotate(120deg) brightness(1.12); }
.btn:disabled { filter: grayscale(0.8) opacity(0.6); }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.card { display: flex; align-items: center; gap: 12px; width: 100%; margin: 8px 0; padding: 10px; border-radius: 20px; border: 3px solid #ffd0dc; background: rgba(255, 255, 255, 0.85); cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: transform 0.12s, filter 0.12s; }
.card.focus { border-color: var(--mint); box-shadow: 0 0 0 3px rgba(63, 214, 166, 0.35); }
.card img { width: 64px; height: 64px; object-fit: contain; flex: none; }
.card b { display: block; font-size: 19px; font-weight: 900; }
.card small { display: block; font-size: 14px; opacity: 0.85; margin-top: 2px; }
.info { font-size: 15px; line-height: 1.45; margin: 6px 0; }
.info b { color: #d4487a; }
.lbl { display: inline-block; background: var(--mint); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 13px; font-weight: 900; margin-right: 6px; }
.items { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.item { width: 76px; min-height: 84px; border-radius: 16px; border: 3px solid #ffd0dc; background: rgba(255, 255, 255, 0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; font: 900 13px var(--font); color: var(--ink); cursor: pointer; padding: 4px; }
.item img { width: 44px; height: 44px; object-fit: contain; }
.item.on { border-color: var(--mint); background: #e2fff4; }
.item.none { opacity: 0.45; }
.item.focus { box-shadow: 0 0 0 3px rgba(63, 214, 166, 0.5); }
.quizopt.right { filter: hue-rotate(150deg) brightness(1.1) !important; }
.quizopt.wrongpick { filter: grayscale(1) !important; }
.big { font-size: 40px; text-align: center; margin: 4px 0; }
.scoreline { text-align: center; font-size: 20px; font-weight: 900; }
.howtext { white-space: pre-line; font-size: 15px; line-height: 1.5; }
.step { display: flex; gap: 10px; align-items: flex-start; margin: 9px 0; font-size: 15px; line-height: 1.4; }
.step i { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--mint); color: #fff; font-style: normal; font-weight: 900; font-size: 16px; display: flex; align-items: center; justify-content: center; border: 2px solid #fff; box-shadow: 0 2px 0 rgba(106, 42, 74, 0.25); }
.diffrow { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 8px 0 2px; }
.diffrow .btn { width: auto; flex: 1; margin: 0; font-size: 17px; min-height: 50px; }
.diffrow .btn.off { filter: grayscale(0.85) opacity(0.6); }

/* hud */
#hud { position: fixed; left: 0; top: 0; z-index: 10; pointer-events: none; padding: max(8px, env(safe-area-inset-top)) 0 0 max(8px, env(safe-area-inset-left)); }
.hud-panel { width: 230px; background: rgba(255, 250, 244, 0.82); border: 3px solid #fff; border-radius: 18px; padding: 6px 10px; box-shadow: 0 3px 0 rgba(106, 42, 74, 0.25); }
.hud-row { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.chip { background: var(--mint); color: #fff; border-radius: 10px; padding: 1px 8px; font-size: 14px; font-weight: 900; white-space: nowrap; }
.chip.p2 { background: #a98bff; } .chip.p3 { background: #ff8caa; }
.htext { font-size: 14px; font-weight: 900; white-space: nowrap; }
.ico { width: 18px; text-align: center; font-size: 15px; color: #e8507a; }
.bar { flex: 1; height: 12px; border-radius: 6px; background: rgba(106, 42, 74, 0.18); overflow: hidden; }
.bar i { display: block; height: 100%; width: 50%; background: linear-gradient(#7ff0c4, #2fc493); border-radius: 6px; transition: width 0.2s; }
.bar.bad i { background: linear-gradient(#ffb07a, #ff5f7e); }
.num { width: 34px; text-align: right; font-size: 16px; font-weight: 900; }
.atp { margin-left: auto; display: flex; align-items: center; gap: 3px; font-size: 16px; }
.atp img { width: 20px; height: 20px; }
.hud-player { margin-top: 6px; display: inline-flex; gap: 8px; align-items: center; background: rgba(63, 214, 166, 0.88); color: #fff; border: 3px solid #fff; border-radius: 16px; padding: 3px 10px; font-size: 14px; }
.hud-player b { font-size: 16px; }
.obj { margin-top: 6px; display: flex; align-items: center; gap: 6px; width: fit-content; max-width: calc(100vw - 24px); background: rgba(255, 224, 120, 0.95); border: 3px solid #fff; border-radius: 16px; padding: 4px 10px; font-size: 15px; font-weight: 900; line-height: 1.3; box-shadow: 0 3px 0 rgba(106, 42, 74, 0.25); }
.obj.new { animation: pop 0.3s cubic-bezier(.3, 1.6, .5, 1) both; }
.objlbl { flex: none; background: #ff8caa; color: #fff; border-radius: 9px; padding: 0 7px; font-size: 13px; }
#toasts { position: fixed; left: 50%; top: 214px; transform: translateX(-50%); z-index: 12; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: 92%; }
.toast { background: rgba(106, 42, 74, 0.82); color: #fff; font-size: 15px; font-weight: 900; padding: 6px 14px; border-radius: 16px; text-align: center; animation: pop 0.22s cubic-bezier(.3, 1.6, .5, 1) both; }
#fact { position: fixed; left: 50%; top: 290px; transform: translateX(-50%); width: min(90%, 360px); z-index: 11; background: rgba(255, 252, 240, 0.95); border: 3px solid #ffd166; border-radius: 18px; padding: 8px 12px; font-size: 14px; line-height: 1.4; pointer-events: none; box-shadow: 0 3px 0 rgba(106, 42, 74, 0.2); }
.tag { display: inline-block; background: #ffb300; color: #fff; font-weight: 900; border-radius: 8px; padding: 0 7px; margin-right: 6px; font-size: 13px; }
#banner { position: fixed; left: 0; right: 0; top: 38%; z-index: 15; text-align: center; font-size: 44px; pointer-events: none; animation: slam 0.4s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes slam { from { transform: scale(2.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#subtitle { position: fixed; left: 50%; bottom: 40%; transform: translateX(-50%); width: min(88%, 360px); z-index: 45; text-align: center; background: rgba(106, 42, 74, 0.75); color: #fff; font-size: 16px; font-weight: 900; padding: 8px 12px; border-radius: 14px; pointer-events: none; }
