html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: #0b0614; }
body { font-family: Impact, "Arial Black", "Trebuchet MS", sans-serif; color: #111; -webkit-tap-highlight-color: transparent; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.screen { position: fixed; inset: 0; display: none; z-index: 10; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.screen.show { display: flex; }
.halftone { background-color: rgba(10, 6, 24, 0.72); background-image: radial-gradient(rgba(255, 210, 63, 0.18) 1.4px, transparent 1.6px); background-size: 10px 10px; }
.panel { background: #fff4d6; border: 4px solid #111; box-shadow: 6px 6px 0 #111; border-radius: 6px; }
.btn { font: inherit; font-family: var(--font); cursor: pointer; border: 4px solid #111; border-radius: 8px; box-shadow: 4px 4px 0 #111; background: #ffd23f; color: #111; padding: 10px 16px; min-height: 48px; font-size: 18px; font-weight: 900; transition: transform .06s; touch-action: manipulation; }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #111; }
.btn.focus { outline: 4px solid #3ba7ff; outline-offset: 2px; }
.btn[disabled] { filter: grayscale(0.8); opacity: 0.7; }
.big-btn { font-size: 24px; background: #ff3b3b; color: #fff; text-shadow: 2px 2px 0 #111; padding: 14px 28px; min-height: 60px; }
#hub { justify-content: center; align-items: flex-start; background-size: cover; background-position: center; }
.hub-inner { width: min(440px, calc(100% - 28px)); padding: 18px 0 28px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; font-family: var(--font); }
.hub-head { padding: 12px 16px; transform: rotate(-1.5deg); display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #ffd23f; }
.hub-head h1 { margin: 0; font-size: 22px; line-height: 1.15; font-weight: 900; letter-spacing: 0.3px; color: #111; text-shadow: 2px 2px 0 #fff; min-width: 0; }
.ink-count { display: flex; align-items: center; gap: 6px; background: #111; color: #fff; border-radius: 20px; padding: 6px 14px 6px 8px; font-size: 20px; font-weight: 900; white-space: nowrap; flex: 0 0 auto; }
.ink-drop { width: 18px; height: 22px; background: #6b3bff; border: 2px solid #fff; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; transform: rotate(180deg); display: inline-block; }
#daily { display: none; align-self: center; background: #3ba7ff; color: #fff; border: 4px solid #111; box-shadow: 4px 4px 0 #111; padding: 8px 18px; font-size: 18px; font-weight: 900; transform: rotate(2deg); text-shadow: 2px 2px 0 #111; animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.3) rotate(2deg); } 70% { transform: scale(1.12) rotate(2deg); } 100% { transform: scale(1) rotate(2deg); } }
.stats { color: #fff; font-size: 16px; text-align: center; text-shadow: 2px 2px 0 #111; font-weight: 700; display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.hub-inner h2 { margin: 4px 0 0; color: #ffd23f; font-size: 20px; text-shadow: 2px 2px 0 #111; font-weight: 900; }
.up-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.up-row img { width: 44px; height: 44px; object-fit: contain; flex: 0 0 44px; }
.up-txt { flex: 1 1 auto; min-width: 0; }
.up-name { font-size: 17px; font-weight: 900; }
.up-name small { font-size: 13px; color: #c0262c; margin-left: 6px; white-space: nowrap; display: inline-block; }
.up-desc { font-size: 14px; font-family: var(--font); color: #333; font-weight: 600; }
.up-row .btn { flex: 0 0 auto; font-size: 15px; padding: 6px 10px; min-width: 88px; }
#btn-start { margin-top: 8px; align-self: center; }
.modal { justify-content: center; align-items: center; }
.modal-box { width: min(420px, calc(100% - 28px)); max-height: calc(100% - 40px); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; font-family: var(--font); box-sizing: border-box; }
.modal-title { font-size: 26px; font-weight: 900; text-align: center; margin: 0; color: #111; }
.modal-sub { text-align: center; font-size: 15px; font-weight: 700; margin: -4px 0 4px; color: #444; }
.recipe { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; background: #fff; padding: 8px 10px; }
.recipe.can { background: #fff; }
.recipe.cant { background: #e8e1cf; }
.recipe.locked { opacity: .6; filter: grayscale(.7); }
.recipe img.ricon { width: 46px; height: 46px; object-fit: contain; flex: 0 0 46px; }
.recipe .rtxt { flex: 1 1 auto; min-width: 0; }
.recipe .rname { font-size: 18px; font-weight: 900; }
.recipe .rdesc { font-size: 13px; font-weight: 600; color: #444; line-height: 1.25; }
.recipe .rlock { font-size: 13px; font-weight: 900; color: #c0262c; margin-top: 2px; }
.recipe .rcost { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.recipe .rcost span { display: inline-flex; align-items: center; gap: 2px; font-size: 15px; font-weight: 900; }
.recipe .rcost span.lack { color: #d61f1f; }
.recipe .rcost img { width: 22px; height: 22px; }
.tier-h { background: #ffd23f; border: 3px solid #111; padding: 2px 10px; font-weight: 900; font-size: 15px; align-self: flex-start; transform: rotate(-1deg); margin-top: 4px; }
.perk-card { width: 100%; background: #fff; display: flex; align-items: center; gap: 12px; padding: 12px; text-align: left; }
.perk-card:nth-child(odd) { transform: rotate(-1deg); }
.perk-card:nth-child(even) { transform: rotate(1deg); }
.perk-badge { width: 52px; height: 52px; flex: 0 0 52px; border: 3px solid #111; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 26px; color: #fff; text-shadow: 2px 2px 0 #111; background: #ff3b3b; }
.perk-name { font-size: 20px; font-weight: 900; }
.perk-desc { font-size: 14px; font-weight: 600; color: #333; }
#perk .modal-box { background: #3ba7ff; }
#perk .modal-title { color: #fff; text-shadow: 3px 3px 0 #111; }
#perk .modal-sub { color: #fff; text-shadow: 1px 1px 0 #111; }
#results .modal-box { align-items: center; text-align: center; background: #fff4d6; }
.ko { font-size: 40px; font-weight: 900; color: #ff3b3b; text-shadow: 3px 3px 0 #111; transform: rotate(-4deg); margin: 6px 0; -webkit-text-stroke: 1.5px #111; }
.res-line { font-size: 19px; font-weight: 800; }
.res-ink { font-size: 24px; font-weight: 900; color: #6b3bff; }
.newbest { display: none; background: #ffd23f; border: 3px solid #111; padding: 4px 14px; font-weight: 900; font-size: 18px; transform: rotate(3deg); }
#help .modal-box p { white-space: pre-line; font-size: 15px; font-weight: 600; line-height: 1.5; margin: 0; }
#video-wrap { position: fixed; inset: 0; z-index: 30; background: #000; display: none; }
#video-wrap.show { display: block; }
#intro-video { width: 100%; height: 100%; object-fit: cover; }
#skip { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); z-index: 2; font-size: 16px; min-width: 88px; }
#subtitle { position: fixed; left: 50%; top: 27%; transform: translateX(-50%); z-index: 40; display: none; max-width: min(380px, calc(100% - 40px)); background: rgba(255, 255, 255, 0.95); color: #111; border: 3px solid #111; border-radius: 16px; padding: 8px 14px; font-family: var(--font); font-size: 15px; font-weight: 800; text-align: center; box-shadow: 4px 4px 0 #111; pointer-events: none; }
#video-wrap.show ~ #subtitle { top: auto; bottom: 12%; }
#fade { position: fixed; inset: 0; background: #0b0614; z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
#fade.on { opacity: 1; }
