@font-face { font-family: 'Lilita One'; src: url(assets/fonts/lilita-one.woff2) format('woff2'); font-display: block; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lilita One'; src: url(assets/fonts/lilita-one-ext.woff2) format('woff2'); font-display: block; unicode-range: U+0100-02BA, U+20A0-20AB, U+20AD-20C4; }
:root { --ink: #2a160c; --paper: #fff6dc; --gold: #ffd23f; --red: #e8343a; --font: 'Lilita One', system-ui, sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #f2a77a; color: var(--ink); font-family: var(--font); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
canvas#game { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; display: block; touch-action: none; }
#hud { position: fixed; inset: 0; pointer-events: none; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); display: flex; justify-content: space-between; align-items: flex-start; }
.plate { background: rgba(255, 246, 220, 0.94); border: 4px solid var(--ink); border-radius: 14px; box-shadow: 0 4px 0 rgba(42, 22, 12, 0.35); padding: 6px 14px; }
#h-left { display: grid; min-width: 150px; }
#h-dist { font-size: clamp(26px, 5vw, 42px); line-height: 1; font-weight: normal; }
#h-best { font-size: 15px; color: #8a5a32; }
#h-feathers { display: flex; gap: 6px; margin-top: 4px; min-height: 18px; }
#h-feathers i { width: 26px; height: 11px; border-radius: 50%; background: #d9541e; border: 2px solid var(--ink); transform: rotate(-30deg); }
#h-feathers i.off { background: rgba(42, 22, 12, 0.15); border-color: rgba(42, 22, 12, 0.3); }
#h-right { display: flex; align-items: center; gap: 10px; font-size: clamp(22px, 4vw, 34px); }
#h-right b { font-weight: normal; }
.coin { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #ffcc33; border: 3px solid var(--ink); color: #d9951a; font-style: normal; font-size: 18px; }
.ov { position: fixed; inset: 0; display: none; place-content: center; text-align: center; padding: 24px; pointer-events: none; }
.ov.on { display: grid; }
#title h1 { margin: 0; font-size: clamp(48px, 10vw, 104px); font-weight: normal; color: var(--gold); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); line-height: 1; transform: rotate(-4deg); }
#title h1 span { color: #ff6b3d; }
#title p { margin: 14px 0 0; font-size: clamp(18px, 3vw, 26px); color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
#title .hint { font-size: clamp(15px, 2.4vw, 20px); opacity: 0.95; }
#title { align-content: start; padding-top: 18vh; }
@media (prefers-reduced-motion: reduce) { #title h1 { transform: none; } }
/* panels: results, shop and the rest */
.panel-ov { pointer-events: auto; background: rgba(42, 22, 12, 0.35); }
.panel { background: var(--paper); border: 5px solid var(--ink); border-radius: 22px; box-shadow: 0 8px 0 rgba(42, 22, 12, 0.45); padding: 18px 22px 20px; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; text-align: center; animation: pop 0.28s cubic-bezier(.2, 1.4, .4, 1); }
.panel.wide { width: min(980px, calc(100vw - 32px)); }
@keyframes pop { from { transform: scale(0.8); opacity: 0; } }
.panel h2 { margin: 0; font-weight: normal; font-size: clamp(40px, 9vw, 64px); line-height: 1.05; }
.kicker { margin: 0; color: #8a5a32; font-size: 18px; }
.newbest { display: inline-block; margin: 6px 0 0; padding: 4px 14px; border-radius: 999px; background: var(--gold); border: 3px solid var(--ink); font-size: 20px; transform: rotate(-3deg); }
#r-sub { margin: 6px 0 10px; color: #8a5a32; }
#r-lines { list-style: none; margin: 0 0 6px; padding: 0; text-align: left; }
#r-lines li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 4px; border-bottom: 2px dashed rgba(42, 22, 12, 0.18); font-size: 18px; }
#r-lines li.extra { color: #2f7a3a; }
.total { margin: 8px 0 14px; font-size: 22px; }
.total b { font-weight: normal; font-size: 30px; color: #b5530f; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { font: inherit; font-size: 22px; padding: 10px 22px; min-height: 48px; border: 4px solid var(--ink); border-radius: 16px; background: #fff; color: var(--ink); box-shadow: 0 5px 0 var(--ink); cursor: pointer; position: relative; }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn:focus-visible { outline: 4px solid #2f7fe0; outline-offset: 3px; }
.btn.big { background: var(--gold); font-size: 28px; padding: 10px 34px; }
.btn.alt { background: #cfe7d6; }
.btn.badge::after { content: '!'; position: absolute; top: -12px; right: -12px; width: 28px; height: 28px; border-radius: 50%; background: var(--red); color: #fff; border: 3px solid var(--ink); font-size: 18px; line-height: 22px; }
.phead { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.phead h2 { font-size: clamp(30px, 6vw, 44px); }
.plate-coins { padding: 4px 14px; border: 3px solid var(--ink); border-radius: 12px; background: #ffe9a8; font-size: 24px; }
#s-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: #fff; border: 4px solid var(--ink); border-radius: 16px; padding: 10px 12px 12px; display: grid; gap: 4px; text-align: left; }
.card h3 { margin: 0; font-weight: normal; font-size: 26px; }
.card p { margin: 0; font-size: 15px; color: #6b4a32; }
.card .stat { color: var(--ink); font-size: 16px; }
.card .stat b { color: #2f7a3a; font-weight: normal; }
.pips { display: flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.pips i { width: 10px; height: 14px; border-radius: 3px; background: rgba(42, 22, 12, 0.12); border: 2px solid rgba(42, 22, 12, 0.35); }
.pips i.on { background: #ff8a2a; border-color: var(--ink); }
.pips i.ginto { border-color: #c9a227; }
.pips i.ginto.on { background: var(--gold); }
.buy { font: inherit; font-size: 20px; padding: 8px; min-height: 44px; border: 3px solid var(--ink); border-radius: 12px; background: var(--gold); box-shadow: 0 4px 0 var(--ink); cursor: pointer; }
.buy:disabled { background: #e8e0d0; color: #9a8a7a; box-shadow: none; cursor: default; }
.buy:not(:disabled):active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
/* the first-run hand */
#hand { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); display: grid; justify-items: center; pointer-events: none; }
#hand[hidden] { display: none; }
#hand svg { width: 64px; height: 64px; animation: tap 0.9s ease-in-out infinite; }
#hand b { font-weight: normal; font-size: 28px; color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
#hand.hold svg { animation: none; transform: translateY(8px) scale(0.92); }
@keyframes tap { 50% { transform: translateY(10px) scale(0.92); } }
@media (prefers-reduced-motion: reduce) { #hand svg, .panel { animation: none; } }
/* the chest, the map and the ending */
.chest { font: inherit; font-size: 20px; display: block; width: 100%; margin: 0 0 12px; padding: 10px; border: 4px dashed var(--ink); border-radius: 14px; background: #ffe9a8; cursor: pointer; animation: wiggle 1.4s ease-in-out infinite; }
.chest span { color: #b5530f; }
.chest:disabled { animation: none; cursor: default; }
@keyframes wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-2deg); } 90% { transform: rotate(2deg); } 95% { transform: rotate(-1deg); } }
#m-route { position: relative; height: 64px; margin: 18px 6px 8px; border: 4px solid var(--ink); border-radius: 14px; overflow: hidden; }
#m-route .zone { position: absolute; top: 0; bottom: 0; display: flex; align-items: flex-end; padding: 0 0 4px 8px; font-size: 14px; color: var(--ink); border-right: 2px dashed rgba(42, 22, 12, 0.4); }
#m-route .mark { position: absolute; top: 6px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); }
#m-route .mark.got { background: var(--gold); }
#m-route .bay { position: absolute; top: 18px; margin-left: -12px; font-size: 22px; font-weight: normal; }
#m-route .you { position: absolute; top: 4px; bottom: 4px; width: 6px; margin-left: -3px; background: var(--red); border-radius: 3px; box-shadow: 0 0 0 2px var(--ink); }
#m-next { margin: 0 0 8px; font-size: 18px; }
.sub { margin: 8px 0; font-weight: normal; font-size: 24px; text-align: left; }
#m-missions { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; text-align: left; }
#m-missions li { position: relative; display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 8px 12px; border: 3px solid var(--ink); border-radius: 12px; background: #fff; overflow: hidden; }
#m-missions li i { position: absolute; left: 0; bottom: 0; height: 5px; background: #3fbf5a; }
#m-missions em { font-style: normal; color: #6b4a32; }
#m-missions b { font-weight: normal; color: #b5530f; }
#ending .panel { background: linear-gradient(#ffe0b8, #fff6dc 60%); }
#ending .crow { font-size: 40px; margin: 6px 0; color: var(--red); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
#ending .credits { color: #6b4a32; }
/* the menu, the sheet, the duel */
.logo { font-size: clamp(40px, 9vw, 64px); color: var(--gold); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; transform: rotate(-3deg); margin-bottom: 14px !important; }
.logo span { color: #ff6b3d; }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.menu-grid .btn { display: grid; justify-items: center; gap: 2px; font-size: 20px; padding: 10px 8px; }
.menu-grid .btn small { font-size: 13px; color: #6b4a32; }
.menu-grid .wide { grid-column: 1 / -1; font-size: 32px; }
.menu-grid .btn:nth-child(2), .menu-grid .btn:nth-child(3) { grid-column: span 1; }
.menu-grid .btn:nth-child(2) { grid-column: 1 / 2; }
.menu-grid { grid-template-areas: none; }
@media (min-width: 0) { .menu-grid .btn:nth-child(2) { grid-column: auto; } }
.btn:disabled { opacity: 0.5; box-shadow: none; cursor: default; }
#sh-body p { margin: 6px 0; font-size: 18px; }
#sh-body b { font-weight: normal; color: #b5530f; }
#sh-buttons { margin-top: 14px; }
.toggles { display: grid; gap: 10px; justify-items: start; margin: 10px auto; width: fit-content; font-size: 22px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle input { width: 26px; height: 26px; accent-color: #ff8a2a; }
#h-mode { color: #2f7fe0; }
#h-mode:empty { display: none; }
#duel-hud { display: none; position: fixed; inset: 0; pointer-events: none; }
body[data-mode='duel'] #duel-hud { display: block; }
body[data-mode='duel'] #hud { display: none; }
#duel-hud .plate { position: absolute; left: 12px; display: grid; padding: 4px 12px; }
#duel-hud .p1 { top: 12px; }
#duel-hud .p2 { top: calc(50% + 12px); }
#duel-hud .wins { left: auto; right: 12px; top: calc(50% - 24px); font-size: 26px; }
#duel-hud b { font-weight: normal; font-size: 28px; line-height: 1; }
#duel-hud small { font-size: 14px; color: #8a5a32; }
body[data-mode='duel']::after { content: ''; position: fixed; left: 0; right: 0; top: calc(50% - 3px); height: 6px; background: var(--ink); pointer-events: none; }
/* shop tabs and looks; the zone banner */
.tabs { display: flex; gap: 8px; }
.tab { font: inherit; font-size: 22px; padding: 6px 16px; border: 4px solid var(--ink); border-radius: 14px; background: #fff; cursor: pointer; }
.tab.on { background: var(--gold); }
.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin-bottom: 8px; }
.look { display: grid; justify-items: center; gap: 4px; padding: 8px; border: 4px solid var(--ink); border-radius: 14px; background: #fff; }
.look.on { background: #fff3c8; }
.look canvas { width: 120px; height: 96px; }
.look .buy { width: 100%; font-size: 16px; }
#s-looks { max-height: 56vh; overflow: auto; margin-bottom: 14px; text-align: left; }
#banner { position: fixed; left: 50%; top: 18%; transform: translate(-50%, -20px) scale(0.6); opacity: 0; display: grid; justify-items: center; pointer-events: none; }
#banner b { font-weight: normal; font-size: clamp(44px, 9vw, 84px); color: var(--gold); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); }
#banner small { font-size: 22px; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
#banner.on { animation: banner 2.6s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translate(-50%, -20px) scale(0.6); } 12% { opacity: 1; transform: translate(-50%, 0) scale(1.08); } 20% { transform: translate(-50%, 0) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -10px) scale(1); } }
@media (prefers-reduced-motion: reduce) { #banner.on { animation: none; opacity: 1; transform: translate(-50%, 0); } }
#s-cards[hidden], #s-looks[hidden] { display: none; }
.ads .btn { font-size: 18px; background: #d6e0f2; }
body.portal .share { display: none; }
.foot { margin: 14px 0 0; font-size: 14px; color: #6b4a32; }
.foot a { color: #b5530f; }
body.portal .outside { display: none; }
