:root { --ink: #2A1F4A; --paper: #FBFAFF; --amber: #FFB020; --lilac: #E9E4F7; --disp: "Paytone One", system-ui, sans-serif; --body: "Lexend", system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--lilac); color: var(--ink); font-family: var(--body); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
button { font: inherit; color: inherit; cursor: pointer; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#fx { position: fixed; inset: 0; pointer-events: none; z-index: 3; }
.float { position: absolute; transform: translate(-50%, -50%); font-family: var(--disp); font-size: 26px; color: #fff; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; animation: up 1s ease-out forwards; }
@keyframes up { from { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -70%) scale(1.1); } to { opacity: 0; transform: translate(-50%, -260%); } }
.joy { position: fixed; z-index: 4; width: 100px; height: 100px; margin: -50px 0 0 -50px; border-radius: 50%; background: rgba(42,31,74,.08); border: 2px solid rgba(42,31,74,.2); pointer-events: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 14px; background: #fff; box-shadow: 0 4px 0 rgba(42,31,74,.25); }

.hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.hud .mine { position: absolute; left: max(14px, env(safe-area-inset-left)); top: max(12px, env(safe-area-inset-top)); display: flex; align-items: baseline; gap: 12px; }
.hud .mine b { font-family: var(--disp); font-weight: 400; font-size: 46px; line-height: 1; color: #fff; -webkit-text-stroke: 7px var(--ink); paint-order: stroke fill; }
.hud .mine span { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; background: #fff; font-weight: 700; box-shadow: 0 3px 0 rgba(42,31,74,.18); }
.hud .mine em { font-style: normal; }
.board { position: absolute; right: max(12px, env(safe-area-inset-right)); top: calc(max(12px, env(safe-area-inset-top)) + 52px); margin: 0; padding: 8px 10px; width: 180px; list-style: none; border-radius: 16px; background: rgba(255,255,255,.88); font-size: 13px; box-shadow: 0 4px 0 rgba(42,31,74,.12); }
.board li { display: flex; align-items: center; gap: 7px; padding: 2px 0; }
.board li i { width: 11px; height: 11px; border-radius: 3px; flex: none; }
.board li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board li.me { font-weight: 700; }
.mini { position: absolute; left: max(12px, env(safe-area-inset-left)); bottom: max(12px, env(safe-area-inset-bottom)); width: 108px; height: 108px; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 4px 0 rgba(42,31,74,.15); }
.ib { pointer-events: auto; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; border: 0; background: #fff; color: var(--ink); box-shadow: 0 3px 0 rgba(42,31,74,.18); }
.hud .ib { position: absolute; right: max(12px, env(safe-area-inset-right)); top: max(12px, env(safe-area-inset-top)); }
.ib svg { width: 20px; height: 20px; }
.ib.small { width: 38px; height: 38px; }
.mute .offi { display: none; } .mute.off .on { display: none; } .mute.off .offi { display: block; }
.tip { position: fixed; z-index: 5; left: 50%; bottom: max(28px, env(safe-area-inset-bottom)); transform: translateX(-50%); margin: 0; padding: 10px 18px; border-radius: 14px; background: var(--ink); color: #fff; font-weight: 600; white-space: nowrap; pointer-events: none; }
.toast { position: fixed; z-index: 6; left: 50%; top: 24%; transform: translateX(-50%); margin: 0; font-family: var(--disp); font-size: clamp(28px, 7vw, 44px); color: #fff; -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; white-space: nowrap; pointer-events: none; }
.toast.gold { color: var(--amber); }
.toast.go { animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { from { transform: translateX(-50%) scale(.4); opacity: 0; } }

.menu, .card { position: fixed; z-index: 9; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(92vw, 400px); max-height: 94vh; overflow: auto; padding: 24px 22px 18px; text-align: center; border-radius: 26px; background: var(--paper); box-shadow: 0 8px 0 rgba(42,31,74,.25), 0 30px 70px rgba(42,31,74,.25); }
.logo { margin: 0; font-family: var(--disp); font-weight: 400; font-size: 84px; line-height: .9; color: var(--amber); -webkit-text-stroke: 10px var(--ink); paint-order: stroke fill; letter-spacing: .02em; transform: rotate(-3deg); }
.tag { margin: 8px 0 16px; font-weight: 700; color: #6B5F95; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; margin: 0 0 10px; padding: 14px; border-radius: 18px; border: 0; background: #fff; color: var(--ink); font-family: var(--disp); font-size: 22px; box-shadow: inset 0 0 0 3px var(--ink), 0 5px 0 var(--ink); }
.btn.big { background: var(--amber); font-size: 28px; }
.btn.ghost { box-shadow: inset 0 0 0 2px rgba(42,31,74,.3); font-size: 18px; }
.btn:active { transform: translateY(3px); }
.btn svg { width: 22px; height: 22px; }
.rules { margin: 10px 0 14px; padding: 0; list-style: none; text-align: left; font-size: 15px; line-height: 1.4; }
.rules li { padding: 6px 0 6px 12px; border-left: 4px solid var(--amber); margin-bottom: 6px; }
.skins { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.skin { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border: 2px solid transparent; border-radius: 14px; background: none; font-size: 12px; color: #6B5F95; }
.skin i { width: 34px; height: 30px; border-radius: 8px; background: var(--c); box-shadow: 0 5px 0 var(--d); margin-bottom: 4px; }
.skin.sel { border-color: var(--ink); color: var(--ink); font-weight: 700; }
.skin:disabled { opacity: .4; cursor: default; }
.foot { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 0; }
.foot a { color: var(--ink); font-weight: 600; }
.card .why { margin: 0; font-weight: 600; color: #6B5F95; }
.card h2 { margin: 4px 0 0; font-family: var(--disp); font-weight: 400; font-size: 72px; line-height: 1; color: var(--amber); -webkit-text-stroke: 8px var(--ink); paint-order: stroke fill; }
.card .best { margin: 4px 0 12px; font-weight: 700; }
.card .best.new { color: #E0245E; }
.card dl { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 14px; padding: 10px; border-radius: 16px; background: #F1EEFB; }
.card dt { grid-row: 1; font-size: 13px; color: #6B5F95; }
.card dd { grid-row: 2; margin: 0; font-family: var(--disp); font-size: 28px; }
.unlock { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 5px 14px; border-radius: 99px; background: #F1EEFB; font-weight: 700; }
.unlock::before { content: ""; width: 16px; height: 16px; border-radius: 4px; background: var(--c); }
.btn:focus-visible, .ib:focus-visible, .skin:focus-visible { outline: 3px dashed #E0245E; outline-offset: 3px; }

.ogmark { display: none; }
body.og .ogmark { display: block; position: fixed; z-index: 8; left: 7%; top: 50%; transform: translateY(-50%); padding: 26px 40px 30px; border-radius: 30px; background: var(--paper); box-shadow: 0 10px 0 rgba(42,31,74,.3); }
body.og .ogmark .logo { font-size: 150px; -webkit-text-stroke-width: 14px; }
body.og .ogmark p { margin: 10px 0 0; font-size: 30px; font-weight: 700; }
body.demo .hud, body.demo .menu, body.demo .card, body.demo .tip, body.demo .toast, body.demo #fx { display: none !important; }
@media (max-width: 520px) { .board { width: 140px; font-size: 12px; } .hud .mine b { font-size: 38px; } .mini { width: 84px; height: 84px; } .tip { white-space: normal; width: 86vw; text-align: center; } }
@media (prefers-reduced-motion: reduce) { .toast.go, .float { animation: none; } }
