/* =====================================================================
   UIKA Virtual Map — gaya antarmuka
   ===================================================================== */
:root {
  --green: #0b8a3e; --green-d: #0b5d2a; --green-l: #e7f6ec; --gold: #d4a537; --ink: #17241c; --muted: #66756b;
  --card: rgba(255, 255, 255, .94); --line: rgba(15, 40, 25, .1); --shadow: 0 10px 30px rgba(10, 30, 18, .18);
  --r: 16px; --font: "Plus Jakarta Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif; --fun: Fredoka, var(--font);
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1f14; font-family: var(--font); color: var(--ink); -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font: inherit; }
kbd { display: inline-block; min-width: 1.6em; padding: 1px 6px; border-radius: 6px; background: #fff; border: 1px solid #cfd8d2; border-bottom-width: 3px; font: 700 12px/1.4 var(--font); text-align: center; color: var(--ink); }
.hidden { display: none !important; }
.muted { color: var(--muted); } .tiny { font-size: 12px; } .warn { color: #b26a00; }
#stage, #stage canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; display: none; }
body.playing #labels { display: block; }

/* ---------- tombol ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: #fff; font-weight: 700; text-decoration: none; transition: transform .12s, box-shadow .12s, background .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.primary:hover { background: var(--green-d); }
.btn.ghost { background: transparent; } .btn.danger { color: #c62828; }
.btn.sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.btn.big { padding: 14px 20px; font-size: 17px; width: 100%; }
.btn.on { background: var(--green-l); border-color: var(--green); color: var(--green-d); }
.icon-btn { width: 36px; height: 36px; border-radius: 12px; border: 1px solid var(--line); background: #fff; display: inline-grid; place-items: center; font-size: 16px; }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 13px; }
.icon-btn.on { background: var(--green); color: #fff; }
.link-btn { border: 0; background: none; color: var(--green); font-weight: 800; font-size: 13px; padding: 0; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: var(--green); border: 1px solid transparent; }
.chip.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.chip.green { background: var(--green); }
button.chip { cursor: pointer; }

/* ---------- layar memuat & profil ---------- */
.screen { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; }
#loading { background: #0b3d1f url(../img/bg-loading.jpg) center/cover; }
.load-card { text-align: center; color: #fff; width: min(520px, 92vw); }
.load-logo { width: 110px; height: 110px; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(0,0,0,.4)); animation: bob 2.4s ease-in-out infinite; }
.load-card h1 { font: 700 46px/1 var(--fun); margin: 16px 0 6px; letter-spacing: .5px; }
.load-card h1 span { color: #ffd54f; }
.load-sub { opacity: .85; margin: 0 0 26px; }
.bar { height: 12px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; border: 1px solid rgba(255,255,255,.25); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffd54f, #8bc34a); border-radius: 99px; transition: width .25s; }
.load-text { font-size: 14px; opacity: .85; min-height: 1.4em; }
@keyframes bob { 50% { transform: translateY(-8px); } }

#profile { background: linear-gradient(180deg, rgba(5, 40, 20, .35), rgba(5, 40, 20, .7)); backdrop-filter: blur(2px); }
.profile-card { display: grid; grid-template-columns: 330px 1fr; width: min(900px, 96vw); max-height: 94vh; overflow: auto; background: #fff; border-radius: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.profile-left { background: linear-gradient(180deg, #e9f7ee, #d3eedb); padding: 18px; border-radius: 26px 0 0 26px; }
#avatarPreview { width: 100%; height: auto; aspect-ratio: 320/380; display: block; }
.swatches label { display: block; font-size: 12px; font-weight: 800; color: var(--green-d); margin: 10px 0 5px; text-transform: uppercase; letter-spacing: .5px; }
.seg { display: flex; gap: 4px; background: #fff; padding: 4px; border-radius: 12px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 7px 4px; border-radius: 9px; font-weight: 700; font-size: 13px; }
.seg button.on { background: var(--green); color: #fff; }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots button { width: 26px; height: 26px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.dots button.on { box-shadow: 0 0 0 3px var(--green); }
.profile-right { padding: 28px 30px; display: flex; flex-direction: column; gap: 12px; }
.profile-brand { display: flex; align-items: center; gap: 10px; } .profile-brand img { width: 44px; height: 44px; object-fit: contain; } .profile-brand span { display: flex; flex-direction: column; font: 700 17px var(--fun); color: var(--green-d); line-height: 1.1; } .profile-brand small { font: 600 12px var(--font); }
.profile-right h2 { font: 700 30px var(--fun); margin: 0; color: var(--green-d); }
.profile-right p { margin: 0; }
.profile-right label, .form-grid label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 13px; }
.profile-right input, .profile-right select, .form-grid select, .modal input, .modal select, .modal textarea { padding: 11px 13px; border-radius: 12px; border: 1px solid #d5ddd8; background: #fbfcfb; font-weight: 500; outline: none; }
.profile-right input:focus, .modal input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(11,138,62,.15); }
label.check { flex-direction: row !important; align-items: center; gap: 8px !important; font-weight: 600 !important; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
small { font-weight: 500; color: var(--muted); }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.6); backdrop-filter: blur(10px); }
.mission-card { position: absolute; left: 14px; top: calc(14px + var(--safe-t)); width: 300px; padding: 12px 14px; }
.mc-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 800; color: var(--green); letter-spacing: .8px; }
.mission-card h3 { margin: 4px 0 2px; font: 700 18px var(--fun); }
.mission-card p { margin: 0; font-size: 13px; color: var(--muted); }
.mc-bar { height: 6px; border-radius: 9px; background: #e3ebe6; margin: 9px 0 6px; overflow: hidden; }
.mc-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--green), #8bc34a); transition: width .4s; }
.mc-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }

#compass { position: absolute; top: calc(14px + var(--safe-t)); left: 50%; transform: translateX(-50%); width: min(420px, 40vw); height: 34px; overflow: hidden; border-radius: 99px; background: rgba(15, 30, 20, .55); backdrop-filter: blur(6px); pointer-events: none !important; -webkit-mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); }
#compassStrip { position: absolute; left: 0; top: 0; height: 100%; }
#compassStrip b { position: absolute; top: 8px; transform: translateX(-50%); color: #cfe8d6; font-size: 12px; font-weight: 700; }
#compassStrip b.big { color: #fff; font-size: 14px; top: 7px; }
#compassStrip i { position: absolute; top: 13px; width: 1px; height: 8px; background: rgba(255,255,255,.4); }
#cmpTarget { position: absolute; top: -2px; transform: translateX(-50%); font-size: 12px; }
.compass-needle { position: absolute; left: 50%; bottom: 0; width: 2px; height: 9px; background: #ff5252; transform: translateX(-50%); }

#topRight { position: absolute; right: 14px; top: calc(14px + var(--safe-t)); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
#statusRow { display: flex; gap: 6px; }
.pill { background: rgba(15, 30, 20, .62); color: #fff; padding: 6px 11px; border-radius: 99px; font-size: 12px; font-weight: 700; backdrop-filter: blur(6px); white-space: nowrap; }
#online { cursor: pointer; } #online.srv { background: rgba(11, 138, 62, .85); }
.pill.coord { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
#minimapWrap { position: relative; width: 180px; height: 180px; }
#minimap { width: 180px; height: 180px; border-radius: 50%; box-shadow: var(--shadow); cursor: zoom-in; display: block; }
.mm-n { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; border-radius: 50%; background: #e53935; color: #fff; font: 800 11px/20px var(--font); text-align: center; pointer-events: none; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mm-tools { position: absolute; left: -34px; bottom: 4px; display: flex; flex-direction: column; gap: 4px; }

.bld-list { position: absolute; right: 14px; top: calc(270px + var(--safe-t)); width: 200px; max-height: calc(100vh - 380px); overflow: auto; padding: 10px 10px 8px; }
.bl-head { display: flex; justify-content: space-between; align-items: center; font-size: 11px; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.bld-list.collapsed #blItems { display: none; }
.bl-cat { font-size: 11px; font-weight: 800; color: var(--muted); margin: 8px 2px 3px; display: flex; align-items: center; gap: 6px; }
.bl-cat i, .lbl-bld i, .res > i, .map-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; flex: none; }
.bl-item { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 9px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.bl-item:hover { background: var(--green-l); }
.bl-item em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--green); background: var(--green-l); padding: 1px 6px; border-radius: 6px; }
.bl-item.target { background: #fff7d6; box-shadow: inset 3px 0 0 #ffca28; }

.prompt { position: absolute; left: 50%; bottom: calc(110px + var(--safe-b)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: rgba(15, 30, 20, .82); color: #fff; padding: 9px 16px 9px 9px; border-radius: 14px; font-weight: 700; font-size: 14px; cursor: pointer; animation: pop .25s; box-shadow: var(--shadow); }
.prompt kbd { background: #ffd54f; border-color: #c9a227; }
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }

.nav-bar { position: absolute; left: 50%; top: calc(60px + var(--safe-t)); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; background: #fff; padding: 8px 10px 8px 8px; border-radius: 16px; box-shadow: var(--shadow); border: 2px solid #00c853; }
.nav-arrow { width: 38px; height: 38px; border-radius: 11px; background: #00c853; color: #fff; display: grid; place-items: center; font-size: 20px; transition: transform .2s; }
.nav-info { display: flex; flex-direction: column; min-width: 120px; } .nav-info b { font-size: 14px; } .nav-info span { font-size: 12px; color: var(--muted); font-weight: 600; }

#toolbar { position: absolute; left: 50%; bottom: calc(14px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 4px; background: var(--card); padding: 6px; border-radius: 18px; box-shadow: var(--shadow); backdrop-filter: blur(10px); }
#toolbar button { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 9px; border-radius: 12px; min-width: 58px; }
#toolbar button:hover { background: var(--green-l); }
#toolbar i { font-style: normal; font-size: 19px; } #toolbar span { font-size: 11px; font-weight: 700; color: var(--muted); }

.emote-wheel { position: absolute; left: 50%; bottom: calc(92px + var(--safe-b)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(3, auto); gap: 6px; background: var(--card); padding: 8px; border-radius: 16px; box-shadow: var(--shadow); }
.emote-wheel button { border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 8px 12px; font-weight: 700; font-size: 13px; }

.chat-feed { position: absolute; left: 14px; bottom: calc(90px + var(--safe-b)); width: 320px; display: flex; flex-direction: column; gap: 4px; pointer-events: none !important; }
.cf { background: rgba(15, 30, 20, .6); color: #fff; padding: 6px 10px; border-radius: 10px; font-size: 13px; animation: pop2 .2s; transition: opacity .5s; }
.cf b { color: #ffd54f; } .cf.out { opacity: 0; }
@keyframes pop2 { from { opacity: 0; transform: translateY(6px); } }

/* ---------- label 3D ---------- */
.lbl { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; }
.lbl-bld { pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px; background: rgba(255,255,255,.95); padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.lbl-bld.target { background: #ffca28; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255,202,40,.35); } }
.lbl-npc { background: rgba(255, 248, 225, .95); border: 2px solid #8d6e63; color: #4e342e; padding: 2px 9px; border-radius: 9px; font-size: 11px; }
.lbl-npc.quest::before { content: '!'; display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 5px; border-radius: 50%; background: #ffca28; color: #4e342e; font-weight: 900; animation: bob 1s infinite; }
.lbl-player { display: flex; flex-direction: column; align-items: center; background: rgba(2, 119, 189, .9); color: #fff; padding: 3px 10px; border-radius: 9px; font-size: 12px; font-weight: 800; }
.lbl-player small { color: #b3e5fc; font-size: 10px; }
.lbl .say { display: block; position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); background: #fff; color: var(--ink); padding: 5px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; box-shadow: 0 2px 8px rgba(0,0,0,.2); max-width: 220px; white-space: normal; text-align: center; }
.lbl-bubble { background: #fff; padding: 5px 11px; border-radius: 14px; font-size: 15px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.lbl-bubble.pop { animation: bubble .35s; }
@keyframes bubble { from { transform: scale(.4); opacity: 0; } }

/* ---------- dialog gaya RPG ---------- */
.dialog { position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); width: min(720px, 94vw); display: flex; gap: 14px; z-index: 30; background: #fffaf0; border: 4px solid #8d6e63; border-radius: 18px; padding: 14px; box-shadow: 0 0 0 4px #f3e0c2, 0 18px 40px rgba(0,0,0,.35); cursor: pointer; animation: pop2 .25s; }
.dlg-portrait { width: 92px; height: 92px; flex: none; border-radius: 14px; background: linear-gradient(#bfe6ff, #e8f7ff); border: 3px solid #8d6e63; overflow: hidden; }
.dlg-body { flex: 1; position: relative; }
.dlg-name { display: inline-block; background: #8d6e63; color: #fff; font: 600 15px var(--fun); padding: 2px 12px; border-radius: 8px; margin-bottom: 6px; }
.dialog p { margin: 0; font: 500 18px/1.45 var(--fun); color: #4e342e; min-height: 52px; }
.dlg-next { position: absolute; right: 2px; bottom: -4px; color: #8d6e63; animation: bob .8s infinite; }

/* ---------- toast ---------- */
#toasts { position: fixed; top: calc(70px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: rgba(255,255,255,.97); padding: 9px 16px; border-radius: 14px; box-shadow: var(--shadow); font-size: 14px; font-weight: 600; animation: pop2 .25s; transition: opacity .4s, transform .4s; max-width: 90vw; }
.toast.out { opacity: 0; transform: translateY(-8px); }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 35; display: grid; place-items: center; background: rgba(5, 20, 10, .45); backdrop-filter: blur(3px); padding: 14px; }
.modal-box { width: min(680px, 96vw); max-height: 90vh; display: flex; flex-direction: column; background: #fff; border-radius: 22px; box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: pop2 .2s; overflow: hidden; }
.modal-box.m-map { width: min(1100px, 97vw); height: 90vh; }
.modal-box.m-bld { width: min(820px, 97vw); }
.modal-box header { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-box h2 { margin: 0; font: 700 21px var(--fun); color: var(--green-d); }
#modalBody { padding: 14px 18px 18px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
#modalBody h4 { margin: 8px 0 2px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--green); }
.lead { margin: 0; font-size: 15px; line-height: 1.55; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.bi-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs { display: flex; gap: 4px; background: #f1f5f2; padding: 4px; border-radius: 12px; }
.tabs button { flex: 1; border: 0; background: transparent; padding: 8px; border-radius: 9px; font-weight: 700; font-size: 13px; }
.tabs button.on { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.1); color: var(--green-d); }
ul.svc { margin: 0; padding-left: 18px; line-height: 1.7; }
.prodi { display: flex; flex-wrap: wrap; gap: 6px; } .prodi span { background: var(--green-l); color: var(--green-d); padding: 4px 10px; border-radius: 9px; font-size: 13px; font-weight: 700; }
.tip { background: #fff8e1; border-left: 4px solid #ffca28; padding: 9px 12px; border-radius: 8px; margin: 4px 0 0; font-size: 14px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.kv span { color: var(--muted); } .kv.hl b { color: var(--green); font-size: 18px; }
.tour-frame { aspect-ratio: 16/9; width: 100%; border-radius: 14px; overflow: hidden; background: #0b1f14 url(../img/foto-kampus.jpg) center/cover; display: grid; place-items: center; }
.tour-frame iframe { width: 100%; height: 100%; border: 0; }
.search { width: 100%; font-size: 16px !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.results { display: flex; flex-direction: column; gap: 6px; }
.res { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.res > div { flex: 1; display: flex; flex-direction: column; } .res small { font-size: 12px; }
.res > i { width: 12px; height: 12px; }

.map-wrap { position: relative; flex: 1; min-height: 300px; border-radius: 14px; overflow: hidden; background: #d9dfcc; }
#fullmap { position: absolute; inset: 0; touch-action: none; cursor: grab; }
.map-tools { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.map-legend { position: absolute; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 10px; background: rgba(255,255,255,.92); padding: 7px 11px; border-radius: 11px; font-size: 12px; font-weight: 600; max-width: 70%; }
.map-legend span { display: flex; align-items: center; gap: 5px; }
.map-legend .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #aaa; }
.dot.g { background: #0b8a3e; } .dot.o { background: #ff9800; } .dot.b { background: #29b6f6; }
.map-legend .ln { width: 16px; height: 4px; background: #f2c200; border-radius: 2px; }
.map-card { position: absolute; right: 10px; top: 10px; width: 280px; background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.map-card p { margin: 0; font-size: 13px; color: var(--muted); max-height: 90px; overflow: auto; }

ol.missions { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
ol.missions li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); }
ol.missions li span { grid-column: 1; font-size: 13px; color: var(--muted); }
ol.missions li .btn { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
ol.missions li.done { background: var(--green-l); border-color: transparent; } ol.missions li.done b { color: var(--green-d); }
ol.missions li.cur { border: 2px solid #ffca28; background: #fffbea; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 3px dashed #cfd8d2; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; color: #b0bab4; }
.stamp span { font-size: 22px; font-weight: 900; } .stamp small { font-size: 10px; line-height: 1.1; }
.stamp.got { border: 3px solid #c62828; color: #c62828; transform: rotate(-8deg); background: #fff5f5; }
.stamp.got small { color: #c62828; font-weight: 800; }

.quiz-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.qcard { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 16px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.qcard:hover { border-color: var(--green); } .qcard b { font: 700 18px var(--fun); color: var(--green-d); } .qcard span { font-size: 12px; color: var(--muted); }
.qz-top { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--muted); }
.qz-bar { height: 6px; background: #e3ebe6; border-radius: 9px; overflow: hidden; } .qz-bar i { display: block; height: 100%; background: var(--green); }
#qz h3 { font: 600 20px/1.35 var(--fun); margin: 14px 0; }
.qz-opts { display: flex; flex-direction: column; gap: 8px; }
.qz-opts button { text-align: left; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font-weight: 600; }
.qz-opts button:hover:not(:disabled) { border-color: var(--green); background: var(--green-l); }
.qz-opts button.right { border-color: var(--green); background: #d9f5e2; } .qz-opts button.wrong { border-color: #e53935; background: #fde6e6; }
.qz-result { text-align: center; } .qz-result .big { font: 700 72px var(--fun); color: var(--green); }
.qz-result .kv { text-align: left; }
ul.review { text-align: left; font-size: 13px; padding-left: 0; list-style: none; } ul.review li { padding: 4px 0; } ul.review li.ok { color: var(--green-d); } ul.review li.no { color: #c62828; }
.chat-box { height: 300px; overflow: auto; display: flex; flex-direction: column; gap: 6px; background: #f6f8f7; border-radius: 12px; padding: 10px; }
.cm { align-self: flex-start; background: #fff; padding: 7px 11px; border-radius: 12px; max-width: 80%; display: flex; flex-direction: column; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.cm b { font-size: 11px; color: var(--green); } .cm.me { align-self: flex-end; background: var(--green-l); }
.chat-form { display: flex; gap: 8px; } .chat-form input { flex: 1; }
ul.players { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; } ul.players li { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; } ul.players li .btn { margin-left: auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; } .help > div { background: #f6f8f7; border-radius: 12px; padding: 10px 12px; } .help p { margin: 4px 0 0; font-size: 14px; line-height: 1.7; }
textarea.code { font: 12px/1.4 ui-monospace, Consolas, monospace; width: 100%; }
code { background: #f1f5f2; padding: 1px 5px; border-radius: 5px; font-size: 12px; }

/* ---------- editor ---------- */
.editor { position: fixed; left: 14px; top: calc(200px + var(--safe-t)); z-index: 20; width: 250px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ed-head { display: flex; justify-content: space-between; align-items: center; }
.ed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.ed-grid button { padding: 8px 0; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-weight: 800; }
.editor select { padding: 8px; border-radius: 10px; border: 1px solid var(--line); }

/* ---------- sentuh ---------- */
#touch { position: absolute; inset: 0; pointer-events: none !important; }
#joy { position: absolute; left: 26px; bottom: calc(100px + var(--safe-b)); width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.5); pointer-events: auto; touch-action: none; backdrop-filter: blur(3px); }
#joyKnob { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255,255,255,.88); box-shadow: 0 4px 12px rgba(0,0,0,.25); }
#touchBtns { position: absolute; right: 20px; bottom: calc(100px + var(--safe-b)); display: grid; grid-template-columns: 64px 64px; gap: 10px; pointer-events: auto; }
#touchBtns button { width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); background: rgba(15,30,20,.55); color: #fff; font-size: 22px; font-weight: 900; backdrop-filter: blur(4px); touch-action: manipulation; }
#tbAct { grid-column: 1 / span 2; justify-self: end; width: 78px !important; height: 78px !important; background: rgba(11,138,62,.85) !important; }
#tbRun.on { background: rgba(255,152,0,.85); }

#photoFlash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 60; }
#photoFlash.go { animation: flash .5s; } @keyframes flash { from { opacity: .9; } }
body.photo #hud, body.photo #labels { visibility: hidden; }

/* ---------- responsif ---------- */
@media (max-width: 820px) {
  .profile-card { grid-template-columns: 1fr; }
  .profile-left { border-radius: 26px 26px 0 0; display: grid; grid-template-columns: 140px 1fr; gap: 10px; }
  .profile-right { padding: 20px; }
  .mission-card { width: min(240px, 56vw); padding: 9px 11px; } .mission-card h3 { font-size: 15px; } .mission-card p { display: none; }
  #compass { top: calc(120px + var(--safe-t)); width: 60vw; height: 28px; }
  #minimapWrap, #minimap { width: 128px; height: 128px; }
  .mm-tools { display: none; }
  .bld-list { top: calc(200px + var(--safe-t)); width: 160px; }
  #toolbar { gap: 0; padding: 3px; left: 6px; right: 6px; transform: none; justify-content: space-between; overflow-x: auto; } #toolbar button { min-width: 0; flex: 1; padding: 5px 0; } #toolbar span { font-size: 9px; } #toolbar i { font-size: 17px; }
  #toasts { top: calc(180px + var(--safe-t)); }
  .chat-feed { width: 60vw; bottom: calc(260px + var(--safe-b)); }
  .prompt { bottom: calc(260px + var(--safe-b)); }
  .dialog { bottom: calc(250px + var(--safe-b)); } .dlg-portrait { width: 64px; height: 64px; } .dialog p { font-size: 15px; }
  .quiz-pick, .form-grid, .help { grid-template-columns: 1fr; }
  .stamps { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .map-card { left: 10px; right: 10px; width: auto; top: auto; bottom: 60px; }
  .pill.coord { display: none; }
  #statusRow .pill { font-size: 11px; padding: 4px 8px; }
}
