/* Visual "Industry" (blueprint) herdado do protótipo da AERYN */
@font-face { font-family: 'Barlow'; font-weight: 400; src: url(../assets/fonts/barlow-400.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 500; src: url(../assets/fonts/barlow-500.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow'; font-weight: 700; src: url(../assets/fonts/barlow-700.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 400; src: url(../assets/fonts/barlowcond-400.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 600; src: url(../assets/fonts/barlowcond-600.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; font-weight: 700; src: url(../assets/fonts/barlowcond-600.woff2) format('woff2'); font-display: swap; }

:root {
  --bg: #1d2d3d; --ink: #f2f2f3; --acc: #b5d9fd; --acc2: #d6ebff;
  --line: rgba(242,242,243,.16); --panel: rgba(14,22,30,.72);
  --head: 'Barlow Condensed', system-ui, sans-serif; --body: 'Barlow', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0e161e; color: var(--ink); font-family: var(--body); user-select: none; }
canvas#game, canvas#ui { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
canvas#game { image-rendering: pixelated; }
canvas#ui { pointer-events: none; }
h1, h2, h6 { font-family: var(--head); font-weight: 600; margin: 0; letter-spacing: .04em; }

.panel { background: var(--panel); border: 1px solid var(--line); padding: 12px 14px; backdrop-filter: blur(4px); }
.blueprint { position: relative; }
.blueprint > .corner { position: absolute; width: 11px; height: 11px; color: var(--acc); }
.blueprint > .corner::before, .blueprint > .corner::after { content: ""; position: absolute; background: currentColor; }
.blueprint > .corner::before { left: 5px; top: 0; width: 1px; height: 100%; }
.blueprint > .corner::after { top: 5px; left: 0; width: 100%; height: 1px; }
.corner.tl { top: -6px; left: -6px; } .corner.tr { top: -6px; right: -6px; } .corner.bl { bottom: -6px; left: -6px; } .corner.br { bottom: -6px; right: -6px; }

.btn { font-family: var(--head); font-weight: 600; font-size: 16px; letter-spacing: .1em; padding: 10px 18px; border: 0; cursor: pointer; background: var(--acc); color: var(--bg); }
.btn:hover:not(:disabled) { background: var(--acc2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Login */
#login { position: fixed; inset: 0; overflow-y: auto; display: grid; place-items: safe center; background: var(--bg) linear-gradient(rgba(148,188,227,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(148,188,227,.06) 1px, transparent 1px); background-size: 64px 64px; z-index: 10; }
#login-form { width: min(380px, 92vw); display: flex; flex-direction: column; gap: 12px; }
#login h1 { font-size: 44px; line-height: 1; } #login h1 span { color: rgba(242,242,243,.55); font-weight: 500; }
#login .sub { margin: 0; color: rgba(242,242,243,.65); }
.stage { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.25); border: 1px solid var(--line); padding: 4px 12px; background-image: linear-gradient(rgba(181,217,253,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(181,217,253,.06) 1px, transparent 1px); background-size: 24px 24px; }
#preview { width: 192px; height: 192px; image-rendering: pixelated; }
.who b { display: block; font-family: var(--head); font-size: 26px; font-weight: 600; } .who span { color: var(--acc); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
#login label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; letter-spacing: .1em; color: rgba(242,242,243,.65); text-transform: uppercase; }
#name, #user, #pass, #pass2 { font: 500 16px var(--body); padding: 9px 10px; color: var(--ink); background: rgba(0,0,0,.3); border: 1px solid var(--line); user-select: text; }
#name:focus, #user:focus, #pass:focus, #pass2:focus { outline: 2px solid var(--acc); outline-offset: 0; }
#auth { display: flex; flex-direction: column; gap: 12px; }
#chars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
#chars button { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 10px; color: var(--ink); background: transparent; border: 1px solid var(--line); cursor: pointer; text-align: left; }
#chars button b { font: 600 16px var(--head); letter-spacing: .04em; } #chars button span { font-size: 11px; opacity: .65; text-transform: none; letter-spacing: 0; }
#chars button.on { background: var(--acc); color: var(--bg); border-color: var(--acc); }
#classes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
#classes button { display: flex; flex-direction: column; align-items: flex-start; padding: 6px 10px; color: var(--ink); background: transparent; border: 1px solid var(--line); cursor: pointer; text-align: left; }
#classes button b { font: 600 16px var(--head); letter-spacing: .04em; }
#classes button.on { background: var(--acc); color: var(--bg); border-color: var(--acc); }
#create { display: flex; flex-direction: column; gap: 10px; }
#class-desc { min-height: 3.6em; color: rgba(242,242,243,.7); }
#login-form.creating #preview { width: 128px; height: 128px; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover:not(:disabled) { background: rgba(242,242,243,.1); }

.msg { margin: 0; min-height: 1.3em; color: #ff9d8f; font-size: 13px; } .hint { margin: 0; font-size: 12px; color: rgba(242,242,243,.45); }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
#hud > * { pointer-events: auto; }
#hud > #netstat { position: absolute; right: 20px; bottom: 20px; display: flex; gap: 12px; padding: 3px 9px; font: 600 13px var(--head); letter-spacing: .05em; color: rgba(242,242,243,.75); background: rgba(14,22,30,.55); border: 1px solid var(--line); pointer-events: none; font-variant-numeric: tabular-nums; }
#netstat.off { display: none !important; }
#netstat .good { color: #5bd17a; } #netstat .warn { color: #e6c879; } #netstat .bad { color: #ff7b6b; }
#left { position: absolute; left: 20px; top: 20px; width: 250px; display: flex; flex-direction: column; gap: 8px; }
#plate { width: 250px; display: flex; flex-direction: column; gap: 6px; }
#plate .row { display: flex; justify-content: space-between; font-family: var(--head); font-size: 20px; font-weight: 600; } #plate .row span { color: var(--acc); }
.bar { position: relative; height: 16px; background: rgba(0,0,0,.45); border: 1px solid var(--line); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; width: 100%; transition: width .15s; }
.bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 11px; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.hp i { background: #4cae68; } .mp i { background: #4a86d6; } .xp { height: 11px; } .xp i { background: #c9a14a; } .xp span { font-size: 9px; }

#target { position: absolute; left: 50%; top: 20px; transform: translateX(-50%); width: 230px; display: flex; flex-direction: column; gap: 6px; }
#target .row { display: flex; justify-content: space-between; font-family: var(--head); font-size: 18px; font-weight: 600; } #target .row span { color: #ffb8a8; }
.foe i { background: #e5584a; }

#hotbar { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 14px; align-items: flex-end; }
/* botão redondo com anel metálico e ícone; a tecla fica num selo no canto inferior direito (estilo Albion) */
.slot { --ring: #8fa3b5; position: relative; display: block; width: 58px; height: 58px; min-width: 0; padding: 0; border-radius: 50%; border: 3px solid var(--ring); background: radial-gradient(circle at 35% 28%, rgba(64,86,112,.96), rgba(12,20,30,.94) 72%); box-shadow: 0 3px 8px rgba(0,0,0,.6), inset 0 0 0 2px rgba(0,0,0,.4), inset 0 2px 4px rgba(255,255,255,.14); cursor: pointer; user-select: none; font-family: var(--head); }
.slot:hover { filter: brightness(1.22); } .slot:active { scale: .94; }
.slot .ico { display: grid; place-items: center; position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; } .slot .ico svg, .slot .ico img { width: 64%; height: 64%; image-rendering: pixelated; }
.slot span, .slot small { display: none; }
.slot kbd { position: absolute; right: -6px; bottom: -6px; z-index: 3; min-width: 19px; padding: 0 4px; font: 700 12px/17px var(--head); text-align: center; color: var(--ink); background: rgba(8,14,20,.95); border: 1px solid rgba(242,242,243,.45); border-radius: 9px; }
.slot[data-slot=attack] kbd, .slot[data-slot=dash] kbd, .slot[data-slot=tab] kbd { font-size: 10px; }
.slot[data-k=sword] { --ring: #c9d3dd; } .slot[data-k=slash] { --ring: #ff9a3c; } .slot[data-k=orb] { --ring: #7a8cff; } .slot[data-k=arrow] { --ring: #7fd35a; } .slot[data-k=dash], .slot[data-k=back] { --ring: #3fd6c4; } .slot[data-k=blink] { --ring: #9d8cff; } .slot[data-k=blast] { --ring: #ff9a3c; } .slot[data-k=stunarrow] { --ring: #ffd45a; } .slot[data-k=snipe] { --ring: #7fd35a; } .slot[data-k=target] { --ring: #ffd45a; }
.slot.off { opacity: .55; filter: saturate(.35); }
.slot.empty { opacity: .28; border-style: dashed; }
.slot.cd::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(6,10,16,.8) calc(var(--cd, 0) * 1%), transparent 0); }
.slot .cdt { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font: 700 17px var(--head); font-style: normal; text-shadow: 0 1px 3px #000; pointer-events: none; }
.slot.pot small { display: block; position: absolute; right: -5px; top: -5px; z-index: 3; padding: 0 5px; font: 700 12px/16px var(--head); color: #ffd45a; background: rgba(8,14,20,.95); border: 1px solid rgba(255,212,90,.5); border-radius: 9px; }
kbd { font-family: var(--head); font-weight: 600; font-size: 14px; min-width: 22px; padding: 0 5px; border: 1px solid rgba(242,242,243,.4); }

#side { position: absolute; right: 20px; top: 20px; width: 150px; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
#minimap { width: 132px; height: 132px; border: 1px solid var(--line); }
#place { width: 100%; padding: 6px 10px; text-align: center; font: 600 14px var(--head); letter-spacing: .06em; color: var(--acc); }
#travel { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#travel .panel { width: min(440px, 92vw); display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
#travel h2 { font-size: 32px; } #travel .hint { margin: 0; }
#travel-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; }
.map-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; text-align: left; padding: 9px 12px; color: var(--ink); background: transparent; border: 1px solid var(--line); cursor: pointer; }
.map-item b { font: 600 20px var(--head); letter-spacing: .04em; } .map-item em { font: 600 14px var(--head); font-style: normal; color: var(--acc); align-self: center; }
.map-item span { grid-column: 1 / -1; font-size: 12px; opacity: .7; }
.map-item.on { background: var(--acc); color: var(--bg); border-color: var(--acc); } .map-item.on em { color: var(--bg); }
.map-item:disabled { opacity: .4; cursor: not-allowed; }
#travel .actions { display: flex; gap: 8px; } #travel .actions .btn { flex: 1; }
/* câmaras de boss */
#bosses, #boss-ready, #boss-result { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#bosses .panel { width: min(640px, 96vw); max-height: 92dvh; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
#bosses .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } #bosses h2 { font-size: 30px; margin: 0; } #bosses small { color: var(--acc); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
#bosses .row .btn { padding: 2px 10px; min-height: 0; }
#bosses-line { margin: 0; padding: 8px 10px; background: rgba(0,0,0,.28); border-left: 3px solid var(--acc); font-size: 13px; font-style: italic; }
#bosses-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 2px; }
.bcard { --bc: #7fb4e8; display: grid; gap: 3px; padding: 9px 12px; border: 1px solid var(--line); border-left: 4px solid var(--bc); background: rgba(0,0,0,.2); }
.bcard .bhead { display: flex; justify-content: space-between; align-items: baseline; } .bcard .bhead b { font: 600 20px var(--head); letter-spacing: .04em; color: var(--bc); } .bcard .bhead em { font: 600 14px var(--head); font-style: normal; color: var(--acc); }
.bcard small { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #9fb3c5; } .bcard p { margin: 2px 0; font-size: 12px; opacity: .85; }
.bcard .bfoot { display: flex; align-items: center; gap: 10px; margin-top: 3px; } .bcard .bfoot .btn { padding: 5px 12px; font-size: 13px; min-height: 0; } .bcard .bq { font-size: 12px; opacity: .8; }
.bcard.locked, .bcard.level, .bcard.inroom { opacity: .72; }
#boss-ready .panel, #boss-result .panel { width: min(420px, 92vw); display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; text-align: center; }
#boss-ready h2, #boss-result h2 { margin: 0; font-size: 30px; } #boss-result h2.win { color: #5bd17a; } #boss-result h2.lose { color: #ff7b6b; }
#boss-ready .actions, #boss-result .actions { display: flex; gap: 8px; } #boss-ready .actions .btn, #boss-result .actions .btn { flex: 1; }
#boss-result-loot { display: flex; flex-direction: column; gap: 4px; max-height: 40vh; overflow-y: auto; align-items: center; } #boss-result-loot .rl { display: flex; align-items: center; gap: 8px; font-size: 14px; } #boss-result-loot img { width: 28px; height: 28px; image-rendering: pixelated; }
#boss-bar { position: fixed; top: calc(8px + var(--st, 0px)); left: 50%; transform: translateX(-50%); width: min(520px, 62vw); z-index: 8; pointer-events: none; text-align: center; }
#boss-bar .bb-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 600 15px var(--head); letter-spacing: .06em; text-shadow: 0 1px 3px #000; } #boss-bar .bb-top b { color: #ffd45a; font-size: 18px; } #boss-bar .bb-top span { opacity: .85; font-size: 13px; }
#boss-bar.shield .bar i { filter: hue-rotate(250deg) saturate(1.4); }
#bb-tags { min-height: 4px; display: flex; justify-content: center; gap: 8px; } #bb-tags i { font: 700 11px var(--head); font-style: normal; letter-spacing: .1em; padding: 1px 8px; border-radius: 3px; background: rgba(8,14,20,.9); } #bb-tags .sh { color: #c88aff; border: 1px solid #c88aff; } #bb-tags .en { color: #ff7b6b; border: 1px solid #ff7b6b; }
/* ranking (highscore) */
#rank { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#rank .panel { width: min(460px, 92vw); display: flex; flex-direction: column; gap: 12px; padding: 20px 22px; }
#rank h2 { font-size: 32px; margin: 0; }
#rank .tabs, #rank .actions { display: flex; gap: 8px; } #rank .tabs .btn, #rank .actions .btn { flex: 1; }
#rank .tabs .btn:not(.on) { opacity: .7; }
#rank-list { display: flex; flex-direction: column; gap: 3px; max-height: 50vh; overflow-y: auto; }
.rk { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); }
.rk i { font: 600 18px var(--head); font-style: normal; text-align: center; opacity: .8; }
.rk b { font: 600 18px var(--head); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk em { font: 600 14px var(--head); font-style: normal; color: var(--acc); white-space: nowrap; }
.rk small { grid-column: 2 / -1; font-size: 12px; opacity: .65; margin-top: -4px; }
.rk.top1 i { color: #ffd45a; } .rk.top2 i { color: #cfd8e3; } .rk.top3 i { color: #d99a63; }
.rk.me { background: var(--acc); color: var(--bg); border-color: var(--acc); } .rk.me em, .rk.me i { color: var(--bg); }
.rk-empty { padding: 14px; text-align: center; opacity: .7; }
/* menu lateral: botões redondos com ícone (o nome vira dica ao passar o mouse); vários por linha */
#menu-icons { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; width: 100%; }
.btn.rbtn { --ring: #8fa3b5; position: relative; display: grid; place-items: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 3px solid var(--ring); background: radial-gradient(circle at 35% 28%, rgba(64,86,112,.96), rgba(12,20,30,.94) 72%); color: var(--ink); box-shadow: 0 3px 8px rgba(0,0,0,.55), inset 0 0 0 2px rgba(0,0,0,.4), inset 0 2px 4px rgba(255,255,255,.14); }
.btn.rbtn:hover:not(:disabled) { background: radial-gradient(circle at 35% 28%, rgba(88,116,148,.98), rgba(18,28,40,.94) 72%); filter: brightness(1.15); }
.btn.rbtn:active { scale: .93; }
.rbtn[hidden] { display: none !important; }
.rbtn .ico { display: grid; place-items: center; width: 62%; height: 62%; pointer-events: none; } .rbtn .ico svg { width: 100%; height: 100%; }
.rbtn .lbl { display: none; }
.rbtn[data-k=help] { --ring: #7fb4e8; } .rbtn[data-k=bag] { --ring: #c9a36a; } .rbtn[data-k=invite] { --ring: #7fd8ff; } .rbtn[data-k=party] { --ring: #c4a6ff; } .rbtn[data-k=fish] { --ring: #4aa3d8; } .rbtn[data-k=chat] { --ring: #b9c6d3; } .rbtn[data-k=follow] { --ring: #7fe08c; } .rbtn[data-k=hunt] { --ring: #ff9a3c; } .rbtn[data-k=home] { --ring: #ffd45a; } .rbtn[data-k=fullscreen] { --ring: #b9c6d3; } .rbtn[data-k=exit] { --ring: #ff7b6b; }
.btn.rbtn:not(.on)[data-k=follow] { filter: saturate(.55) brightness(.9); }
.btn.rbtn.on { box-shadow: 0 0 12px rgba(91,209,122,.7), inset 0 0 0 2px rgba(0,0,0,.4); }
#side .panel { width: 100%; padding: 8px 10px; } #side h6 { font-size: 12px; letter-spacing: .14em; color: var(--acc); margin-bottom: 4px; }
#online-list { list-style: none; margin: 0; padding: 0; font-size: 12px; max-height: 160px; overflow: auto; } #online-list li { padding: 1px 0; }

#chat { position: absolute; left: 20px; bottom: 20px; width: min(340px, calc(50vw - 270px)); display: flex; flex-direction: column; gap: 4px; }
#chat-log { height: 130px; overflow-y: auto; padding: 6px 8px; font-size: 13px; line-height: 1.35; background: rgba(14,22,30,.5); border: 1px solid var(--line); user-select: text; }
#chat-log b { color: var(--acc); } #chat-log .sys { color: #c9a14a; }
#chat-input { font: 400 13px var(--body); padding: 6px 8px; color: var(--ink); background: rgba(14,22,30,.7); border: 1px solid var(--line); user-select: text; }
#chat-input:focus { outline: 1px solid var(--acc); }

#death, #lost { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(60,10,10,.45); z-index: 20; }
#lost { background: rgba(10,16,22,.8); }
#death .panel, #lost .panel { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; padding: 20px 30px; }
#death h2, #lost h2 { font-size: 38px; }

/* ouro e mochila */
#plate .gold { font-size: 14px; color: var(--ink); } #plate .gold b { color: #ffd45a; }
#inv { position: absolute; right: 190px; top: 20px; width: 262px; display: flex; flex-direction: column; gap: 8px; }
#inv .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--head); font-size: 18px; } #inv .row span { flex: 1; text-align: right; } #inv .row .btn { padding: 4px 10px; font-size: 13px; min-height: 34px; } #inv .row span b { color: #ffd45a; }
#inv-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.islot { position: relative; aspect-ratio: 1; border: 1px solid var(--line); background: rgba(10,16,22,.6); cursor: pointer; padding: 0; }
.islot.on { border-color: var(--acc); }
.islot i { position: absolute; inset: 22%; transform: rotate(45deg); border: 1px solid rgba(0,0,0,.6); }
.islot img { position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px); image-rendering: pixelated; pointer-events: none; }
.islot em { color: #fff; position: absolute; right: 3px; bottom: 1px; font: 700 12px var(--head); font-style: normal; text-shadow: 0 1px 2px #000; }
#inv-info { min-height: 52px; font-size: 13px; } #inv-info b { font-family: var(--head); font-size: 16px; } #inv-info p { margin: 2px 0 0; color: #9fb3c5; }
#inv .actions { display: flex; gap: 6px; } #inv .actions .btn { flex: 1; padding: 6px 8px; font-size: 14px; }

/* baú da ilha */
#chest { position: absolute; right: 462px; top: 20px; width: 340px; display: flex; flex-direction: column; gap: 8px; }
#chest .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-family: var(--head); font-size: 18px; } #chest .row span { flex: 1; text-align: right; font-size: 14px; } #chest .row span b { color: #ffd45a; font-size: 14px; }
#chest .row .btn { padding: 4px 8px; font-size: 13px; }
#chest-grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
#chest .hint { margin: 0; font-size: 12px; color: #9fb3c5; }

/* PvP: o mapa decide */
#place.pvp { color: #ff7b6b; }


/* atalho de poção */


/* ===== Celular / telas pequenas ===== */
html { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; -webkit-touch-callout: none; }
canvas#game, canvas#ui { height: 100dvh; touch-action: none; }
#login { height: 100dvh; }
:root { --sl: env(safe-area-inset-left, 0px); --sr: env(safe-area-inset-right, 0px); --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px); }
#menu-btn, #chat-btn { display: none; }
#joy { display: none; }
html.touch #joy { display: block; position: absolute; left: calc(18px + var(--sl)); bottom: calc(18px + var(--sb)); width: 128px; height: 128px; border-radius: 50%; background: rgba(14,22,30,.35); border: 2px solid rgba(181,217,253,.35); touch-action: none; }
#joy i { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: rgba(181,217,253,.45); border: 2px solid rgba(181,217,253,.7); pointer-events: none; }

@media (max-width: 900px), (max-height: 520px), (pointer: coarse) {
  .btn { min-height: 34px; }
  #login-form { padding: 10px 12px; gap: 8px; } #login h1 { font-size: 34px; }
  #preview { width: 128px; height: 128px; } #login-form.creating #preview { width: 96px; height: 96px; }
  #login .hint:last-child { display: none; }

  #hud > #netstat { display: none; }
  #left { left: calc(8px + var(--sl)); top: calc(8px + var(--st)); width: 172px; gap: 4px; }
  #plate { width: 172px; padding: 6px 8px; gap: 3px; } #plate .row { font-size: 15px; }
  .bar { height: 13px; } .bar span { font-size: 10px; } .xp { height: 9px; } .xp span { font-size: 8px; }
  #plate .gold { font-size: 12px; }
  #target { top: calc(8px + var(--st)); width: 150px; padding: 6px 8px; gap: 3px; } #target .row { font-size: 14px; }

  #menu-btn { display: block; position: absolute; right: calc(8px + var(--sr)); top: calc(8px + var(--st)); width: 44px; height: 44px; padding: 0; font-size: 22px; z-index: 9; background: rgba(14,22,30,.72); }
  #side { right: calc(8px + var(--sr)); top: calc(58px + var(--st)); width: 150px; gap: 6px; z-index: 9; }
  #side > .panel, #side .rbtn { display: none; }
  /* minimapa redondo e pequeno, ao lado do ☰ (não cobre mais os botões de ação) */
  #side #minimap { position: fixed; right: calc(60px + var(--sr)); top: calc(8px + var(--st)); width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(181,217,253,.45); box-shadow: 0 0 0 2px rgba(10,16,22,.65); background: rgba(14,22,30,.8); z-index: 9; }
  #side.open { max-height: calc(100dvh - 66px - var(--st)); overflow-y: auto; }
  #side.open #menu-icons { flex-direction: column; flex-wrap: nowrap; gap: 6px; }
  #side.open .rbtn:not([hidden]) { display: flex; }
  #side.open #place { display: block; }
  #side.open .rbtn { width: 100%; height: auto; border-radius: 8px; border-width: 1px; padding: 6px 10px; font-size: 14px; gap: 10px; justify-content: flex-start; align-items: center; box-shadow: none; background: rgba(14,22,30,.8); }
  #side.open .rbtn .ico { width: 22px; height: 22px; flex: none; } #side.open .rbtn .lbl { display: inline; font-weight: 600; letter-spacing: .08em; }
  #chat-btn { display: block; }
  #hud:has(#side.open) #hotbar { visibility: hidden; }

  /* barra de habilidades: grade de botões no canto direito */
  /* habilidades em arco (estilo Albion): ataque grande no canto, o resto em botões redondos ao redor (posições --dx/--dy vêm do JS) */
  #hotbar { left: auto; top: auto; transform: none; right: calc(80px + var(--sr)); bottom: calc(80px + var(--sb)); width: 0; height: 0; display: block; }
  .slot { --ring: #8fa3b5; position: absolute; left: 0; top: 0; width: 44px; height: 44px; min-width: 0; padding: 0; border-radius: 50%; border: 2px solid var(--ring); background: radial-gradient(circle at 35% 28%, rgba(64,86,112,.96), rgba(12,20,30,.94) 72%); box-shadow: 0 2px 6px rgba(0,0,0,.55), inset 0 0 0 2px rgba(0,0,0,.35); transform: translate(calc(var(--dx, 0px) - 50%), calc(var(--dy, 0px) - 50%)); touch-action: none; user-select: none; -webkit-tap-highlight-color: transparent; }
  .slot:active { scale: .92; }
  .slot[data-slot=attack] { width: 72px; height: 72px; border-width: 3px; }
  .slot kbd, .slot span, .slot small { display: none; }
  .slot .ico { display: grid; place-items: center; position: absolute; inset: 0; border-radius: 50%; overflow: hidden; pointer-events: none; } .slot .ico svg, .slot .ico img { width: 66%; height: 66%; image-rendering: pixelated; }
  .slot[data-k=sword] { --ring: #c9d3dd; } .slot[data-k=slash] { --ring: #ff9a3c; } .slot[data-k=orb] { --ring: #7a8cff; } .slot[data-k=arrow] { --ring: #7fd35a; } .slot[data-k=dash], .slot[data-k=back] { --ring: #3fd6c4; } .slot[data-k=blink] { --ring: #9d8cff; } .slot[data-k=blast] { --ring: #ff9a3c; } .slot[data-k=stunarrow] { --ring: #ffd45a; } .slot[data-k=snipe] { --ring: #7fd35a; } .slot[data-k=target] { --ring: #ffd45a; }
  .slot.empty { opacity: .26; border-style: dashed; }
  .slot.off { opacity: .55; filter: saturate(.35); }
  .slot.cd { opacity: 1; } .slot.cd::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(rgba(6,10,16,.8) calc(var(--cd, 0) * 1%), transparent 0); }
  .slot .cdt { font-size: 15px; z-index: 1; }
  .slot.pot { margin-left: 0; border-color: var(--ring) !important; }
  .slot.pot small { display: block; position: absolute; right: -3px; top: auto; bottom: -3px; z-index: 2; padding: 0 4px; font: 700 11px/15px var(--head); color: #ffd45a; background: rgba(8,14,20,.94); border: 1px solid rgba(255,212,90,.5); border-radius: 9px; }

  /* chat enxuto: ao lado do direcional; o campo só aparece ao tocar em CHAT */
  #chat { left: calc(8px + var(--sl)); bottom: calc(8px + var(--sb)); width: calc(100vw - 16px - 240px - var(--sl) - var(--sr)); min-width: 150px; max-width: 360px; }
  html.touch #chat { left: calc(158px + var(--sl)); width: calc(100vw - 166px - 240px - var(--sl) - var(--sr)); }
  #chat-log { height: 64px; font-size: 11px; padding: 3px 6px; }
  #chat-input { display: none; font-size: 16px; }
  #chat.typing #chat-input { display: block; }

  /* painéis como janelas que cabem na tela */
  #inv, #chest { position: fixed; z-index: 12; max-height: calc(100dvh - 16px - var(--st) - var(--sb)); overflow-y: auto; padding: 8px 10px; }
  #inv { right: calc(8px + var(--sr)); left: auto; top: calc(8px + var(--st)); width: min(250px, 44vw); }
  #chest { left: calc(8px + var(--sl)); top: calc(8px + var(--st)); width: auto; right: calc(min(250px, 44vw) + 16px + var(--sr)); }
  #inv-info { min-height: 36px; }
  #inv .actions { flex-wrap: wrap; } #inv .actions .btn { font-size: 12px; padding: 6px 4px; }
  #chest-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; }
  .islot { min-width: 0; }
  #travel .panel { max-height: 94dvh; overflow-y: auto; padding: 14px; gap: 8px; } #travel-list { max-height: 34dvh; } #travel h2 { font-size: 26px; }
  #death h2, #lost h2 { font-size: 30px; }
}

/* em pé: baú no alto e mochila embaixo, em largura total; direcional sobe o chat */
@media (orientation: portrait) and (max-width: 900px) {
  #inv { left: calc(8px + var(--sl)); right: calc(8px + var(--sr)); top: auto; bottom: calc(8px + var(--sb)); width: auto; max-height: 46dvh; }
  #chest { left: calc(8px + var(--sl)); right: calc(8px + var(--sr)); top: calc(8px + var(--st)); max-height: 44dvh; }
  #chat, html.touch #chat { left: calc(8px + var(--sl)); width: calc(100vw - 16px - var(--sl) - var(--sr)); max-width: 420px; bottom: calc(205px + var(--sb)); }
  #target { left: auto; right: calc(60px + var(--sr)); transform: none; width: 130px; top: calc(8px + var(--st)); }
}
@media (max-width: 900px) and (orientation: landscape), (max-height: 520px) { #chest-grid { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
@media (orientation: portrait) and (max-width: 900px) { #inv-grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 2px; } }

/* pesca */
#fish-msg { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 6px 16px; background: rgba(10,16,22,.82); border: 1px solid var(--line); color: var(--ink); font: 600 17px var(--head); letter-spacing: .05em; z-index: 6; }
#fish-msg.bite { border-color: #ffd45a; color: #ffd45a; }
.islot .noicon { position: absolute; inset: 24%; transform: rotate(45deg); border: 1px solid rgba(0,0,0,.6); }

/* equipamento */
#inv-eq { display: flex; align-items: center; gap: 10px; padding: 4px 0; } #inv-eq .islot { width: 46px; flex: none; }
#inv-eq small { display: block; font-size: 10px; letter-spacing: .14em; color: #9fb3c5; } #inv-eq b { font: 600 15px var(--head); }
#inv-stats { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 1px 8px; font-size: 12px; } #inv-stats dt { color: #9fb3c5; } #inv-stats dd { margin: 0; }
#eq-slot.on { border-color: var(--acc); }

/* celular (toque): sem chat por enquanto; aviso para girar o aparelho */
html.touch #chat, html.touch #chat-btn { display: none !important; }
#rotate-hint { position: absolute; left: 50%; top: calc(14px + var(--st)); transform: translateX(-50%); max-width: 80vw; padding: 8px 14px; text-align: center; background: rgba(10,16,22,.88); border: 1px solid var(--acc); color: var(--ink); font: 600 15px var(--head); letter-spacing: .03em; z-index: 30; pointer-events: none; }

/* convite para a ilha */
#invite { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#invite .panel { width: min(380px, 92vw); display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; } #invite h2 { font-size: 28px; }
#invite-name { font: 500 16px var(--body); padding: 9px 10px; color: var(--ink); background: rgba(0,0,0,.3); border: 1px solid var(--line); user-select: text; } #invite-name:focus { outline: 2px solid var(--acc); }
#invite .actions, #invite-in .actions { display: flex; gap: 8px; } #invite .actions .btn, #invite-in .actions .btn { flex: 1; }
#invite-in { position: absolute; left: 50%; top: 70px; transform: translateX(-50%); width: min(320px, 92vw); display: flex; flex-direction: column; gap: 8px; z-index: 15; } #invite-in p { margin: 0; font-size: 14px; } #invite-in b { color: var(--acc); font-family: var(--head); font-size: 17px; }

/* grupo (PT) */
#party { display: flex; flex-direction: column; gap: 4px; padding: 6px 8px; }
#party .row { display: flex; align-items: center; gap: 8px; font-family: var(--head); font-size: 15px; } #party .row span { flex: 1; text-align: right; font-size: 12px; color: #5bd17a; }
#party .row .btn { padding: 2px 8px; font-size: 12px; min-height: 0; }
.pm { display: grid; grid-template-columns: 1fr auto; gap: 1px 6px; font-size: 12px; } .pm b { font-weight: 600; } .pm b.lead::before { content: '★ '; color: #ffd45a; } .pm span { color: var(--acc); }
.pm .bar { grid-column: 1 / -1; height: 7px; }

/* cancelar alvo (celular não tem Esc) */
#target .row { align-items: center; gap: 8px; } #target .row b { flex: 1; }
#target-x { width: 20px; height: 20px; padding: 0; font-size: 12px; line-height: 1; color: var(--ink); background: rgba(229,88,74,.25); border: 1px solid #e5584a; cursor: pointer; }
html.touch #target-x { width: 26px; height: 26px; font-size: 14px; }

/* celular/iOS: sem zoom por toque duplo ou pinça, texto sem ajuste automático, campos de 16px (o iOS amplia a tela ao focar menores) */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (pointer: coarse) { input, select, textarea { font-size: 16px !important; } html, body { -webkit-user-select: none; user-select: none; } input, textarea { -webkit-user-select: text; user-select: text; } }
/* botão de tela cheia (só no toque; o JS o mostra) ao lado do minimapa */
#fs-float { position: absolute; right: calc(126px + var(--sr)); top: calc(8px + var(--st)); width: 40px; height: 40px; z-index: 9; }
#ios-help { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.78); z-index: 40; }
#ios-help[hidden] { display: none; }
#ios-help .panel { width: min(420px, 92vw); display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
#ios-help h2 { font-size: 26px; } #ios-help .hint { margin: 0; } #ios-help ol { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; } #ios-help li b { color: var(--acc); }

/* skills por nível e buffs */
.slot.locked { opacity: .4; filter: grayscale(1); cursor: not-allowed; }
.slot.locked::before { content: attr(data-lock); position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%); padding: 1px 6px; font: 700 12px/16px var(--head); color: #ffd45a; background: rgba(8,14,20,.92); border: 1px solid rgba(255,212,90,.5); border-radius: 8px; white-space: nowrap; }
#buffs { display: flex; gap: 6px; } #buffs b { padding: 1px 8px; font: 700 12px/17px var(--head); letter-spacing: .06em; color: #cfe6ff; background: rgba(60,100,150,.55); border: 1px solid #7fb4e8; border-radius: 9px; }
#buffs b[hidden] { display: none; }

/* vila: NPC (conversa, loja, forja) */
#market { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(500px, 94vw); max-height: min(560px, 92dvh); overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 8px; z-index: 14; }
#market .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } #market .row b { display: block; font: 600 22px var(--head); } #market .row small { color: var(--acc); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
#market .row .btn { padding: 2px 10px; min-height: 0; }
#mk-line { margin: 0; padding: 8px 10px; background: rgba(0,0,0,.28); border-left: 3px solid var(--acc); font-size: 13px; font-style: italic; }
#market .tabs { display: flex; gap: 6px; } #market .tabs .btn { flex: 1; padding: 6px 4px; font-size: 13px; min-height: 0; } #market .tabs .btn:not(.on) { opacity: .7; }
#mk-earn { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(0,0,0,.28); border-left: 3px solid #ffd45a; font-size: 13px; } #mk-earn .btn { padding: 4px 10px; min-height: 0; }
#mk-body .hint { margin: 4px 0; font-size: 12px; opacity: .75; }
#market .nrow > div:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.mk-price { width: 78px; padding: 4px 6px; font-size: 12px; background: rgba(0,0,0,.35); color: var(--ink); border: 1px solid var(--line); }
#tut { position: fixed; top: calc(var(--st) + 10px); left: 50%; transform: translateX(-50%); z-index: 12; display: flex; align-items: center; gap: 10px; max-width: min(560px, 94vw); padding: 8px 12px; border: 1px solid var(--acc); }
#tut b { font: 600 18px var(--head); color: var(--acc); } #tut span { font-size: 14px; line-height: 1.3; } #tut .btn { padding: 2px 10px; min-height: 0; flex: none; }
.tut-hl { animation: tut-pulse 1s ease-in-out infinite; position: relative; z-index: 3; }
@keyframes tut-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,212,90,.9); } 50% { box-shadow: 0 0 0 7px rgba(255,212,90,0); } }
#npc { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(460px, 94vw); max-height: min(520px, 92dvh); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; z-index: 14; }
#npc .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } #npc .row b { display: block; font: 600 22px var(--head); } #npc .row small { color: var(--acc); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
#npc .row .btn { padding: 2px 10px; min-height: 0; }
#npc-line { margin: 0; padding: 8px 10px; background: rgba(0,0,0,.28); border-left: 3px solid var(--acc); font-size: 13px; font-style: italic; }
#npc-body h6 { font-size: 12px; letter-spacing: .14em; color: var(--acc); margin: 6px 0 4px; }
.nrow { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.nrow img { width: 32px; height: 32px; image-rendering: pixelated; } .nrow b { font-weight: 600; } .nrow small { display: block; color: #9fb3c5; font-size: 11px; }
.nrow .acts { display: flex; gap: 4px; } .nrow .btn { padding: 4px 8px; font-size: 12px; min-height: 0; }
.nrow .gold { color: #ffd45a; } .nrow .ok { color: #5bd17a; } .nrow .no { color: #ff9d8f; }
.nempty { color: #9fb3c5; font-size: 12px; padding: 4px 0; }
#npc { overflow-x: hidden; } .nrow > div:nth-child(2) { min-width: 0; overflow-wrap: anywhere; } .nrow .acts { flex-wrap: wrap; justify-content: flex-end; }

/* painel de grupo: linhas clicáveis para escolher o aliado da cura */
#party-list .pm { cursor: pointer; border: 1px solid transparent; border-radius: 4px; } #party-list .pm:hover { background: rgba(127,224,140,.12); }
#party-list .pm.ally { border-color: #5fe08a; background: rgba(95,224,138,.16); }

/* tecla de atalho nos botões do menu (selo no canto, como nas habilidades); no celular não há teclado */
.rbtn .mk { position: absolute; right: -5px; bottom: -5px; z-index: 3; min-width: 18px; padding: 0 3px; font: 700 11px/16px var(--head); text-align: center; color: var(--ink); background: rgba(8,14,20,.95); border: 1px solid rgba(255,255,255,.35); border-radius: 4px; pointer-events: none; }
html.touch .rbtn .mk { display: none; }
#side.open .rbtn .mk { position: static; margin-left: auto; }

/* painel de magias */
/* wiki: navegação à esquerda, texto à direita (no celular a navegação vira uma faixa rolável em cima) */
#wiki { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#wiki .panel { width: min(820px, 96vw); height: min(620px, 92dvh); display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
#wiki .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } #wiki h2 { font-size: 30px; margin: 0; } #wiki .row small { color: var(--acc); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
#wiki .row .btn { padding: 2px 10px; min-height: 0; }
.wk { display: grid; grid-template-columns: 150px 1fr; gap: 14px; min-height: 0; flex: 1; }
#wiki-nav { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
#wiki-nav button { text-align: left; padding: 7px 10px; font: 600 14px var(--head); letter-spacing: .06em; color: var(--ink); background: transparent; border: 1px solid var(--line); cursor: pointer; }
#wiki-nav button.on { background: var(--acc); color: var(--bg); border-color: var(--acc); }
#wiki-body { overflow-y: auto; padding-right: 6px; font-size: 14px; line-height: 1.5; }
#wiki-body h3 { margin: 0 0 8px; font: 600 24px var(--head); color: var(--acc); }
#wiki-body h4 { margin: 14px 0 6px; font: 600 16px var(--head); letter-spacing: .1em; text-transform: uppercase; color: #ffd45a; }
#wiki-body p { margin: 6px 0; } #wiki-body ul { margin: 6px 0; padding-left: 20px; } #wiki-body li { margin: 3px 0; }
#wiki-body .mut { opacity: .7; font-size: 12px; } #wiki-body .no { color: #ff9d8f; }
#wiki-body table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0; }
#wiki-body th { text-align: left; font: 600 11px var(--head); letter-spacing: .1em; text-transform: uppercase; color: #9fb3c5; padding: 4px 6px; border-bottom: 1px solid var(--line); }
#wiki-body td { padding: 5px 6px; border-bottom: 1px solid rgba(255,255,255,.07); vertical-align: top; }
#wiki-body kbd { display: inline-block; min-width: 20px; padding: 0 5px; margin: 0 1px; font: 700 12px/19px var(--head); text-align: center; color: var(--ink); background: rgba(8,14,20,.95); border: 1px solid rgba(255,255,255,.35); border-radius: 4px; }
#wiki-body code { padding: 0 4px; background: rgba(0,0,0,.35); border-radius: 3px; font-size: 12px; }
@media (max-width: 640px) {
  .wk { grid-template-columns: 1fr; grid-template-rows: auto 1fr; gap: 8px; }
  #wiki-nav { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding-bottom: 4px; } #wiki-nav button { white-space: nowrap; flex: none; padding: 5px 9px; font-size: 13px; }
  #wiki-body table { font-size: 12px; }
}
#spells { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#spells .panel { width: min(560px, 94vw); max-height: 92dvh; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
#spells .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } #spells h2 { font-size: 30px; margin: 0; } #spells small { color: var(--acc); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
#spells .row .btn { padding: 2px 10px; min-height: 0; }
#spells-list { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 2px; }
.sp { display: grid; grid-template-columns: 54px 1fr; gap: 4px 12px; padding: 8px 10px; border: 1px solid var(--line); background: rgba(0,0,0,.2); }
.sp.locked { opacity: .55; border-style: dashed; }
.sp .ico { position: relative; width: 54px; height: 54px; border-radius: 50%; border: 3px solid #8fa3b5; background: radial-gradient(circle at 35% 28%, rgba(60,84,112,.95), rgba(14,22,32,.95) 72%); display: grid; place-items: center; }
.sp .ico svg { width: 66%; height: 66%; } .sp .ico kbd { position: absolute; right: -8px; bottom: -6px; min-width: 18px; padding: 0 4px; font: 700 11px/16px var(--head); text-align: center; background: rgba(8,14,20,.95); border: 1px solid rgba(255,255,255,.35); border-radius: 4px; }
.sp b { font: 600 20px var(--head); letter-spacing: .03em; } .sp b em { font: 600 12px var(--head); font-style: normal; color: #ffb15c; margin-left: 8px; letter-spacing: .08em; }
.sp p { margin: 2px 0 4px; font-size: 13px; color: #cfd8e3; }
.sp dl { margin: 0; display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 1px 10px; font-size: 12px; } .sp dt { color: #9fb3c5; } .sp dd { margin: 0; }
@media (max-width: 520px) { .sp dl { grid-template-columns: auto 1fr; } }

.rbtn[data-k=spells] { --ring: #b48cff; }

/* tela de login */
.lcol, .rcol { display: contents; }
/* celular deitado (pouca altura): 2 colunas — título e personagem à esquerda, campos e botões à direita — para caber sem rolar */
@media (orientation: landscape) and (max-height: 520px) {
  #login { place-items: safe center; padding: calc(6px + var(--st)) calc(8px + var(--sr)) calc(6px + var(--sb)) calc(8px + var(--sl)); box-sizing: border-box; }
  #login-form { width: min(720px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); column-gap: 18px; row-gap: 4px; align-items: start; padding: 10px 14px; }
  .lcol, .rcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
  #login h1 { font-size: 30px; }
  #login-form .stage { padding: 2px 10px; } #login-form #preview { width: 84px; height: 84px; } #login-form.creating #preview { width: 72px; height: 72px; }
  #login .who b { font-size: 20px; }
  #login .hint { grid-column: 1 / -1; margin: 0; }
  #login .hint:last-child { display: none; }
  #login .btn { min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
  #login input { padding: 6px 9px; }
  #login label { gap: 3px; }
  #classes { grid-template-columns: repeat(4, 1fr); } #classes button { padding: 4px 6px; }      /* criação de personagem: 4 classes numa linha */
  #class-desc { font-size: 12px; margin: 0; }
}

/* mapa grande (tecla M) */
#bigmap { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.78); z-index: 20; }
#bigmap .panel { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; max-width: 96vw; }
#bigmap .row { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } #bigmap h2 { font-size: 28px; margin: 0; } #bigmap small { color: var(--acc); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
#bigmap .row .btn { padding: 2px 10px; min-height: 0; }
#bigmap-cv { width: min(74dvh, 90vw); height: min(74dvh, 90vw); image-rendering: pixelated; cursor: crosshair; border: 1px solid var(--line); background: #0e161e; touch-action: none; align-self: center; }
#bigmap-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; font-size: 12px; color: #cfd8e3; } #bigmap-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; }
.rbtn[data-k=map] { --ring: #e7d2a6; }
#minimap { cursor: pointer; }

/* painel de opções */
#options { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.78); z-index: 21; }
#options .panel { width: min(520px, 94vw); max-height: 92dvh; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; }
#options .row { display: flex; justify-content: space-between; align-items: center; } #options h2 { font-size: 28px; margin: 0; } #options .row .btn { padding: 2px 10px; min-height: 0; }
#opt-tabs { display: flex; gap: 6px; } #opt-tabs .btn { flex: 1; padding: 6px 4px; font-size: 14px; } #opt-tabs .btn:not(.on) { opacity: .7; }
#opt-body { display: flex; flex-direction: column; gap: 8px; overflow-y: auto; padding-right: 2px; min-height: 180px; }
.orow { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; padding: 5px 2px; border-bottom: 1px solid var(--line); font-size: 14px; }
.orow input[type=range] { width: min(220px, 44vw); accent-color: var(--acc); } .orow small { color: #9fb3c5; font-size: 12px; grid-column: 1 / -1; }
.orow input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--acc); }
.ogroup { margin: 8px 0 2px; font: 600 13px var(--head); letter-spacing: .14em; color: var(--acc); text-transform: uppercase; }
.okey { min-width: 96px; padding: 4px 10px; font: 700 14px var(--head); background: rgba(0,0,0,.35); color: var(--ink); border: 1px solid rgba(255,255,255,.3); border-radius: 4px; cursor: pointer; }
.okey.cap { border-color: #ffd45a; color: #ffd45a; animation: okp 1s infinite; } .okey.chg { border-color: var(--acc); }
@keyframes okp { 50% { opacity: .55; } }
.oconf { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; font-size: 12px; color: #ffb15c; } .oconf .btn { padding: 3px 10px; min-height: 0; font-size: 12px; }
.oact { display: flex; gap: 8px; margin-top: 6px; } .oact .btn { padding: 6px 12px; min-height: 0; font-size: 13px; }
.rbtn[data-k=gear] { --ring: #9fb3c5; }

.olang { background: rgba(0,0,0,.35); color: var(--ink); border: 1px solid rgba(255,255,255,.3); border-radius: 4px; padding: 5px 8px; font: 600 14px var(--head); }
.olang option { background: #14202c; }

#chat-log b.who { cursor: pointer; } #chat-log b.who:hover { text-decoration: underline; }
#namemenu { position: fixed; z-index: 40; display: flex; flex-direction: column; gap: 4px; padding: 8px; min-width: 150px; } #namemenu b { font: 600 15px var(--head); margin-bottom: 2px; } #namemenu .btn { min-height: 0; padding: 4px 10px; text-align: left; }

#roster { display: flex; flex-direction: column; gap: 8px; }
.rcard { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--line); background: rgba(14,22,30,.35); }
.rcard canvas { width: 48px; height: 48px; image-rendering: pixelated; flex: none; } .rcard .rinfo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rcard .rinfo b { font: 600 18px var(--head); letter-spacing: .04em; overflow: hidden; text-overflow: ellipsis; } .rcard .rinfo span { font-size: 12px; opacity: .65; }
.rcard .btn { min-height: 0; padding: 4px 12px; } .rcard.confirm { flex-direction: column; align-items: stretch; border-color: #ff7b6b; } .rcard .warn { margin: 0; font-size: 13px; color: #ff7b6b; }
.rcard input { padding: 7px 9px; font-size: 16px; color: var(--ink); background: rgba(0,0,0,.3); border: 1px solid var(--line); } .btn.danger { background: #b5392b; color: #fff; border-color: #b5392b; }

label.chk { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.35; text-transform: none; letter-spacing: 0; } label.chk input { margin-top: 2px; flex: none; } label.chk a { color: var(--acc); }
#auth.terms-only > label:not(#terms-row) { display: none; }
#options .onote { margin: 0 0 10px; font-size: 13px; opacity: .85; line-height: 1.4; } #options .onote a { color: var(--acc); } #options .opass { width: 100%; padding: 8px 10px; font-size: 16px; color: var(--ink); background: rgba(0,0,0,.3); border: 1px solid var(--line); margin-bottom: 10px; }

/* ---------- missões (client/js/ui/quests.js) ---------- */
#qtrack { width: 100%; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }      /* dentro de #left, abaixo da ficha e do grupo */
#qtrack .qt { padding: 6px 9px; background: rgba(12,20,30,.78); border-left: 3px solid var(--gold, #ffd45a); cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
#qtrack .qt.ready { border-left-color: #7fe08c; }
#qtrack b { font: 600 15px var(--head); color: #ffe9a8; letter-spacing: .03em; }
#qtrack small { font-size: 12.5px; color: #dbe6f2; line-height: 1.25; } #qtrack small.ok { color: #7fe08c; }
#toasts { position: fixed; top: calc(var(--st) + 64px); left: 50%; transform: translateX(-50%); z-index: 13; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; }
#toasts .toast { font: 600 16px var(--head); letter-spacing: .04em; padding: 3px 12px; background: rgba(8,14,20,.8); border: 1px solid rgba(181,217,253,.25); animation: toastIn .25s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-6px); } }
#quests, #story { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#quests .panel { width: min(560px, 94vw); max-height: 86vh; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
#quests .row { display: flex; justify-content: space-between; align-items: center; } #quests h2, #story h2 { font-size: 30px; margin: 0; }
#quests-body { overflow: auto; display: flex; flex-direction: column; gap: 8px; }
#quests h6, #npc-body h6 { margin: 6px 0 0; }
.qstory h6 { font-size: 15px; color: var(--acc); margin: 0; }
.qstory { padding: 8px 10px; border-left: 3px solid var(--acc); background: rgba(181,217,253,.06); } .qstory p { margin: 4px 0 0; font-size: 14px; color: #c9d6e3; line-height: 1.35; }
.qrow { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 8px 10px; background: rgba(14,22,30,.6); border: 1px solid rgba(181,217,253,.14); }
.qrow b { font: 600 17px var(--head); color: #ffe9a8; } .qrow p { margin: 0; font-size: 13.5px; color: #c9d6e3; line-height: 1.3; font-style: italic; }
.qrow small { font-size: 13px; color: #dbe6f2; } .qrow small.ok { color: #7fe08c; } .qrow small.no { color: #ff9b8b; } .qrow small.gold { color: #ffd45a; }
.qrow .btn { margin-top: 4px; padding: 3px 14px; min-height: 0; }
.qdone { font-size: 13px; color: #9fb3c5; line-height: 1.5; }
#story .panel { width: min(520px, 92vw); display: flex; flex-direction: column; gap: 12px; padding: 22px 24px; text-align: center; }
#story p { margin: 0; font-size: 17px; line-height: 1.5; color: #dbe6f2; font-style: italic; } #story .actions { justify-content: center; }
@media (max-width: 900px), (max-height: 520px), (pointer: coarse) {
  #qtrack { gap: 4px; }
  #qtrack .qt:nth-child(n+2) { display: none; }      /* celular: só a primeira missão, para não cobrir o jogo */
  #qtrack b { font-size: 13px; } #qtrack small { font-size: 11px; }
  #toasts { top: calc(var(--st) + 40px); } #toasts .toast { font-size: 13px; }
}
#npc-body small.qs, #quests small.qs { display: block; font-size: 13px; color: #9fb3c5; margin: 2px 0 4px; }
#qtrack .qt.daily { border-left-color: #b5d9fd; }

/* ---------- bestiário (client/js/ui/bestiary.js) ---------- */
#bestiary { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(10,16,22,.72); z-index: 20; }
#bestiary .panel { width: min(680px, 95vw); max-height: 88vh; display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
#bestiary .row { display: flex; justify-content: space-between; align-items: flex-start; } #bestiary h2 { font-size: 30px; margin: 0; } #bestiary-sub { color: #9fb3c5; font-size: 13px; }
#bestiary-body { overflow: auto; display: flex; flex-direction: column; gap: 8px; } #bestiary h6 { margin: 8px 0 0; }
#bestiary .bhint { margin: 0; font-size: 13px; color: #9fb3c5; line-height: 1.35; }
.bgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.bcard { display: flex; gap: 8px; align-items: center; padding: 6px 8px; background: rgba(14,22,30,.6); border: 1px solid rgba(181,217,253,.14); }
.bcard.boss { border-color: rgba(255,212,90,.45); } .bcard.max { background: rgba(255,212,90,.08); } .bcard.unk { opacity: .6; }
.bthumb { width: 56px; height: 56px; flex: none; image-rendering: pixelated; background: radial-gradient(circle at 50% 80%, rgba(181,217,253,.14), transparent 70%); }
.binfo { display: flex; flex-direction: column; gap: 1px; min-width: 0; } .binfo b { font: 600 16px var(--head); color: #f2f2f3; } .binfo small { font-size: 12px; color: #9fb3c5; line-height: 1.25; text-transform: none; letter-spacing: 0; }
.binfo small.gold { color: #ffd45a; } .binfo small.ok { color: #7fe08c; }
.bpips { display: flex; gap: 4px; margin: 2px 0; } .bpips i { width: 14px; height: 6px; background: rgba(181,217,253,.18); } .bpips i.on { background: #ffd45a; }
