/* ---------- Loading, news, world picker and profile screens ---------- */
:root { --font-fancy: "Lilita One", "Arial Rounded MT Bold", "Trebuchet MS", Verdana, sans-serif; }   /* the ONE font used everywhere (chunky + cute) */

.btn {
  font-family: var(--font-fancy);
  font-size: 22px;
  letter-spacing: .5px;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 8px 22px 10px;
  cursor: pointer;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.btn.small { font-size: 18px; padding: 5px 16px 7px; }
.btn.green { background: #14b88f; box-shadow: 0 5px 0 #0b7f64; }
.btn.blue { background: #11a8ff; box-shadow: 0 5px 0 #0a73b3; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .35); }

.scr {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: auto;
  font-family: var(--font-fancy);
}
.scr[hidden] { display: none; }

.panel {
  width: min(94vw, 600px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
  background: #26447a;
  border: 2px solid rgba(0, 0, 0, .35);
  border-radius: 10px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, .35);
  color: #fff;
  text-align: left;
}
.panel h2 { margin: 0; font-size: 30px; font-weight: normal; letter-spacing: .5px; }
.panel-head, .pf-head { display: flex; align-items: center; gap: 14px; }
.panel-head canvas { width: 48px; height: 48px; image-rendering: pixelated; }

/* ---- loading ---- */
#loading {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 45%, #0b5d93 0%, #06406f 55%, #042e55 100%);
  font-family: var(--font-fancy);
  letter-spacing: 0;
}
#loading[hidden] { display: none; }
.ld-logo {
  font-size: clamp(64px, 15vw, 130px);
  line-height: 1;
  color: #fff;
  letter-spacing: 4px;
  padding-left: 4px;
  -webkit-text-stroke: 10px #0a2145;
  paint-order: stroke fill;
  text-shadow: 0 8px 0 #ffcf3f;
}
.ld-text { font-size: 22px; color: #fff; text-shadow: 0 2px 0 #0a2145; min-height: 28px; text-align: center; padding: 0 16px; }
.ld-bar { width: min(70vw, 320px); height: 12px; background: rgba(0, 0, 0, .35); border-radius: 8px; overflow: hidden; }
.ld-bar i { display: block; height: 100%; width: 0; background: linear-gradient(#ffe27a, #ffb82e); border-radius: 8px; transition: width .2s; }
.ld-peek { position: absolute; left: 50%; bottom: 0; width: 81px; height: 74px; margin-left: -40px; overflow: hidden; animation: peek 2.4s ease-in-out infinite; }
.ld-peek img { display: block; width: 81px; height: 111px; image-rendering: pixelated; image-rendering: crisp-edges; }
@keyframes peek { 0%, 100% { transform: translateY(14px); } 50% { transform: translateY(0); } }
.ld-bubbles { position: absolute; inset: 0; pointer-events: none; }
.ld-bubbles b { position: absolute; border-radius: 50%; background: rgba(60, 160, 255, .13); animation: drift 9s ease-in-out infinite; }
@keyframes drift { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-18px); } }

/* ---- news ---- */
#news { z-index: 60; background: rgba(8, 24, 60, .62); backdrop-filter: blur(3px); }   /* sits on top of the world picker */
.news-panel { height: min(88vh, 640px); }
.news-scroll { flex: 1; overflow-y: auto; padding-right: 6px; font-family: var(--font-fancy); }
.news-scroll::-webkit-scrollbar { width: 8px; }
.news-scroll::-webkit-scrollbar-thumb { background: #11a8ff; border-radius: 4px; }
.news-banner {
  height: 172px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 6px;
  background: radial-gradient(circle at 50% 40%, #ff9f43, #e0457b 55%, #6b1d8f);
  font-family: var(--font-fancy);
}
.nb-title { font-size: min(56px, 12vw); line-height: 1; color: #fff; -webkit-text-stroke: 7px #5a1650; paint-order: stroke fill; letter-spacing: 3px; }
.nb-sub { font-size: min(58px, 12vw); line-height: 1.05; margin-top: 4px; color: #ffe27a; -webkit-text-stroke: 6px #5a1650; paint-order: stroke fill; letter-spacing: 2px; }
.news-date { font-family: var(--font-fancy); font-size: 22px; color: #ffe84a; margin: 8px 0 8px; }
.news-item { display: flex; gap: 10px; margin: 0 0 12px; font-size: 16px; font-weight: bold; line-height: 1.35; }
.news-item .tag { color: #2cf04a; font-family: var(--font-fancy); font-weight: normal; margin-right: 4px; }
.news-item .arrow { flex: none; width: 30px; height: 18px; margin-top: 3px; background: #c9852f; border-radius: 3px 9px 9px 3px; position: relative; box-shadow: 0 2px 0 #7d4d12; }
.news-item .arrow::after { content: ""; position: absolute; right: 5px; top: 4px; border: 5px solid transparent; border-left: 7px solid #fff; border-right: 0; }
.news-thanks { margin: 18px 0 6px; font-family: var(--font-fancy); font-size: 22px; }

/* ---- world picker ---- */
.scr-menu {
  flex-direction: column;
  justify-content: flex-start;
  gap: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 60%, #b8f7c0 0%, #86d68f 60%, #5fb56f 100%);
}
.menu-tabs { position: relative; z-index: 1; display: flex; gap: 22px; margin-top: 22px; align-items: flex-start; }
.mtab { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; font-family: var(--font-fancy); }
.mtab-label { font-size: 17px; letter-spacing: .5px; color: #fff; -webkit-text-stroke: 4px #3a4152; paint-order: stroke fill; }
.mtab-box {
  width: 98px; height: 98px; display: flex; align-items: center; justify-content: center;
  background: #4a4f63; border: 3px solid #3a4152; border-radius: 10px; box-shadow: 0 7px 0 rgba(0, 0, 0, .25);
  transition: transform .12s;
}
.mtab-box canvas { width: 60px; height: 60px; image-rendering: pixelated; image-rendering: crisp-edges; }
.mtab-box:has(.tile-icon) { padding: 0; overflow: hidden; }
.mtab-box canvas.tile-icon { width: 100%; height: 100%; }
.mtab-box canvas.globe-icon { width: 72px; height: 72px; }      /* 36px art at exactly 2x */
.mtab:hover .mtab-box { transform: translateY(-3px); }
.mtab.active .mtab-box { border-color: #ffd84a; transform: translateY(-3px); }
.menu-main { position: relative; z-index: 1; flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; margin-top: 0; padding-bottom: calc(148px + 6vh + 90px); width: min(92vw, 660px); text-align: center; }   /* centred in the space between the tabs and the character */
.menu-label { display: block; font-size: 32px; color: #fff; -webkit-text-stroke: 6px #3a4152; paint-order: stroke fill; margin-bottom: 22px; }
#worldInput {
  width: 100%; font: 22px var(--font-fancy); text-align: center; letter-spacing: 1px;
  padding: 12px; border: 2px solid #3d9be0; border-radius: 6px; background: #fff; color: #26447a; outline: none;
  text-transform: uppercase;
}
#worldInput::placeholder { text-transform: none; color: #a9b4c7; }
#worldInput:focus { border-color: #ffd84a; }
.world-err { min-height: 24px; margin: 14px 0 14px; font: 15px var(--font-fancy); color: #b02a2a; }
#listRows { max-height: 34vh; overflow-y: auto; margin: 8px 0 14px; display: flex; flex-direction: column; gap: 8px; padding: 2px 6px 6px; }
.world-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: #26447a; border-radius: 8px; box-shadow: 0 4px 0 rgba(0, 0, 0, .25); color: #fff; text-align: left; }
.world-row .wname { flex: 1; font-size: 24px; letter-spacing: 1px; overflow: hidden; text-overflow: ellipsis; }
.world-row .wmeta { font: 13px var(--font-fancy); opacity: .75; }
.world-row .wstar { background: none; border: 0; color: #ffd84a; font-size: 26px; cursor: pointer; padding: 0 4px; }
.list-empty { padding: 16px; font: 17px var(--font-fancy); color: #26447a; background: rgba(255, 255, 255, .55); border-radius: 8px; }
.exit-btn { position: absolute; top: 24px; right: 24px; width: 62px; height: 62px; display: flex; align-items: center; justify-content: center; background: #d6323a; border: 3px solid #8f1d24; border-radius: 10px; box-shadow: 0 5px 0 rgba(0, 0, 0, .3); cursor: pointer; }
.exit-btn:hover { filter: brightness(1.1); }

.menu-sprite { position: absolute; left: 50%; bottom: 6vh; width: 108px; height: 148px; margin-left: -54px; animation: breathe 2.6s ease-in-out infinite; }
.menu-sprite .spr { position: absolute; image-rendering: pixelated; image-rendering: crisp-edges; }
.menu-sprite .body { left: 0; top: 0; width: 108px; height: 148px; z-index: 1; }
.menu-sprite .arm-back { left: 76px; top: 84px; width: 24px; height: 40px; z-index: 0; }
.menu-sprite .arm-front { left: 12px; top: 84px; width: 24px; height: 40px; z-index: 2; }
@keyframes breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
.menu-blocks { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.menu-blocks img { position: absolute; width: 32px; height: 32px; opacity: .35; image-rendering: pixelated; animation: floaty 7s ease-in-out infinite; }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(var(--r, 0deg)); } 50% { transform: translateY(-14px) rotate(var(--r, 0deg)); } }

@media (max-height: 560px) {
  .menu-sprite { transform: scale(.7); transform-origin: bottom center; bottom: 2vh; animation: none; }
  .menu-tabs { margin-top: 10px; }
  .mtab-box { width: 72px; height: 72px; }
  .mtab-box canvas { width: 44px; height: 44px; }
  .mtab-box canvas.tile-icon { width: 100%; height: 100%; }
  .mtab-box canvas.globe-icon { width: 54px; height: 54px; }
  .menu-main { padding-bottom: calc(104px + 2vh + 40px); }
  .menu-label { margin-bottom: 12px; }
  .world-err { margin: 8px 0; }
}
@media (max-height: 440px) {
  .menu-sprite { display: none; }
  .menu-main { padding-bottom: 0; }
}
@media (max-width: 480px) {
  .menu-tabs { gap: 10px; margin-top: 70px; }
  .mtab-box { width: 76px; height: 76px; }
  .mtab-box canvas { width: 48px; height: 48px; }
  .mtab-box canvas.tile-icon { width: 100%; height: 100%; }
  .mtab-box canvas.globe-icon { width: 54px; height: 54px; }
  .mtab-label { font-size: 13px; }
  .exit-btn { top: 10px; right: 10px; width: 48px; height: 48px; }
}

/* ---- profile ---- */
.scr-modal { background: rgba(8, 14, 30, .55); z-index: 50; }
.profile-panel { width: min(94vw, 460px); font-family: var(--font-fancy); }
.pf-head canvas { width: 52px; height: 52px; image-rendering: pixelated; background: #3a4152; border-radius: 8px; border: 2px solid #1e2740; }
.pf-head h2 { font-family: var(--font-fancy); font-size: 34px; overflow: hidden; text-overflow: ellipsis; }
.pf-tabs { display: flex; gap: 8px; }
.pf-tab { flex: 1; font: 22px var(--font-fancy); color: #fff; background: #0f3a6b; border: 0; border-radius: 6px; padding: 8px 0 10px; cursor: pointer; text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.pf-tab.active { background: #11a8ff; box-shadow: 0 4px 0 #0a73b3; }
#pfBody { overflow-y: auto; min-height: 180px; font-size: 16px; line-height: 1.45; }
.pf-level { font: 26px var(--font-fancy); color: #2cf04a; margin: 4px 0 6px; }
.pf-level span { color: #fff; font-size: 20px; }
.pf-xp { height: 12px; background: rgba(0, 0, 0, .35); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.pf-xp i { display: block; height: 100%; background: linear-gradient(#7dff8f, #1fc24a); border-radius: 8px; }
.pf-section { font: 22px var(--font-fancy); margin: 12px 0 6px; }
.pf-row { display: flex; align-items: center; gap: 10px; margin: 6px 0; }
.pf-row img { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; }
.pf-foot { margin-top: 14px; font-weight: bold; }
.pf-stat { display: flex; justify-content: space-between; padding: 8px 12px; margin: 6px 0; background: rgba(0, 0, 0, .22); border-radius: 6px; }
.pf-stat b { color: #ffe27a; }
.pf-muted { opacity: .7; }

body.panel-open #toast { z-index: 70; }

.chat-line.system { opacity: .85; }

/* the news panel: bigger heading + logo icon, and tag colours for the three kinds of lines */
.news-panel .panel-head h2 { font-size: 42px; }
.news-panel .panel-head #newsIcon { width: 84px; height: 60px; image-rendering: pixelated; }
.news-item .tag.fixed { color: #4ad8ff; }
.news-item .tag.soon { color: #ffb23d; }
.btn.red { background: #e5484d; box-shadow: 0 5px 0 #a02a2e; }

.world-row .wcount { font-size: 22px; letter-spacing: 1px; color: #8dff9c; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.world-row .wcount.zero { color: #9fb6dd; }
