Files
pokeazure/style.css
T

652 lines
33 KiB
CSS
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');
/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
--black: #0f0f0f;
--darkgray: #2d2d2d;
--gray: #4a4a4a;
--lightgray: #8a8a8a;
--white: #e8e8e8;
--cream: #f0e8c8;
--dark-bg: #1a1a2e;
--red: #c8003a;
--red-hover: #e0004a;
--blue: #0050a0;
--blue-hover: #0068c8;
--green: #008a1e;
--green-hover:#00b026;
--yellow: #f8c030;
--dialog-bg: #f0e8c8;
--dialog-bd: #202040;
--hp-green: #50c020;
--hp-yellow: #c8b000;
--font: 'Press Start 2P', monospace;
--app-w: 420px;
--app-h: 680px;
--safe-bottom: env(safe-area-inset-bottom, 0px);
/* GBA controller palette */
--gba-body: #6a5acd;
--gba-dark: #3d2f99;
--gba-ab-a: #e83030;
--gba-ab-b: #2060d0;
--gba-dpad: #1a1a2e;
}
/* ─── RESET ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Prevent text selection and touch callouts everywhere in the game */
html, body, #app {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color: transparent;
}
/* ─── BODY ───────────────────────────────────────────────── */
html, body {
height: 100%;
overflow: hidden;
background: #12082a;
background-image:
radial-gradient(ellipse at 20% 50%, rgba(80,0,120,.35) 0%, transparent 55%),
radial-gradient(ellipse at 80% 50%, rgba(0,40,120,.35) 0%, transparent 55%);
display: flex;
align-items: center;
justify-content: center;
font-family: var(--font);
}
/* ─── APP SHELL ──────────────────────────────────────────── */
#app {
position: relative;
width: min(var(--app-w), 100vw);
height: min(var(--app-h), 100dvh);
background: var(--dark-bg);
overflow: hidden;
border: 5px solid #111;
border-radius: 6px;
box-shadow: 0 0 0 2px #333, 0 0 40px rgba(100,80,200,.55), 0 0 90px rgba(80,60,180,.25);
}
#app::after {
content: '';
position: absolute;
inset: 0;
background: repeating-linear-gradient(0deg, transparent 0px, transparent 2px, rgba(0,0,0,.045) 2px, rgba(0,0,0,.045) 4px);
pointer-events: none;
z-index: 900;
border-radius: 6px;
}
/* ─── MOBILE FULL-SCREEN ─────────────────────────────────── */
@media (max-width: 480px), (max-height: 720px) {
html, body { align-items: flex-start; }
#app { width: 100vw; height: 100dvh; border: none; border-radius: 0; box-shadow: none; }
}
/* ─── SCREENS ────────────────────────────────────────────── */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; }
.screen.active { display: flex; }
/* ─── ANIMATIONS ─────────────────────────────────────────── */
@keyframes blink { 0%,100%{opacity:1}50%{opacity:0} }
@keyframes fadeIn { from{opacity:0}to{opacity:1} }
@keyframes slideUp { from{transform:translateY(16px);opacity:0}to{transform:translateY(0);opacity:1} }
@keyframes bounce { 0%,100%{transform:translateY(0)}50%{transform:translateY(-7px)} }
@keyframes pop { 0%{transform:scale(.5);opacity:0}65%{transform:scale(1.08)}100%{transform:scale(1);opacity:1} }
@keyframes goldShimmer { 0%,100%{color:#f8c030;text-shadow:0 0 8px #f8c030}50%{color:#ffe878;text-shadow:0 0 18px #ffe878,0 0 36px #f8c030} }
@keyframes blueShimmer { 0%,100%{color:#60c8ff;text-shadow:4px 4px 0 #003d70,0 0 12px #60c8ff}50%{color:#a0e0ff;text-shadow:4px 4px 0 #003d70,0 0 24px #a0e0ff,0 0 48px #60c8ff} }
@keyframes correctPulse { 0%,100%{background:#c8ffc8;border-color:var(--green)}50%{background:#e0ffe0} }
@keyframes wrongShake { 0%,100%{transform:translateX(0)}25%{transform:translateX(-5px)}75%{transform:translateX(5px)} }
@keyframes npcFloat { 0%,100%{transform:translateY(0)}50%{transform:translateY(-8px)} }
@keyframes treeSway { 0%,100%{transform:rotate(-2deg)}50%{transform:rotate(2deg)} }
/* Sprite walk — player.png 384x32px, 24 frames at 16x32px each
Layout: 0-2=down 3-5=up 6-8=left 9-11=right */
@keyframes walkDown { from{background-position-x: 0px} to{background-position-x: -96px} }
@keyframes walkLeft { from{background-position-x: -96px} to{background-position-x: -192px} }
@keyframes walkUp { from{background-position-x:-192px} to{background-position-x: -288px} }
@keyframes walkRight { from{background-position-x:-288px} to{background-position-x: -384px} }
@keyframes dpadPress { 0%{transform:scale(1)}50%{transform:scale(.88)}100%{transform:scale(1)} }
@keyframes abPress { 0%{transform:scale(1)}40%{transform:scale(.82)}100%{transform:scale(1)} }
@keyframes choiceCursor { 0%,100%{box-shadow:0 0 0 3px var(--yellow), 2px 2px 0 var(--darkgray)}50%{box-shadow:0 0 0 3px #ffe878, 2px 2px 0 var(--darkgray)} }
@keyframes talkBubble { 0%{transform:translateY(0)}50%{transform:translateY(-3px)} }
@keyframes arrowPulse { 0%,100%{transform:scale(1) translateX(0);opacity:1} 50%{transform:scale(1.25) translateX(4px);opacity:.7} }
.blink { animation: blink 1s step-end infinite; }
/* ─── DIALOG BOX ─────────────────────────────────────────── */
.dialog-box {
background: var(--dialog-bg);
border: 4px solid var(--dialog-bd);
position: relative;
padding: 16px 14px 12px;
flex-shrink: 0;
}
.dialog-box::before {
content: '';
position: absolute;
inset: 3px;
border: 1px solid rgba(255,255,255,.45);
pointer-events: none;
}
.dialog-speaker {
font-size: 7px;
color: var(--black);
background: var(--dialog-bg);
border: 3px solid var(--dialog-bd);
padding: 3px 8px;
position: absolute;
top: -16px;
left: 10px;
white-space: nowrap;
letter-spacing: .5px;
}
.dialog-text {
font-size: clamp(6.5px, 1.8vw, 8px);
line-height: 2;
color: var(--black);
padding-top: 2px;
min-height: 52px;
}
.dialog-arrow { font-size: 10px; color: var(--black); text-align: right; margin-top: 4px; }
/* ─── PIXEL BUTTONS ──────────────────────────────────────── */
.btn-pixel {
display: inline-block;
font-family: var(--font);
font-size: clamp(7px, 2vw, 9px);
padding: 10px 16px;
border: 3px solid var(--black);
cursor: pointer;
box-shadow: 3px 3px 0 var(--black);
transition: transform .05s, box-shadow .05s;
letter-spacing: .5px;
color: var(--white);
user-select: none;
-webkit-tap-highlight-color: transparent;
}
.btn-pixel:active { transform: translate(3px,3px); box-shadow: none; }
.btn-blue { background: var(--blue); } .btn-blue:hover { background: var(--blue-hover); }
.btn-green { background: var(--green); } .btn-green:hover { background: var(--green-hover); }
.btn-red { background: var(--red); } .btn-red:hover { background: var(--red-hover); }
.btn-full { width: 100%; text-align: center; }
/* ─── OVERWORLD BG ───────────────────────────────────────── */
.overworld-bg {
flex: 1;
position: relative;
overflow: hidden;
background:
repeating-linear-gradient(0deg, transparent 0,transparent 31px, rgba(0,80,0,.12) 31px, rgba(0,80,0,.12) 32px),
repeating-linear-gradient(90deg, transparent 0,transparent 31px, rgba(0,80,0,.12) 31px, rgba(0,80,0,.12) 32px),
linear-gradient(180deg, #6cb84e 0%, #58a83e 100%);
}
/* ═══════════════════════════════════════════════════════════
GBA CONTROLLER OVERLAY
Sits outside #app, fixed to viewport bottom.
Shown only when screen === 'map' or 'battle'.
═══════════════════════════════════════════════════════════ */
.gba-controller {
position: fixed;
bottom: 0;
left: 0;
right: 0;
height: clamp(110px, 22vw, 148px);
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 clamp(8px,3vw,20px) max(8px, var(--safe-bottom));
background: linear-gradient(180deg, rgba(26,10,62,.82) 0%, rgba(14,6,36,.95) 100%);
backdrop-filter: blur(6px);
-webkit-backdrop-filter: blur(6px);
border-top: 2px solid rgba(120,80,255,.35);
z-index: 800;
user-select: none;
touch-action: none;
pointer-events: auto;
}
.gba-controller.hidden { display: none; }
/* Only show controller on touch / small screens by default.
On desktop we rely on keyboard — but controller still shows
if screen is narrow enough. JS toggles it per screen anyway. */
@media (min-width: 900px) {
.gba-controller { display: none !important; }
}
/* ── D-PAD ───────────────────────────────────────────────── */
.dpad {
position: relative;
width: clamp(90px, 21vw, 120px);
height: clamp(90px, 21vw, 120px);
flex-shrink: 0;
}
.dpad-btn {
position: absolute;
background: var(--gba-dpad);
border: 2px solid rgba(255,255,255,.18);
color: rgba(255,255,255,.75);
font-size: clamp(8px, 2.2vw, 11px);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
user-select: none;
touch-action: none;
transition: background .08s;
}
.dpad-btn:active, .dpad-btn.pressed {
background: #3a3a6e;
animation: dpadPress .15s ease;
}
/* Cross layout: 3×3 grid conceptually */
.dpad-up { top:0; left:33.3%; width:33.4%; height:33.4%; border-radius:4px 4px 0 0; }
.dpad-down { bottom:0; left:33.3%; width:33.4%; height:33.4%; border-radius:0 0 4px 4px; }
.dpad-left { top:33.3%; left:0; width:33.4%; height:33.4%; border-radius:4px 0 0 4px; }
.dpad-right { top:33.3%; right:0; width:33.4%; height:33.4%; border-radius:0 4px 4px 0; }
.dpad-center{ top:33.3%; left:33.3%; width:33.4%; height:33.4%; background:#111; border:none; cursor:default; }
/* ── SELECT / START (center strip) ───────────────────────── */
.gba-mid-btns {
display: flex;
flex-direction: row;
gap: 8px;
align-items: center;
justify-content: center;
}
.gba-mid-btn {
background: #2a1a5e;
border: 2px solid rgba(255,255,255,.2);
border-radius: 30px;
color: rgba(255,255,255,.6);
font-family: var(--font);
font-size: clamp(4.5px, 1.2vw, 6px);
padding: clamp(8px, 2vw, 11px) clamp(10px, 2.5vw, 14px);
cursor: pointer;
letter-spacing: .5px;
-webkit-tap-highlight-color: transparent;
transition: background .08s;
min-width: 52px;
text-align: center;
}
.gba-mid-btn:active { background: #3d2f99; }
/* ── A / B BUTTONS ───────────────────────────────────────── */
.ab-cluster {
position: relative;
width: clamp(90px, 21vw, 120px);
height: clamp(90px, 21vw, 120px);
flex-shrink: 0;
}
.ab-btn {
position: absolute;
width: clamp(36px, 9vw, 48px);
height: clamp(36px, 9vw, 48px);
border-radius: 50%;
border: 3px solid rgba(0,0,0,.5);
font-family: var(--font);
font-size: clamp(9px, 2.5vw, 13px);
font-weight: bold;
color: var(--white);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
box-shadow: 0 4px 0 rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.3);
-webkit-tap-highlight-color: transparent;
-webkit-user-select: none;
user-select: none;
touch-action: none;
transition: transform .06s, box-shadow .06s;
}
.ab-btn:active, .ab-btn.pressed {
transform: translateY(3px);
box-shadow: 0 1px 0 rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.2);
animation: abPress .18s ease;
}
/* B = left, A = right (classic GBA layout) */
.ab-b { background: radial-gradient(circle at 35% 35%, #4080ff, var(--gba-ab-b)); bottom: 14%; left: 5%; }
.ab-a { background: radial-gradient(circle at 35% 35%, #ff5555, var(--gba-ab-a)); top: 14%; right: 5%; }
/* label under each button */
.ab-btn::after {
content: attr(id) == 'btn-a' ? 'A' : 'B';
position: absolute;
bottom: -14px;
font-size: 5px;
color: rgba(255,255,255,.4);
letter-spacing: 1px;
}
/* ─── BOOT ───────────────────────────────────────────────── */
#screen-boot { background: var(--white); align-items: center; justify-content: center; animation: fadeIn .4s ease; }
.boot-logo { text-align: center; }
.boot-gameboy { font-size: clamp(8px,2.5vw,11px); color: var(--black); letter-spacing: 4px; margin-bottom: 10px; }
.boot-ding { font-size: 28px; margin-bottom: 8px; animation: goldShimmer 1.5s ease-in-out infinite; }
.boot-copy { font-size: 6px; color: var(--gray); }
/* ─── TITLE ──────────────────────────────────────────────── */
#screen-title { background: linear-gradient(180deg,#08031a 0%,#180a44 45%,#240e6a 75%,#120538 100%); overflow: hidden; }
.title-bg { position:relative; width:100%; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; }
.title-stars {
position: absolute; inset: 0;
background-image:
radial-gradient(1px 1px at 8% 12%, #fff 100%,transparent),
radial-gradient(1px 1px at 22% 38%, #fff 100%,transparent),
radial-gradient(1px 1px at 43% 8%, #fff 100%,transparent),
radial-gradient(1px 1px at 58% 28%, #fff 100%,transparent),
radial-gradient(1px 1px at 73% 14%, #fff 100%,transparent),
radial-gradient(1px 1px at 87% 42%, #fff 100%,transparent),
radial-gradient(1px 1px at 33% 62%, rgba(255,255,255,.5) 100%,transparent),
radial-gradient(1px 1px at 52% 72%, rgba(255,255,255,.5) 100%,transparent),
radial-gradient(2px 2px at 18% 82%, rgba(255,220,100,.8) 100%,transparent),
radial-gradient(2px 2px at 78% 78%, rgba(255,220,100,.8) 100%,transparent);
}
.title-main { text-align:center; z-index:1; padding:24px 16px; }
.title-logo { margin-bottom:16px; line-height:1; }
.title-poke { font-size:clamp(30px,11vw,50px); color:var(--yellow); text-shadow:4px 4px 0 #7a5800,0 0 24px rgba(248,192,48,.5); animation:goldShimmer 3s ease-in-out infinite; display:inline-block; }
.title-sql { font-size:clamp(30px,11vw,50px); color:#60c8ff; text-shadow:4px 4px 0 #003d70,0 0 24px rgba(96,200,255,.5); display:inline-block; animation:blueShimmer 3s ease-in-out infinite; animation-delay:.4s; }
.title-sub { font-size:clamp(6px,1.8vw,8px); color:rgba(255,255,255,.75); letter-spacing:1px; margin:10px 0 6px; }
.title-edition { font-size:clamp(5.5px,1.6vw,7px); color:var(--yellow); margin-bottom:24px; animation:goldShimmer 3s ease-in-out infinite; }
.title-deco { font-size:clamp(22px,6vw,32px); margin-bottom:28px; display:flex; gap:16px; justify-content:center; }
.title-deco span:nth-child(1){animation:npcFloat 2.0s ease-in-out infinite;}
.title-deco span:nth-child(2){animation:npcFloat 2.4s ease-in-out infinite;}
.title-deco span:nth-child(3){animation:npcFloat 2.8s ease-in-out infinite;}
.title-tap { font-size:clamp(7px,2vw,9px); color:var(--white); letter-spacing:1px; }
.title-footer { position:absolute; bottom:max(12px,var(--safe-bottom)); font-size:6px; color:rgba(255,255,255,.3); letter-spacing:.5px; }
/* ─── CONTINUE ───────────────────────────────────────────── */
#screen-continue { background:linear-gradient(180deg,#08031a 0%,#180a44 100%); align-items:center; justify-content:center; }
.continue-bg { width:90%; max-width:340px; display:flex; flex-direction:column; align-items:center; gap:16px; animation:fadeIn .5s ease; }
.continue-logo { font-size:clamp(16px,5vw,22px); color:var(--yellow); text-shadow:3px 3px 0 #7a5800; animation:goldShimmer 3s ease-in-out infinite; }
.continue-logo span { color:#60c8ff; text-shadow:3px 3px 0 #003d70; }
.continue-card { width:100%; background:var(--dialog-bg); border:4px solid var(--dialog-bd); padding:16px; display:flex; flex-direction:column; gap:10px; box-shadow:4px 4px 0 rgba(0,0,0,.5); }
.continue-card-header { font-size:8px; color:var(--black); margin-bottom:4px; letter-spacing:1px; }
.save-row { display:flex; justify-content:space-between; align-items:center; font-size:clamp(6.5px,1.8vw,8px); }
.save-lbl { color:var(--gray); } .save-val { color:var(--black); }
.continue-or { font-size:7px; color:rgba(255,255,255,.4); letter-spacing:1px; }
.continue-warn{ font-size:6px; color:rgba(255,80,80,.7); text-align:center; line-height:1.8; min-height:14px; }
/* ─── NAME ENTRY ─────────────────────────────────────────── */
#screen-name { background:#c8b88a; padding:14px 10px 10px; gap:10px; }
.name-dialog { flex-shrink:0; }
.name-entry-area { display:flex; flex-direction:column; align-items:center; gap:8px; flex:1; }
.name-display-box { background:var(--white); border:3px solid var(--black); padding:8px 20px; font-size:clamp(14px,4.5vw,20px); color:var(--black); min-width:180px; text-align:center; letter-spacing:4px; box-shadow:inset 2px 2px 0 rgba(0,0,0,.2); }
.keyboard-grid { display:grid; grid-template-columns:repeat(10,1fr); gap:3px; width:100%; }
.key-btn { background:var(--white); border:2px solid var(--black); color:var(--black); font-family:var(--font); font-size:clamp(6px,1.8vw,8px); padding:clamp(5px,1.5vw,8px) 2px; cursor:pointer; text-align:center; box-shadow:2px 2px 0 var(--darkgray); user-select:none; -webkit-tap-highlight-color:transparent; transition:transform .05s,box-shadow .05s; }
.key-btn:active { transform:translate(2px,2px); box-shadow:none; }
.name-controls { display:flex; gap:12px; margin-top:4px; }
.btn-del { background:var(--red); } .btn-del:hover { background:var(--red-hover); }
.btn-ok { background:var(--green); } .btn-ok:hover { background:var(--green-hover); }
/* ─── INTRO ──────────────────────────────────────────────── */
#screen-intro { flex-direction:column-reverse; }
.intro-dialog { margin:10px; min-height:90px; }
.intro-npc { position:absolute; right:22%; bottom:30%; font-size:clamp(44px,13vw,64px); animation:npcFloat 2s ease-in-out infinite; filter:drop-shadow(2px 3px 0 rgba(0,0,0,.4)); }
.intro-player {
position: absolute;
left: 22%;
bottom: 28%;
width: 32px;
height: 64px;
background-image: url('./player.png');
background-repeat: no-repeat;
background-size: 768px 64px;
background-position-x: -32px; /* idle down frame */
background-position-y: 0;
image-rendering: pixelated;
animation: bounce 1s ease-in-out infinite;
filter: drop-shadow(2px 3px 0 rgba(0,0,0,.4));
}
.tap-hint { font-size:6px; color:var(--black); background:rgba(255,255,255,.6); text-align:center; padding:4px; letter-spacing:1px; flex-shrink:0; }
/* ─── MAP ────────────────────────────────────────────────── */
.map-header { background:var(--dark-bg); padding:8px 12px; display:flex; align-items:center; justify-content:space-between; gap:8px; border-bottom:3px solid var(--black); flex-shrink:0; }
.map-left { display:flex; align-items:center; gap:6px; }
.map-pin { font-size:12px; }
.map-town-name { font-size:clamp(5.5px,1.6vw,7px); color:var(--yellow); letter-spacing:.5px; }
.map-right { display:flex; align-items:center; gap:6px; }
.prog-bar-outer { width:80px; height:9px; background:var(--black); border:2px solid var(--lightgray); overflow:hidden; }
.prog-bar-inner { height:100%; width:0%; background:var(--hp-green); transition:width .5s ease; }
.prog-text { font-size:6px; color:var(--white); }
.save-dot { font-size:12px; animation:blink 3s ease-in-out infinite; }
.music-toggle {
font-size: 14px;
cursor: pointer;
opacity: 1;
transition: opacity .2s;
-webkit-tap-highlight-color: transparent;
user-select: none;
padding: 2px 4px;
}
.music-toggle.muted { opacity: .35; }
.map-world {
position: relative;
overflow: hidden;
}
/* Wide scrolling inner world — JS translates this to pan the camera */
.map-inner {
position: absolute;
top: 0; bottom: 0; left: 0;
width: 400%;
will-change: transform;
z-index: 5;
}
.map-trees {
position: absolute;
inset: 0;
pointer-events: none;
}
.tree {
position: absolute;
display: inline-block;
animation: treeSway 3s ease-in-out infinite;
filter: drop-shadow(1px 2px 0 rgba(0,0,0,.3));
line-height: 1;
}
.tree:nth-child(even) { animation-direction: reverse; }
.map-ground {
position: absolute;
bottom: 0; left: 0; right: 0;
height: 48%;
background:
linear-gradient(180deg,
transparent 0%, transparent 54%,
#3d8a28 54%, #4a9e30 58%, #3d8a28 62%, #4aaa32 66%, #3d8a28 100%
),
linear-gradient(180deg,
#4a9e30 0%, #3d8a28 8%, #2d6e1a 10%,
#c8aa6a 10%, #b89858 30%, #c0a060 50%, #b89858 70%, #a88848 88%,
#2d6e1a 90%, #3d8a28 92%, #4a9e30 100%
);
border-top: 3px solid #2d6e1a;
}
/* Directional nudge arrow */
.map-dir-arrow {
position: absolute;
font-size: clamp(24px, 7vw, 34px);
color: var(--yellow);
text-shadow: 0 0 6px rgba(248,192,48,.8), 2px 2px 0 rgba(0,0,0,.5);
pointer-events: none;
z-index: 50;
filter: drop-shadow(0 0 4px rgba(248,192,48,.6));
right: 12px;
display: none;
bottom: -9999px;
}
.map-dir-arrow.visible {
display: block;
animation: arrowPulse .7s ease-in-out infinite;
}
/* NPC lives inside .map-inner, positioned in world-px via JS */
.map-npc-wrap { position:absolute; text-align:center; z-index: 30; }
.npc-bubble { font-size:14px; font-family:var(--font); color:var(--black); background:var(--yellow); border:2px solid var(--black); width:20px; height:20px; display:flex; align-items:center; justify-content:center; margin:0 auto 2px; animation:bounce .7s ease-in-out infinite; }
.map-npc { font-size:clamp(36px,10vw,52px); filter:drop-shadow(2px 3px 0 rgba(0,0,0,.35)); cursor:pointer; }
/* Player is fixed to the viewport centre horizontally; only Y moves */
.player-bubble { font-size:11px; font-family:var(--font); color:var(--black); background:#fff; border:2px solid var(--black); padding:0 4px; height:20px; display:none; align-items:center; justify-content:center; border-radius:2px; white-space:nowrap; position:absolute; z-index:100; left:-9999px; }
.player-bubble.visible { display:flex; animation:bounce .5s ease-in-out 3; }
.map-player {
position: absolute;
position: absolute;
width: 32px;
height: 64px;
background-image: url('./player.png');
background-repeat: no-repeat;
background-size: 768px 64px;
background-position: 0 0;
image-rendering: pixelated;
filter: drop-shadow(2px 3px 0 rgba(0,0,0,.4));
z-index: 99;
font-size: 0;
color: transparent;
}
.map-player.walk-down { animation: walkDown .32s steps(3) infinite; }
.map-player.walk-up { animation: walkUp .32s steps(3) infinite; }
.map-player.walk-left { animation: walkLeft .32s steps(3) infinite; }
.map-player.walk-right { animation: walkRight .32s steps(3) infinite; }
.map-player.idle { animation: none; background-position-x: 0px; }
/* Talk hint that floats above player when near NPC */
.map-talk-hint {
position: absolute;
font-family: var(--font);
font-size: 6px;
background: var(--yellow);
color: var(--black);
border: 2px solid var(--black);
padding: 3px 6px;
white-space: nowrap;
z-index: 11;
animation: talkBubble .6s ease-in-out infinite;
pointer-events: none;
}
/* Desktop: show "Press E", hide "Press A" */
.hint-touch { display: none; }
.hint-pc { display: inline; }
/* Touch/mobile: show "Press A", hide "Press E" */
@media (pointer: coarse) {
.hint-touch { display: inline; }
.hint-pc { display: none; }
}
/* HUD below map */
.map-hud { background:var(--dialog-bg); border-top:4px solid var(--dialog-bd); padding:8px 10px; display:flex; gap:0; flex-shrink:0; }
.hud-cell { flex:1; text-align:center; border-right:2px solid rgba(0,0,0,.15); padding:0 4px; }
.hud-cell:last-child { border-right:none; }
.hud-lbl { font-size:5.5px; color:var(--gray); margin-bottom:3px; }
.hud-val { font-size:clamp(7px,2vw,9px); color:var(--black); }
/* ─── BATTLE ─────────────────────────────────────────────── */
#screen-battle { flex-direction:column; }
.battle-scene {
display:flex; justify-content:space-between; align-items:flex-end;
padding:10px 16px 6px;
background:linear-gradient(180deg,#90c8f0 0%,#70b0e0 55%,#c8b880 55%,#b09860 100%);
flex-shrink:0; min-height:clamp(100px,22vh,150px); position:relative;
}
.battle-scene::after { content:''; position:absolute; top:55%; left:0; right:0; height:2px; background:rgba(0,0,0,.18); }
.battle-npc-side, .battle-player-side { display:flex; flex-direction:column; align-items:center; gap:4px; }
.battle-sprite { font-size:clamp(38px,11vw,56px); filter:drop-shadow(2px 3px 0 rgba(0,0,0,.3)); animation:npcFloat 2s ease-in-out infinite; }
.battle-player-side .battle-sprite { animation:bounce 1s ease-in-out infinite; }
/* Player sprite on battle screen — use sprite sheet facing down-idle */
.battle-player-sprite {
width: 48px;
height: 96px;
background-image: url('./player.png');
background-repeat: no-repeat;
background-size: 1152px 96px; /* 3× scale */
background-position-x: -48px; /* idle down frame */
background-position-y: 0;
image-rendering: pixelated;
filter: drop-shadow(2px 3px 0 rgba(0,0,0,.3));
animation: bounce 1s ease-in-out infinite;
}
.battle-name-tag { font-size:clamp(5.5px,1.6vw,7px); background:rgba(255,255,255,.8); border:2px solid var(--black); padding:2px 6px; color:var(--black); }
.battle-dialog { margin:8px; min-height:72px; }
.battle-choices { display:grid; grid-template-columns:1fr 1fr; gap:5px; padding:5px 8px; flex-shrink:0; }
/* choice button */
.choice-btn {
background:var(--dialog-bg);
border:3px solid var(--dialog-bd);
color:var(--black);
font-family:var(--font);
font-size:clamp(6px,1.7vw,7.5px);
padding:clamp(7px,2vw,10px) clamp(6px,2vw,10px);
cursor:pointer;
text-align:left;
line-height:1.8;
box-shadow:2px 2px 0 var(--darkgray);
word-break:break-word;
hyphens:auto;
transition:transform .06s, box-shadow .06s, border-color .08s;
-webkit-tap-highlight-color:transparent;
position:relative;
}
.choice-btn::before { content:attr(data-letter) ' '; color:var(--blue); }
.choice-btn:hover { background:#fffae0; border-color:var(--blue); transform:translate(-1px,-1px); box-shadow:3px 3px 0 var(--darkgray); }
.choice-btn:active { transform:translate(2px,2px); box-shadow:none; }
/* D-pad / keyboard cursor highlight */
.choice-btn.cursor:not(.confirm-btn) { animation:choiceCursor .7s ease-in-out infinite; border-color:var(--yellow) !important; background:#fffae0 !important; }
.choice-btn.confirm-btn.cursor { border-color:var(--yellow) !important; box-shadow:0 0 0 3px var(--yellow); }
.choice-btn.correct { background:#c8ffc8; border-color:var(--green); animation:correctPulse .5s ease 3; pointer-events:none; }
.choice-btn.wrong { background:#ffc8c8; border-color:var(--red); animation:wrongShake .35s ease; pointer-events:none; }
.choice-btn.disabled{ opacity:.5; pointer-events:none; }
.choice-btn.selected{ background:#c0e0ff; border-color:var(--blue); border-width:4px; box-shadow:3px 3px 0 var(--blue); color:var(--black); }
.choice-btn.selected::after { content:' ✔'; color:var(--blue); font-size:1.6em; vertical-align:middle; }
.choice-btn.confirm-btn { background:var(--blue); color:#fff; border-color:#003080; text-align:center; grid-column: 1 / -1; }
.choice-btn.confirm-btn:hover:not(:disabled) { background:#0050d0; }
.choice-btn.confirm-inactive { opacity:.4; pointer-events:none; }
.choice-btn.confirm-btn::before { content:''; }
.battle-footer { background:var(--dark-bg); border-top:3px solid var(--black); padding:clamp(4px,1.2vw,6px) 12px max(4px,var(--safe-bottom)); display:flex; justify-content:space-between; align-items:center; font-size:clamp(5.5px,1.5vw,7px); color:var(--yellow); flex-shrink:0; }
.kbd-hint { font-size:5px; color:rgba(255,255,255,.3); }
@media (max-width:480px) { .kbd-hint { display:none; } }
/* ─── RESULT ─────────────────────────────────────────────── */
#screen-result { background:rgba(0,0,0,.86); align-items:center; justify-content:center; }
.result-box { background:var(--dialog-bg); border:4px solid var(--dialog-bd); padding:clamp(16px,4.5vw,26px) clamp(12px,3.5vw,20px); width:clamp(270px,88vw,390px); text-align:center; box-shadow:6px 6px 0 rgba(0,0,0,.5); animation:pop .4s cubic-bezier(.175,.885,.32,1.275); display:flex; flex-direction:column; gap:9px; }
.result-icon { font-size:clamp(26px,8vw,40px); }
.result-label { font-size:clamp(11px,3.5vw,15px); }
.result-label.correct { color:var(--green); text-shadow:2px 2px 0 #003010; }
.result-label.wrong { color:var(--red); text-shadow:2px 2px 0 #400010; }
.result-correct-ans { font-size:clamp(6px,1.8vw,7.5px); color:var(--green); background:rgba(0,160,30,.1); border:2px solid rgba(0,160,30,.3); padding:6px; text-align:left; line-height:1.8; display:none; }
.result-correct-ans.visible { display:block; }
.result-explanation { font-size:clamp(6px,1.8vw,7.5px); color:var(--black); line-height:2; text-align:left; padding:8px; background:rgba(255,255,255,.5); border:2px solid rgba(0,0,0,.15); }
.result-pts { font-size:clamp(9px,2.8vw,12px); color:var(--yellow); text-shadow:2px 2px 0 #604000; animation:goldShimmer 2s ease-in-out infinite; }
/* ─── LEVEL UP ───────────────────────────────────────────── */
#screen-levelup { background:linear-gradient(135deg,#0f0630,#220e5e,#0a0a34); align-items:center; justify-content:center; }
.levelup-box { text-align:center; padding:clamp(16px,4vw,28px) clamp(14px,3.5vw,22px); width:90%; max-width:360px; display:flex; flex-direction:column; gap:12px; animation:fadeIn .5s ease; }
.lu-stars { font-size:clamp(7px,2vw,9px); color:var(--yellow); text-shadow:0 0 8px var(--yellow); letter-spacing:1px; }
.lu-sprite { font-size:clamp(52px,15vw,74px); animation:bounce 1s ease-in-out infinite; }
.lu-text { font-size:clamp(7.5px,2.2vw,9px); color:var(--white); line-height:2; }
.lu-badge { font-size:clamp(7px,2vw,9px); color:var(--yellow); background:rgba(255,255,255,.08); border:2px solid var(--yellow); padding:clamp(8px,2.5vw,12px); }
.lu-prog-wrap{ display:flex; flex-direction:column; gap:5px; align-items:center; }
.lu-prog-outer{ width:80%; height:12px; background:var(--black); border:2px solid var(--lightgray); overflow:hidden; }
.lu-prog-inner{ height:100%; background:var(--hp-green); transition:width .8s ease; }
.lu-prog-label{ font-size:7px; color:var(--white); }
/* ─── COMPLETE ───────────────────────────────────────────── */
#screen-complete { background:linear-gradient(180deg,#08031a 0%,#180a44 100%); overflow:hidden; }
.complete-scroll { overflow-y:auto; height:100%; -webkit-overflow-scrolling:touch; }
.complete-area { text-align:center; padding:clamp(18px,4.5vw,28px) clamp(12px,3.5vw,18px) max(22px,var(--safe-bottom)); display:flex; flex-direction:column; gap:12px; align-items:center; animation:fadeIn .7s ease; }
.complete-trophy { font-size:clamp(44px,13vw,64px); animation:goldShimmer 2s ease-in-out infinite; }
.complete-title { font-size:clamp(16px,5.5vw,24px); color:var(--yellow); text-shadow:3px 3px 0 #604000; animation:goldShimmer 2s ease-in-out infinite; }
.complete-name { font-size:clamp(9px,2.8vw,13px); color:var(--white); }
.complete-msg { font-size:clamp(6px,1.7vw,7.5px); color:rgba(255,255,255,.8); line-height:2.2; max-width:360px; text-align:left; }
.complete-stats { font-size:clamp(7px,2vw,8.5px); color:var(--yellow); background:rgba(255,255,255,.08); border:2px solid rgba(255,255,255,.15); padding:clamp(10px,3vw,16px); line-height:2.6; width:100%; max-width:340px; text-align:left; white-space:pre-line; }
.complete-badges { width:100%; max-width:340px; display:flex; flex-direction:column; gap:6px; }
.badge-row { font-size:clamp(6.5px,1.8vw,8px); color:var(--white); padding:8px 10px; border:2px solid rgba(248,192,48,.35); background:rgba(255,255,255,.04); text-align:left; }
/* ─── TOAST ──────────────────────────────────────────────── */
.toast { position:absolute; bottom:max(20px,var(--safe-bottom)); left:50%; transform:translateX(-50%); background:var(--dark-bg); border:3px solid var(--yellow); color:var(--yellow); font-family:var(--font); font-size:clamp(6.5px,1.8vw,8px); padding:10px 18px; z-index:950; animation:slideUp .3s ease; white-space:nowrap; max-width:90%; overflow:hidden; text-overflow:ellipsis; }
.hidden { display:none !important; }