:root { --glass: rgba(10, 18, 30, 0.62); --glass2: rgba(10, 18, 30, 0.82); --line: rgba(255,255,255,0.12); --text: #eef3f8; --muted: #9fb0c3; --accent: #7fe0a4; --gold: #f2c14e; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0c1a2c; color: var(--text); font: 14px/1.4 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { display: inline-block; padding: 1px 6px; border: 1px solid rgba(255,255,255,0.25); border-radius: 5px; background: rgba(255,255,255,0.08); font: 600 11px/1.5 inherit; margin-right: 3px; }
.pill { background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pill b { color: var(--text); }
.pill.warn { border-color: rgba(242,92,84,0.7); color: #ffb4ae; background: rgba(60,12,12,0.85); cursor: pointer; }
#connBanner { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 21; font-weight: 600; }
.pill.res span { margin: 0 6px; }

#loading { position: fixed; inset: 0; display: flex; flex-direction: column; gap: 18px; align-items: center; justify-content: center; background: #0c1a2c; z-index: 50; color: var(--muted); letter-spacing: .04em; }
.planet-spin { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7fd0ff, #2e7fc0 55%, #173f66); box-shadow: 0 0 40px rgba(90,170,255,0.4); animation: spin 2.4s linear infinite; position: relative; overflow: hidden; }
.planet-spin::after { content: ""; position: absolute; left: 10px; top: 24px; width: 46px; height: 26px; border-radius: 50%; background: #64c25a; transform: rotate(-12deg); }
@keyframes spin { to { transform: rotate(360deg); } }

#logo { position: fixed; left: 18px; top: 14px; display: flex; gap: 10px; align-items: center; z-index: 5; }
#logo .mark { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.7); position: relative; }
#logo .mark::after { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: linear-gradient(135deg, #7fd0ff, #64c25a); }
#logo .brand { font-weight: 700; letter-spacing: .22em; font-size: 12px; }
#logo .tag { font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }

#topbar { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
#topright { position: fixed; top: 14px; right: 18px; display: flex; gap: 8px; z-index: 5; }
button.icon { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); font-size: 15px; position: relative; }
button.icon:hover { background: rgba(255,255,255,0.14); }
button.icon.off { opacity: .45; }
button.icon.off::after { content: ""; position: absolute; left: 8px; top: 17px; width: 20px; height: 2px; background: #ff9a9a; transform: rotate(-45deg); border-radius: 1px; }
button.icon i { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: #f25c54; color: #fff; font: 700 11px/18px inherit; padding: 0 5px; }

#myLands { position: fixed; top: 60px; right: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; z-index: 5; }
#myLands button { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(10px); border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 12px; font-weight: 600; }
#myLands button:hover { background: rgba(127,224,164,0.2); border-color: var(--accent); }
#buildPanel:not([hidden]) ~ #myLands { display: none; }
#daynight { font-variant-numeric: tabular-nums; }
#menuWrap { position: fixed; right: 18px; bottom: 160px; z-index: 7; }
#menu { position: absolute; right: 0; bottom: 44px; min-width: 230px; background: var(--glass2); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 16px 40px rgba(0,0,0,0.45); }
#menu button, #menu a { text-align: left; border: 0; background: transparent; color: var(--text); padding: 8px 10px; border-radius: 8px; font-size: 13px; text-decoration: none; }
#menu button:hover, #menu a:hover { background: rgba(255,255,255,0.1); }
#menu .sep { height: 1px; background: var(--line); margin: 4px 6px; }
#menu a span { color: var(--muted); }
#portrait { position: fixed; right: 18px; bottom: 18px; width: 128px; height: 128px; z-index: 6; cursor: pointer; }
#portrait .frame { position: absolute; inset: 0; border-radius: 12px; border: 3px solid #c9a44a; box-shadow: inset 0 0 0 2px #5b3a22, inset 0 0 18px rgba(0,0,0,0.55), 0 6px 20px rgba(0,0,0,0.5); pointer-events: none; }
#portrait .frame::before { content: ""; position: absolute; inset: -6px; border-radius: 16px; border: 2px solid rgba(201,164,74,0.35); }
#portrait:hover .frame { border-color: #f2c14e; }
#portrait .caption { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); background: #5b3a22; border: 2px solid #c9a44a; color: #fff3c4; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 1px 10px; border-radius: 999px; white-space: nowrap; pointer-events: none; }
button.pill { cursor: pointer; font: inherit; font-size: 12.5px; } button.pill:hover { background: rgba(255,255,255,0.14); }
#creatureList { position: fixed; right: 18px; top: 66px; max-height: calc(100% - 330px); width: 300px; display: flex; flex-direction: column; background: var(--glass2); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; z-index: 9; overflow: hidden; }
#creatureList .head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 8px 14px; font-size: 11px; letter-spacing: .25em; color: var(--muted); border-bottom: 1px solid var(--line); }
#creatureList .rows { overflow: auto; padding: 6px; }
#creatureList .row { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 8px 8px; border-radius: 9px; cursor: pointer; font-size: 12.5px; }
#creatureList .row:hover { background: rgba(255,255,255,0.08); }
#creatureList .row .n { font-size: 22px; text-align: center; }
#creatureList .row .name { display: flex; flex-direction: column; font-weight: 600; }
#creatureList .row .name small { font-weight: 500; color: var(--muted); letter-spacing: .12em; font-size: 9.5px; }
#creatureList .row .tag { font-size: 11px; color: var(--accent); border: 1px solid rgba(127,224,164,0.5); border-radius: 999px; padding: 2px 8px; }
#btnReturnMe { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; font-size: 13px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
#btnReturnMe kbd { margin-left: 6px; font-size: 11px; opacity: 0.8; }
#parcelList { position: fixed; left: 18px; top: 66px; bottom: 250px; width: 300px; display: flex; flex-direction: column; background: var(--glass2); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; z-index: 8; overflow: hidden; }
#parcelList .head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 8px 14px; font-size: 11px; letter-spacing: .25em; color: var(--muted); border-bottom: 1px solid var(--line); }
#parcelList .rows { overflow: auto; padding: 6px; }
#parcelList .row { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: 12.5px; }
#parcelList .row:hover { background: rgba(255,255,255,0.08); }
#parcelList .row.sel { background: rgba(127,224,164,0.16); outline: 1px solid rgba(127,224,164,0.4); }
#parcelList .row .n { color: var(--muted); font-size: 11px; }
#parcelList .row .name { font-weight: 600; } #parcelList .row .name small { display: block; font-weight: 400; color: var(--muted); font-size: 10.5px; letter-spacing: .1em; }
#parcelList .row .tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,0.1); white-space: nowrap; }
#parcelList .row .tag.free { color: var(--gold); } #parcelList .row .tag.mine { color: var(--accent); }
button.icon.small { width: 26px; height: 26px; font-size: 12px; }
#parcelCard { position: fixed; left: 18px; bottom: 18px; width: 300px; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; z-index: 5; }
#parcelCard .kind { font-size: 10px; letter-spacing: .25em; color: var(--muted); }
#parcelCard .name { font: 400 28px/1.15 Georgia, "Times New Roman", serif; margin: 4px 0 2px; word-break: break-word; }
#parcelCard .name .edit { display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; margin-left: 8px; width: 30px; height: 30px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.1); color: var(--text); padding: 0; cursor: pointer; }
#parcelCard .name .edit svg { width: 15px; height: 15px; display: block; }
#parcelCard .name .edit:hover { background: rgba(255,255,255,0.16); color: var(--text); }
#parcelCard .name a { color: var(--accent); text-decoration: none; } #parcelCard .name a:hover { text-decoration: underline; }
#parcelCard .owner { font-size: 12.5px; color: var(--muted); }
#parcelCard .owner b { color: var(--text); }
#parcelCard .owner .price { color: var(--gold); font-weight: 600; }
#parcelCard .tagline { font-size: 12px; color: var(--muted); margin-top: 6px; font-style: italic; }
#parcelCard .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#parcelCard .actions:empty { display: none; }
.btn, .modal .btns button, #parcelCard .actions button { border: 1px solid var(--line); background: rgba(255,255,255,0.1); padding: 7px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; }
.btn:hover, .modal .btns button:hover, #parcelCard .actions button:hover { background: rgba(255,255,255,0.18); }
.primary, .modal .btns button.primary, #parcelCard .actions button.primary { background: var(--accent); color: #0b2a18; border-color: transparent; }
.primary:hover, .modal .btns button.primary:hover, #parcelCard .actions button.primary:hover { background: #a2f0be; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.busy { opacity: .85; cursor: progress; }
.spinner { display: inline-block; width: 12px; height: 12px; border: 2px solid rgba(0,0,0,0.25); border-top-color: currentColor; border-radius: 50%; vertical-align: -2px; margin-right: 4px; animation: spin 0.8s linear infinite; }

#unitMenu { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); background: var(--glass2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; z-index: 6; min-width: 320px; }
#unitMenu .t { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; margin-bottom: 8px; }
#unitMenu .t span { color: var(--muted); font-size: 12px; }
#unitMenu .btns { display: flex; flex-wrap: wrap; gap: 6px; }
#unitMenu .btns button { border: 1px solid var(--line); background: rgba(255,255,255,0.08); padding: 6px 10px; border-radius: 8px; font-size: 12px; }
#unitMenu .btns button.active { border-color: var(--accent); background: rgba(127,224,164,0.2); }
#unitMenu .btns button.danger { color: #ff9a9a; }
.lampcol { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.lampcol input { width: 34px; height: 24px; border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 0 2px; }
#prompt { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--glass2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 16px 8px 10px; z-index: 5; }
#prompt kbd { font-size: 14px; padding: 6px 10px; border-color: var(--accent); color: var(--accent); }
#prompt small { display: block; font-size: 10px; letter-spacing: .2em; color: var(--muted); }
#prompt span { font-weight: 600; }
#prompt .bar { height: 6px; width: 180px; background: rgba(255,255,255,0.12); border-radius: 3px; margin-top: 5px; overflow: hidden; }
#prompt .bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width .08s linear; }

#hints { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; font-size: 11px; color: var(--muted); z-index: 4; white-space: nowrap; }

#buildPanel { position: fixed; right: 18px; top: 66px; bottom: 175px; width: 300px; background: var(--glass); backdrop-filter: blur(12px); border: 1px solid var(--line); border-radius: 14px; padding: 12px; z-index: 5; display: flex; flex-direction: column; gap: 10px; }
#buildPanel .head { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px; }
#buildPanel .head b { color: var(--accent); letter-spacing: .2em; font-size: 11px; }
#buildPanel .sel { font-size: 12px; color: var(--text); background: rgba(127,224,164,0.12); border: 1px solid rgba(127,224,164,0.35); border-radius: 8px; padding: 6px 9px; }
#buildPanel .grid .group { grid-column: 1 / -1; font-size: 10px; letter-spacing: .2em; color: var(--muted); margin-top: 6px; }
#buildPanel .item .sw.slab { height: 17px; margin-top: 17px; }
#buildPanel .item .sw.glassy, #hotbar .sw.glassy { opacity: .7; box-shadow: inset 0 0 0 2px rgba(255,255,255,0.6); }
#buildPanel .item .lbl { font-size: 11px; }
#hotbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 5px; background: var(--glass2); border: 1px solid var(--line); border-radius: 12px; padding: 6px; z-index: 6; }
#hotbar .slot { position: relative; width: 62px; height: 62px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.05); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; cursor: pointer; font-size: 9px; }
#hotbar .slot.active { border-color: #fff; background: rgba(127,224,164,0.25); transform: translateY(-4px); }
#hotbar .slot.poor { opacity: .45; }
#hotbar .slot .key { position: absolute; top: 2px; left: 4px; font-size: 9px; color: var(--muted); }
#hotbar .slot .sw { width: 26px; height: 26px; border-radius: 5px; box-shadow: inset 0 -4px 0 rgba(0,0,0,0.18); }
#hotbar .slot .sw.wedge { clip-path: polygon(0 100%, 100% 100%, 100% 0); }
#hotbar .slot .sw.slab { height: 13px; margin-top: 13px; }
#hotbar .slot .ic { font-size: 20px; line-height: 26px; }
#hotbar .slot .lbl { max-width: 58px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hotbar .slot .cost { color: var(--muted); font-size: 8px; }
#buildPanel .tabs { display: flex; gap: 4px; flex-wrap: wrap; }
#buildPanel .tabs button { border: 0; background: transparent; color: var(--muted); padding: 5px 9px; border-radius: 8px; font-size: 12px; font-weight: 600; }
#buildPanel .tabs button.active { background: rgba(255,255,255,0.14); color: var(--text); }
#buildPanel .grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; align-content: start; }
#buildPanel .item { border: 1px solid var(--line); border-radius: 10px; padding: 8px 6px 6px; background: rgba(255,255,255,0.05); text-align: center; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
#buildPanel .item.active { border-color: var(--accent); background: rgba(127,224,164,0.15); }
#buildPanel .item .sw { width: 34px; height: 34px; border-radius: 8px; box-shadow: inset 0 -6px 0 rgba(0,0,0,0.18); }
#buildPanel .item .sw.wedge { clip-path: polygon(0 100%, 100% 100%, 100% 0); }
#buildPanel .item .ic { font-size: 24px; line-height: 34px; }
#buildPanel .item .cost { color: var(--muted); font-size: 10px; }
#buildPanel .item.poor { opacity: .45; }
#buildPanel .tools { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; gap: 6px; }
.offers .o input[type=color] { width: 30px; height: 26px; border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 0 2px; }
.offers .o input[type=text] { width: 120px; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); font: inherit; font-size: 12px; }
#buildPanel .tool { border: 1px solid var(--line); background: rgba(255,255,255,0.08); border-radius: 8px; padding: 5px 9px; font-size: 12px; }
#buildPanel .tool.active { border-color: #f25c54; background: rgba(242,92,84,0.2); }
#buildPanel .tool small, #buildPanel .rot small { color: var(--muted); margin-left: 4px; }

#chat { position: fixed; left: 18px; bottom: 210px; width: 300px; z-index: 5; pointer-events: none; }
#chatLog { display: flex; flex-direction: column; gap: 3px; margin-bottom: 6px; }
#chatLog div { font-size: 12px; background: rgba(10,18,30,0.55); padding: 4px 8px; border-radius: 8px; animation: fadeout 12s forwards; width: fit-content; max-width: 100%; }
#chatLog div b { color: var(--accent); }
@keyframes fadeout { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }
#chatInput { pointer-events: auto; width: 100%; padding: 8px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--glass2); color: var(--text); font: inherit; outline: none; }

#toasts { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; z-index: 20; pointer-events: none; }
#toasts div { background: var(--glass2); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; font-size: 13px; animation: toast 5s forwards; max-width: 460px; text-align: center; }
#toasts div.good { border-color: rgba(127,224,164,0.5); }
#toasts div.bad { border-color: rgba(242,92,84,0.6); }
#toasts div.offer { border-color: rgba(242,193,78,0.6); }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 8%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }

#claimBanner { position: fixed; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; z-index: 25; pointer-events: none; animation: claim 3.4s ease-out forwards; text-shadow: 0 4px 30px rgba(0,0,0,0.6); }
#claimBanner .small { font-size: 12px; letter-spacing: .4em; color: var(--accent); }
#claimBanner .big { font: 400 64px/1.1 Georgia, serif; margin: 6px 0; }
#claimBanner .sub { color: var(--muted); font-size: 14px; }
@keyframes claim { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); } 12% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); } 18% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
.modal { position: fixed; inset: 0; background: rgba(4,10,18,0.55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; z-index: 30; }
.modal .box { width: 420px; max-width: calc(100% - 32px); max-height: calc(100% - 32px); overflow: auto; background: #101d2e; border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; box-shadow: 0 30px 80px rgba(0,0,0,0.5); }
.modal .box.wide { width: 560px; }
.modal h2 { margin: 0 0 6px; font: 400 26px/1.2 Georgia, serif; }
.modal h3 { margin: 16px 0 6px; font-size: 12px; letter-spacing: .18em; color: var(--muted); text-transform: uppercase; }
.modal .muted, .muted { color: var(--muted); font-size: 12.5px; }
.modal .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.modal .row label { color: var(--muted); font-size: 12.5px; }
.modal input[type=text], .modal input:not([type]), .modal input[type=number] { flex: 1; max-width: 220px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--text); font: inherit; }
.modal input[type=color] { width: 44px; height: 30px; border: 1px solid var(--line); border-radius: 6px; background: transparent; padding: 0 2px; }
.modal select { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line); background: #1a2a40; color: var(--text); font: inherit; }
.modal .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.modal .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal .summary { background: rgba(255,255,255,0.06); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.modal .summary b { color: var(--gold); }
.modal code { background: rgba(255,255,255,0.1); padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.help { padding-left: 18px; margin: 10px 0; }
.help li { margin: 6px 0; font-size: 13px; color: #d4dee9; }
.offers { display: flex; flex-direction: column; gap: 6px; }
.offers .o { display: flex; align-items: center; gap: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; }
.offers .o .t { flex: 1; }
.offers .o .t small { display: block; color: var(--muted); }
.offers .o .st { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.offers .o .st.accepted { color: var(--accent); } .offers .o .st.rejected, .offers .o .st.void { color: #f25c54; } .offers .o .st.paid { color: var(--gold); }
.offers .empty { color: var(--muted); font-size: 12.5px; }
.modal .previews { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.modal .previews.one { grid-template-columns: 1fr; }
.settings { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 14px; }
/* metrics page */
.modal .box.metrics { width: 640px; }
.metrics .mhead h2 { margin-bottom: 2px; }
.metrics .df { color: #ff8a3d; font-weight: 700; }
.metrics .cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.metrics .card { background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.metrics .card b { display: block; font-size: 22px; line-height: 1.1; }
.metrics .card span { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.metrics .card i { display: block; font-style: normal; font-size: 11px; color: #4ade80; margin-top: 2px; }
.metrics .charts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metrics .charts h4 { margin: 0 0 4px; font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.metrics canvas { width: 100%; height: auto; background: rgba(0,0,0,0.25); border-radius: 10px; }
.metrics .small { font-size: 11px; margin-top: 8px; }
@media (max-width: 700px) { .metrics .cards { grid-template-columns: repeat(2, 1fr); } .metrics .charts { grid-template-columns: 1fr; } }
.settings label { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(255,255,255,0.05); cursor: pointer; }
.settings label:hover { background: rgba(255,255,255,0.09); }
.settings label input { grid-row: span 2; width: 18px; height: 18px; accent-color: #4ade80; }
.settings label span { color: var(--muted); font-size: 12px; }
#fps { position: fixed; left: 18px; bottom: 18px; z-index: 7; font: 600 12px/1 ui-monospace, monospace; color: #4ade80; background: rgba(0,0,0,0.5); padding: 6px 8px; border-radius: 8px; pointer-events: none; }
.modal .box.wide.center { width: 720px; }
.modal .previews div { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: radial-gradient(circle at 50% 40%, #1b3050, #0c1a2c 75%); }
.modal .previews canvas { display: block; width: 100%; height: auto; }
.modal .previews span { position: absolute; left: 10px; bottom: 8px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.payouts { background: rgba(242,193,78,0.08); border: 1px solid rgba(242,193,78,0.3); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.adPreview { height: 200px; border-radius: 10px; background: rgba(255,255,255,0.05) center/contain no-repeat; border: 1px dashed var(--line); margin: 10px 0; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
#adFile { font-size: 12px; color: var(--muted); }
#modalAd, #modalCheckout { z-index: 40; }   /* opened on top of other dialogs (airships panel, offers) */
.modal .box.center { text-align: center; }
.modal .btns.center { justify-content: center; }
.modal .box.landing { width: 520px; }
.modal .features { list-style: none; padding: 0; margin: 14px 0 6px; text-align: left; display: grid; gap: 7px; }
.modal .features li { font-size: 13px; color: #d4dee9; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; }
#btnReturnPlanet { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; }
#btnDismount { position: fixed; left: 50%; top: 64px; transform: translateX(-50%); z-index: 6; font-size: 13px; padding: 8px 14px; border-radius: 999px; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
#btnDismount kbd { margin-left: 6px; font-size: 11px; opacity: 0.8; }
/* RPG dialogue box */
#dialog { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); width: 680px; max-width: calc(100% - 24px); display: flex; gap: 16px; background: linear-gradient(180deg, rgba(14,24,40,0.96), rgba(8,14,26,0.96)); border: 2px solid #4ade80; border-radius: 14px; padding: 14px 16px; z-index: 8; box-shadow: 0 20px 50px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.06); }
#dialog img { width: 96px; height: 96px; object-fit: cover; object-position: top; border-radius: 10px; border: 2px solid rgba(255,255,255,0.15); background: #0b1626; flex: none; }
#dialog .body { flex: 1; min-width: 0; }
#dialog .who { font-weight: 700; letter-spacing: 0.02em; color: #4ade80; margin-bottom: 4px; }
#dialog .who span { color: var(--muted); font-weight: 500; }
#dialog .text { font-size: 15px; line-height: 1.45; min-height: 44px; white-space: pre-wrap; }
#dialog .text::after { content: '▌'; color: #4ade80; animation: blink 1s steps(2) infinite; }
#dialog .text.done::after { content: ''; }
@keyframes blink { to { opacity: 0; } }
#dialog .choices { display: flex; flex-direction: column; gap: 4px; margin-top: 10px; }
#dialog .choices button { text-align: left; background: rgba(255,255,255,0.06); border: 1px solid transparent; color: var(--text); padding: 7px 10px; border-radius: 8px; font-size: 14px; }
#dialog .choices button:hover, #dialog .choices button:focus { background: rgba(74,222,128,0.15); border-color: rgba(74,222,128,0.5); outline: 0; }
#dialog .choices button kbd { margin-right: 8px; font-size: 11px; }
#dialog .hint { color: var(--muted); font-size: 12px; margin-top: 8px; }
#visitorBar { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); display: flex; gap: 12px; align-items: center; background: var(--glass2); border: 1px solid rgba(127,224,164,0.5); border-radius: 12px; padding: 8px 10px 8px 16px; z-index: 6; font-size: 13px; }
.modal .mark.big { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 12px; background: radial-gradient(circle at 35% 35%, #7fd0ff, #2e7fc0 55%, #173f66); box-shadow: 0 0 40px rgba(90,170,255,0.4); position: relative; overflow: hidden; }
.modal .mark.big::after { content: ""; position: absolute; left: 10px; top: 24px; width: 42px; height: 24px; border-radius: 50%; background: #64c25a; transform: rotate(-12deg); }
.modal button.big { font-size: 15px; padding: 11px 20px; display: inline-flex; align-items: center; gap: 10px; }
.modal .muted.small { font-size: 11.5px; margin-top: 14px; }
.modal a { color: var(--accent); }
@media (max-width: 900px) { #hints { display: none; } #buildPanel { width: 240px; } #parcelCard { width: 250px; } }

/* ============================================================ phones: a compact HUD that never overlaps; gestures replace keys */
@media (max-width: 760px) {
  #logo, #hints, #online { display: none !important; }
  #topbar { top: 8px; left: 8px; right: 52px; transform: none; flex-wrap: wrap; gap: 4px; }
  #topbar .pill { font-size: 10.5px; padding: 4px 9px; }
  #topbar .pill.res span { margin: 0 3px; }
  #parcelCount { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  #topright { top: 8px; right: 8px; flex-direction: column; gap: 5px; }
  #topright button.icon { width: 34px; height: 34px; font-size: 14px; }
  #myLands { top: 74px; left: 8px; right: auto; align-items: flex-start; gap: 4px; }
  #myLands button { font-size: 11px; padding: 4px 9px 4px 7px; }
  #btnReturnMe, #btnReturnPlanet, #btnDismount { top: 168px; font-size: 12px; padding: 7px 12px; }
  #toasts { top: 118px; left: 8px; right: 8px; transform: none; align-items: center; }
  #toasts div { max-width: 100%; font-size: 12px; }
  #creatureList, #parcelList { left: 8px; right: 8px; top: 70px; bottom: 120px; width: auto; max-height: none; }
  #parcelCard { left: 8px; bottom: 8px; width: calc(100% - 104px); padding: 10px 12px; }
  #parcelCard .name { font-size: 20px; }
  #parcelCard .name .edit { width: 26px; height: 26px; }
  #parcelCard .tagline { display: none; }
  #parcelCard .actions button { padding: 6px 10px; font-size: 12px; }
  #portrait { width: 76px; height: 76px; right: 8px; bottom: 8px; }
  #portrait .caption { font-size: 9px; }
  #menuWrap { right: 8px; bottom: auto; top: 250px; }
  #menuWrap #menuBtn { width: 34px; height: 34px; }
  #menu { min-width: 210px; bottom: auto; top: 40px; }
  body.building #parcelCard, body.building #portrait, body.building #chat, body.building #myLands, body.talking #parcelCard, body.talking #myLands { display: none !important; }
  #buildPanel .rot small, #buildPanel .tool small { display: none; }
  #prompt { top: 168px; bottom: auto; left: 8px; right: 8px; transform: none; justify-content: center; padding: 8px 12px; pointer-events: auto; cursor: pointer; }
  #prompt kbd { display: none; }
  #prompt .bar { width: 140px; }
  #unitMenu { left: 8px; right: 8px; top: 168px; bottom: auto; transform: none; min-width: 0; }
  #chat { left: 8px; top: 222px; bottom: auto; width: calc(100% - 104px); }
  #chat.open #chatInput { display: block; }
  #buildPanel { left: 8px; right: 8px; top: auto; bottom: 96px; height: 46vh; width: auto; padding: 8px 10px; }
  #buildPanel .head span { display: none; }
  #buildPanel .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #buildPanel .tabs button { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
  #buildPanel .grid { grid-template-columns: repeat(4, 1fr); }
  #buildPanel:not([hidden]) ~ #portrait, #buildPanel:not([hidden]) ~ #parcelCard, #buildPanel:not([hidden]) ~ #chat { display: none; }
  #hotbar { left: 8px; right: 8px; bottom: 8px; transform: none; overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 5px; gap: 4px; }
  #hotbar .slot { width: 54px; height: 54px; flex: none; }
  #hotbar .slot .key { display: none; }
  .modal { align-items: flex-end; }
  .modal .box, .modal .box.wide, .modal .box.wide.center, .modal .box.metrics { width: 100%; max-width: 100%; max-height: 92%; border-radius: 16px 16px 0 0; padding: 16px 16px 20px; }
  .modal h2 { font-size: 20px; }
  .modal .previews.one canvas, .modal .previews canvas { width: 100%; height: auto; }
  #dialog { left: 8px; right: 8px; bottom: 100px; width: auto; transform: none; gap: 10px; padding: 10px 12px; }
  #dialog img { width: 60px; height: 60px; }
  #dialog .text { font-size: 13.5px; min-height: 36px; }
  #dialog .choices button { font-size: 13px; padding: 7px 9px; }
  #dialog .hint { display: none; }
  #visitorBar { left: 8px; right: 8px; bottom: 100px; transform: none; flex-wrap: wrap; justify-content: center; }
  #claimBanner .big { font-size: 38px; }
  #fps { left: 8px; bottom: 96px; }
  .settings label { padding: 7px 9px; }
}
