/* POKÉBALL CATCH — styles */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; background: #0b1020; font-family: "Nunito Sans", "Segoe UI", system-ui, sans-serif; color: #fff; }
.hidden { display: none !important; }
.pixel { image-rendering: pixelated; image-rendering: crisp-edges; }

/* ============ LOGIN / TITLE SCREEN ============ */
#loginScreen { position: fixed; inset: 0; z-index: 50; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.login-bg { position: absolute; inset: 0; background: radial-gradient(120% 90% at 50% 0%, #1d3a6e 0%, #0e1a33 55%, #070b18 100%); }
.login-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(60% 45% at 50% 88%, rgba(224, 64, 64, .22), transparent 70%); }
#artStrip { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: space-around; opacity: .5; pointer-events: none; }
#artStrip img { height: 62vh; max-width: 26vw; object-fit: contain; filter: drop-shadow(0 20px 40px rgba(0,0,0,.6)); animation: kenburns 24s ease-in-out infinite alternate; }
#artStrip img:nth-child(2) { animation-delay: -8s; }
#artStrip img:nth-child(3) { animation-delay: -16s; }
#artStrip img:nth-child(4) { animation-delay: -4s; height: 40vh; }
@keyframes kenburns { from { transform: scale(1) translateY(0); } to { transform: scale(1.08) translateY(-14px); } }
.login-orb { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; animation: drift 14s ease-in-out infinite alternate; }
.orb1 { width: 420px; height: 420px; background: #e04040; top: -120px; left: -80px; }
.orb2 { width: 360px; height: 360px; background: #2e6bc2; bottom: -100px; right: -60px; animation-delay: -7s; }
@keyframes drift { from { transform: translate(0,0); } to { transform: translate(40px, 30px); } }

.login-card { position: relative; z-index: 2; width: min(560px, 94vw); max-height: 96vh; overflow-y: auto; text-align: center; padding: 26px 28px 20px; background: rgba(10, 16, 34, .72); border: 1px solid rgba(255,255,255,.14); border-radius: 28px; backdrop-filter: blur(14px); box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.15); animation: cardIn .7s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.beta-badge { display: inline-block; padding: 4px 12px; border-radius: 999px; background: linear-gradient(90deg, #ffb020, #ff7847); color: #231303; font-weight: 800; font-size: 12px; letter-spacing: 2px; box-shadow: 0 4px 14px rgba(255, 150, 40, .5); }

/* --- HERO POKÉ BALL: the exact in-game item art, front and center --- */
.hero-ball-wrap { position: relative; width: 210px; height: 210px; margin: 14px auto 2px; }
.hero-ball-glow { position: absolute; inset: 6%; border-radius: 50%; background: radial-gradient(circle, rgba(255,80,80,.55) 0%, rgba(255,80,80,.18) 45%, transparent 70%); animation: glowPulse 2.6s ease-in-out infinite; }
@keyframes glowPulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: .6; } }
.hero-ball-ring { position: absolute; inset: 0; border-radius: 50%; border: 2px dashed rgba(255,255,255,.35); animation: spinSlow 26s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.hero-ball { width: 190px; height: 190px; position: absolute; inset: 10px; filter: drop-shadow(0 18px 24px rgba(0,0,0,.6)); animation: ballFloat 3.2s ease-in-out infinite; cursor: pointer; }
@keyframes ballFloat { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }
.hero-ball:active { animation: ballShake .4s ease-in-out; }
@keyframes ballShake { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.hero-ball-shadow { width: 120px; height: 18px; margin: 0 auto; border-radius: 50%; background: rgba(0,0,0,.45); filter: blur(6px); animation: shadowPulse 3.2s ease-in-out infinite; }
@keyframes shadowPulse { 0%,100% { transform: scale(1); opacity: .5; } 50% { transform: scale(.72); opacity: .3; } }
.hero-ball-caption { font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: rgba(255,255,255,.55); margin-top: 8px; }

.logo { font-size: clamp(42px, 8vw, 64px); font-weight: 900; line-height: .95; letter-spacing: 1px; margin-top: 6px; text-shadow: 0 4px 0 rgba(0,0,0,.35), 0 10px 30px rgba(0,0,0,.5); }
.logo .logo-o { display: inline-block; width: .78em; height: .78em; vertical-align: -0.06em; }
.logo .logo-o img { width: 100%; height: 100%; }
.logo-red { background: linear-gradient(180deg, #ff6b6b, #e04040 55%, #b02020); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tagline { margin-top: 6px; font-size: 15px; color: rgba(255,255,255,.85); letter-spacing: .5px; }
.lang-row { display: flex; gap: 8px; justify-content: center; margin: 16px 0 4px; }
.lang-pill { padding: 6px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.06); color: #fff; font-weight: 700; cursor: pointer; transition: .15s; }
.lang-pill.active { background: #e04040; border-color: #e04040; box-shadow: 0 4px 14px rgba(224,64,64,.5); }
.login-form { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.login-form label { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: rgba(255,255,255,.6); text-align: left; }
#nameInput { padding: 13px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.08); color: #fff; font-size: 17px; font-weight: 700; outline: none; transition: .15s; }
#nameInput:focus { border-color: #ff6b6b; box-shadow: 0 0 0 3px rgba(224,64,64,.35); background: rgba(255,255,255,.12); }
#nameInput::placeholder { color: rgba(255,255,255,.4); font-weight: 400; }
.gender-row { display: flex; gap: 10px; }
.gender-btn { flex: 1; padding: 11px; border-radius: 14px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.06); color: #fff; font-size: 15px; font-weight: 700; cursor: pointer; transition: .15s; }
.gender-btn.active { background: linear-gradient(180deg, #2e6bc2, #1d4a8a); border-color: #5a9ae0; box-shadow: 0 4px 14px rgba(46,107,194,.5); }
.btn { padding: 14px 22px; border-radius: 16px; border: none; font-size: 17px; font-weight: 800; letter-spacing: 1px; cursor: pointer; transition: .15s; color: #fff; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); }
.btn:hover { transform: translateY(-1px); }
.btn.primary { background: linear-gradient(180deg, #ff5a5a, #d02020); box-shadow: 0 10px 26px rgba(224,64,64,.5), inset 0 1px 0 rgba(255,255,255,.35); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 19px; }
.btn.primary:hover { box-shadow: 0 14px 32px rgba(224,64,64,.65), inset 0 1px 0 rgba(255,255,255,.35); }
.btn.primary .btn-ball { width: 26px; height: 26px; }
.btn.danger { background: rgba(224,64,64,.18); border-color: rgba(224,64,64,.5); }
.ball-variants { display: flex; gap: 10px; justify-content: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.1); }
.ball-variants img { width: 34px; height: 34px; opacity: .85; transition: .15s; }
.ball-variants img:hover { transform: translateY(-4px) scale(1.15); opacity: 1; }
.world-preview { margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid rgba(255,255,255,.15); position: relative; }
.world-preview img { width: 100%; display: block; }
.world-preview span { position: absolute; left: 10px; bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 6px rgba(0,0,0,.8); }
.login-foot { margin-top: 14px; font-size: 11px; line-height: 1.5; color: rgba(255,255,255,.45); }

/* ============ GAME UI ============ */
#gameUI { position: fixed; inset: 0; }
#gameCanvas { width: 100%; height: 100%; display: block; touch-action: none; }
#overlayLayer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.floater { position: absolute; font-weight: 900; font-size: 18px; text-shadow: 0 2px 0 rgba(0,0,0,.7), 0 0 8px rgba(0,0,0,.5); transform: translate(-50%, -100%); white-space: nowrap; }
.nametag { position: absolute; font-size: 12px; font-weight: 800; color: #fff; text-shadow: 0 1px 3px #000; background: rgba(0,0,0,.45); padding: 1px 7px; border-radius: 999px; transform: translate(-50%, -100%); white-space: nowrap; }
.wild-hp { position: absolute; width: 46px; height: 6px; background: rgba(0,0,0,.6); border-radius: 3px; transform: translate(-50%, -100%); overflow: hidden; }
.wild-hpfill { height: 100%; background: linear-gradient(90deg, #ff5a5a, #ff8a5a); transition: width .15s; }
.hud { position: absolute; z-index: 5; }
#questPanel { top: 12px; left: 12px; width: 240px; background: rgba(8, 12, 28, .72); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; padding: 10px 12px; backdrop-filter: blur(8px); }
#questPanel h3 { font-size: 12px; letter-spacing: 2px; color: #ffd23f; margin-bottom: 6px; }
.quest { margin-bottom: 8px; }
.quest .qtitle { font-weight: 800; font-size: 13px; }
.quest.active .qtitle { color: #8fd8ff; }
.quest.done { opacity: .55; }
.qstep { font-size: 12px; color: rgba(255,255,255,.85); margin-left: 4px; }
.qstep.done { color: rgba(255,255,255,.5); text-decoration: line-through; }
#mapTitle { top: 12px; left: 50%; transform: translateX(-50%); font-size: 19px; font-weight: 900; letter-spacing: 1px; text-shadow: 0 2px 8px rgba(0,0,0,.8); background: rgba(8,12,28,.55); padding: 6px 18px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); white-space: nowrap; }
#topRight { top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#minimap { width: 132px; height: 132px; border-radius: 12px; border: 2px solid rgba(255,255,255,.25); background: #1a2a1a; box-shadow: 0 6px 20px rgba(0,0,0,.5); }
#currencyBar { display: flex; gap: 10px; background: rgba(8,12,28,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 6px 14px; font-weight: 800; font-size: 14px; backdrop-filter: blur(8px); }
#currencyBar .coin { color: #ffd23f; }
#netBadge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.12); }
#netBadge.live { background: #1d9e4b; }
#netBadge.demo { background: #b8860b; }
#onlineCount { font-size: 11px; color: rgba(255,255,255,.7); }
#partyPanel { left: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 6px; }
.party-slot { display: flex; align-items: center; gap: 6px; width: 168px; background: rgba(8,12,28,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 10px; padding: 4px 8px; backdrop-filter: blur(8px); }
.party-slot.leader { border-color: #ffd23f; }
.party-slot img { width: 34px; height: 34px; }
.ps-info { flex: 1; min-width: 0; }
.ps-name { font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ps-name span { color: #ffd23f; }
.ps-hp { height: 5px; background: rgba(0,0,0,.6); border-radius: 3px; overflow: hidden; margin-top: 2px; }
.ps-hpfill { height: 100%; background: linear-gradient(90deg, #37d67a, #7dff8a); transition: width .2s; }
.ps-hptext { font-size: 10px; color: rgba(255,255,255,.65); }
.ps-empty { color: rgba(255,255,255,.35); font-size: 12px; text-align: center; flex: 1; }
#dexChip { margin-top: 4px; font-size: 11px; font-weight: 800; color: rgba(255,255,255,.75); background: rgba(8,12,28,.72); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 3px 10px; text-align: center; }
#chatBox { left: 12px; bottom: 12px; width: min(340px, 46vw); }
#chatLog { max-height: 130px; overflow-y: auto; font-size: 13px; text-shadow: 0 1px 3px #000; margin-bottom: 6px; display: flex; flex-direction: column; gap: 2px; }
.chat-msg { background: rgba(0,0,0,.45); border-radius: 8px; padding: 3px 8px; width: fit-content; max-width: 100%; }
.chat-msg.mine b { color: #ffd23f; }
#chatInput { width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(8,12,28,.8); color: #fff; font-size: 14px; outline: none; backdrop-filter: blur(8px); }
#actionBar { left: 50%; bottom: 12px; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; }
.ab-btn { min-width: 64px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.2); background: rgba(8,12,28,.8); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; backdrop-filter: blur(8px); display: flex; align-items: center; gap: 6px; justify-content: center; }
.ab-btn:hover { background: rgba(30,40,70,.9); }
.ab-btn.disabled { opacity: .45; }
.ab-btn img { width: 22px; height: 22px; }
.ab-btn .key { font-size: 10px; opacity: .6; border: 1px solid rgba(255,255,255,.35); border-radius: 4px; padding: 0 4px; }
#catchPrompt { left: 50%; bottom: 84px; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: linear-gradient(180deg, #ff5a5a, #c02020); font-weight: 900; cursor: pointer; box-shadow: 0 8px 24px rgba(224,64,64,.6); animation: glowPulse 1.2s ease-in-out infinite; border: none; color: #fff; font-size: 15px; }
#iconGrid { right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; }
.icon-btn { width: 52px; height: 52px; border-radius: 14px; border: 1px solid rgba(255,255,255,.2); background: rgba(8,12,28,.8); color: #fff; font-size: 21px; cursor: pointer; backdrop-filter: blur(8px); }
.icon-btn:hover { background: rgba(30,40,70,.9); }
#camControls { right: 12px; bottom: 240px; display: flex; flex-direction: column; gap: 6px; }
.cam-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,.2); background: rgba(8,12,28,.7); color: #fff; font-size: 16px; cursor: pointer; }
#dlgBox { left: 50%; bottom: 84px; transform: translateX(-50%); width: min(640px, 92vw); background: rgba(10,14,30,.92); border: 2px solid rgba(255,255,255,.25); border-radius: 16px; padding: 14px 18px 12px; cursor: pointer; box-shadow: 0 14px 40px rgba(0,0,0,.6); z-index: 8; }
#dlgName { font-weight: 900; color: #ffd23f; font-size: 14px; margin-bottom: 4px; letter-spacing: 1px; }
#dlgText { font-size: 16px; line-height: 1.45; white-space: pre-line; }
.dlg-hint { text-align: right; font-size: 11px; color: rgba(255,255,255,.5); margin-top: 6px; }
#toast { left: 50%; top: 64px; transform: translateX(-50%); background: rgba(8,12,28,.9); border: 1px solid rgba(255,210,63,.5); color: #ffd23f; font-weight: 800; padding: 9px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 9; white-space: nowrap; max-width: 94vw; overflow: hidden; text-overflow: ellipsis; }
#toast.show { animation: toastIn .25s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.panel { position: absolute; z-index: 10; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 92vw); max-height: 80vh; overflow-y: auto; background: rgba(10,14,30,.96); border: 1px solid rgba(255,255,255,.2); border-radius: 20px; padding: 20px; box-shadow: 0 24px 60px rgba(0,0,0,.7); }
.panel h2 { font-size: 19px; margin-bottom: 12px; }
.panel-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 15px; cursor: pointer; }
.bag-row, .party-row, .quest-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid rgba(255,255,255,.08); flex-wrap: wrap; }
.bag-row span:first-child { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.item-ico { width: 26px; height: 26px; }
.muted { color: rgba(255,255,255,.55); font-size: 12px; }
.party-row img { width: 44px; height: 44px; }
.badge { background: #ffd23f; color: #231303; font-size: 10px; font-weight: 900; padding: 3px 8px; border-radius: 999px; }
.quest-row { display: block; }
.quest-row.done { opacity: .55; }
#starterBox { position: absolute; z-index: 11; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(620px, 94vw); background: rgba(10,14,30,.97); border: 1px solid rgba(255,210,63,.4); border-radius: 22px; padding: 24px; text-align: center; box-shadow: 0 24px 70px rgba(0,0,0,.75); }
#starterBox h2 { font-size: 22px; margin-bottom: 16px; }
#starterCards { display: flex; gap: 12px; justify-content: center; }
.starter-card { flex: 1; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.15); border-radius: 16px; padding: 16px 8px; cursor: pointer; transition: .15s; }
.starter-card:hover { transform: translateY(-4px); border-color: #ffd23f; box-shadow: 0 12px 30px rgba(0,0,0,.5); background: rgba(255,255,255,.1); }
.starter-card img { width: 92px; height: 92px; }
.sc-name { font-weight: 900; font-size: 16px; margin-top: 6px; }
.sc-type { display: inline-block; font-size: 11px; font-weight: 800; color: #fff; padding: 2px 10px; border-radius: 999px; margin-top: 4px; }
.sc-stats { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 6px; }
#fadeBlack { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity .45s; z-index: 20; }
#fadeBlack.on { opacity: 1; pointer-events: all; }

/* ============ MOBILE ============ */
@media (max-width: 760px) {
  #artStrip img { height: 42vh; }
  .login-card { padding: 18px 16px 14px; }
  .hero-ball-wrap { width: 160px; height: 160px; }
  .hero-ball { width: 144px; height: 144px; inset: 8px; }
  #questPanel { width: 178px; padding: 8px 10px; }
  #questPanel h3 { font-size: 11px; }
  .qstep { font-size: 11px; }
  #mapTitle { font-size: 14px; top: 10px; }
  #minimap { width: 92px; height: 92px; }
  #partyPanel { display: none; }
  #chatBox { width: 58vw; bottom: 76px; }
  #chatLog { max-height: 84px; font-size: 12px; }
  #actionBar { bottom: 8px; }
  .ab-btn { min-width: 54px; padding: 8px 8px; font-size: 12px; }
  #dlgBox { bottom: 70px; }
  #camControls { bottom: 210px; }
  #starterCards { flex-direction: row; }
  .starter-card img { width: 64px; height: 64px; }
}
