@font-face { font-family: "Baloo"; src: url(font/baloo-2-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Baloo"; src: url(font/baloo-2-latin-500-normal.woff2) format("woff2"); font-weight: 400 600; font-display: swap; }
:root {
  --plum: #5a2350; --plum2: #7d3a6e; --pink: #f2679a; --pink2: #ffd3e3; --cream: #fff8f1; --gold: #f2b53a;
  --cF: #47b98f; --cL: #f2679a; --cA: #f28b55; --cM: #9a74de; --cE: #4f9fe2; --cS: #e0a91f;
  --font: "Baloo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f6c9dc; color: var(--plum); font-family: var(--font); }
body { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input { -webkit-user-select: text; user-select: text; }
button { font-family: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
#bg { position: fixed; inset: 0; background: url(img/bg_tall.webp) center bottom / cover no-repeat; }
@media (min-aspect-ratio: 1/1) { #bg { background-image: url(img/bg_wide.webp); } }
#bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(255,240,248,.18), rgba(255,240,248,.05)); }

#app { position: relative; height: 100%; display: flex; flex-direction: column; max-width: 1180px; margin: 0 auto; }
header { display: flex; align-items: center; gap: 8px; padding: 8px 12px 4px; }
.sp { flex: 1; }
.logo { display: flex; background: rgba(255,255,255,.8); border: 2px solid var(--plum); border-radius: 16px; padding: 2px 4px 0 10px; align-items: baseline; font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: .5px; filter: drop-shadow(0 2px 0 rgba(90,35,80,.25)); }
.logo b { -webkit-text-stroke: 1.2px var(--plum); paint-order: stroke fill; padding: 0 1px; }
.logo span { margin-left: 4px; font-size: 15px; color: var(--plum); padding: 0 6px 0 0; }
.cF { color: var(--cF) !important } .cL { color: var(--cL) !important } .cA { color: var(--cA) !important }
.cM { color: var(--cM) !important } .cE { color: var(--cE) !important } .cS { color: var(--cS) !important }
.stars { display: flex; align-items: center; gap: 4px; background: rgba(255,255,255,.85); border: 2px solid var(--plum); border-radius: 20px; padding: 2px 10px 2px 6px; font-weight: 800; font-size: 18px; }
.stars svg { width: 20px; height: 20px; fill: var(--gold); stroke: var(--plum); stroke-width: 1.4; }
.stars.bump { animation: bump .45s; }
.ib { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.85); border: 2px solid var(--plum); display: grid; place-items: center; }
.ib svg { width: 22px; height: 22px; }
.ib:active { transform: scale(.92); }

main#play { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 4px 12px 12px; gap: 8px; }
.say { display: flex; align-items: center; gap: 8px; }
.say .mini { width: 58px; height: 58px; object-fit: contain; flex: none; filter: drop-shadow(0 3px 2px rgba(90,35,80,.25)); }
.say p { flex: 1; margin: 0; background: #fff; border: 2.5px solid var(--plum); border-radius: 18px; padding: 6px 14px; font-size: 17px; font-weight: 600; line-height: 1.25; position: relative; box-shadow: 0 3px 0 rgba(90,35,80,.25); min-height: 44px; }
.say p::before { content: ""; position: absolute; left: -10px; top: 50%; margin-top: -7px; border: 7px solid transparent; border-right: 10px solid var(--plum); border-left: 0; }
.say p.pulse { animation: bump .4s; }
.cols { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.board { background: rgba(255,250,246,.94); border: 3px solid var(--plum); border-radius: 22px; padding: 10px 10px 8px; box-shadow: 0 5px 0 rgba(90,35,80,.25); position: relative;
  background-image: radial-gradient(circle at 12px 12px, rgba(242,103,154,.12) 2px, transparent 2.5px); background-size: 22px 22px; }
.nrow { display: flex; align-items: flex-start; gap: 8px; }
.tag { flex: none; font-weight: 800; font-size: 13px; padding: 2px 8px; border-radius: 10px; color: #fff; margin-top: 8px; max-width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t1 { background: var(--pink); } .t2 { background: var(--cM); }
.tiles { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; min-height: 44px; }
.tile { --s: 40px; width: var(--s); height: calc(var(--s) * 1.12); border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: calc(var(--s) * .62);
  border: 2.5px solid var(--plum); position: relative; transition: transform .2s, opacity .3s, background .3s; box-shadow: 0 3px 0 rgba(90,35,80,.3); }
.tiles.a .tile { background: #ffe1ec; } .tiles.b .tile { background: #ebe1ff; }
.tile.gap { width: 12px; border: 0; box-shadow: none; background: none !important; }
.tile::after { content: ""; position: absolute; left: -4px; right: -4px; top: 50%; height: 5px; margin-top: -2px; background: #e8335f; border-radius: 3px; transform: scaleX(0) rotate(-14deg); transform-origin: left center; transition: transform .28s ease-out; }
.tile.hl { transform: translateY(-5px) scale(1.08); background: #fff3a8 !important; }
.tile.struck::after { transform: scaleX(1) rotate(-14deg); }
.tile.struck { opacity: .55; transform: scale(.92); background: #eee !important; }
.tile.left { background: #fff !important; }
.tile.left.cnt { animation: bump .3s; background: #c9f2df !important; }
.tile.cnt i { position: absolute; top: -12px; right: -8px; font-style: normal; font-size: 12px; background: var(--plum); color: #fff; border-radius: 9px; padding: 0 5px; line-height: 18px; }
.tile.tap { cursor: pointer; }
.tile.tap:not(.struck):hover { transform: translateY(-2px); }
.tile.no { animation: shake .35s; background: #ffc4c4 !important; }
.plus { text-align: center; font-weight: 800; font-size: 18px; line-height: 1; color: var(--pink); margin: 2px 0; }
.count { margin: 8px auto 0; width: max-content; background: var(--plum); color: #fff; border-radius: 16px; padding: 1px 14px; font-weight: 800; font-size: 16px; opacity: .35; transition: opacity .3s; }
.count.on { opacity: 1; animation: bump .4s; }
.count span { color: #ffe27a; font-size: 20px; }

.ringBox { flex: 1; min-height: 0; display: grid; place-items: center; }
.ring { --R: 110px; --c: 74px; position: relative; width: calc(var(--R) * 2 + var(--c)); height: calc(var(--R) * 2 + var(--c)); }
.ring::before { content: ""; position: absolute; inset: calc(var(--c) / 2); border-radius: 50%; border: 4px dashed rgba(255,255,255,.9); }
.core { position: absolute; left: 50%; top: 50%; width: calc(var(--R) * .95); height: calc(var(--R) * .88); transform: translate(-50%, -48%); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff;
  background: radial-gradient(circle at 35% 30%, #ff9cc0, #f2508a);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 90 C20 68 0 50 0 28 C0 12 12 0 27 0 C38 0 46 6 50 14 C54 6 62 0 73 0 C88 0 100 12 100 28 C100 50 80 68 50 90Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 92'%3E%3Cpath d='M50 90 C20 68 0 50 0 28 C0 12 12 0 27 0 C38 0 46 6 50 14 C54 6 62 0 73 0 C88 0 100 12 100 28 C100 50 80 68 50 90Z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.core b { font-size: calc(var(--R) * .34); line-height: .9; margin-top: -8%; }
.core small { font-weight: 800; font-size: 13px; opacity: .9; }
.core.beat { animation: beat .35s; }
.charm { position: absolute; width: var(--c); height: var(--c); border-radius: 50%; border: 3px solid var(--plum); background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 rgba(90,35,80,.3); transition: transform .2s, opacity .4s, filter .4s; }
.charm b { font-size: calc(var(--c) * .46); line-height: .9; color: #fff; -webkit-text-stroke: 1.5px var(--plum); paint-order: stroke fill; }
.charm small { font-size: 10.5px; font-weight: 800; color: var(--plum); line-height: 1.1; }
.charm.on { transform: scale(1.22); box-shadow: 0 0 0 5px #fff, 0 0 0 9px var(--gold), 0 6px 0 rgba(90,35,80,.3); z-index: 2; }
.charm.start::before { content: "start"; position: absolute; top: -18px; font-size: 11px; font-weight: 800; background: var(--gold); color: var(--plum); padding: 0 6px; border-radius: 8px; border: 2px solid var(--plum); }
.charm.out { filter: grayscale(1); opacity: .35; transform: scale(.8); }
.charm.out::after { content: ""; position: absolute; width: 120%; height: 5px; background: #e8335f; border-radius: 3px; transform: rotate(-35deg); }
.charm.win { animation: winp 1s infinite alternate; z-index: 3; }
.charm.tap { cursor: pointer; }
.charm.tap:hover { transform: scale(1.1); }
.charm.no { animation: shake .35s; }
.charm i { position: absolute; bottom: -10px; right: -6px; font-style: normal; background: var(--plum); color: #fff; font-size: 13px; font-weight: 800; border-radius: 10px; padding: 0 6px; line-height: 20px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; min-height: 52px; }
.chip { min-width: 52px; height: 48px; border-radius: 16px; border: 2.5px solid var(--plum); background: #fff; font-weight: 800; font-size: 15px; padding: 0 10px; box-shadow: 0 3px 0 rgba(90,35,80,.3); display: flex; align-items: center; gap: 6px; }
.chip b { width: 26px; height: 26px; border-radius: 50%; color: #fff; display: grid; place-items: center; font-size: 15px; }
.chip:active, .soft:active, .big:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(90,35,80,.3); }
.chip.pick { background: #fff3a8; }
.big { background: linear-gradient(#ff8db6, #f2508a); color: #fff; font-weight: 800; font-size: 24px; padding: 8px 34px; border-radius: 22px; border: 3px solid var(--plum); box-shadow: 0 5px 0 var(--plum); text-shadow: 0 2px 0 rgba(90,35,80,.4); }
.big.sm { font-size: 20px; padding: 6px 24px; }
.soft { background: #fff; border: 2.5px solid var(--plum); border-radius: 16px; font-weight: 800; font-size: 16px; padding: 6px 14px; box-shadow: 0 3px 0 rgba(90,35,80,.3); }
.soft.gold { background: #ffe27a; }

/* overlays */
.ov { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 10px; background: rgba(90,35,80,.28); overflow-y: auto; }
.panel { position: relative; background: var(--cream); border: 3.5px solid var(--plum); border-radius: 28px; box-shadow: 0 8px 0 rgba(90,35,80,.35); width: min(520px, 100%); padding: 16px 18px; text-align: center; animation: pop .35s ease-out; }
.startP { padding-top: 70px; margin-top: 56px; background-image: radial-gradient(circle at 14px 14px, rgba(242,103,154,.1) 2.5px, transparent 3px); background-size: 26px 26px; }
.mithuS { position: absolute; top: -66px; left: 50%; width: 130px; transform: translateX(-50%); filter: drop-shadow(0 4px 3px rgba(90,35,80,.3)); animation: bob 2.4s ease-in-out infinite; }
h1 { margin: 0; line-height: 1; }
.h1a { display: block; font-size: 40px; color: var(--pink); -webkit-text-stroke: 1.5px var(--plum); paint-order: stroke fill; text-shadow: 0 3px 0 var(--plum); }
.h1b { display: inline-block; margin-top: 6px; font-size: 18px; background: var(--plum); color: #fff; padding: 0 12px; border-radius: 12px; }
.intro { font-size: 15px; line-height: 1.35; margin: 10px 0 10px; font-weight: 500; }
.inputs { display: flex; align-items: flex-end; gap: 6px; }
.inputs label { flex: 1; text-align: left; font-weight: 800; font-size: 13px; }
.inputs input { display: block; width: 100%; margin-top: 2px; font: 800 20px var(--font); color: var(--plum); padding: 6px 12px; border-radius: 14px; border: 2.5px solid var(--plum); background: #fff; outline: none; }
.inputs input:focus { box-shadow: 0 0 0 4px #ffc0d8; }
.inputs input.bad { animation: shake .35s; box-shadow: 0 0 0 4px #ffb0b0; }
.heart { color: var(--pink); font-size: 26px; padding-bottom: 8px; animation: beat 1.2s infinite; }
.modes { display: flex; gap: 8px; margin: 12px 0; }
.mode { flex: 1; border: 2.5px solid var(--plum); border-radius: 16px; background: #fff; padding: 6px 6px; display: flex; flex-direction: column; line-height: 1.15; opacity: .75; }
.mode b { font-size: 17px; } .mode small { font-size: 12px; font-weight: 500; }
.mode.on { background: #ffe1ec; opacity: 1; box-shadow: 0 0 0 3px var(--pink); }
.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; font-size: 13px; margin-top: 12px; font-weight: 600; }
kbd { font: 800 12px var(--font); background: #fff; border: 2px solid var(--plum); border-bottom-width: 3.5px; border-radius: 6px; padding: 0 5px; }
.row2 { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.link { text-decoration: underline; font-weight: 800; font-size: 15px; color: var(--plum2); }
.fun { font-size: 12.5px; opacity: .85; margin: 8px 0 0; font-weight: 600; }

/* reveal */
.curtain { position: fixed; top: 0; bottom: 0; width: 51%; z-index: 0; background: repeating-linear-gradient(90deg, #e9548a 0 22px, #f17aa5 22px 40px, #d94279 40px 48px); box-shadow: inset 0 -40px 60px rgba(90,35,80,.35); transition: transform .7s cubic-bezier(.6,.05,.3,1); }
.curtain.l { left: 0; } .curtain.r { right: 0; }
.curtain::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40px; background: radial-gradient(circle at 20px 0, #ffb84d 14px, #ff9a1f 15px, transparent 16px) 0 0 / 40px 40px repeat-x; }
#reveal.open .curtain.l { transform: translateX(-100%); } #reveal.open .curtain.r { transform: translateX(100%); }
.revP { z-index: 1; padding-top: 12px; margin-top: 70px; opacity: 0; transform: scale(.7); transition: opacity .3s .35s, transform .45s .35s cubic-bezier(.3,1.6,.5,1); animation: none; }
#reveal.open .revP { opacity: 1; transform: none; }
.mithuR { position: absolute; top: -84px; right: 8px; width: 92px; filter: drop-shadow(0 4px 3px rgba(90,35,80,.3)); animation: bob 2s ease-in-out infinite; }
.res { --rc: var(--pink); border-radius: 22px; padding: 8px 12px 10px; background: #fff; border: 3px dashed var(--rc); }
.res .names { font-weight: 800; font-size: 20px; line-height: 1.15; padding-right: 70px; text-align: left; }
.res .names em { color: var(--pink); font-style: normal; }
.badge { width: 150px; height: 150px; border-radius: 50%; display: block; margin: 4px auto 0; clip-path: circle(46%); }
.word { font-size: 46px; font-weight: 800; line-height: 1; color: var(--rc); -webkit-text-stroke: 2px var(--plum); paint-order: stroke fill; text-shadow: 0 4px 0 var(--plum); letter-spacing: 1px; margin-top: 2px; }
.line { font-size: 16px; font-weight: 600; margin: 6px 0; line-height: 1.25; }
.meter { margin: 6px 4px 0; }
.mlab { display: flex; justify-content: space-between; font-weight: 800; font-size: 14px; }
.mlab b { font-size: 18px; color: var(--pink); }
.bar { height: 16px; border-radius: 9px; border: 2.5px solid var(--plum); background: #ffeef5; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb3cf, #f2508a, #9a74de); border-radius: 6px; transition: width 1.4s cubic-bezier(.2,.8,.3,1); }
.gain { font-weight: 800; font-size: 14px; color: #b07a00; min-height: 0; margin-top: 4px; }
.res .fun { margin-top: 2px; }
.btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* sheets */
.sheet { text-align: left; width: min(620px, 100%); max-height: calc(100% - 10px); overflow-y: auto; }
.sheet h2 { margin: 0 34px 8px 0; font-size: 24px; line-height: 1.1; }
.x { position: absolute; top: 8px; right: 10px; width: 38px; height: 38px; font-size: 28px; line-height: 1; border-radius: 50%; border: 2.5px solid var(--plum); background: #fff; font-weight: 800; }
.sheet ol { margin: 0; padding-left: 22px; }
.sheet li { margin: 0 0 10px; font-size: 15.5px; line-height: 1.35; font-weight: 500; }
.sheet li b { font-weight: 800; }
.mt { display: inline-flex; flex-wrap: wrap; gap: 3px; vertical-align: middle; margin: 2px 0; }
.mt span { display: inline-grid; place-items: center; min-width: 22px; height: 24px; border-radius: 6px; border: 2px solid var(--plum); background: #fff; font-weight: 800; font-size: 14px; padding: 0 3px; }
.mt span.x1 { text-decoration: line-through; text-decoration-color: #e8335f; text-decoration-thickness: 3px; opacity: .55; background: #eee; }
.mt span.hit { background: #ffe27a; }
.hrow { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-bottom: 2px dashed #f3c6d8; }
.hrow img { width: 42px; height: 42px; border-radius: 50%; clip-path: circle(46%); flex: none; }
.hrow div { flex: 1; min-width: 0; font-weight: 800; font-size: 15px; line-height: 1.15; }
.hrow small { display: block; font-weight: 500; font-size: 12.5px; }
.hrow b { font-size: 16px; }
.empty { opacity: .7; font-weight: 600; padding: 10px 0; }
.prevP { text-align: center; }
.prevP img { width: 100%; max-width: 360px; border-radius: 16px; border: 3px solid var(--plum); -webkit-user-select: auto; user-select: auto; -webkit-touch-callout: default; }
.hint { font-size: 13.5px; font-weight: 600; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; background: var(--plum); color: #fff; font-weight: 800; padding: 8px 18px; border-radius: 18px; box-shadow: 0 4px 0 rgba(0,0,0,.2); animation: pop .25s; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.pt { position: absolute; font-size: 22px; will-change: transform, opacity; }
.fly { position: absolute; font-weight: 800; color: #b07a00; font-size: 22px; -webkit-text-stroke: 1px #fff; animation: rise 1s forwards; }

@keyframes bump { 50% { transform: scale(1.15); } }
@keyframes beat { 30% { transform: scale(1.15); } 60% { transform: scale(.97); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes pop { from { transform: scale(.8); opacity: 0; } }
@keyframes bob { 50% { transform: translate(-50%, -6px); } }
.mithuR { animation-name: bobR; } @keyframes bobR { 50% { transform: translateY(-6px) rotate(4deg); } }
@keyframes winp { to { transform: scale(1.3); box-shadow: 0 0 0 6px #fff, 0 0 0 12px var(--gold), 0 0 30px 14px rgba(255,220,120,.9); } }
@keyframes rise { to { transform: translateY(-50px); opacity: 0; } }

/* desktop / landscape: names left, ring right */
@media (min-width: 820px) and (min-aspect-ratio: 1/1) {
  .cols { flex-direction: row; align-items: stretch; }
  .board { flex: 1.15; align-self: center; padding: 16px; }
  .ringBox { flex: 1; }
  .say p { font-size: 19px; }
  .logo { font-size: 30px; }
}
@media (max-height: 640px) and (min-aspect-ratio: 1/1) { .startP { padding-top: 54px; } .mithuS { width: 104px; top: -52px; } .intro { font-size: 14px; margin: 6px 0; } .modes { margin: 8px 0; } }
@media (max-width: 400px) { .h1a { font-size: 34px; } .intro { font-size: 14px; } .say p { font-size: 15.5px; } .word { font-size: 40px; } .badge { width: 124px; height: 124px; } .soft { font-size: 15px; padding: 6px 11px; } }
@media (prefers-reduced-motion: reduce) { .mithuS, .mithuR, .heart { animation: none; } }
