/* Archivo: public/css/style.css | Depende de: index.html | Propósito: Estilo medieval del HUD, paneles y pantallas. */
:root {
  --ink: #2b1d0e; --parch: #efe0bd; --parch-dark: #d9c393; --gold: #d4a63a; --blood: #a3242a;
  --mana: #2f6fd6; --xp: #c9a227; --ui-bg: rgba(18, 12, 6, .72); --ui-border: #8a6a32; --text: #f3e6c8;
  --ok: #6fbf5a; --warn: #e0a030;
  font-family: 'Crimson Text', Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: var(--text); user-select: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; }
h1, h2, h3, button { font-family: 'Cinzel', Georgia, serif; }
button { cursor: pointer; background: linear-gradient(#7a5426, #4e3315); color: #f6e6c0; border: 1px solid #c9a35a; border-radius: 4px; padding: 6px 12px; font-size: 14px; }
button:hover { filter: brightness(1.2); }
button:disabled { opacity: .45; cursor: default; filter: none; }
.parchment { background: linear-gradient(160deg, var(--parch), var(--parch-dark)); color: var(--ink); border: 3px double #6b4a1c; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }

/* Pantallas */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, #2b2a4a, #07060c); z-index: 50; }
#death { background: rgba(60, 0, 0, .55); }
.screen .parchment { padding: 28px 34px; width: min(420px, calc(100vw - 32px)); text-align: center; }
.screen h1 { margin: 0 0 4px; font-size: 30px; letter-spacing: 1px; }
.screen .sub { margin: 0 0 18px; font-style: italic; }
#login .auth { width: min(460px, calc(100vw - 32px)); }
#login label { display: block; text-align: left; margin: 10px 0; font-weight: 600; }
#login label.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
#login label.check input { width: auto; margin: 0; }
#login input { width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #8a6a32; border-radius: 4px; background: #fff8e6; font-size: 16px; }
#auth-form > button[type=submit] { width: 100%; margin-top: 12px; font-size: 17px; padding: 10px; }
#login .tabs { justify-content: center; }
#login .tabs button.on { background: linear-gradient(#b8862f, #7a5426); }
.char-card { display: flex; align-items: center; gap: 10px; text-align: left; border: 1px solid #a78a52; border-radius: 6px; padding: 8px 10px; margin: 6px 0; background: rgba(255,255,255,.3); }
.char-card .grow { flex: 1; }
.char-card .meta { font-size: 13px; opacity: .8; }
.row-form { display: flex; gap: 6px; margin: 8px 0; }
.row-form input { margin: 0 !important; flex: 1; }
#login details { text-align: left; margin: 8px 0; font-size: 14px; }
button.link { background: none; border: none; color: #6b4a1c; text-decoration: underline; padding: 4px; }
.error { color: var(--blood); min-height: 1.2em; font-weight: 600; }
.hint { font-size: 13px; opacity: .8; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px; border: 2px solid rgba(255,255,255,.75); border-radius: 50%; box-shadow: 0 0 3px #000; }
#crosshair::after { content: ''; position: absolute; left: 6px; top: 6px; width: 2px; height: 2px; background: #fff; }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); text-align: center; text-shadow: 0 2px 4px #000; }
#zone-name { font-family: 'Cinzel', serif; font-size: 20px; }
#zone-name .pvp { color: #ff6b6b; font-size: 13px; margin-left: 6px; }
#clock { font-size: 16px; }
#events { display: flex; gap: 6px; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.event-chip { background: var(--ui-bg); border: 1px solid var(--gold); border-radius: 12px; padding: 2px 10px; font-size: 13px; }
.event-chip.blood { border-color: #ff3b3b; color: #ffb3b3; }
#radar { position: absolute; top: 10px; right: 10px; width: 160px; height: 160px; border-radius: 50%; border: 2px solid var(--ui-border); background: rgba(10,10,10,.55); }
#bossbar { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: min(620px, calc(100vw - 220px)); text-align: center; text-shadow: 0 2px 4px #000; background: rgba(12, 8, 4, .72); border: 1px solid var(--ui-border); border-radius: 6px; padding: 4px 10px 6px; }
#bossbar .b-name { font-family: 'Cinzel', serif; font-size: 18px; color: #ffcf4d; }
#bossbar .b-name .enr { color: #ff4040; }
#bossbar .b-sub { font-size: 14px; color: #f3e6c8; font-family: 'Crimson Text', serif; }
#bossbar .bar { height: 16px; border: 1px solid #d4a63a; }
#bossbar .fill { background: linear-gradient(#d43a3a, #6a0e0e); }
#bossbar.on ~ #target { top: 170px; }
#death .parchment button { margin: 4px; }
#target { position: absolute; top: 90px; left: 50%; transform: translateX(-50%); width: 260px; text-align: center; text-shadow: 0 1px 3px #000; }
#target .t-name { font-weight: 600; }
#target .t-name .night { color: #ff6060; }
#target .bar { height: 10px; background: rgba(0,0,0,.6); border: 1px solid #000; }
#target .fill { height: 100%; background: linear-gradient(#e04848, #8a1515); width: 100%; }
#prompt { position: absolute; left: 50%; top: calc(50% + 40px); transform: translateX(-50%); background: var(--ui-bg); border: 1px solid var(--ui-border); padding: 4px 12px; border-radius: 4px; font-size: 15px; }
#prompt b { color: var(--gold); }
#party-frames { position: absolute; left: 12px; top: 44px; display: flex; flex-direction: column; gap: 4px; width: 170px; font-size: 13px; text-shadow: 0 1px 2px #000; }
.pframe { background: var(--ui-bg); border: 1px solid #3f8f4a; border-radius: 4px; padding: 3px 6px; }
.pframe .bar { height: 7px; margin-top: 2px; }
.pframe .fill { background: linear-gradient(#5ce36a, #1f7a2a); }
.pframe.off, .pframe.dead { opacity: .5; }
#buffs { position: absolute; left: 12px; top: 12px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 300px; }
.buff { background: var(--ui-bg); border: 1px solid var(--ui-border); border-radius: 4px; padding: 2px 6px; font-size: 12px; }
#bottom { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100vw - 32px)); }
#bars { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 6px; }
.bar { position: relative; height: 16px; background: rgba(0,0,0,.65); border: 1px solid #000; border-radius: 3px; overflow: hidden; }
.bar .fill { position: absolute; inset: 0 auto 0 0; width: 0; transition: width .15s; }
.bar span { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 16px; text-shadow: 0 1px 2px #000; }
.bar.hp .fill { background: linear-gradient(#e64545, #8f1717); }
.bar.mp .fill { background: linear-gradient(#4f8cf0, #1c3f8f); }
.bar.st { grid-column: 1 / -1; height: 5px; }
.bar.st .fill { background: linear-gradient(#e6d36a, #a8902a); transition: width .1s linear; }
.bar.st.ex .fill { background: #a04a2a; animation: exh .5s ease-in-out infinite alternate; }
@keyframes exh { to { opacity: .45; } }
.dmg.combo { color: #ffd04a; font-size: 26px; text-shadow: 0 0 8px #ff7a1a, 0 2px 2px #000; }
.dmg.head { color: #ff5050; font-size: 24px; }
.dmg.parry { color: #fff2a0; font-size: 26px; text-shadow: 0 0 10px #ffd04a, 0 2px 2px #000; }
.dmg.pet { color: #9be36a; }
.bar.sh { grid-column: 1 / 3; height: 5px; }
.bar.sh .fill { background: #9fd8ff; }
.bar.xp { height: 8px; margin-top: 6px; }
.bar.xp .fill { background: linear-gradient(#f0cf55, #9a7414); }
.bar.xp span { font-size: 0; }
#hotbar { display: flex; gap: 4px; justify-content: center; }
#hotbar .slot { font-size: 20px; }
.slot { position: relative; width: 46px; height: 46px; background: var(--ui-bg); border: 1px solid var(--ui-border); border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.slot .key { position: absolute; top: 1px; left: 4px; font-size: 11px; color: var(--gold); }
.slot .qty { position: absolute; bottom: 1px; right: 4px; font-size: 12px; }
.slot .cd { position: absolute; inset: auto 0 0 0; background: rgba(0,0,0,.65); }
.slot.locked { opacity: .35; }
.slot.passive { border-style: dashed; }
#classline { text-align: center; font-size: 14px; margin-top: 2px; text-shadow: 0 1px 3px #000; }
#classline .gold { color: var(--gold); }
#toasts { position: absolute; left: 50%; top: 32%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.toast { background: var(--ui-bg); border: 1px solid var(--ui-border); padding: 4px 14px; border-radius: 4px; animation: fadeup 3.2s forwards; font-size: 15px; }
.toast.warn { border-color: var(--warn); color: #ffd28a; }
.toast.ok { border-color: var(--ok); color: #c9f5b8; }
.toast.loot { border-color: var(--gold); color: #ffe7a3; }
.toast.level { border-color: var(--gold); color: #fff1b0; font-size: 20px; font-family: 'Cinzel', serif; }
@keyframes fadeup { 0% { opacity: 0; transform: translateY(8px); } 8% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12px); } }
#announce { position: absolute; top: 18%; left: 0; right: 0; margin: 0 auto; text-align: center; text-shadow: 0 2px 8px #000; animation: fadeup 7s forwards; width: min(700px, calc(100vw - 32px)); }
#announce h2 { margin: 0; font-size: 34px; color: var(--gold); }
#announce p { margin: 4px 0 0; font-size: 18px; }
#chat { position: absolute; left: 10px; bottom: 10px; width: min(380px, calc(100vw - 32px)); pointer-events: auto; }
#chat-log { max-height: 170px; overflow-y: auto; font-size: 14px; text-shadow: 0 1px 2px #000; display: flex; flex-direction: column; }
#chat-log div { padding: 1px 4px; background: rgba(0,0,0,.25); }
#chat-log .sys { color: #d8c38a; font-style: italic; }
#chat-log .global .from { color: #ffb84d; }
#chat-log .zone .from { color: #8fd3ff; }
#chat-log .party { color: #9dffa8; }
#chat-log .guild { color: #9fd8ff; }
#chat-log .party .from, #chat-log .guild .from { font-weight: 600; }
#chat-log .whisper { color: #f3a6ff; }
#chat-log .whisper .from { font-weight: 600; }
#zone-name .safe { color: #9dffa8; margin-left: 6px; font-size: 13px; }
.karma { margin-left: 6px; font-size: 13px; padding: 1px 6px; border-radius: 4px; background: rgba(0,0,0,.4); color: #e8d6b0; }
.karma.aggr { color: #ffa040; }
.karma.red { color: #ff5a50; font-weight: 600; }
.tabs-row { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
.tabs-row button.on { background: linear-gradient(#e0b84a, #b98a1e); color: #2b1a08; }
table.ranks { width: 100%; border-collapse: collapse; font-size: 14px; }
table.ranks td, table.ranks th { padding: 3px 6px; border-bottom: 1px solid rgba(90,60,20,.2); text-align: left; }
table.ranks tr.me { background: rgba(212,166,58,.25); }
#quest-tracker { position: absolute; right: 12px; top: 182px; width: 230px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; text-shadow: 0 1px 2px #000; pointer-events: none; }
#quest-tracker .tq { background: rgba(0,0,0,.35); padding: 4px 8px; border-left: 3px solid var(--gold); border-radius: 3px; }
#quest-tracker .tq b { color: #ffe7a3; display: block; }
#quest-tracker .tq.ready { border-left-color: #7dff8a; }
#tutorial { position: absolute; left: 50%; top: 92px; transform: translateX(-50%); width: min(560px, 92vw); background: var(--ui-bg); border: 1px solid var(--gold); border-radius: 6px; padding: 8px 14px; font-size: 15px; text-align: center; box-shadow: 0 0 18px rgba(212,166,58,.35); }
#tutorial .tut-title { color: var(--gold); font-weight: 600; margin-bottom: 2px; }
#tutorial button.link { font-size: 12px; margin-top: 4px; }
.quest { border: 1px solid rgba(90,60,20,.3); border-radius: 6px; padding: 6px 10px; margin: 6px 0; background: rgba(255,255,255,.18); }
.quest p { margin: 2px 0 4px; }
.quest .reward { font-size: 14px; }
ul.goals { margin: 2px 0 4px; padding-left: 20px; }
ul.goals li.done { color: #2f7d3a; text-decoration: line-through; }
.ok { color: #2f7d3a; font-weight: 600; }
.bar.small { width: 140px; height: 8px; background: rgba(0,0,0,.25); border-radius: 4px; overflow: hidden; }
.bar.small .fill { height: 100%; background: linear-gradient(90deg, #c9a227, #ffd86b); }
.ach.locked { opacity: .55; }
.ach-icon { font-size: 22px; width: 30px; text-align: center; }
.look-editor { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.look-editor canvas { width: 180px; height: 220px; background: radial-gradient(circle, rgba(255,240,200,.5), rgba(0,0,0,.08)); border-radius: 8px; }
.look-controls { display: flex; flex-direction: column; gap: 4px; }
.look-row { display: flex; align-items: center; gap: 6px; }
.look-row button { padding: 2px 8px; min-width: 0; }
.look-label { width: 110px; font-size: 14px; }
.look-value { min-width: 130px; text-align: center; font-size: 14px; padding: 2px 6px; border-radius: 4px; }
.look-value.swatch { border: 1px solid rgba(0,0,0,.4); height: 18px; }
#char-look-box { margin-top: 6px; }
#chat-input { width: 100%; margin-top: 4px; padding: 6px; background: rgba(0,0,0,.75); color: #fff; border: 1px solid var(--ui-border); font-size: 14px; }
#dmg-layer { position: absolute; inset: 0; overflow: hidden; }
.dmg { position: absolute; font-weight: 700; font-family: 'Cinzel', serif; font-size: 18px; text-shadow: 0 0 3px #000, 0 2px 2px #000; animation: dmg 1s forwards; transform: translate(-50%, -50%); }
.dmg.crit { color: #ffd23f; font-size: 26px; }
.dmg.inc { color: #ff5a5a; }
.dmg.heal { color: #6fff8a; }
.dmg.dot { color: #9be36a; font-size: 14px; }
.dmg.fire { color: #ff8a3a; }
.dmg.frost { color: #9fd8ff; }
@keyframes dmg { to { opacity: 0; margin-top: -50px; } }
#vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 0 rgba(160,0,0,0); transition: box-shadow .2s; }
#vignette.hurt { box-shadow: inset 0 0 120px 30px rgba(170,0,0,.55); }
#click-to-play { position: fixed; left: 50%; top: 60%; transform: translateX(-50%); z-index: 20; background: var(--ui-bg); padding: 8px 18px; border: 1px solid var(--ui-border); border-radius: 4px; font-family: 'Cinzel', serif; }

/* Paneles */
#panel { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow-y: auto; padding: 18px 22px; z-index: 30; }
#panel .close { position: absolute; top: 8px; right: 8px; padding: 2px 9px; }
#panel h2 { margin: 0 0 8px; }
#panel h3 { margin: 12px 0 6px; font-size: 16px; border-bottom: 1px solid #a78a52; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.grid { display: grid; grid-template-columns: repeat(6, 48px); gap: 5px; }
.cell { position: relative; width: 48px; height: 48px; background: rgba(60,40,15,.25); border: 1px solid #8a6a32; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; }
.cell:hover { background: rgba(212,166,58,.35); }
.cell .qty { position: absolute; right: 2px; bottom: 0; font-size: 12px; font-weight: 700; }
.cell .plus { position: absolute; left: 2px; top: 0; font-size: 11px; color: #1b6e1b; font-weight: 700; }
.cell.empty { cursor: default; }
.cell.rar1 { background: radial-gradient(circle, rgba(90,160,255,.45), rgba(60,40,15,.25) 70%); border-color: #5aa0ff; }
.cell.rar2 { background: radial-gradient(circle, rgba(176,107,255,.5), rgba(60,40,15,.25) 70%); border-color: #b06bff; }
.cell.rar3 { background: radial-gradient(circle, rgba(255,154,42,.6), rgba(60,40,15,.25) 72%); border-color: #ff9a2a; animation: legend 2.4s ease-in-out infinite; }
@keyframes legend { 50% { box-shadow: 0 0 10px #ff9a2a; } }
.cell.broken { filter: grayscale(1) brightness(.7); }
.cell .broke { position: absolute; right: 1px; top: -2px; font-size: 12px; }
.cell .sockets { position: absolute; left: 2px; bottom: 1px; font-size: 7px; letter-spacing: -1px; line-height: 1; }
.cell .wearbar { position: absolute; left: 3px; right: 3px; bottom: 1px; height: 2px; background: #3a2a10; }
.cell .wearbar i { display: block; height: 100%; background: #e0a030; }
.trade-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.trade-side { border: 1px solid #8a6a32; border-radius: 6px; padding: 8px; min-height: 120px; }
.trade-side.locked { border-color: #4caf50; box-shadow: 0 0 6px rgba(76,175,80,.5); }
.trade-side .grid { min-height: 52px; }
.cell.tier1 { box-shadow: inset 0 0 0 2px #6a9ad1; } .cell.tier2 { box-shadow: inset 0 0 0 2px #9b59d0; } .cell.tier3 { box-shadow: inset 0 0 0 2px #e08a1e; } .cell.tier4 { box-shadow: inset 0 0 0 2px #2fd4b4; }
.equip { display: grid; grid-template-columns: 80px 48px 1fr; gap: 6px; align-items: center; font-size: 14px; }
.stats { font-size: 14px; columns: 2; }
.row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dotted #b49a64; font-size: 15px; }
.row .grow { flex: 1; }
.row .price { color: #7a5200; font-weight: 600; white-space: nowrap; }
.row .mats { font-size: 13px; opacity: .85; }
.row .mats .miss { color: var(--blood); font-weight: 600; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.tabs button.on { background: linear-gradient(#b8862f, #7a5426); }
.tree { border: 1px solid #a78a52; border-radius: 6px; padding: 10px; }
.tree.current { border: 2px solid #b8862f; background: rgba(212,166,58,.12); }
.tree h3 { border: none; margin: 0 0 6px; }
.branch { display: flex; gap: 8px; margin-bottom: 8px; }
.skill { flex: 1; border: 1px solid #a78a52; border-radius: 4px; padding: 6px; font-size: 13px; background: rgba(255,255,255,.25); }
.skill b { font-size: 14px; }
.skill .rank { float: right; font-weight: 700; }
.skill button { margin-top: 4px; padding: 2px 8px; font-size: 12px; }
.skill.learned { background: rgba(212,166,58,.18); }
.skill .req { font-size: 12px; margin-top: 2px; }
.skill .req .ok { color: #2f6b1f; } .skill .req .miss, .miss { color: var(--blood); font-weight: 600; }
.skill .hb { font-size: 12px; margin-top: 3px; } .skill .hb button { padding: 0 6px; margin: 1px; }
.skill .hb button.on { background: linear-gradient(#d4a63a, #7a5426); }
.branch.col { flex-direction: column; }
.attrs { display: grid; grid-template-columns: 110px 34px 30px 1fr; gap: 4px; align-items: center; font-size: 14px; }
.attrs button { padding: 0 8px; }
.muted { opacity: .7; font-size: 13px; }
#tooltip { position: fixed; z-index: 60; background: #1b130a; color: #f4e5c2; border: 1px solid var(--gold); border-radius: 4px; padding: 8px 10px; font-size: 13px; max-width: 260px; pointer-events: none; }
#tooltip b { color: var(--gold); font-size: 14px; }
.help-keys { columns: 2; font-size: 15px; }
.help-keys kbd { background: #3b2a12; color: #f6e6c0; border-radius: 3px; padding: 0 5px; font-family: monospace; }
@media (max-width: 640px) { #radar { width: 100px; height: 100px; } .grid { grid-template-columns: repeat(5, 44px); } .cell { width: 44px; height: 44px; } }
/* Pesca */
#fishing { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); width: min(420px, calc(100vw - 32px)); background: var(--ui-bg); border: 1px solid var(--ui-border); border-radius: 8px; padding: 10px 14px; text-align: center; }
#fishing .f-title { font-family: 'Cinzel', serif; font-size: 18px; margin-bottom: 6px; }
#fishing .f-bar { position: relative; height: 18px; background: #2a1f14; border-radius: 9px; overflow: hidden; margin: 6px 0; }
#fishing .f-zone { position: absolute; top: 0; bottom: 0; background: rgba(90,200,90,.55); }
#fishing .f-tension { position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px; background: #fff; box-shadow: 0 0 6px #fff; }
#fishing .f-progress { height: 6px; background: #2a1f14; border-radius: 3px; overflow: hidden; }
#fishing .f-progress i { display: block; height: 100%; width: 0; background: #e6c36a; }
#fishing .f-help { font-size: 12px; opacity: .85; margin-top: 6px; }

/* Final de juego: Piedra del Desafío y desenlace */
.tier-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 6px 0; }
.tier-grid button.on { background: linear-gradient(#b8862f, #7a5426); color: #fff; }
.finale-choice { border: 1px solid #c8b48a; border-radius: 6px; padding: 8px 10px; margin: 8px 0; background: rgba(255, 248, 230, 0.5); }
.finale-choice.on { border-color: #b8862f; box-shadow: 0 0 0 2px rgba(184, 134, 47, 0.35); }
.finale-choice p { margin: 4px 0; }
.bar-mini { height: 6px; background: rgba(0, 0, 0, 0.12); border-radius: 3px; overflow: hidden; margin: 4px 0; }
.bar-mini i { display: block; height: 100%; background: linear-gradient(90deg, #d8a840, #b8862f); }

/* Mapa grande (tecla N) */
.map-wrap { display: flex; gap: 12px; align-items: flex-start; }
canvas.bigmap { width: min(600px, 62vw); aspect-ratio: 1; border: 2px solid var(--ui-border, #8a6a2a); border-radius: 6px; cursor: crosshair; background: #0c0a08; touch-action: none; }
.map-side { flex: 1; min-width: 180px; }
.map-side select { width: 100%; margin-bottom: 6px; }
.map-side input { min-width: 0; }
@media (max-width: 760px) { .map-wrap { flex-direction: column; } canvas.bigmap { width: 100%; } }

/* Interfaz movible (F2) */
body.layout-edit #hud > [data-layout-name] { pointer-events: auto; outline: 2px dashed #ffd34d; outline-offset: 2px; cursor: move; min-width: 60px; min-height: 28px; background-color: rgba(30, 20, 0, .35); }
body.layout-edit #hud > [data-layout-name]::before { content: attr(data-layout-name); position: absolute; top: -20px; left: 0; font-size: 12px; color: #ffd34d; text-shadow: 0 1px 2px #000; white-space: nowrap; }
body.layout-edit #target, body.layout-edit #bossbar { display: block !important; }
#layout-banner { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 40; background: #1b130a; color: #f4e5c2; border: 1px solid #d4a63a; border-radius: 6px; padding: 6px 12px; }
#layout-banner button { margin-left: 6px; }

/* Modo espectador de la arena */
#spectate { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); width: min(520px, calc(100vw - 32px)); background: rgba(12, 8, 4, .78); border: 1px solid #d4a63a; border-radius: 6px; padding: 8px 12px; color: #f4e5c2; text-shadow: 0 1px 2px #000; }
#spectate .sp-title { font-family: 'Cinzel', serif; color: #ffcf4d; font-size: 17px; }
#spectate .sp-teams { display: flex; gap: 16px; margin-top: 6px; }
#spectate .sp-team { flex: 1; display: flex; flex-direction: column; gap: 4px; }
#spectate .sp-team.t1 { text-align: right; }
#spectate .sp-f .bar { height: 8px; background: rgba(0,0,0,.6); border: 1px solid #000; }
#spectate .sp-f .fill { height: 100%; background: linear-gradient(#e04848, #8a1515); }
#spectate .sp-f.on span { color: #7dff8a; }
#spectate .sp-keys { font-size: 12px; margin-top: 4px; }

/* Controles táctiles */
.touch-ui { position: absolute; inset: 0; pointer-events: none; }
.touch-ui.hidden-ui { display: none; }
.touch-stick { position: absolute; left: 24px; bottom: 120px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.08); border: 2px solid rgba(255,231,163,.4); pointer-events: auto; touch-action: none; }
.touch-knob { position: absolute; left: 40px; top: 40px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,231,163,.45); }
.touch-pad { position: absolute; right: 20px; bottom: 64px; width: 200px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; pointer-events: auto; }
.touch-row { position: absolute; right: 20px; bottom: 10px; display: flex; gap: 8px; pointer-events: auto; }
.touch-menu { position: absolute; left: 10px; top: 60px; display: flex; flex-direction: column; gap: 6px; pointer-events: auto; }
.touch-btn { width: 58px; height: 58px; border-radius: 50%; font-size: 22px; background: rgba(27,19,10,.6); color: #ffe7a3; border: 2px solid rgba(212,166,58,.7); touch-action: none; user-select: none; }
.touch-btn.big { width: 78px; height: 78px; font-size: 30px; }
.touch-btn.small { width: 42px; height: 42px; font-size: 16px; }
.touch-btn.on { background: rgba(212,166,58,.6); }
body.touch #crosshair { opacity: .8; }
body.touch #bottom { bottom: 6px; left: 38%; width: min(420px, 50vw); }
body.touch #hotbar, body.touch #classline { display: none; } /* las habilidades van en los botones táctiles */
body.touch #party-frames, body.touch #buffs { left: 64px; }
body.touch #chat { left: 170px; bottom: 64px; width: min(260px, 28vw); font-size: 12px; }
.keys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 4px 18px; }
.keys-grid .row { padding: 1px 0; }
.kbtn { min-width: 74px; font-family: monospace; }
.kbtn.on { background: linear-gradient(#b8862f, #7a5426); color: #fff; }
