/* Back end UI (js/game/net.js, netgame.js, update.js): the top-centre stack #netTop (update bar / pill + announcement), the GM
   letter, and the title screen additions (banned / maintenance panel, server footer buttons). Royal palette with its own colour
   tokens, so it looks the same over the title screen and over the game HUD.
   Sections: tokens · update bar + pill · announcement · GM letter · title additions · settings row · phone */
#netTop, .net-letter-ov {
  --n-panel: linear-gradient(180deg, rgba(40, 27, 88, 0.97), rgba(13, 10, 40, 0.98));
  --n-gold: #e0b252; --n-gold-hi: #ffe39a; --n-line: rgba(140, 110, 220, 0.45); --n-text: #f2f1ff; --n-muted: #a9a6d2;
  font-family: 'Kanit', 'Thonburi', 'Leelawadee UI', 'Noto Sans Thai', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--n-text);
}
#netTop { position: fixed; left: 50%; top: max(8px, env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 9050; display: flex; flex-direction: column; align-items: center; gap: 6px;
  width: max-content; max-width: min(92vw, 560px); pointer-events: none; }
#netTop > * { pointer-events: auto; }
#netTop:empty { display: none; }
@keyframes net-pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- update bar + pill (the old game's .upd-banner / .upd-pill) */
.upd-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; max-width: 100%; padding: 8px 10px 8px 14px; border-radius: 14px; background: var(--n-panel); border: 1px solid var(--n-gold);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 18px rgba(224, 178, 82, 0.3); animation: net-pop .25s ease both; }
.upd-ico { font-size: 18px; flex: none; }
.upd-msg { flex: none; font-size: 13px; font-weight: 600; white-space: nowrap; }
.upd-more { flex: none; font-size: 12px; color: var(--n-gold-hi, #ffe39a); text-decoration: underline; white-space: nowrap; }
.upd-banner { flex-wrap: nowrap !important; width: max-content; }
.upd-cd { flex: none; font-size: 11px; color: var(--n-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.upd-now { flex: none; min-height: 30px; padding: 3px 12px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: #2a1a04; cursor: pointer;
  background: linear-gradient(180deg, #ffe39a, #e0a83e); border: 1px solid #8a5a16; white-space: nowrap; }
.upd-now:hover { filter: brightness(1.08); }
.upd-min { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--n-line); background: rgba(14, 11, 44, 0.7); color: var(--n-text); font: inherit; font-weight: 700; line-height: 1; cursor: pointer; }
.upd-min:hover { border-color: var(--n-gold); }
.upd-pill { padding: 5px 13px; border-radius: 999px; background: var(--n-panel); border: 1px solid var(--n-gold); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45); color: var(--n-text); font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap; }
.upd-pill:hover { border-color: var(--n-gold-hi); }

/* ---------- announcement */
.net-ann { display: flex; align-items: flex-start; gap: 8px; max-width: 100%; padding: 7px 8px 7px 12px; border-radius: 12px; background: var(--n-panel); border: 1px solid var(--n-line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45); font-size: 13px; line-height: 1.4; animation: net-pop .25s ease both; }
.net-ann-ico { flex: none; }
.net-ann-t { flex: 1; min-width: 0; overflow-wrap: anywhere; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.net-ann-x { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--n-line); background: rgba(14, 11, 44, 0.7); color: var(--n-text); font: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.net-ann-x:hover { border-color: var(--n-gold); }

/* ---------- GM letter (message / mail) */
.net-letter-ov { position: fixed; inset: 0; z-index: 9060; display: grid; place-items: center; padding: 16px; background: rgba(6, 4, 22, 0.55); }
.net-letter { width: min(420px, 100%); max-height: min(80vh, 520px); display: flex; flex-direction: column; border-radius: 16px; background: var(--n-panel); border: 1px solid var(--n-gold);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6), 0 0 22px rgba(224, 178, 82, 0.25); animation: net-pop .25s ease both; }
.net-letter-h { padding: 12px 16px 8px; font-size: 16px; font-weight: 600; color: var(--n-gold-hi); border-bottom: 1px solid var(--n-line); }
.net-letter-b { padding: 12px 16px; overflow-y: auto; font-size: 14px; line-height: 1.55; }
.net-letter-b p { margin: 0; overflow-wrap: anywhere; }
.net-letter-b ul { margin: 10px 0 0; padding: 8px 10px 8px 28px; border-radius: 10px; background: rgba(8, 6, 28, 0.6); border: 1px solid var(--n-line); color: var(--n-gold-hi); }
.net-letter-f { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px 12px; font-size: 12px; color: var(--n-muted); }
.net-letter-ok { min-height: 34px; padding: 4px 22px; border-radius: 10px; font: inherit; font-size: 14px; font-weight: 600; color: #2a1a04; cursor: pointer; background: linear-gradient(180deg, #ffe39a, #e0a83e); border: 1px solid #8a5a16; }

/* ---------- title screen additions */
html.ttl-open .ttl-view { top: var(--net-h, 0px); }                      /* room for the update bar / announcement above the title */
.ttl-top .ttl-status { flex: 0 1 auto; min-width: 0; } .ttl-top .ttl-row { flex: none; }      /* the live counts make the status longer: it shrinks, */
.ttl-status-sub { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }   /* the language switch + settings stay on screen */
.ttl-msg { width: min(520px, 100%); }
.ttl-msg-ico { font-size: 40px; line-height: 1; flex: none; }
.ttl-msg-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 4px 0; padding: 12px 14px; border-radius: 12px; background: var(--t-well); border: 1px solid var(--t-line); }
.ttl-msg-list dt { color: var(--t-muted); font-size: 13px; white-space: nowrap; }
.ttl-msg-list dd { margin: 0; overflow-wrap: anywhere; }
.ttl-msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ttl-srv-btns { display: flex; align-items: center; gap: 8px; flex: none; }
.ttl-srv-hero { margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttl-acc .ttl-faint { overflow-wrap: anywhere; }

/* ---------- settings window: account row */
.acct-row b { font-weight: 500; overflow-wrap: anywhere; }
.acct-row .acct-role { font-style: normal; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--gold-dim, #8a6a2a); font-size: 12px; white-space: nowrap; }
.acct-row small { opacity: .7; white-space: nowrap; }

/* ---------- phone */
@media (max-width: 480px) {
  #netTop { max-width: calc(100vw - 16px); }
  .upd-banner { gap: 6px 8px; padding: 7px 8px 7px 10px; }
  .upd-msg { font-size: 12.5px; }
  .ttl-srv-btns { flex: 1 1 100%; } .ttl-srv-btns .ttl-btn { flex: 1 1 0; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .upd-banner { padding: 5px 8px 5px 10px; } .upd-msg { font-size: 12px; }
  .net-letter { max-height: 90vh; }
}

/* loading screen: picture of the destination map behind the loading box */
#loading .ld-art { position: absolute; inset: 0; background: center / cover no-repeat; opacity: 0; transition: opacity .35s ease; }
#loading .ld-art.on { opacity: 1; }
#loading .ld-art::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 55%, rgba(8, 10, 34, .25), rgba(6, 8, 26, .78) 78%); }
#loading .ld-box { position: relative; z-index: 1; }

/* update notice, light version (2026-10-10): open = see-through strip in the middle with one small button;
   minimised = a small button at the far left under the quest cards (update.js placePill) */
.upd-banner { background: rgba(10, 8, 34, .28) !important; border: 1px solid rgba(255, 227, 154, .28) !important; box-shadow: none !important; backdrop-filter: none; padding: 3px 6px 3px 10px !important; gap: 4px 8px !important; border-radius: 999px !important; }
.upd-banner .upd-ico { display: none; }
.upd-banner .upd-msg { font-size: 12px; font-weight: 600; text-shadow: 0 1px 0 #000, 0 0 5px #000; }
.upd-banner .upd-cd { font-size: 10.5px; text-shadow: 0 1px 0 #000; color: #e6e9ff; }
.upd-banner .upd-more { font-size: 11px; text-shadow: 0 1px 0 #000; }
.upd-banner .upd-now { min-height: 24px; padding: 1px 10px; font-size: 12px; border-radius: 999px; }
.upd-banner .upd-min { width: 22px; height: 22px; border-radius: 50%; background: rgba(14, 11, 44, .45); }
.upd-pill.side { position: fixed; z-index: 45; left: 8px; top: 8px; padding: 3px 10px; font-size: 11.5px; font-weight: 600; white-space: nowrap; border-radius: 999px;
  background: rgba(10, 8, 34, .5); border: 1px solid rgba(255, 227, 154, .6); color: #ffe9a8; box-shadow: none; text-shadow: 0 1px 0 #000; }
