:root { --ink: #3b2a1a; --bg1: #fff3d6; --bg2: #ffd9ec; --pri: #ff8a3d; --pri2: #ff6b1a; --alt: #7c5cff; --ok: #30a46c; --card: #fff; --line: #f0d9b5; color-scheme: light; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { font-family: ui-rounded, 'Nunito', 'Baloo 2', 'Comic Neue', system-ui, sans-serif; color: var(--ink); background: linear-gradient(180deg, var(--bg1), var(--bg2)); min-height: 100dvh; font-size: 20px; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
h1 { font-size: 40px; margin: 6px 0 0; text-align: center; line-height: 1; }
h1 em { font-style: normal; color: var(--pri2); }
h2 { font-size: 30px; margin: 0; text-align: center; }
.lead { text-align: center; font-size: 22px; margin: 6px 0; }
.small { text-align: center; font-size: 15px; opacity: .75; margin: 4px 0; }
.err { color: #c53030; text-align: center; font-weight: 700; }
.screen { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 16px 16px calc(18px + env(safe-area-inset-bottom)); }

.big { display: block; width: 100%; min-height: 68px; padding: 14px 20px; border-radius: 28px; background: var(--pri); color: #fff; font-size: 24px; font-weight: 800; box-shadow: 0 6px 0 var(--pri2); transition: transform .08s, box-shadow .08s; }
.big:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--pri2); }
.big.alt { background: var(--alt); box-shadow: 0 6px 0 #5a3fd6; }
.big.go { background: var(--ok); box-shadow: 0 6px 0 #1f7a4d; font-size: 28px; min-height: 78px; }
.big.ghost { background: #fff; color: var(--ink); box-shadow: 0 6px 0 var(--line); }
.big:disabled { opacity: .45; }
.pulse { animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.link { background: none; text-decoration: underline; font-size: 17px; opacity: .7; padding: 8px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }

.owlbox { display: grid; place-items: center; }
.owl { animation: bob 3s ease-in-out infinite; }
.owl .eyes { animation: blink 4.5s infinite; transform-origin: 60px 57px; }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-1.5deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
.bubble { position: relative; background: #fff; border: 3px solid var(--line); border-radius: 26px; padding: 14px 18px; font-size: 24px; font-weight: 700; text-align: center; line-height: 1.25; }
.bubble.oops { border-color: #f5a3a3; background: #fff5f5; } .bubble.win { border-color: #9be2b6; background: #f1fff6; }
.bigthing { font-size: 72px; text-align: center; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 0; }
.ic { width: 52px; height: 52px; border-radius: 50%; background: #fff; font-size: 26px; box-shadow: 0 3px 0 var(--line); }
.stars { font-size: 28px; letter-spacing: 4px; } .stars span { filter: grayscale(1); opacity: .35; } .stars span.on { filter: none; opacity: 1; animation: pop .5s; }
@keyframes pop { 40% { transform: scale(1.5); } }

.home { justify-content: center; }
.join { display: flex; gap: 10px; align-items: stretch; } .join input { flex: 1; min-width: 0; border: 3px solid var(--line); border-radius: 22px; font: inherit; font-size: 28px; text-align: center; letter-spacing: 6px; text-transform: uppercase; padding: 10px; background: #fff; -webkit-user-select: text; user-select: text; }
.join .big { width: auto; flex: 1.2; }

.codebox { text-align: center; background: #fff; border-radius: 22px; padding: 10px; border: 3px dashed var(--alt); } .codebox b { font-size: 36px; letter-spacing: 8px; color: var(--alt); } .codebox small { display: block; font-size: 14px; opacity: .7; }
.dev { background: #fff; border-radius: 22px; padding: 10px 14px; border: 3px solid var(--line); } .dev.me { border-color: var(--pri); } .dev.off { opacity: .5; } .dev b { font-size: 17px; }
.seats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.seat { position: relative; display: inline-flex; align-items: center; gap: 6px; background: #fff8e8; border: 2px solid var(--line); border-radius: 20px; padding: 4px 12px 4px 8px; } .seat .av { font-size: 34px; } .seat .meta { font-size: 18px; } .seat.helper { background: #eef4ff; } .seat.farceur { background: #f3ecff; }
.seat .x { width: 28px; height: 28px; border-radius: 50%; background: #ffe0e0; font-size: 14px; margin-left: 2px; }
.lbl { font-size: 18px; font-weight: 800; margin: 8px 0 4px; }
.addform { background: #fff; border-radius: 26px; padding: 14px; border: 3px solid var(--alt); display: grid; gap: 4px; }
.avgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; } .avgrid button { font-size: 32px; background: #fff8e8; border-radius: 16px; padding: 6px 0; border: 3px solid transparent; } .avgrid button.on { border-color: var(--pri); background: #ffe9d6; }
.opts { display: flex; gap: 8px; } .opts button { flex: 1; display: grid; gap: 2px; justify-items: center; background: #fff8e8; border-radius: 18px; padding: 8px 4px; font-size: 15px; font-weight: 700; border: 3px solid transparent; } .opts button span { font-size: 30px; } .opts button.on { border-color: var(--pri); background: #ffe9d6; }
.themes .opts button { font-size: 14px; }

.play { gap: 10px; } .main { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.turn { display: grid; gap: 10px; justify-items: center; } .avatar { font-size: 96px; line-height: 1; animation: bob 2s ease-in-out infinite; } .avatar.sm { font-size: 40px; animation: none; vertical-align: middle; margin-right: 8px; }
.gtitle { text-align: center; font-size: 26px; font-weight: 800; }
.gamebox { flex: 1; display: grid; align-content: center; }
.foot { display: grid; gap: 8px; }
.cluecard { background: #fff; border: 4px solid var(--pri); border-radius: 28px; padding: 18px; text-align: center; display: grid; gap: 8px; justify-items: center; } .cluecard p { margin: 0; font-size: 26px; font-weight: 800; } .cluecard .big { all: unset; font-size: 80px; }
.clues { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; } .clue { background: #fff; border-radius: 16px; padding: 4px 10px; border: 3px solid var(--line); } .clue.hot { border-color: #e5484d; animation: pop .6s 2; }
.clueic { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; font-size: 38px; } .clueic .dot { width: 38px; height: 38px; } .clueic .no { position: absolute; font-size: 50px; color: #e5484d; line-height: 1; }
.dot { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 3px solid rgba(0,0,0,.18); }

.suspects { display: flex; gap: 8px; justify-content: center; } .sus { position: relative; flex: 1; max-width: 130px; background: #fff; border-radius: 22px; padding: 8px 4px; display: grid; justify-items: center; gap: 2px; border: 4px solid var(--line); transition: transform .1s; }
.sus .face { font-size: 46px; line-height: 1.1; } .sus .tags { display: flex; gap: 6px; align-items: center; } .sus .it { font-size: 24px; } .sus .nm { font-size: 14px; font-weight: 800; text-align: center; line-height: 1.1; }
.sus.out { opacity: .38; filter: grayscale(.8); } .sus .no { position: absolute; top: 2px; right: 8px; font-size: 40px; color: #e5484d; }
.suspects.pick .sus { padding: 12px 4px; } .suspects.pick .face { font-size: 62px; } .sus.sel { border-color: var(--ok); transform: scale(1.08); background: #f1fff6; } .sus.wrong { border-color: #f5a3a3; }
.suspects.pick { flex-wrap: wrap; }

.tell, .tip { border-radius: 18px; padding: 10px 14px; font-size: 16px; font-weight: 700; } .tell { background: #f3ecff; border: 3px solid var(--alt); } .tip { background: #eef6ff; border: 3px solid #9cc5f5; }
.culprit { display: grid; justify-items: center; gap: 4px; } .culprit .face { font-size: 80px; } .culprit b { font-size: 26px; }
.sticker { text-align: center; font-size: 30px; font-weight: 800; background: #fff6bf; border-radius: 22px; padding: 10px; transform: rotate(-3deg); border: 3px solid #f5c518; }
.confetti { font-size: 40px; text-align: center; animation: fall 1.6s ease-out; letter-spacing: 6px; } @keyframes fall { from { transform: translateY(-40px); opacity: 0; } }

.g-pairs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; } .g-pairs.c8 { grid-template-columns: repeat(4, 1fr); }
.pc { position: relative; aspect-ratio: 1; border-radius: 22px; background: #fff; border: 4px solid var(--line); font-size: 54px; perspective: 400px; } .pc .back, .pc .front { position: absolute; inset: 0; display: grid; place-items: center; transition: opacity .15s, transform .25s; } .pc .front { opacity: 0; transform: scale(.4); } .pc .back { background: #e9e0ff; border-radius: 18px; color: var(--alt); }
.pc.up .front, .pc.ok .front { opacity: 1; transform: none; } .pc.up .back, .pc.ok .back { opacity: 0; } .pc.ok { border-color: var(--ok); background: #f1fff6; }
.g-bubbles { position: relative; height: 56vh; min-height: 320px; border-radius: 28px; background: linear-gradient(#dff4ff, #bfe6ff); overflow: hidden; }
.bub { position: absolute; bottom: -90px; left: var(--x); width: 86px; height: 86px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #fff 0 14%, hsla(var(--h), 85%, 75%, .75) 40%, hsla(var(--h), 85%, 60%, .6)); border: 3px solid rgba(255,255,255,.8); animation: rise var(--d) linear infinite; }
@keyframes rise { to { transform: translateY(-70vh); } } .bub.pop { animation: burst .3s forwards; pointer-events: none; } @keyframes burst { to { transform: scale(1.7); opacity: 0; } }
.g-odd { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; } .g-odd.n6 { grid-template-columns: repeat(3, 1fr); }
.oc { aspect-ratio: 1; border-radius: 24px; background: #fff; border: 4px solid var(--line); font-size: 62px; } .oc.good { border-color: var(--ok); background: #f1fff6; transform: scale(1.1); } .oc.shake { animation: shake .35s; } @keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.g-dots { display: flex; gap: 8px; justify-content: center; margin-top: 12px; } .g-dots i { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--line); } .g-dots i.on { background: var(--ok); border-color: var(--ok); }

.sheetwrap { position: fixed; inset: 0; background: rgba(60, 40, 20, .45); display: grid; align-items: end; z-index: 20; }
.sheet { background: #fffaf0; border-radius: 28px 28px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 10px; max-width: 560px; width: 100%; margin: 0 auto; } .sheet h3 { margin: 0; font-size: 24px; } .sheet p { margin: 0; font-size: 17px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: #3b2a1a; color: #fff; border-radius: 20px; padding: 10px 18px; font-size: 17px; opacity: 0; transition: .25s; pointer-events: none; z-index: 30; max-width: 90vw; } #toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }
