/* Palack Online: page, HUD, character screens (po-mag). Faction colours: --f0 Őslakók rust, --f1 Palackszedők green. */
:root { --f0: #c4561f; --f1: #1f8a3c; --ink: #f1ece2; --dim: rgba(241,236,226,.62); --bg: rgba(12,11,10,.74); --line: rgba(241,236,226,.22); }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0c0b; color: var(--ink);
  font-family: "Bahnschrift", "Segoe UI", system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none;
  overscroll-behavior: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { container-type: size; }
input, textarea { user-select: text; -webkit-user-select: text; }
:root { --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px); }
html.gk-rot { --safe-l: env(safe-area-inset-top, 0px); --safe-r: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-right, 0px); --safe-b: env(safe-area-inset-left, 0px); }
#view { position: fixed; inset: 0; width: 100cqw; height: 100cqh; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
#ui { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#ui > * { pointer-events: auto; }
.hidden { display: none !important; }
#overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(22,18,12,.75), rgba(0,0,0,.95)); }
#overlay .boot { text-align: center; padding: 16px; }
#overlay h1, .cs-head h1 { font-size: clamp(34px, 7cqw, 72px); letter-spacing: .12em; margin: 0; font-weight: 800; }
#overlay h1 span, .cs-head h1 span { display: block; font-size: .32em; letter-spacing: .7em; opacity: .85; color: #9fd08a; }
#overlay p { opacity: .85; }
button { font: inherit; color: var(--ink); cursor: pointer; }

/* ---- character screens ---- */
.cs { position: fixed; inset: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: calc(14px + var(--safe-t)) calc(14px + var(--safe-r)) 14px calc(14px + var(--safe-l)); box-sizing: border-box;
  background: linear-gradient(180deg, rgba(0,0,0,.6), rgba(0,0,0,.35) 40%, rgba(0,0,0,.7)); }
.cs-head { text-align: center; }
.cs-head h1 { font-size: clamp(28px, 5cqw, 54px); }
.cs-head p { margin: 4px 0 0; color: var(--dim); }
.cs-list { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.cs-card { width: min(250px, 80cqw); min-height: 150px; padding: 16px; box-sizing: border-box; background: var(--bg); border: 2px solid var(--fc, var(--line));
  display: flex; flex-direction: column; gap: 8px; text-align: left; }
.cs-card b { font-size: 22px; color: var(--fc, var(--ink)); }
.cs-card i { font-style: normal; color: var(--dim); }
.cs-card .cs-play { margin-top: auto; padding: 10px; font-size: 18px; background: var(--fc); border: 0; color: #111; font-weight: 700; letter-spacing: .05em; }
.cs-card .cs-play:disabled { opacity: .5; }
.cs-card .cs-del { padding: 4px; font-size: 13px; background: none; border: 0; color: var(--dim); text-decoration: underline; }
.cs-new { align-items: center; justify-content: center; font-size: 20px; border-style: dashed !important; color: var(--dim); }
.cs-new:hover { color: var(--ink); }
.cs-online { color: var(--dim); margin: 0; }
.cs-online b { color: var(--ink); }
.cs-err { min-height: 1.2em; margin: 0; color: #ff8a6a; }
.cs-make { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; align-items: flex-start; }
.cs-prev { width: min(280px, 40cqw); height: min(380px, 60cqh); background: radial-gradient(ellipse at 50% 70%, rgba(255,255,255,.08), rgba(0,0,0,.3)); border: 1px solid var(--line); }
.cs-prev canvas { width: 100%; height: 100%; display: block; }
.cs-form { width: min(600px, 92cqw); display: flex; flex-direction: column; gap: 7px; background: var(--bg); padding: 16px; box-sizing: border-box; border: 1px solid var(--line); }
.cs-name { display: flex; gap: 10px; align-items: center; font-size: 18px; }
.cs-name input { flex: 1; font: inherit; font-size: 20px; padding: 8px 10px; background: rgba(0,0,0,.4); color: var(--ink); border: 1px solid var(--dim); }
.cs-facs { display: flex; gap: 10px; }
.cs-fac { flex: 1; text-align: left; padding: 10px; background: rgba(0,0,0,.35); border: 2px solid rgba(255,255,255,.12); display: flex; flex-direction: column; gap: 3px; }
.cs-fac b { color: var(--fc); font-size: 19px; } .cs-fac small { color: var(--ink); opacity: .8; } .cs-fac i { font-style: normal; color: var(--dim); font-size: 13px; line-height: 1.3; }
.cs-fac.sel { border-color: var(--fc); background: color-mix(in srgb, var(--fc) 18%, transparent); }
.cs-row { display: flex; gap: 10px; align-items: center; }
.cs-row > span { width: 64px; flex: none; font-size: 14px; color: var(--dim); }
.cs-opts { display: flex; gap: 4px; flex-wrap: wrap; }
.cs-sw { width: 22px; height: 22px; border: 2px solid rgba(255,255,255,.25); border-radius: 50%; padding: 0; }
.cs-sw.sel { border-color: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.6), 0 0 8px #fff; }
.cs-tx { padding: 3px 8px; font-size: 14px; background: rgba(0,0,0,.35); border: 1px solid var(--line); }
.cs-tx.sel { border-color: var(--ink); background: rgba(255,255,255,.14); }
.cs-btns { display: flex; gap: 10px; justify-content: flex-end; }
.cs-btns button { padding: 10px 22px; font-size: 18px; background: transparent; border: 2px solid var(--ink); }
.cs-btns .cs-ok { background: var(--ink); color: #111; font-weight: 700; }
.cs-btns .cs-ok:disabled { opacity: .5; }
.cs-queue { text-align: center; background: var(--bg); padding: 22px 30px; border: 1px solid var(--line); }
.cs-queue .cs-pos { display: block; font-size: 72px; line-height: 1; margin: 8px 0; }
.cs-queue p { color: var(--dim); margin: 4px 0; }
.cs-queue button { margin-top: 12px; padding: 8px 18px; background: transparent; border: 1px solid var(--dim); }

/* ---- the in-world HUD ---- */
.ph { position: absolute; inset: 0; }
.ph-me { position: absolute; left: calc(12px + var(--safe-l)); top: calc(10px + var(--safe-t)); background: var(--bg); padding: 8px 12px; border-left: 4px solid var(--fc); display: flex; flex-direction: column; gap: 2px; }
.ph-name { font-size: 18px; } .ph-fac { font-style: normal; color: var(--fc); font-size: 14px; } .ph-place { color: var(--dim); font-size: 13px; }
.ph-place:empty { display: none; }
.ph-net { position: absolute; right: calc(12px + var(--safe-r)); top: calc(10px + var(--safe-t)); background: var(--bg); padding: 6px 10px; font-size: 14px; color: var(--dim); }
.ph-banner { position: absolute; left: 50%; top: 16%; transform: translateX(-50%); text-align: center; opacity: 0; pointer-events: none; white-space: nowrap; }
.ph-banner b { display: block; font-size: clamp(22px, 3.4cqw, 40px); color: var(--zc); text-shadow: 0 2px 6px #000, 0 0 2px #000; letter-spacing: .03em; }
.ph-banner i { display: block; font-style: normal; color: var(--ink); text-shadow: 0 1px 4px #000; margin-top: 4px; }
.ph-banner.on { animation: banner 4.5s ease-out forwards; }
@keyframes banner { 0% { opacity: 0; transform: translateX(-50%) translateY(8px); } 10% { opacity: 1; transform: translateX(-50%); } 75% { opacity: 1; } 100% { opacity: 0; } }
.ph-help { position: absolute; bottom: calc(8px + var(--safe-b)); left: 50%; transform: translateX(-50%); font-size: 12px; color: var(--dim); text-shadow: 0 1px 2px #000; white-space: nowrap; }
body:has(.tch:not(.hidden)) .ph-help { display: none; }
.pm { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); }
.pm-box { background: var(--bg); border: 1px solid var(--line); padding: 20px 26px; display: flex; flex-direction: column; gap: 10px; min-width: 280px; }
.pm-box h2 { margin: 0 0 6px; } .pm-box button { padding: 10px; font-size: 18px; background: rgba(255,255,255,.06); border: 1px solid var(--line); }
.pm-keys { color: var(--dim); font-size: 13px; line-height: 1.5; margin: 6px 0 0; }

/* nameplates */
.plates { position: absolute; inset: 0; }
.plate { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; white-space: nowrap; transform-origin: 50% 100%; will-change: transform; }
.plate b { color: var(--fc); font-size: 15px; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.plate i { font-style: normal; font-size: 11px; color: #111; background: var(--fc); border-radius: 8px; padding: 0 5px; font-weight: 700; }

/* chat */
.chat { position: absolute; left: calc(12px + var(--safe-l)); bottom: calc(30px + var(--safe-b)); width: min(440px, 46cqw); display: flex; flex-direction: column; gap: 4px; }
.chat-log { display: flex; flex-direction: column; gap: 2px; max-height: 30cqh; overflow: hidden; justify-content: flex-end; }
.chat-l { font-size: 14px; text-shadow: 0 1px 2px #000, 0 0 2px #000; transition: opacity .6s; overflow-wrap: anywhere; }
.chat-l.old { opacity: 0; }
.chat-l em { color: #9fd08a; font-style: normal; } .chat-l.sys { color: #ffd27a; }
.chat.open .chat-log { background: rgba(0,0,0,.35); }
.chat-in { display: flex; gap: 6px; align-items: center; background: var(--bg); padding: 4px 8px; pointer-events: auto; }
.chat-in input { flex: 1; font: inherit; font-size: 15px; background: transparent; border: 0; color: var(--ink); outline: none; }
.chat-ch { color: var(--dim); font-size: 14px; } .chat-in[data-ch=faction] .chat-ch { color: #9fd08a; }

/* touch HUD */
.tch { position: fixed; inset: 0; z-index: 15; pointer-events: auto; }
.tch-stick { position: absolute; width: 112px; height: 112px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); opacity: 0; }
.tch-stick.on { opacity: 1; }
.tch-stick i { position: absolute; left: 36px; top: 36px; width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.5); }
.tch-b { position: absolute; border-radius: 50%; border: 2px solid rgba(255,255,255,.4); background: rgba(0,0,0,.35); font-size: 12px; letter-spacing: .05em; }
.tch-jump { right: calc(26px + var(--safe-r)); bottom: calc(40px + var(--safe-b)); width: 78px; height: 78px; }
.tch-chat { right: calc(26px + var(--safe-r)); top: calc(64px + var(--safe-t)); width: 56px; height: 56px; }
.tch-zin, .tch-zout { width: 42px; height: 42px; font-size: 20px; right: calc(120px + var(--safe-r)); }
.tch-zin { bottom: calc(110px + var(--safe-b)); } .tch-zout { bottom: calc(56px + var(--safe-b)); }
.cs-signin { max-width: 420px; }
.cs-signin p { color: var(--ink); font-size: 18px; line-height: 1.4; }
.cs-signin .cs-in { display: inline-block; margin-top: 14px; padding: 12px 34px; font-size: 20px; font-weight: 700; background: var(--ink); color: #111; border: 0; text-decoration: none; }
