/* GeoQuest World Explorer — standalone RPG page (no effect on main app) */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  background: #0b1026;
  font-family: 'Baloo 2', 'Nunito', system-ui, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
#game { position: fixed; inset: 0; min-width: 0; min-height: 0; overflow: hidden; }
#world { touch-action: none; overscroll-behavior: none; -webkit-user-select: none; user-select: none; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* map colors */
.c { fill: #3d5a3d; stroke: #a8c8a8; stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .25s; }
.c:hover { fill: #55804f; }
.c.visited { fill: #4c7a4c; }
.c.visited::after { }
.c.current { fill: #d9a441 !important; stroke: #ffd97a; }

/* city labels */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.clabel {
  position: absolute; transform: translate(-50%, -120%);
  font-weight: 800; font-size: 13px; letter-spacing: .02em;
  color: #fff; text-shadow: 0 0 4px #000, 0 1px 3px #000, 0 0 2px #000;
  white-space: nowrap; opacity: .95;
}
.clabel small { font-weight: 600; opacity: .85; font-size: 11px; }

/* player + entities */
#player { cursor: grab; }
#player.moving #player-emoji, #player.moving #player-mount { animation: player-bob .5s ease-in-out infinite; }
#player.sprint #player-emoji, #player.sprint #player-mount { animation-duration: .3s; }
@keyframes player-bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
#player.spawned #player-ring { animation: spawn-pulse 1.7s ease-out 2; transform-origin: center; }
@keyframes spawn-pulse { 0% { transform: scale(.5); opacity: 1; } 80% { transform: scale(1.9); opacity: .4; } 100% { transform: scale(1.9); opacity: 0; } }

/* spawn drop FX: BOOM rings + flying stars + landing text (HTML overlay = constant screen size) */
#spawn-fx { position: absolute; inset: 0; pointer-events: none; z-index: 19; }
#spawn-fx.hidden { display: none; }
#spawn-fx .sf-ring { position: absolute; width: 140px; height: 140px; margin: -70px; border: 6px solid rgba(255,217,122,.95); border-radius: 50%; transform: scale(.2); box-shadow: 0 0 30px rgba(255,217,122,.55); animation: sf-ring .75s ease-out forwards; }
#spawn-fx .sf-ring2 { border-color: rgba(255,110,110,.9); animation-delay: .14s; }
@keyframes sf-ring { to { transform: scale(2); opacity: 0; } }
#spawn-fx .sf-star { position: absolute; font-size: 32px; transform: translate(-50%,-50%); animation: sf-fly .9s ease-out forwards; }
@keyframes sf-fly { 0% { transform: translate(-50%,-50%) scale(.3); opacity: 1; } 100% { transform: translate(calc(-50% + var(--dx,0px)), calc(-50% + var(--dy,-90px))) scale(1.3); opacity: 0; } }
#spawn-fx .sf-boom { position: absolute; font-size: 46px; font-weight: 900; color: #ffd97a; text-shadow: 0 3px 14px rgba(0,0,0,.8), 0 0 30px rgba(255,217,122,.6); transform: translate(-50%,-50%); white-space: nowrap; letter-spacing: 2px; animation: sf-boom .95s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes sf-boom { 0% { transform: translate(-50%,-50%) scale(.2); opacity: 0; } 35% { transform: translate(-50%,-50%) scale(1.35); opacity: 1; } 70% { transform: translate(-50%,-50%) scale(1); opacity: 1; } 100% { transform: translate(-50%,-50%) scale(1.05); opacity: 0; } }
#spawn-fx .sf-land { position: absolute; font-size: 18px; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.85); white-space: nowrap; transform: translate(-50%, 26px); animation: sf-land 3.2s ease-out forwards; }
@keyframes sf-land { 0% { opacity: 0; transform: translate(-50%, 44px); } 12% { opacity: 1; transform: translate(-50%, 26px); } 85% { opacity: 1; } 100% { opacity: 0; } }
.footstep { animation: step-fade 1.4s linear forwards; pointer-events: none; }
@keyframes step-fade { from { opacity: .8; } to { opacity: 0; } }
#route-line { stroke: rgba(255,217,122,.85); stroke-width: 5; stroke-dasharray: 18 14; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: route-dash 1s linear infinite; pointer-events: none; }
@keyframes route-dash { to { stroke-dashoffset: -32; } }
.dust { fill: rgba(255,255,255,.5); animation: dust-fade .7s ease-out forwards; pointer-events: none; }
@keyframes dust-fade { to { opacity: 0; transform: translateY(10px) scale(1.8); } }
.contrail { stroke: rgba(255,255,255,.65); stroke-width: 3; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: step-fade 1.2s linear forwards; pointer-events: none; }
#fab-mount b { background: #7dff8a; color: #06301a; }
.decor { opacity: .8; pointer-events: none; }   /* font-size is set per-zoom in applyCam (constant on-screen size) */
.cloud { pointer-events: none; }
.decor, .cloud, #route-line { }

/* minimap */
#minimap {
  position: absolute; top: calc(96px + env(safe-area-inset-top)); right: 12px; z-index: 18;
  width: 118px; height: 59px; border-radius: 8px; cursor: pointer;
  background:
    radial-gradient(ellipse at 68% 62%, #3d5a3d 0 12%, transparent 13%),
    radial-gradient(ellipse at 30% 40%, #3d5a3d 0 16%, transparent 17%),
    radial-gradient(ellipse at 78% 30%, #3d5a3d 0 8%, transparent 9%),
    linear-gradient(180deg, #12305e, #0d2449);
  border: 2px solid rgba(255,255,255,.35); box-shadow: 0 4px 14px rgba(0,0,0,.5);
  overflow: hidden;
}
.mm-view { position: absolute; border: 1.5px solid rgba(255,255,255,.9); border-radius: 2px; pointer-events: none; }
.mm-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: #ffd97a; box-shadow: 0 0 6px #ffd97a; transform: translate(-50%, -50%); pointer-events: none; }
.mm-mon { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #ff6b6b; transform: translate(-50%, -50%); pointer-events: none; }
.mm-boss { width: 9px; height: 9px; background: #ffd97a; box-shadow: 0 0 8px #ffd97a; }
.mm-view, .mm-dot, .mm-mon { will-change: left, top; }
.ent { cursor: pointer; }
.ent .body { animation: bob 1.6s ease-in-out infinite; }
.ent.chest .body { animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.spawn { animation: spawn-pop .5s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes spawn-pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.shadow { fill: rgba(0,0,0,.35); }

/* floating combat text */
.ftext { font-size: 20px; font-weight: 900; pointer-events: none; }
.ftext.dmg { fill: #ff5a5a; }
.ftext.heal { fill: #7dff8a; }
.ftext.xp { fill: #ffd700; }
.ftext.float { animation: ftext-up 1.1s ease-out forwards; }
@keyframes ftext-up { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-46px); opacity: 0; } }

/* sparkles on collect */
.spark { fill: #ffe066; pointer-events: none; }
.spark.fly { animation: spark-fly .8s ease-out forwards; }
@keyframes spark-fly { from { transform: translate(0,0) scale(1); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }

/* HUD */
#hud {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: flex-start; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}
#hud > * { pointer-events: auto; }
#hud-avatar {
  width: 56px; height: 56px; border-radius: 18px; border: 3px solid #ffd97a;
  background: linear-gradient(160deg, #1e2a55, #10182f);
  font-size: 30px; cursor: pointer; flex: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
#hud-bars { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
#hud-row1 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#hud-name, #hud-lv, #hud-coins {
  background: rgba(10,15,34,.78); border: 1px solid rgba(255,255,255,.22);
  color: #fff; border-radius: 10px; padding: 4px 10px; font-weight: 800; font-size: 13px;
  white-space: nowrap; backdrop-filter: blur(4px);
}
#hud-lv { color: #ffd97a; }
#hud-row1 button {
  width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(10,15,34,.78); color: #fff; font-size: 18px; cursor: pointer; backdrop-filter: blur(4px);
}
#hud-row1 button.off { filter: grayscale(1) brightness(.7); }
.bar {
  position: relative; height: 20px; border-radius: 10px; overflow: hidden;
  background: rgba(10,15,34,.78); border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(4px);
}
.bar i { position: absolute; inset: 0; width: 50%; transition: width .35s ease; border-radius: 10px; }
.bar.hp i { background: linear-gradient(90deg, #e04f4f, #ff7b5a); }
.bar.xp i { background: linear-gradient(90deg, #2e9e5b, #6fd18b); }
.bar span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 800; text-shadow: 0 1px 2px #000;
}

/* country banner */
#banner {
  position: absolute; top: calc(84px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 15; display: flex; align-items: center; gap: 10px;
  background: rgba(10,15,34,.88); border: 2px solid #ffd97a; border-radius: 16px;
  padding: 10px 18px; color: #fff; backdrop-filter: blur(6px);
  box-shadow: 0 6px 24px rgba(0,0,0,.5);
  animation: banner-in .35s cubic-bezier(.34,1.56,.64,1);
  max-width: min(92vw, 480px);
  cursor: pointer;
}
@keyframes banner-in { from { transform: translateX(-50%) translateY(-16px) scale(.9); opacity: 0; } }
#banner.hidden { display: none; }
#banner-flag { font-size: 34px; }
#banner-name { font-size: 18px; display: block; }
#banner-cap { font-size: 12px; color: #ffd97a; display: block; }
#banner-trail { font-size: 10px; color: rgba(255,255,255,.6); display: block; letter-spacing: .5px; margin-top: 1px; }

/* toasts */
#toasts {
  position: absolute; top: calc(204px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 30; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none;
  width: max-content; max-width: 92vw;
}
.toast {
  background: rgba(10,15,34,.92); color: #fff; border-radius: 12px; padding: 8px 16px;
  font-size: 14px; font-weight: 700; border: 1px solid rgba(255,255,255,.25);
  animation: toast-in .3s ease, toast-out .4s ease 2.4s forwards; backdrop-filter: blur(4px);
  max-width: 92vw; text-align: center;
}
@keyframes toast-in { from { transform: translateY(-12px) scale(.92); opacity: 0; } }
@keyframes toast-out { to { transform: translateY(-8px); opacity: 0; } }

/* joystick */
#joy {
  position: absolute; left: 22px; bottom: calc(22px + env(safe-area-inset-bottom));
  width: 130px; height: 130px; border-radius: 50%; z-index: 20;
  background: rgba(255,255,255,.09); border: 2px solid rgba(255,255,255,.28);
  display: none; touch-action: none;
}
#joy.on { display: block; }
#joy-knob {
  position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.35); border: 2px solid rgba(255,255,255,.5);
  transform: translate(-50%, -50%); pointer-events: none;
}
@media (pointer: fine) { #joy.on { opacity: .55; } }

/* fabs */
#fabs { position: absolute; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20; display: flex; flex-direction: column; gap: 10px; }
#fabs button {
  width: 62px; height: 62px; border-radius: 50%; border: 2px solid #ffd97a;
  background: linear-gradient(160deg, #1e2a55, #10182f); color: #fff; font-size: 26px;
  cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.5); position: relative;
}
#fabs button b {
  position: absolute; top: -4px; right: -4px; background: #ffd97a; color: #10182f;
  min-width: 22px; height: 22px; border-radius: 11px; font-size: 12px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px; font-weight: 900;
}

/* modal */
#modal {
  position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center;
  background: rgba(5,8,20,.62); backdrop-filter: blur(3px); padding: 14px;
}
#modal.hidden { display: none; }
#modal-card {
  background: linear-gradient(170deg, #1b2450, #0e1430);
  border: 2px solid rgba(255,255,255,.28); border-radius: 22px;
  max-width: 520px; width: 100%; max-height: 84vh; overflow-y: auto;
  padding: 22px; color: #fff; box-shadow: 0 12px 44px rgba(0,0,0,.65);
  animation: card-in .3s cubic-bezier(.34,1.56,.64,1);
  position: relative;
}
#modal-card.shake { animation: card-shake .45s; }
@keyframes card-shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-12px); } 40% { transform: translateX(10px); } 60% { transform: translateX(-8px); } 80% { transform: translateX(6px); } }
@keyframes card-in { from { transform: translateY(24px) scale(.94); opacity: 0; } }
#modal-card h2 { font-size: 22px; margin-bottom: 8px; text-align: center; }
#modal-card .sub { text-align: center; opacity: .75; font-size: 13px; margin-bottom: 12px; }
#modal-card .big-emoji { font-size: 64px; text-align: center; margin: 6px 0 10px; animation: bob 1.8s ease-in-out infinite; }
#modal-card .hpbar { height: 16px; border-radius: 8px; background: rgba(0,0,0,.4); overflow: hidden; margin: 8px 0; }
#modal-card .hpbar i { display: block; height: 100%; background: linear-gradient(90deg, #e04f4f, #ff7b5a); transition: width .4s; }
#modal-card .row { display: flex; gap: 8px; margin: 8px 0; font-size: 14px; font-weight: 700; }
#modal-card .row span { background: rgba(255,255,255,.1); border-radius: 8px; padding: 4px 10px; }
.mbtn {
  display: block; width: 100%; min-height: 54px; border-radius: 14px; border: 0;
  font-family: inherit; font-size: 17px; font-weight: 900; cursor: pointer;
  background: linear-gradient(160deg, #ffd97a, #ffb14a); color: #3a2408; margin-top: 10px;
  box-shadow: 0 3px 0 #c97f1e; transition: transform .08s;
}
.mbtn:active { transform: translateY(2px); box-shadow: 0 1px 0 #c97f1e; }
.mbtn.ghost { background: rgba(255,255,255,.12); color: #fff; box-shadow: 0 3px 0 rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.25); }
.mbtn.good { background: linear-gradient(160deg, #7dff8a, #38c46a); color: #06301a; box-shadow: 0 3px 0 #1f8a48; }
.mbtn.fight { font-size: 20px; background: linear-gradient(135deg, #ff5d5d, #ff9d5c); color: #3d0f00; box-shadow: 0 4px 0 #b03c1a; }

/* boss VS entrance screen (Pokemon-GO style) */
.vs-wrap { text-align: center; padding: 6px 0; }
.vs-stamp { font-size: 28px; font-weight: 900; color: #ff5d5d; letter-spacing: 4px; animation: stamp-in .5s cubic-bezier(.34,1.56,.64,1); text-shadow: 0 0 18px rgba(255,93,93,.6); }
@keyframes stamp-in { 0% { transform: scale(3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.vs-boss { font-size: 78px; line-height: 1.2; animation: vs-slide .6s cubic-bezier(.34,1.56,.64,1); filter: drop-shadow(0 8px 22px rgba(255,93,93,.55)); }
@keyframes vs-slide { 0% { transform: translateY(-70px) scale(.2); opacity: 0; } 60% { transform: translateY(8px) scale(1.18); } 100% { transform: translateY(0) scale(1); } }

/* boss battle zone */
.boss-zone { text-align: center; }
.boss-emoji { font-size: 60px; line-height: 1.15; transition: transform .12s; filter: drop-shadow(0 4px 12px rgba(255,93,93,.4)); }
.boss-emoji.hit { transform: translateX(-16px) rotate(-10deg) scale(.92); }
.boss-emoji.strike { transform: translateX(80px) scale(1.25); }
.boss-goal { margin: 8px 0 4px; font-weight: 800; color: #ffd97a; font-size: 15px; letter-spacing: 1px; }
#btl-pips { font-size: 17px; }

/* attack FX layer inside the battle modal */
#fx-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.fx-throw { position: absolute; left: 8%; top: 58%; font-size: 42px; animation: throw-fly .42s cubic-bezier(.25,.7,.3,1) forwards; }
@keyframes throw-fly { 0% { left: 8%; top: 58%; transform: rotate(0) scale(.6); } 100% { left: 44%; top: 4%; transform: rotate(320deg) scale(1.25); } }
.fx-hit { position: absolute; left: 41%; top: 0%; font-size: 56px; animation: hit-pop .5s ease-out forwards; }
@keyframes hit-pop { 0% { transform: scale(.3); opacity: 1; } 60% { transform: scale(1.7); } 100% { transform: scale(1.2); opacity: 0; } }
.fx-dmg { position: absolute; left: 42%; top: 14%; font-size: 22px; font-weight: 900; color: #ffd97a; text-shadow: 0 2px 6px rgba(0,0,0,.7); animation: dmg-up 1s ease-out forwards; }
@keyframes dmg-up { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(-48px); opacity: 0; } }
.fx-ko { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 38px; font-weight: 900; color: #ffd97a; text-shadow: 0 3px 12px rgba(0,0,0,.8); animation: ko-in .5s cubic-bezier(.34,1.56,.64,1) forwards; }
@keyframes ko-in { 0% { transform: scale(3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.fx-burst { position: absolute; font-size: 24px; animation: burst-fly .95s ease-out forwards; }
@keyframes burst-fly { to { transform: translate(var(--bx), var(--by)) rotate(120deg); opacity: 0; } }
.fx-atk { position: absolute; font-size: 30px; animation: atk-drift .8s ease-out forwards; }
@keyframes atk-drift { to { transform: translate(var(--ax), var(--ay)) scale(.4); opacity: 0; } }

/* country knowledge card (tap the banner) */
.cc-icons { text-align: center; font-size: 30px; letter-spacing: 6px; margin: 6px 0 10px; }
.cc-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 2px; border-bottom: 1px solid rgba(255,255,255,.1); font-size: 14.5px; }
.cc-row span { opacity: .75; flex: none; }
.cc-row b { text-align: right; font-weight: 800; }

/* completed-country markers: outer anchor stays on the country; inner star bobs safely */
.conq-anchor { pointer-events: none; }
.conq-crown { pointer-events: none; animation: star-bob 2.2s ease-in-out infinite; filter: drop-shadow(0 0 8px rgba(255,217,122,.9)); }
.conq-crown text { fill: #ffd97a; stroke: #171b35; stroke-width: 2.5; paint-order: stroke; font-weight: 900; }
.conq-crown .conq-name { fill: #fff; stroke: #171b35; stroke-width: 2.5; paint-order: stroke; font-size: .78em; font-weight: 800; }
.ans { display: block; width: 100%; min-height: 52px; margin-top: 8px; border-radius: 12px; border: 2px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.1); color: #fff; font-family: inherit; font-size: 15px; font-weight: 800; cursor: pointer; transition: background .15s; }
.ans:hover { background: rgba(255,255,255,.2); }
.ans.correct { background: #2e9e5b; border-color: #7dff8a; }
.ans.wrong { background: #a83a3a; border-color: #ff8a8a; }
.ans:disabled { opacity: .85; cursor: default; }

/* backpack & collection */
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; margin-top: 8px; }
.bag-item { background: rgba(255,255,255,.08); border-radius: 12px; padding: 8px 4px; text-align: center; border: 1px solid rgba(255,255,255,.14); }
.bag-item .e { font-size: 26px; display: block; }
.bag-item .t { font-size: 10px; line-height: 1.25; opacity: .85; display: block; margin-top: 2px; }
.bag-item small { color: #ffd97a; font-size: 9px; }
.bag-sec { margin-top: 12px; font-size: 15px; font-weight: 900; color: #ffd97a; }
.stat-line { display: flex; justify-content: space-between; font-size: 14px; padding: 4px 2px; opacity: .92; }

/* title screen */
#title-screen {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 30%, #22307a 0%, #0b1026 65%);
  padding: 16px; overflow-y: auto;
}
#title-screen.hidden { display: none; }
#title-card { text-align: center; max-width: 440px; width: 100%; color: #fff; }
#title-logo { font-size: 72px; animation: bob 2.6s ease-in-out infinite; }
#title-h1 { font-size: clamp(26px, 6vw, 38px); margin: 6px 0 2px; color: #ffd97a; text-shadow: 0 2px 0 #8a5a00, 0 6px 18px rgba(0,0,0,.5); }
#title-sub { opacity: .8; font-size: 14px; margin-bottom: 18px; }
#profile-panel { margin: 0 auto 14px; padding: 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 16px; background: rgba(0,0,0,.18); text-align: left; }
#profile-heading { color: #ffd97a; font-size: 14px; font-weight: 900; margin-bottom: 8px; }
#profile-list { display: grid; gap: 7px; max-height: 142px; overflow-y: auto; }
.profile-row { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px; border-radius: 10px; border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.07); color: #fff; cursor: pointer; font: inherit; text-align: left; }
.profile-row.selected { border-color: #ffd97a; background: rgba(255,217,122,.16); }
.profile-row .profile-main { flex: 1; min-width: 0; }
.profile-row .profile-main strong, .profile-row .profile-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-row .profile-main small { opacity: .7; font-size: 11px; margin-top: 1px; }
.profile-delete { width: 32px; height: 32px; flex: none; border: 0; border-radius: 8px; background: rgba(255,100,100,.14); color: #ffb0b0; cursor: pointer; font: inherit; }
#btn-new-profile { width: 100%; min-height: 38px; margin-top: 9px; border: 1px dashed rgba(255,217,122,.65); border-radius: 10px; background: transparent; color: #ffd97a; font: inherit; font-weight: 800; cursor: pointer; }
#char-picker { display: flex; gap: 10px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
#char-picker button {
  width: 68px; height: 68px; font-size: 36px; border-radius: 18px; cursor: pointer;
  border: 3px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); transition: all .15s;
}
#char-picker button.sel { border-color: #ffd97a; background: rgba(255,217,122,.18); transform: scale(1.08); box-shadow: 0 0 18px rgba(255,217,122,.35); }
#char-name {
  width: 100%; min-height: 50px; border-radius: 14px; border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.1); color: #fff; font-family: inherit; font-size: 16px; font-weight: 700;
  text-align: center; margin-bottom: 12px; outline: none;
}
#char-name::placeholder { color: rgba(255,255,255,.5); }
#btn-start, #btn-continue {
  width: 100%; min-height: 58px; border-radius: 16px; border: 0; cursor: pointer;
  font-family: inherit; font-size: 19px; font-weight: 900;
  background: linear-gradient(160deg, #ffd97a, #ffb14a); color: #3a2408;
  box-shadow: 0 4px 0 #c97f1e, 0 8px 24px rgba(255,177,74,.35); margin-top: 4px;
}
#btn-continue { background: linear-gradient(160deg, #7db8ff, #4a7de0); color: #0a1a3a; box-shadow: 0 4px 0 #2a4a9a; margin-top: 10px; }
#btn-start:active, #btn-continue:active { transform: translateY(3px); box-shadow: 0 1px 0 #c97f1e; }
#title-continue { margin-top: 10px; }

/* lang chip floating top-right under hud */
#btn-lang {
  position: absolute; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 25;
  width: 46px; height: 40px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25);
  background: rgba(10,15,34,.78); color: #fff; font-weight: 900; font-size: 13px; cursor: pointer;
  backdrop-filter: blur(4px);
}
#hud-row1 button, #btn-lang { -webkit-user-select: none; }

@media (max-width: 640px) {
  #hud-avatar { width: 48px; height: 48px; font-size: 26px; border-radius: 15px; }
  #banner-name { font-size: 15px; }
  #banner { padding: 8px 14px; }
  .clabel { font-size: 11px; }
  #title-logo { font-size: 56px; }
  .dex-item .e { font-size: 22px; }
}

/* daily-quest alert dot */
#fabs button .dot {
  position: absolute; top: -5px; left: -5px; min-width: 24px; height: 24px; border-radius: 12px;
  background: #ff4d4d; color: #fff; font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
  box-shadow: 0 0 0 2px rgba(255,77,77,.35); animation: dot-pulse 1.6s ease-in-out infinite;
}
#fabs button .dot.hidden { display: none; }
@keyframes dot-pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* treasure dex */
.dex-bar {
  position: relative; height: 26px; border-radius: 13px; background: rgba(0,0,0,.4);
  overflow: hidden; margin: 6px 0 12px; border: 1px solid rgba(255,255,255,.2);
}
.dex-bar i { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #ffd97a, #ff9a3c); transition: width .6s ease; }
.dex-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px; color: #fff; text-shadow: 0 1px 2px #000; }
.dex-page { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.dex-page.hidden { display: none; }
.dex-item {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 8px 4px; text-align: center; min-height: 74px;
}
.dex-item .e { font-size: 26px; display: block; }
.dex-item .t { font-size: 10px; line-height: 1.25; display: block; margin-top: 2px; font-weight: 700; }
.dex-item small { font-size: 10px; opacity: .8; }
.dex-item.own { border-color: rgba(255,217,122,.65); background: rgba(255,217,122,.12); }
.dex-item.miss { opacity: .55; filter: grayscale(.4); }

/* daily quests */
.dq { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.16); border-radius: 14px; padding: 12px; margin-top: 10px; }
.dq.done { opacity: .55; }
.dq-txt { font-weight: 800; font-size: 15px; margin-bottom: 8px; }
.dq-bar { position: relative; height: 18px; border-radius: 9px; background: rgba(0,0,0,.4); overflow: hidden; }
.dq-bar i { position: absolute; inset: 0; width: 0; background: linear-gradient(90deg, #6fd18b, #2e9e5b); transition: width .4s; }
.dq-bar span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 900; color: #fff; text-shadow: 0 1px 2px #000; }
.dq-claimed { display: block; text-align: center; color: #7dff8a; font-weight: 900; margin-top: 6px; }

/* day-night + weather */
#env-sun { filter: drop-shadow(0 0 30px rgba(255,217,77,.8)); animation: sun-pulse 4s ease-in-out infinite; pointer-events: none; }
.env-moon { filter: drop-shadow(0 0 22px rgba(232,236,255,.9)); pointer-events: none; }
@keyframes sun-pulse { 0%,100% { opacity: .55; } 50% { opacity: .75; } }
.env-rain { stroke: rgba(170,200,255,.55); stroke-width: 2.5; stroke-linecap: round; vector-effect: non-scaling-stroke; animation: rain-fall .55s linear forwards; pointer-events: none; }
@keyframes rain-fall { to { transform: translateY(140px); opacity: 0; } }
.env-snow { fill: rgba(255,255,255,.85); animation: snow-fall 2.6s linear forwards; pointer-events: none; }
@keyframes snow-fall { to { transform: translateY(120px) translateX(26px); opacity: 0; } }
#env-chip, #wth-chip {
  position: absolute; z-index: 17; pointer-events: none;
  background: rgba(10,15,34,.72); color: #fff; border-radius: 10px; padding: 4px 10px;
  font-size: 12px; font-weight: 800; border: 1px solid rgba(255,255,255,.22); backdrop-filter: blur(4px);
}
#env-chip { top: calc(140px + env(safe-area-inset-top)); right: 12px; }
#wth-chip { top: calc(170px + env(safe-area-inset-top)); right: 12px; }
#env-chip:empty, #wth-chip:empty { display: none; }

/* mission tracker + marker */
#tracker {
  position: absolute; top: calc(150px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%);
  z-index: 16; display: flex; align-items: center; gap: 8px;
  background: rgba(10,15,34,.88); border: 1.5px solid #ffd97a; border-radius: 14px;
  padding: 7px 12px; color: #fff; backdrop-filter: blur(6px);
  cursor: pointer; max-width: min(94vw, 520px); box-shadow: 0 4px 16px rgba(0,0,0,.45);
}
#tracker.hidden { display: none; }
#tracker small { display: block; font-size: 10px; color: #ffd97a; font-weight: 800; opacity: .95; }
#tracker .tr-main { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tr-arrow { display: inline-block; color: #7dff8a; font-size: 15px; transition: transform .3s; }
#tr-go { border: 0; background: rgba(255,217,122,.2); border-radius: 9px; color: #fff;
  font-size: 15px; width: 32px; height: 32px; cursor: pointer; flex: none; }
#mstar { pointer-events: none; animation: star-bob 1.6s ease-in-out infinite; }
@keyframes star-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.pulse-ring { animation: pulse-ring 2s ease-out infinite; transform-origin: center; }
@keyframes pulse-ring { 0% { opacity: .8; transform: scale(.6); } 70% { opacity: 0; transform: scale(1.5); } 100% { opacity: 0; } }
.mm-star { position: absolute; transform: translate(-50%, -50%); font-size: 10px; filter: drop-shadow(0 0 3px #ffd97a); pointer-events: none; }
.ent.icon .gold-ring { animation: ring-spin 3.5s linear infinite; }
@keyframes ring-spin { to { stroke-dashoffset: -96; } }
.ent.icon .body { filter: drop-shadow(0 0 12px #ffd97a) drop-shadow(0 0 24px rgba(255,217,122,.5)); animation: bob 1.4s ease-in-out infinite; }

/* boss battle */
.boss-goal {
  text-align: center; font-size: 17px; font-weight: 900; color: #ffd97a;
  background: rgba(255,217,122,.12); border: 1px solid rgba(255,217,122,.45);
  border-radius: 12px; padding: 8px; margin: 8px 0; letter-spacing: 2px;
}
.ent.boss .crown { animation: crown-bounce 1.4s ease-in-out infinite; }
@keyframes crown-bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
