@import url("https://fonts.googleapis.com/css2?family=Pixelify+Sans:wght@400;600;700&display=swap");
/* Pixelify Sans draws 5 and 8 almost like an S: digits use Silkscreen, a pixel font with clear numbers.
   "ArcDigits" covers only 0-9 and goes before Pixelify Sans in every font list. */
@font-face{font-family:"ArcDigits";src:url(https://fonts.gstatic.com/s/silkscreen/v6/m8JXjfVPf62XiF7kO-i9YLNlaw.woff2) format("woff2");unicode-range:U+0030-0039;font-weight:100 900;font-display:swap}
/* Lobby hall (Inicio): fills the screen under the header. */
.page.lobby-home{max-width:none!important;padding:0!important;margin:0!important;position:relative}
.lobby-hall{position:relative;width:100%}
.lobby-stage{position:relative;width:100%;height:calc(100dvh - 70px);min-height:320px;overflow:hidden;background:#120f14;border-top:1px solid #6d5130;border-bottom:1px solid #6d5130}
.lobby-canvas{display:block;width:100%;height:100%;image-rendering:pixelated;touch-action:none;outline:none}
.lobby-canvas:focus-visible{box-shadow:inset 0 0 0 3px #ffd78588}
/* Camera toggle: zoom out to frame the whole current room, then return to player-follow zoom. */
.lobby-overview-btn{position:absolute;top:12px;left:120px;z-index:74;display:grid;place-items:center;width:42px;height:42px;padding:0;border:2px solid #d6aa4e;border-radius:0;background:#17101bdf;color:#ffe08a;box-shadow:inset 0 0 0 2px #09060b,0 0 0 2px #09060b,0 4px 0 #050306;font:700 27px/1 "ArcDigits","Pixelify Sans",sans-serif;cursor:pointer;image-rendering:pixelated;touch-action:manipulation}
.lobby-overview-btn:hover,.lobby-overview-btn:focus-visible{background:#3a2a14;color:#fff0c0;border-color:#ffe08a}
.lobby-overview-btn:focus-visible{outline:2px solid #fff0c0;outline-offset:3px}
.lobby-overview-btn[aria-pressed="true"],.lobby-overview-btn.active{background:#6e2130;color:#fff0c0;border-color:#ffe08a}
.lobby-overview-btn span{display:block;transform:translateY(-1px)}
.lobby-stage.editing .lobby-overview-btn{display:none}
@media (pointer:coarse),(max-width:850px){
  .lobby-overview-btn{top:calc(60px + env(safe-area-inset-top));left:max(10px,env(safe-area-inset-left));width:40px;height:40px;font-size:25px;opacity:.8}
  .lobby-overview-btn:active{opacity:1;transform:translateY(2px)}
}
.lobby-hint{position:absolute;left:50%;bottom:12px;transform:translateX(-50%);padding:6px 14px;border-radius:999px;background:#0c0a0ddd;border:1px solid #a0814a;color:#f0dcae;font-size:12px;font-weight:700;white-space:nowrap;pointer-events:none;max-width:calc(100% - 24px);overflow:hidden;text-overflow:ellipsis}
/* Chat over the hall, bottom left: recent messages and the input (Enter focuses it). */
.lobby-chat-box{position:absolute;left:12px;bottom:12px;width:min(380px,calc(100% - 24px));display:flex;flex-direction:column;gap:6px;pointer-events:none}
.lobby-chat-log{max-height:min(190px,26vh);overflow:auto;padding:8px 10px;border-radius:10px;background:linear-gradient(180deg,#0c0a0d55,#0c0a0dcc);border:1px solid #6d513066;font-size:12px;scrollbar-width:thin;pointer-events:auto;-webkit-mask-image:linear-gradient(180deg,transparent,#000 24px)}
.lobby-chat-log>*{margin:0 0 4px!important;padding:2px 0!important;background:none!important;border:0!important}
.lobby-chat-log a,.lobby-chat-log button{font-size:10px}
.lobby-chat-box .chat-send{display:flex;gap:6px;pointer-events:auto}
.lobby-chat-box .chat-send .input{flex:1;min-width:0;height:36px;background:#0c0a0de6;border-color:#6d5130}
.lobby-chat-box .chat-send .btn{height:36px}
/* Player menu (click on an avatar). */
.lobby-menu{position:absolute;left:0;top:0;z-index:5;min-width:200px;display:flex;flex-direction:column;gap:4px;padding:10px;border-radius:12px;background:linear-gradient(180deg,#221a12f2,#120e0bf5);border:1px solid #b48d55;box-shadow:0 12px 30px #000a,0 0 0 1px #000;color:#eadcb8}
.lobby-menu[hidden]{display:none}
.lobby-menu-head{display:flex;flex-direction:column;gap:2px;padding:0 4px 6px;margin-bottom:2px;border-bottom:1px solid #6d513066}
.lobby-menu-head b{font-size:15px}
.lobby-menu-head span{font-size:11px;color:#bfae86}
.lobby-menu-head i{font-style:normal;font-weight:700}
.lobby-menu button{all:unset;cursor:pointer;padding:7px 10px;border-radius:7px;font-size:13px;font-weight:700;color:#f0dcae}
.lobby-menu button:hover,.lobby-menu button:focus-visible{background:#3a2a14}
.lobby-menu button[disabled]{opacity:.4;cursor:not-allowed;background:none}
.lobby-menu p{margin:2px 4px;font-size:12px}
/* Pending duel: floating card over the hall. */
.lobby-duel-float{position:absolute!important;z-index:6;top:10px;left:50%;transform:translateX(-50%);margin:0!important}
@media (max-width:700px){
  .lobby-chat-box{width:calc(100% - 24px)}
  .lobby-chat-log{max-height:84px}
  .lobby-hint{bottom:auto;top:44px;font-size:11px}
}
/* Report/block links stay in the Chat section; the hall overlay only shows the conversation. */
.lobby-chat-log .privacy-chat-tools{display:none!important}
.lobby-chat-box{bottom:10px;left:10px}

/* ---------- Phones: fullscreen landscape, joystick, chat toggle ---------- */
.lobby-chat-toggle,.lobby-joy,.lobby-fs-btn,.lobby-fs-exit,.lobby-rotate{display:none}
.lobby-stage:fullscreen,.lobby-stage.native-full{width:100vw;height:100dvh!important;border:0}
.lobby-stage:-webkit-full-screen{width:100vw;height:100vh!important;border:0}
.lobby-stage.touch-ui .lobby-joy{display:block;position:absolute;left:18px;bottom:18px;width:118px;height:118px;border-radius:50%;background:radial-gradient(circle,#0c0a0d55,#0c0a0dbb);border:2px solid #b48d5588;touch-action:none;z-index:4}
.lobby-joy i{position:absolute;left:50%;top:50%;width:48px;height:48px;margin:-24px 0 0 -24px;border-radius:50%;background:radial-gradient(circle at 35% 30%,#ffe9b0,#c9a14a 60%,#7a5a22);box-shadow:0 3px 10px #000a;transition:transform .06s linear}
.lobby-stage.touch-ui .lobby-chat-toggle{display:grid;place-items:center;position:absolute;right:14px;bottom:18px;width:54px;height:54px;border-radius:50%;border:2px solid #b48d55;background:#1c140ce6;font-size:24px;z-index:5;box-shadow:0 4px 14px #000a}
.lobby-stage.touch-ui .lobby-chat-box{display:none;left:auto;right:76px;bottom:14px;width:min(420px,calc(100% - 230px));z-index:5}
.lobby-stage.touch-ui.chat-open .lobby-chat-box{display:flex}
.lobby-stage.touch-ui.chat-open .lobby-chat-toggle{background:#3a2a14}
.lobby-stage.touch-ui .lobby-chat-log{max-height:min(150px,34vh)}
.lobby-stage.touch-ui .lobby-hint{bottom:auto;top:10px;left:12px;transform:none;font-size:11px;max-width:calc(100% - 150px)}
.lobby-stage.touch-ui:not(.is-full):not(.native-full) .lobby-fs-btn{display:block;position:absolute;left:50%;bottom:20px;transform:translateX(-50%);padding:10px 18px;border-radius:999px;border:1px solid #f2cf73;background:linear-gradient(#997431,#48320e);color:#fff1c9;font-weight:800;font-size:13px;z-index:5;box-shadow:0 4px 14px #000a}
.lobby-stage.is-full .lobby-fs-exit,.lobby-stage.native-full .lobby-fs-exit{display:grid;place-items:center;position:absolute;top:10px;right:12px;width:36px;height:36px;border-radius:50%;border:1px solid #a0814a;background:#0c0a0dcc;color:#f0dcae;font-size:16px;z-index:6}


/* Mobile: floating button back to the hall from any other section. */
.hall-return{display:none}
@media (pointer:coarse),(max-width:820px){
  body:not([data-view="home"]):not([data-view="duel"]):not([data-view="spectate"]) .hall-return{display:flex;align-items:center;gap:6px;position:fixed;z-index:60;right:12px;bottom:calc(76px + env(safe-area-inset-bottom));padding:10px 14px;border-radius:999px;border:1px solid #f2cf73;background:linear-gradient(#997431,#48320e);color:#fff1c9;font-weight:800;font-size:13px;box-shadow:0 6px 18px #000b}
}
.lobby-menu-head.with-portrait{flex-direction:row;align-items:center;gap:10px}
.lobby-menu-head.with-portrait>div{display:flex;flex-direction:column;gap:2px;min-width:0}
.lobby-menu-portrait{width:46px;height:46px;flex:0 0 46px;border-radius:10px;overflow:hidden;border:1px solid #b48d55}
.lobby-menu-portrait .portrait-art{display:block;width:100%;height:100%;background-size:400% 200%}

/* XP progress in your own hall menu */
.lobby-xp{display:flex;flex-direction:column;gap:6px;padding:4px 4px 8px}
.lobby-xp>div:first-child{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.lobby-xp b{font:700 13px Cinzel,serif;color:#f2d28a}
.lobby-xp span{font-size:11px;color:#bfae86}
.lobby-xp-bar{height:8px;border-radius:99px;background:#000a;box-shadow:inset 0 0 0 1px #b4945644;overflow:hidden}
.lobby-xp-bar i{display:block;height:100%;border-radius:99px;background:linear-gradient(90deg,#8a6a26,#f2cf73,#fff0c0);box-shadow:0 0 8px #f2cf7377}
.lobby-hint:empty{display:none}

/* Pixel-art UI (SGQ_ui frames recoloured to gold): player menu and hall chat. */
.lobby-menu{border:24px solid transparent!important;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 24px round!important;background:none!important;box-shadow:none!important;filter:drop-shadow(0 10px 18px #000c);padding:0!important;border-radius:0!important;image-rendering:pixelated;font-family:"ArcDigits","Pixelify Sans",sans-serif}
.lobby-menu-head{border-bottom:2px dashed #d6aa4e66!important}
.lobby-menu-head b{font-family:"ArcDigits","Pixelify Sans",sans-serif;font-size:17px;font-weight:700}
.lobby-menu-head span,.lobby-menu p{font-family:"ArcDigits","Pixelify Sans",sans-serif;font-size:13px}
.lobby-menu button{font-family:"ArcDigits","Pixelify Sans",sans-serif!important;font-size:15px!important;font-weight:600!important;border-radius:0!important;padding:6px 8px!important}
.lobby-menu button:hover,.lobby-menu button:focus-visible{background:#d6aa4e!important;color:#18111e!important}
.lobby-menu-portrait{border-radius:0!important;border:2px solid #d6aa4e!important;image-rendering:pixelated}
.lobby-xp b{font-family:"ArcDigits","Pixelify Sans",sans-serif!important}
.lobby-xp-bar{border-radius:0!important;height:10px!important;box-shadow:inset 0 0 0 2px #d6aa4e!important;background:#18111e!important}.lobby-xp-bar i{border-radius:0!important}
.lobby-chat-log{border:18px solid transparent!important;border-image:url(assets/lobby/ui-panel.png) 6 fill / 18px round!important;background:none!important;-webkit-mask-image:none!important;mask-image:none!important;padding:0 4px!important;border-radius:0!important;image-rendering:pixelated;font-family:"ArcDigits","Pixelify Sans",sans-serif;font-size:14px!important}
.lobby-chat-log b{font-family:"ArcDigits","Pixelify Sans",sans-serif!important;font-weight:700}
.lobby-chat-box .chat-send .input{border:12px solid transparent!important;border-image:url(assets/lobby/ui-panel.png) 6 fill / 12px round!important;background:none!important;border-radius:0!important;height:44px!important;padding:0 6px!important;font-family:"ArcDigits","Pixelify Sans",sans-serif;font-size:15px;color:#f3e6c4}
.lobby-chat-box .chat-send .btn{height:44px!important;border-radius:0!important;font-family:"ArcDigits","Pixelify Sans",sans-serif!important;font-size:15px!important;box-shadow:0 0 0 2px #18111e,0 0 0 4px #d6aa4e!important}

/* Admin hall editor */
/* Admin hall editor: a small pixel button above the online counter (bottom right); it opens the editor directly. */
.lobby-editor{position:fixed;right:18px;bottom:58px;z-index:64;display:flex;align-items:center;gap:8px;padding:3px;background:#18111ee6;border:2px solid #d6aa4e;font-family:"ArcDigits","Pixelify Sans",sans-serif}
.lobby-editor .lobby-edit-help{display:none;color:#f3e6c4;font-size:12px;padding:0 4px}
.lobby-stage.editing .lobby-editor .lobby-edit-help{display:inline}
body:not([data-view="home"]) .lobby-editor{display:none}
@media (max-width:850px){.lobby-editor{right:10px;bottom:calc(108px + env(safe-area-inset-bottom))}.lobby-stage.editing .lobby-editor .lobby-edit-help{display:none}}
.lobby-editor[hidden]{display:none}
.lobby-editor button{all:unset;cursor:pointer;padding:4px 10px;background:#d6aa4e;color:#18111e;font-weight:700;font-size:14px}
.lobby-edit-help,.lobby-edit-reset{display:none}
.lobby-stage.editing .lobby-edit-help{display:inline;color:#f3e6c4;font-size:13px}
.lobby-stage.editing .lobby-edit-reset{display:inline-block}
.lobby-stage.editing .lobby-chat-box,.lobby-stage.editing .lobby-hint{opacity:.35;pointer-events:none}

/* Auction house panel (pixel frame) */
.auction-modal{max-width:640px!important;border:24px solid transparent!important;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 24px round!important;background:none!important;box-shadow:none!important;filter:drop-shadow(0 16px 30px #000d);border-radius:0!important;font-family:"ArcDigits","Pixelify Sans",sans-serif}
.auction-modal .modal-head b{font-family:"ArcDigits","Pixelify Sans",sans-serif;font-size:20px;color:#f2d28a}
.auction-lot{display:grid;grid-template-columns:130px 1fr;gap:14px;align-items:start}
.auction-lot img{width:130px;filter:drop-shadow(0 6px 10px #000a)}
.auction-lot h3{margin:2px 0 6px;font-family:"ArcDigits","Pixelify Sans",sans-serif;font-size:22px;color:#f3e6c4}
.auction-price{font-size:15px;color:#d9c79c}.auction-price b{font-size:26px;color:#f2cf73}
.auction-phase{display:inline-block;margin:6px 0;padding:2px 8px;background:#2a1d12;border:2px solid #d6aa4e;color:#f3e6c4;font-weight:700}
.auction-phase.once,.auction-phase.twice{color:#ff9a6a;border-color:#ff9a6a;animation:auctionBlink 1s steps(2) infinite}
@keyframes auctionBlink{50%{opacity:.55}}
.auction-bid-row{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}.auction-bid-row .input{width:96px}
.auction-bid-row .btn,.auction-sell-row .btn{border-radius:0!important;font-family:"ArcDigits","Pixelify Sans",sans-serif!important}
.auction-bids{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.auction-bids span{padding:2px 6px;background:#18111e;border:1px solid #6d5130;font-size:12px}
.auction-lists{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:14px}.auction-lists h4{margin:0 0 4px;color:#f2d28a;font-family:"ArcDigits","Pixelify Sans",sans-serif}.auction-lists ul{margin:0;padding-left:16px;font-size:13px}
.auction-sell{margin-top:14px;border-top:2px dashed #d6aa4e55;padding-top:10px}.auction-sell summary{cursor:pointer;color:#f2d28a;font-weight:700}
.auction-sell-row{display:flex;gap:6px;margin-top:8px;flex-wrap:wrap}.auction-sell-row .select{flex:1;min-width:180px}.auction-sell-row .input{width:90px}
.auction-entry .panel-body{display:flex;align-items:center;justify-content:space-between;gap:12px}.auction-entry .panel-body>div{display:flex;flex-direction:column;gap:2px}
@media (max-width:600px){.auction-lot{grid-template-columns:90px 1fr}.auction-lot img{width:90px}.auction-lists{grid-template-columns:1fr}}

.flash-focus{box-shadow:0 0 0 3px #ffd66e,0 0 24px #ffd66e88!important;transition:box-shadow .3s}

/* Ranking / Manual opened from the hall: pixel-art window */
.hall-panel{width:min(1100px,calc(100vw - 24px))!important;max-width:none!important;max-height:calc(100dvh - 40px);display:flex;flex-direction:column;border:24px solid transparent!important;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 24px round!important;background:none!important;box-shadow:none!important;filter:drop-shadow(0 16px 30px #000d);border-radius:0!important}
.hall-panel-body{overflow:auto;min-height:0;scrollbar-width:thin;scrollbar-color:#d6aa4e #18111e}
.hall-panel-body .page{padding:6px!important;max-width:none!important}
.hall-menu-back-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  width:100%;
  min-height:44px;
  padding:0 2px 4px;
  box-sizing:border-box;
}
.hall-menu-back{
  width:40px!important;
  height:40px!important;
  min-width:40px!important;
  min-height:40px!important;
  padding:0!important;
  display:grid!important;
  place-items:center!important;
  line-height:1!important;
  font-size:18px!important;
  flex:0 0 40px!important;
  box-sizing:border-box!important;
}
body .hall-panel[data-panel="collection"]{position:relative;padding:0!important}
body .hall-panel[data-panel="collection"] .hall-panel-body{padding:0!important}
body .hall-panel[data-panel="collection"] .page{padding:0!important}
.npc-dialogue-line{display:flex;align-items:center;gap:18px;margin-bottom:18px}
.npc-dialogue-line .avatar{flex:0 0 80px;width:80px;height:100px}
.npc-dialogue-line p{margin:0;line-height:1.6}
.npc-responses{display:grid;gap:8px}
.npc-responses .btn{text-align:left;white-space:normal}
.npc-dialogue .npc-answer:not(:empty){margin-top:18px;padding:12px;border:1px solid #8a7044}
.hall-panel-body .panel{border-radius:0!important;border:2px solid #6d5130!important;background:#140e18cc!important}
.hall-panel-body h1,.hall-panel-body h2,.hall-panel-body h3{font-family:"ArcDigits","Pixelify Sans",sans-serif!important}

.chat-msg.castle-msg{color:#e8d6aa}.chat-room-tag{font-size:11px}
/* Gold in your own hall card, with a pixel-art coin from the dungeon tileset */
.lobby-gold{display:flex;align-items:center;gap:8px;padding:2px 4px 6px;font-family:"ArcDigits","Pixelify Sans",sans-serif}
.lobby-gold b{font-size:20px;color:#ffd66e;text-shadow:0 2px 0 #000}
.lobby-gold span{font-size:13px;color:#bfae86}
.pixel-coin{display:inline-block;width:32px;height:32px;background:url(assets/lobby/dungeon-tileset.png) -192px -256px/320px 320px no-repeat;image-rendering:pixelated;filter:drop-shadow(0 0 4px #ffcf5a88)}
/* Minimise buttons: chat and editor */
.lobby-chat-min,.lobby-edit-min{all:unset;cursor:pointer;display:grid;place-items:center;width:24px;height:24px;background:#18111e;border:2px solid #d6aa4e;color:#ffd66e;font:700 15px/1 "ArcDigits","Pixelify Sans",sans-serif}
.lobby-chat-box{position:absolute}
.lobby-chat-min{position:absolute;top:-30px;left:0;pointer-events:auto;z-index:2}
/* Minimised chat: only the latest lines as plain text over the hall, no boxes */
.lobby-stage.chat-min .lobby-chat-box .chat-send{display:none}
.lobby-stage.chat-min .lobby-chat-log{border:0!important;border-image:none!important;background:none!important;max-height:118px!important;overflow:hidden!important;pointer-events:none;-webkit-mask-image:linear-gradient(180deg,transparent,#000 30px)!important;mask-image:linear-gradient(180deg,transparent,#000 30px)!important}
.lobby-stage.chat-min .lobby-chat-log .chat-msg{text-shadow:0 1px 0 #000,0 0 4px #000,1px 0 0 #000,-1px 0 0 #000}
.lobby-stage.chat-min .lobby-chat-min{top:auto;bottom:0;left:0}
.lobby-stage.chat-min .lobby-chat-box{bottom:44px}
/* Minimised editor: just a small button */
.lobby-stage.chat-min .lobby-chat-log .chat-msg,.lobby-stage.chat-min .lobby-chat-log>*{background:none!important;border:0!important;box-shadow:none!important;padding:1px 0!important;margin:0!important}
.lobby-stage.chat-min .lobby-chat-log{padding-left:32px!important}
/* ===== Pixel-art theme for every window opened in the hall ===== */
.hall-panel,.hall-panel *,.auction-modal,.auction-modal *,.lobby-menu,.lobby-menu *,.lobby-chat-box,.lobby-chat-box *,.lobby-editor,.lobby-editor *{font-family:"ArcDigits","Pixelify Sans",sans-serif!important;letter-spacing:.01em}
.hall-panel *,.auction-modal *{border-radius:0!important}
.hall-panel h1,.hall-panel h2,.hall-panel h3,.hall-panel .kicker{text-transform:none!important;letter-spacing:.02em!important}
.hall-panel h1{font-size:30px!important;color:#f3e6c4!important;text-shadow:0 3px 0 #000}
.hall-panel h2{font-size:20px!important;color:#f2d28a!important}
.hall-panel .kicker{color:#d6aa4e!important;font-size:12px!important}
/* buttons: square, gold frame, stepped shadow, pressed effect */
.hall-panel .btn,.auction-modal .btn,.lobby-chat-box .btn,.duel-invite-modal .btn{border-radius:0!important;border:2px solid #d6aa4e!important;background:#2a1d12!important;color:#f3e6c4!important;box-shadow:0 0 0 2px #120c16,inset -3px -3px 0 #0007,inset 3px 3px 0 #ffffff14!important;font-weight:700!important;text-transform:none!important;letter-spacing:.02em!important;image-rendering:pixelated;transition:none!important}
.hall-panel .btn:hover:not(:disabled),.auction-modal .btn:hover:not(:disabled),.lobby-chat-box .btn:hover{background:#3a2814!important;color:#fff0c0!important}
.hall-panel .btn:active:not(:disabled),.auction-modal .btn:active:not(:disabled),.lobby-chat-box .btn:active{box-shadow:0 0 0 2px #120c16,inset 3px 3px 0 #0007!important;transform:translateY(1px)}
.hall-panel .btn.primary,.auction-modal .btn.primary,.lobby-chat-box .btn.primary,.duel-invite-modal .btn.primary{background:#d6aa4e!important;color:#18111e!important;border-color:#fff0c0!important}
.hall-panel .btn.primary:hover:not(:disabled),.auction-modal .btn.primary:hover:not(:disabled){background:#ffd66e!important}
.hall-panel .btn.danger{background:#5e1a26!important;border-color:#ff9a6a!important}
.hall-panel .btn:disabled{opacity:.45!important}
/* cards, panels, inputs, tables */
.hall-panel .panel,.hall-panel .stat-card,.hall-panel .game-card,.hall-panel .reward-banner,.hall-panel .pack-card,.hall-panel .deck-slot{border-radius:0!important;border:2px solid #6d5130!important;box-shadow:0 0 0 2px #120c16!important;background:#150f19!important}
.hall-panel .stat-card strong{color:#ffd66e!important;font-size:30px!important}
.hall-panel .input,.hall-panel .select,.hall-panel textarea,.auction-modal .input,.auction-modal .select{border-radius:0!important;border:2px solid #6d5130!important;background:#0f0b12!important;color:#f3e6c4!important;box-shadow:inset 2px 2px 0 #000a!important}
.hall-panel .input:focus,.hall-panel .select:focus{border-color:#d6aa4e!important;outline:none!important}
.hall-panel table th{color:#d6aa4e!important;font-size:13px!important;letter-spacing:.04em!important}
.hall-panel table tr{border-bottom:2px dashed #6d513055!important}
.hall-panel .pill{border-radius:0!important;border:2px solid #6d5130!important;background:#120c16!important}
.hall-panel .modal-head .btn.icon,.auction-modal .modal-head .btn.icon{width:30px;height:30px;padding:0!important}
/* ===== Pixel-art navigation bar and HUD (same style as the hall) ===== */
.sidebar .nav-btn,.mobile-nav button,.currency,.currency *,.sidebar .player-chip *{font-family:"ArcDigits","Pixelify Sans",sans-serif!important}
.sidebar .nav-btn{border-radius:0!important;border:2px solid transparent!important;background:none!important;box-shadow:none!important;text-transform:none!important;letter-spacing:.03em!important;font-size:15px!important;font-weight:700!important;transition:none!important}
.sidebar .nav-btn:hover{border-color:#6d5130!important;background:#1a121e!important;color:#fff0c0!important}
.sidebar .nav-btn.active{border-color:#d6aa4e!important;background:#2a1d12!important;color:#ffd66e!important;box-shadow:0 0 0 2px #120c16,inset -2px -2px 0 #0007!important}
.sidebar .nav-btn.active:before,.sidebar .nav-btn.active:after{display:none!important}
.sidebar .nav-badge{border-radius:0!important;font-family:"ArcDigits","Pixelify Sans",sans-serif!important}
.currency{border-radius:0!important;border:2px solid #d6aa4e!important;background:#18111e!important;box-shadow:0 0 0 2px #120c16,inset -2px -2px 0 #0007!important}
.currency .hud-icon,.currency .support-header{border-radius:0!important}
.mobile-nav{border-top:2px solid #d6aa4e!important;background:#120c16!important}
.mobile-nav button{border-radius:0!important;text-transform:none!important}
.mobile-nav button.active,.mobile-nav button[aria-current]{background:#2a1d12!important;color:#ffd66e!important;box-shadow:inset 0 3px 0 #d6aa4e!important}
.hall-return{border-radius:0!important;font-family:"ArcDigits","Pixelify Sans",sans-serif!important;border:2px solid #fff0c0!important;box-shadow:0 0 0 2px #120c16!important}
.lobby-sprite-grid{display:grid;grid-template-columns:repeat(4,46px);gap:6px;padding:4px 2px}
.lobby-menu .lobby-sprite{all:unset;cursor:pointer;display:grid;place-items:center;width:42px;height:54px;background:#120c16;border:2px solid #5a4630}
.lobby-menu .lobby-sprite.on,.lobby-menu .lobby-sprite:hover{border-color:#ffd66e;background:#2a1d10}
.lobby-sprite canvas{image-rendering:pixelated;width:36px;height:48px}
/* The hall is the navigation on phones and in the Android app: no bottom menu bar. Every section
   opens from its station in the hall; pages outside it (training, admin) have the "Salón" button. */
.mobile-nav{display:none!important}
@media (pointer:coarse),(max-width:850px){
  .main{padding-bottom:env(safe-area-inset-bottom)!important}
  body:not([data-view="home"]):not([data-view="duel"]):not([data-view="spectate"]) .hall-return{right:auto;left:12px;bottom:calc(14px + env(safe-area-inset-bottom))}
}

/* Bottom-right dock (pixel art): private messages, music, settings, supporter badge, online count. */
.hud-dock{position:fixed;right:18px;bottom:18px;z-index:64;display:flex;align-items:center;gap:4px;padding:3px 4px;background:#18111ecc;border:1px solid #d6aa4e40;box-shadow:none;font-family:"ArcDigits","Pixelify Sans",sans-serif}
.hud-dock .hud-icons{display:inline-flex;align-items:center;gap:4px}
.hud-dock .hud-icon{position:relative;display:grid;place-items:center;width:30px;height:30px;padding:0;margin:0;border:1px solid #5a463066;border-radius:0!important;background:#120c16;color:#ffd66e;font-size:15px;cursor:pointer}
.hud-dock .hud-icon:hover{border-color:#ffd66e;background:#2a1d10}
.hud-dock .online-counter{position:static!important;box-shadow:none;border-radius:0;border:1px solid #5a463066;background:#120c16;padding:4px 10px;height:30px;box-sizing:border-box;pointer-events:auto;cursor:pointer;font-family:"ArcDigits","Pixelify Sans",sans-serif}
.hud-dock .online-counter span:last-child{display:none}
.hud-dock [data-message-count]{position:absolute;top:-7px;right:-7px;min-width:15px;height:15px;padding:0 3px;box-sizing:border-box;background:#c0392b;color:#fff;font:700 10px/15px "ArcDigits","Pixelify Sans",sans-serif;text-align:center;border:1px solid #fff2}
.hud-dock [data-message-count][hidden]{display:none}
.shell.duel-mode .hud-dock,body[data-view="duel"] .hud-dock,body[data-view="spectate"] .hud-dock{display:none!important}
.lobby-editor{bottom:62px}
@media (pointer:coarse),(max-width:850px){
  .hud-dock{right:10px;bottom:calc(10px + env(safe-area-inset-bottom))}
  .hud-dock .hud-icon{width:34px;height:34px}
  .hud-dock .online-counter{height:34px}
  .lobby-editor{right:10px;bottom:calc(58px + env(safe-area-inset-bottom))}
  .lobby-stage.touch-ui .lobby-chat-toggle{right:auto;left:14px}
}

/* hall editor: just a small pixel icon above the dock */
.lobby-editor{padding:0;border:0;background:none;gap:6px}
.lobby-editor .lobby-edit-toggle{display:grid;place-items:center;width:30px;height:30px;padding:0;box-sizing:border-box;background:#120c16cc;border:1px solid #d6aa4e40;color:#ffd66e;font-size:16px}
.lobby-editor .lobby-edit-toggle:hover{background:#2a1d10}
.lobby-stage.editing .lobby-editor .lobby-edit-toggle{background:#d6aa4e;color:#18111e}
.lobby-stage.editing .lobby-editor .lobby-edit-help{background:#18111ee6;border:2px solid #d6aa4e;padding:5px 8px}
.lobby-editor{bottom:64px;right:22px}
@media (pointer:coarse),(max-width:850px){.lobby-editor{right:12px;bottom:calc(60px + env(safe-area-inset-bottom))}}
/* dock: no frame, all buttons the same small pixel square (overrides the audio/messages header sizes) */
.hud-dock{background:none!important;border:0!important;box-shadow:none!important;padding:0!important;gap:4px}
.hud-dock .hud-icon,.hud-dock .online-counter{min-width:30px!important;width:30px!important;min-height:30px!important;height:30px!important;box-sizing:border-box!important;border:0!important;outline:0!important;box-shadow:none!important;border-radius:0!important;background:#120c16d9!important;font-size:15px!important;animation:none!important;transform:none!important}
.hud-dock .online-counter{width:auto!important;padding:0 8px!important}
.hud-dock .hud-icon:hover{background:#2a1d10!important}
.hud-dock .message-open.has-unread{background:#4a1018d9!important}
.lobby-editor .lobby-edit-toggle{border:0!important;box-shadow:none!important;outline:0!important}
@media (pointer:coarse),(max-width:850px){.hud-dock .hud-icon,.hud-dock .online-counter{min-width:34px!important;width:34px!important;min-height:34px!important;height:34px!important}.hud-dock .online-counter{width:auto!important}}

/* dock: buttons side by side with no gap; tapping the online counter shows or hides them */
.hud-dock{gap:0!important}
.hud-dock .hud-icons{gap:0!important}
.hud-dock .hud-icons,.hud-dock>.support-header{display:none!important}
.hud-dock.open .hud-icons{display:inline-flex!important}
.hud-dock.open>.support-header{display:grid!important}
.hud-dock .hud-icon+.hud-icon,.hud-dock>.support-header,.hud-dock .online-counter{margin-left:0!important;border-left:1px solid #00000066!important}
.hud-dock .hud-icons>.hud-icon:first-child{border-left:0!important}
.hud-dock:not(.open) .online-counter{border-left:0!important}

/* gold in the dock, next to the online counter, with the pixel coin */
.currency[hidden]{display:none!important}
.hud-dock .hud-gold{display:inline-flex;align-items:center;gap:5px;height:30px;padding:0 8px;box-sizing:border-box;background:#120c16d9;border-left:1px solid #00000066;color:#ffd66e;font:700 14px/1 "ArcDigits","Pixelify Sans",sans-serif;font-variant-numeric:tabular-nums}
.hud-dock .hud-gold .pixel-coin{width:16px;height:16px;flex:0 0 16px;background-size:160px 160px;background-position:-96px -128px}
.hud-dock:not(.open) .hud-gold{border-left:0}
@media (pointer:coarse),(max-width:850px){.hud-dock .hud-gold{height:34px}}

/* Players panel (opened from the online counter): pixel art, with the HUD icons and log out at the bottom */
.hud-dock .hud-icons{display:none!important}
.social-drawer{border:20px solid transparent!important;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 20px round!important;background:none!important;border-radius:0!important;box-shadow:none!important;display:flex;flex-direction:column}
.social-drawer,.social-drawer *{font-family:"ArcDigits","Pixelify Sans",sans-serif!important}
.social-drawer .btn,.social-drawer button,.social-drawer .social-me,.social-drawer .social-user,.social-drawer .avatar{border-radius:0!important}
.social-drawer .social-me,.social-drawer .social-user{background:#120c16cc!important;border:1px solid #5a463066!important;box-shadow:none!important}
.social-drawer .social-me:hover,.social-drawer .social-user:hover{background:#2a1d10!important}
.social-drawer .social-title{color:#ffd66e!important;letter-spacing:.04em}
.social-foot{margin-top:auto;display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:10px;border-top:1px solid #d6aa4e33}
.social-icons .hud-icons{display:inline-flex!important;gap:0}
.social-icons .hud-icon{position:relative;display:grid;place-items:center;min-width:32px!important;width:32px!important;min-height:32px!important;height:32px!important;padding:0!important;margin:0!important;box-sizing:border-box;border:0!important;border-left:1px solid #00000066!important;border-radius:0!important;background:#120c16!important;color:#ffd66e!important;font-size:15px!important;box-shadow:none!important;animation:none!important;cursor:pointer}
.social-icons .hud-icon:first-child{border-left:0!important}
.social-icons .hud-icon:hover{background:#2a1d10!important}
.social-icons .message-open.has-unread{background:#4a1018!important}
.social-icons [data-message-count]{position:absolute;top:-7px;right:-7px;min-width:15px;height:15px;padding:0 3px;box-sizing:border-box;border-radius:0!important;background:#c0392b;color:#fff;font:700 10px/15px "ArcDigits","Pixelify Sans",sans-serif;text-align:center}
.social-icons [data-message-count][hidden]{display:none}
.social-logout{all:unset;cursor:pointer;padding:7px 10px;background:#5e1a26;color:#f3e6c4;font:700 13px/1 "ArcDigits","Pixelify Sans",sans-serif;border:1px solid #c0392b66}
.social-logout:hover{background:#7a2232}

.hud-dock .online-counter{position:relative!important}
.dock-unread{position:absolute;top:-6px;right:-6px;min-width:14px;height:14px;padding:0 3px;box-sizing:border-box;background:#c0392b;color:#fff;font:700 9px/14px "ArcDigits","Pixelify Sans",sans-serif;text-align:center}
.dock-unread[hidden]{display:none}
/* Phones: the hall uses the whole screen (no header bar), the fullscreen button is pixel art and
   small, and notices appear above the bottom-right dock. */
@media (pointer:coarse),(max-width:850px){
  body .shell:not(.duel-mode) .topbar{display:none!important}
  body[data-view="home"] .shell:not(.duel-mode) .main{padding-top:0!important;padding-bottom:0!important}
  body .shell:not(.duel-mode) .main{padding-bottom:env(safe-area-inset-bottom)!important}
  .toast-stack{bottom:calc(56px + env(safe-area-inset-bottom))!important;right:10px!important}
}
.lobby-stage.touch-ui:not(.is-full):not(.native-full) .lobby-fs-btn{left:auto!important;right:10px!important;top:10px!important;bottom:auto!important;transform:none!important;padding:6px 10px!important;border-radius:0!important;border:1px solid #d6aa4e66!important;background:#120c16d9!important;color:#ffd66e!important;font:700 12px/1 "ArcDigits","Pixelify Sans",sans-serif!important;box-shadow:none!important}
.lobby-stage.native-full .lobby-fs-btn,.lobby-stage.native-full .lobby-fs-exit{display:none!important}

/* online counter in the dock shows just the dot and the number */
.hud-dock .online-counter b+span{display:none!important}
/* phones: the character walks where you tap, no joystick */
.lobby-stage.touch-ui .lobby-joy{display:none!important}
/* languages at the very bottom of the players panel */
.social-langs{padding-top:8px;display:flex;justify-content:center}
.social-langs #languageFlags{position:static!important;transform:none!important;display:flex!important;gap:10px;right:auto!important;top:auto!important}
.hud-dock .online-counter{top:auto!important;right:auto!important;bottom:auto!important;left:auto!important}
/* phones: the hall is the whole screen, nothing scrolls around it */
@media (pointer:coarse),(max-width:850px){
  html:has(body[data-view="home"]),body[data-view="home"],body[data-view="home"] .shell,body[data-view="home"] .main{overflow:hidden!important;height:100dvh!important;min-height:0!important}
}
.social-drawer *{border-radius:0!important}
.social-drawer{overflow-y:auto!important}

/* Compact desktop identity; languages sit before it in the header. */
@media(min-width:851px) and (pointer:fine){
 .shell:not(.duel-mode) .sidebar{display:flex!important;align-items:center;gap:14px;padding-right:18px!important}
 .sidebar .nav{flex:1;min-width:0;overflow-x:auto;white-space:nowrap}
 .shell:not(.duel-mode) .sidebar .header-account{position:static!important;display:block!important;flex:0 0 182px;order:4;margin:0!important;width:182px}
 .sidebar #languageFlags{position:static!important;transform:none!important;display:flex!important;flex:0 0 auto;order:3;gap:6px;margin:0 14px 0 8px}
 .header-account .player-chip{display:flex;align-items:center;gap:9px;width:100%;min-height:48px;padding:4px 7px;text-align:left;border:1px solid #b4985b33;background:#15121799;border-radius:2px;color:#eee1c5;cursor:pointer}
 .header-account .player-chip:hover{border-color:#b4985b88;background:#221b2399}
 .header-account .player-chip:focus-visible{outline:2px solid #e7c57b;outline-offset:2px}
 .header-account .avatar{width:36px;height:36px;min-width:36px;padding:0;overflow:hidden;border:1px solid #ae936655;border-radius:2px}
 .header-account .portrait-art{display:block;width:100%;height:100%}
 .header-account .player-chip-info{min-width:0;display:grid;gap:3px}
 .header-account #playerName{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
 .header-account #playerMeta{font-size:12px;color:#baa989}
 .header-account .mini-xp{display:none}
}
/* Fine pixel borders and comfortably sized invisible touch areas. */
@media(pointer:coarse),(max-width:850px){
 .lobby-stage.touch-ui .lobby-chat-min{display:none!important}
 .lobby-stage.touch-ui .lobby-chat-toggle{width:44px!important;height:44px!important;left:max(10px,env(safe-area-inset-left))!important;bottom:max(10px,env(safe-area-inset-bottom))!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;font-size:18px!important;color:#dfc58e}
 .lobby-stage.touch-ui .lobby-chat-toggle:before{content:'';position:absolute;inset:6px;background:#17121cdd;border:1px solid #a88b5755;z-index:-1}
 .lobby-stage.touch-ui .lobby-chat-box{left:max(12px,env(safe-area-inset-left))!important;right:auto!important;bottom:62px!important;width:min(390px,calc(100% - 24px))!important;border:1px solid #a88b5755!important;border-image:none!important;background:#17121cee!important;padding:8px!important}
 .lobby-chat-log{font-size:14px!important;border:0!important;border-image:none!important;background:none!important;padding:6px!important}
 .lobby-chat-box .input{font-size:16px!important;min-height:44px!important}
 .lobby-chat-box .btn,.lobby-menu button{min-height:44px!important;box-sizing:border-box!important}
 .lobby-menu,.social-drawer{border:1px solid #a88b5766!important;border-image:none!important;background:#17121cf5!important;border-radius:2px!important;box-shadow:0 6px 20px #0006!important;padding:12px!important}
 .lobby-menu button{font-size:14px!important;border:0!important;border-image:none!important;background:transparent!important}
 .social-drawer .social-user{min-height:52px}
 .lobby-stage.touch-ui .lobby-hint{font-size:13px!important;border:1px solid #a88b5733!important;border-radius:1px!important;background:#17121cc9!important;box-shadow:none!important}
 .hud-dock .online-counter{min-height:44px!important;height:44px!important;background:#17121cc9!important;font-size:14px!important}
 .hud-dock .hud-gold{height:44px!important;background:#17121cc9!important;font-size:14px!important}
}

/* The editor stays available to authorised users on small/touch screens. Visibility is still set by the server-backed permissions in visual-lobby.js. */
/* Browser fallback: rotate the actual game surface, never show a portrait game or prompt. */
html.mobile-landscape-rotated{width:100%;height:100%;overflow:hidden!important}
html.mobile-landscape-rotated body{position:absolute!important;top:0;left:100%;width:var(--game-width)!important;height:var(--game-height)!important;min-height:0!important;transform:rotate(90deg);transform-origin:0 0;overflow:auto}
html.mobile-landscape-rotated body[data-view="home"] .shell,
html.mobile-landscape-rotated body[data-view="home"] .main{height:var(--game-height)!important}
html.mobile-landscape-rotated :fullscreen{width:var(--game-width)!important;height:var(--game-height)!important;position:fixed!important;inset:auto!important;top:0!important;left:100%!important;transform:rotate(90deg)!important;transform-origin:0 0!important}
html.mobile-landscape-rotated .combat-viewport{height:var(--game-height)!important}

html.mobile-landscape-rotated #viewRoot .combat-viewport,
html.mobile-landscape-rotated #viewRoot .combat-viewport .duel-page{width:var(--game-width)!important;height:var(--game-height)!important}
html.mobile-landscape-rotated .modal,html.mobile-landscape-rotated dialog{max-width:calc(var(--game-width) - 24px)!important;max-height:calc(var(--game-height) - 24px)!important}
html.mobile-landscape-rotated .modal-body{max-height:calc(var(--game-height) - 90px)!important}


/* ===== Pixel UI kit (SGQ pack recoloured to ARCANUM: gold, cream, purple, crimson) ===== */
.px-ico{width:16px;height:16px;image-rendering:pixelated;display:block}
/* experience bar: pixel frame with a gold segmented fill */
.px-bar{display:block;position:relative;height:15px;box-sizing:border-box;border:6px solid transparent!important;border-image:url(assets/ui/barEmpty.png) 3 fill / 6px!important;background:none!important;box-shadow:none!important;border-radius:0!important;overflow:visible!important;image-rendering:pixelated}
.px-bar i{position:absolute!important;left:-3px;top:-3px;bottom:-3px;max-width:calc(100% + 6px);display:block;border-radius:0!important;box-shadow:none!important;background:repeating-linear-gradient(90deg,#ffd66e 0 6px,#d6aa4e 6px 8px)!important}
.lobby-xp-bar.px-bar{height:15px!important}
/* header identity (desktop) */
.header-account .mini-xp{display:block!important;position:relative;height:12px;margin-top:2px;box-sizing:border-box;border:5px solid transparent;border-image:url(assets/ui/barEmpty.png) 3 fill / 5px;background:none!important;border-radius:0!important;overflow:visible!important}
.header-account .mini-xp #playerXpFill{position:absolute;left:-2px;top:-2px;bottom:-2px;max-width:calc(100% + 4px);display:block;background:repeating-linear-gradient(90deg,#ffd66e 0 5px,#d6aa4e 5px 7px)!important;border-radius:0!important}
.header-account .player-chip-info{gap:1px!important}
.header-account #playerMeta{font-size:11px!important}
.player-tier{display:inline-flex;align-items:center;gap:3px;width:max-content;padding:0 5px;background:#8a2a3a;color:#ffd66e;font:700 10px/15px "ArcDigits","Pixelify Sans",sans-serif}
.player-tier[hidden]{display:none}
.player-tier .sup-badge img{width:11px;height:11px}
@media(min-width:851px) and (pointer:fine){.shell:not(.duel-mode) .sidebar .header-account{flex:0 0 200px!important;width:200px!important}}
/* players panel: your card */
.social-me .me-xp{display:flex;align-items:center;gap:6px;margin-top:4px}
.social-me .me-xp .px-bar{flex:1;min-width:70px}
.social-me .me-xp small{font-size:11px;color:#bfa77a;white-space:nowrap}
.social-me .me-tier{font-style:normal;background:#8a2a3a;color:#ffd66e;padding:0 4px}
/* dock: crimson pixel buttons for gold and online */
.hud-dock .hud-gold,.hud-dock .online-counter{border:6px solid transparent!important;border-image:url(assets/ui/btn3.png) 5 fill / 6px!important;background:none!important;padding:0 6px!important;box-sizing:border-box!important;height:34px!important;color:#ffd66e!important}
.hud-dock{gap:4px!important}
.hud-dock .online-counter b{color:#ffd66e!important}
/* icon buttons in the players panel */
.social-icons .hud-icons{gap:4px!important}
.social-icons .hud-icon{border:6px solid transparent!important;border-image:url(assets/ui/btn3.png) 5 fill / 6px!important;background:none!important;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important}
.social-icons .hud-icon:hover,.social-icons .hud-icon:active{border-image-source:url(assets/ui/btn.png)!important}
.social-icons .hud-icon:hover .px-ico{filter:brightness(.2)}
.social-icons .message-open.has-unread{border-image-source:url(assets/ui/btn.png)!important}
.social-logout{display:inline-flex!important;align-items:center;gap:6px;border:6px solid transparent!important;border-image:url(assets/ui/btn3.png) 5 fill / 6px!important;background:none!important;padding:2px 6px!important}
.social-logout:hover{filter:brightness(1.15)}
/* buttons inside the hall windows and the chat */
.hall-panel .btn,.lobby-chat-box .chat-send .btn,.auction-modal .btn{border:9px solid transparent!important;border-image:url(assets/ui/btn.png) 5 fill / 9px!important;background:none!important;box-shadow:none!important;border-radius:0!important;color:#18111e!important;font-family:"ArcDigits","Pixelify Sans",sans-serif!important;font-weight:700!important;padding:2px 10px 4px!important;text-shadow:none!important}
.hall-panel .btn:active,.lobby-chat-box .chat-send .btn:active,.auction-modal .btn:active{border-image-source:url(assets/ui/btnDown.png)!important;transform:translateY(2px)}

/* Spectator buttons: the 9px pixel border used to steal too much of the fixed 80px
   match column, pushing "Observar" into the right edge. Give the live-match action
   its natural width and center the label inside the pixel frame. */
.hall-panel .live-match{grid-template-columns:minmax(0,1fr) max-content!important}
.hall-panel .live-match .btn[data-action="spectate"],
.hall-panel .chat-accept[data-action="spectate"]{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:96px;
  line-height:1!important;
  padding:3px 8px!important;
  text-align:center!important;
  white-space:nowrap;
}
.hall-panel .btn.ghost,.hall-panel .btn.danger,.hall-panel .btn.icon,.auction-modal .btn.ghost,.auction-modal .btn.icon{border-image-source:url(assets/ui/btn3.png)!important;color:#ffd66e!important}
.hall-panel .btn[disabled],.auction-modal .btn[disabled]{filter:grayscale(.7) brightness(.7);cursor:not-allowed}
/* chat input */
.lobby-chat-box .chat-send .input{border:9px solid transparent!important;border-image:url(assets/ui/inputBlank.png) 3 fill / 9px!important;background:none!important;color:#f3e6c4!important}
.header-account .player-chip-info{display:grid!important;grid-template-columns:auto 1fr;align-items:center;column-gap:5px;row-gap:2px}
.header-account #playerName{grid-column:1;max-width:96px!important}
.header-account .player-tier{grid-column:2;justify-self:start;height:13px!important;line-height:13px!important;padding:0 4px!important;font-size:9px!important;overflow:hidden}
.header-account #playerMeta,.header-account .mini-xp{grid-column:1 / -1}
.header-account .player-tier .sup-badge{display:inline-flex}
.header-account .player-tier .sup-badge img{width:9px!important;height:9px!important}
/* notices sit above the bottom-right dock */
.toast-stack{bottom:62px!important}
.header-account .player-tier{width:max-content!important;gap:3px!important}

/* A compact conversation strip sits immediately above the mobile keyboard. */
@media(pointer:coarse),(max-width:850px){
 .lobby-stage.touch-ui.chat-open .lobby-chat-box{bottom:calc(12px + var(--chat-keyboard-offset,0px))!important;gap:4px!important;pointer-events:auto}
 .lobby-stage.touch-ui.chat-open .lobby-chat-log{max-height:min(120px,calc(var(--chat-visible-height,390px) * .3))!important;min-height:28px;overflow-y:auto!important;overscroll-behavior:contain}
 .lobby-stage.touch-ui.chat-open .lobby-chat-box .chat-send .input{border:1px solid #a88b5755!important;border-image:none!important;background:#0d0b12!important;padding:8px!important;height:44px!important;font-size:16px!important;box-shadow:none!important}
 .lobby-stage.touch-ui.chat-open .lobby-chat-box .chat-send .btn{border:1px solid #a88b5766!important;border-image:none!important;background:#d6aa4e!important;box-shadow:none!important;padding:8px 12px!important;font-size:14px!important}
 .lobby-stage.touch-ui.chat-open .lobby-chat-toggle{bottom:calc(12px + var(--chat-keyboard-offset,0px))!important;left:auto!important;right:12px!important}
}

@media(pointer:coarse),(max-width:850px){
 body:has(.lobby-stage.touch-ui.chat-open) .hud-dock{display:none!important}
 .lobby-stage.touch-ui.chat-open .lobby-fs-btn{display:none!important}
}

/* admin access icon: next to the editor pencil, above the gold */
.dock-admin{position:fixed;right:58px;bottom:64px;z-index:64;width:30px;height:30px;padding:0;display:grid;place-items:center;cursor:pointer;box-sizing:border-box;background:#120c16cc;border:1px solid #d6aa4e40;border-radius:0}
.dock-admin:hover{background:#2a1d10}
body:not([data-view="home"]) .dock-admin{right:22px}
.shell.duel-mode .dock-admin,body[data-view="duel"] .dock-admin,body[data-view="spectate"] .dock-admin{display:none!important}
@media (pointer:coarse),(max-width:850px){.dock-admin{right:10px!important;bottom:calc(52px + env(safe-area-inset-bottom))}}
.toast-stack{bottom:104px!important}
@media (pointer:coarse),(max-width:850px){.toast-stack{bottom:calc(96px + env(safe-area-inset-bottom))!important}}
/* Gold in the top-left corner (the online counter stays bottom right) */
body[data-view="home"] .hud-dock .hud-gold{position:fixed!important;left:16px;top:calc(var(--hall-top,80px) + 12px);z-index:64}
@media (pointer:coarse),(max-width:850px){
  .hud-dock .hud-gold{position:fixed!important;left:calc(10px + env(safe-area-inset-left))!important;top:calc(10px + env(safe-area-inset-top))!important;z-index:64}
}

/* @mentions in the chat */
.chat-mention{color:#8fc3ff;font-weight:700}
.chat-mention.me{color:#18111e;background:#ffd66e;padding:0 3px}
.chat-msg.mentions-me{background:#ffd66e1f;box-shadow:inset 3px 0 0 #ffd66e}

/* Language selector hidden until the translations are ready (remove these two lines to bring it back). */
html body nav#languageFlags.language-flags,html body .sidebar nav#languageFlags.language-flags,html body .social-drawer .social-langs{display:none!important}


/* ===== Desktop standard hall: true full-viewport game engine =====
   The normal desktop hall now owns the whole viewport. Navigation is an overlay opened
   from the pixel menu button, while the player's identity remains pinned at top-right. */
@media (min-width:851px) and (pointer:fine){
  html:has(body[data-view="home"]),
  body[data-view="home"],
  body[data-view="home"] #appShell,
  body[data-view="home"] #appShell>.main,
  body[data-view="home"] #viewRoot,
  body[data-view="home"] .page.lobby-home,
  body[data-view="home"] .lobby-hall{
    width:100%!important;
    height:100dvh!important;
    min-height:0!important;
    max-height:100dvh!important;
    margin:0!important;
    padding:0!important;
    overflow:hidden!important;
  }
  body[data-view="home"] #appShell{display:block!important;position:relative!important}
  body[data-view="home"] #appShell>.main{min-height:100dvh!important;background:#120f14!important}
  body[data-view="home"] #appShell>.main>.topbar{display:none!important}
  body[data-view="home"] .lobby-stage{
    position:relative!important;
    width:100vw!important;
    height:100dvh!important;
    min-height:100dvh!important;
    max-height:100dvh!important;
    border:0!important;
  }

  /* The old permanent desktop header becomes a retractable overlay. */
  body[data-view="home"] #appShell>.sidebar{
    display:flex!important;
    position:fixed!important;
    inset:0 0 auto 0!important;
    z-index:88!important;
    width:100vw!important;
    height:64px!important;
    min-height:64px!important;
    padding:0 238px 0 128px!important;
    gap:12px!important;
    border:0!important;
    border-bottom:2px solid transparent!important;
    background:transparent!important;
    box-shadow:none!important;
    backdrop-filter:none!important;
    pointer-events:none;
    transition:background .14s linear,border-color .14s linear,box-shadow .14s linear;
  }
  body[data-view="home"] #appShell>.sidebar::after{opacity:0!important;transition:opacity .14s linear}
  body[data-view="home"] #appShell>.sidebar>.brand,
  body[data-view="home"] #appShell>.sidebar>.nav,
  body[data-view="home"] #appShell>.sidebar>#languageFlags{
    opacity:0;
    visibility:hidden;
    transform:translateY(-16px);
    pointer-events:none;
    transition:opacity .12s linear,transform .12s ease,visibility 0s linear .12s;
  }
  body[data-view="home"].hall-nav-open #appShell>.sidebar{
    border-bottom-color:#6d5130!important;
    background:linear-gradient(180deg,#100b10f7,#09070cf4)!important;
    box-shadow:0 3px 0 #050306,0 10px 28px #0008!important;
  }
  body[data-view="home"].hall-nav-open #appShell>.sidebar::after{opacity:.6!important}
  body[data-view="home"].hall-nav-open #appShell>.sidebar>.brand,
  body[data-view="home"].hall-nav-open #appShell>.sidebar>.nav,
  body[data-view="home"].hall-nav-open #appShell>.sidebar>#languageFlags{
    opacity:1;
    visibility:visible;
    transform:none;
    pointer-events:auto;
    transition-delay:0s;
  }
  body[data-view="home"] #appShell>.sidebar>.nav{height:64px!important;align-items:stretch!important}
  body[data-view="home"] #appShell>.sidebar>.nav .nav-btn{height:64px!important}
  body[data-view="home"] #appShell>.sidebar>#languageFlags{margin:0 4px!important}

  /* Always-visible player sheet, detached visually from the retractable navigation. */
  body[data-view="home"] #appShell>.sidebar .header-account{
    display:block!important;
    position:fixed!important;
    top:10px!important;
    right:12px!important;
    left:auto!important;
    bottom:auto!important;
    z-index:102!important;
    width:210px!important;
    height:52px!important;
    margin:0!important;
    flex:none!important;
    pointer-events:auto;
  }
  body[data-view="home"] .header-account .player-chip{
    position:relative;
    width:100%!important;
    height:52px!important;
    min-height:52px!important;
    box-sizing:border-box!important;
    display:flex!important;
    align-items:center!important;
    gap:9px!important;
    padding:5px 9px!important;
    border:2px solid #d6aa4e!important;
    border-radius:0!important;
    clip-path:polygon(5px 0,calc(100% - 5px) 0,calc(100% - 5px) 2px,100% 2px,100% calc(100% - 5px),calc(100% - 2px) calc(100% - 5px),calc(100% - 2px) 100%,5px 100%,5px calc(100% - 2px),0 calc(100% - 2px),0 5px,2px 5px,2px 2px,5px 2px);
    background:linear-gradient(180deg,#1d151feF,#0c090fF2)!important;
    box-shadow:inset 0 0 0 2px #2b1d27,inset 0 0 0 4px #0a070b,0 0 0 2px #09060b,0 4px 0 #050306,0 8px 18px #0008!important;
    color:#f3e6c4!important;
  }
  body[data-view="home"] .header-account .player-chip::before,
  body[data-view="home"] .header-account .player-chip::after{
    content:"";position:absolute;width:4px;height:4px;background:#ffe08a;box-shadow:0 0 0 1px #6d5130;pointer-events:none;
  }
  body[data-view="home"] .header-account .player-chip::before{left:4px;top:4px}
  body[data-view="home"] .header-account .player-chip::after{right:4px;bottom:4px}
  body[data-view="home"] .header-account .avatar{
    width:38px!important;height:38px!important;min-width:38px!important;
    border:2px solid #8e713d!important;border-radius:0!important;background:#100b12!important;
    box-shadow:inset 0 0 0 1px #090609!important;
  }
  body[data-view="home"] .header-account #playerName{max-width:112px!important;color:#fff0c0!important;font-size:13px!important}
  body[data-view="home"] .header-account #playerMeta{color:#c5ad7c!important;font-size:10px!important}
  body[data-view="home"] .header-account .mini-xp{display:block!important;height:5px!important;margin-top:2px!important}
  body[data-view="home"] .header-account .player-chip{display:grid!important;grid-template-columns:36px minmax(0,1fr);gap:9px;padding:6px 9px!important;border-image:none!important;clip-path:none;box-shadow:inset 0 0 0 1px #2b1d27,0 2px 0 #09060b!important}
  body[data-view="home"] .header-account .avatar{width:36px!important;height:36px!important;min-width:36px!important;border-image:none!important;box-sizing:border-box}
  body[data-view="home"] .header-account .player-chip-info{min-width:0;width:100%;grid-template-columns:minmax(0,1fr) auto;row-gap:2px!important;line-height:1.15}
  body[data-view="home"] .header-account #playerName{max-width:none!important;font-size:12px!important;line-height:15px}
  body[data-view="home"] .header-account #playerMeta{display:block;white-space:nowrap;font-size:10px!important;line-height:12px}
  body[data-view="home"] .header-account .player-tier[hidden]{display:none!important}
  body[data-view="home"] .header-account .mini-xp{height:6px!important;min-height:6px;border:1px solid #80682d!important;border-image:none!important;overflow:hidden!important;background:#100b14!important;box-shadow:none!important}
  body[data-view="home"] .header-account .mini-xp #playerXpFill{position:static;height:100%;max-width:100%;min-height:0}

  /* Pixel-art navigation trigger. It stays on top of the hall and of the opened bar. */
  .lobby-nav-toggle{
    display:flex;
    position:fixed;
    top:12px;
    left:12px;
    z-index:103;
    align-items:center;
    justify-content:center;
    gap:7px;
    height:40px;
    width:96px;
    min-width:96px;
    box-sizing:border-box;
    padding:0 11px;
    border:2px solid #d6aa4e;
    border-radius:0;
    background:#17101bdF;
    color:#ffe08a;
    box-shadow:inset 0 0 0 2px #09060b,0 0 0 2px #09060b,0 4px 0 #050306;
    font:700 12px/1 "ArcDigits","Pixelify Sans",sans-serif;
    letter-spacing:.04em;
    cursor:pointer;
  }
  .lobby-nav-toggle:hover,.lobby-nav-toggle[aria-expanded="true"]{background:#6e2130;color:#fff0c0;border-color:#ffe08a}
  .lobby-nav-toggle span{font-size:15px;line-height:1}
  .lobby-nav-toggle:focus-visible{outline:2px solid #fff0c0;outline-offset:3px}
  body[data-view="home"] .lobby-fs-btn{display:none!important}
}
@media (max-width:850px),(pointer:coarse){
  .lobby-nav-toggle{display:none!important}
}

/* Give narrower desktop windows a second navigation row instead of crowding the logo. */
@media (min-width:851px) and (max-width:1450px) and (pointer:fine){
  body[data-view="home"].hall-nav-open #appShell>.sidebar{height:112px!important;min-height:112px!important;align-items:flex-start!important}
  body[data-view="home"].hall-nav-open #appShell>.sidebar>.brand{margin-top:9px!important}
  body[data-view="home"].hall-nav-open #appShell>.sidebar>#languageFlags{margin-top:20px!important}
  body[data-view="home"].hall-nav-open #appShell>.sidebar>.nav{position:absolute;left:16px;right:16px;top:64px;height:44px!important}
  body[data-view="home"].hall-nav-open #appShell>.sidebar>.nav .nav-btn{height:44px!important}
}


/* ===== Mobile GBA-style hall controls ===== */
.lobby-action-btn{display:none}
@media (pointer:coarse),(max-width:850px){
  body[data-view="home"] .hud-dock{
    position:fixed!important;top:calc(10px + env(safe-area-inset-top))!important;right:calc(10px + env(safe-area-inset-right))!important;bottom:auto!important;left:auto!important;
    display:flex!important;align-items:center!important;gap:0!important;padding:4px!important;
    background:rgba(70,70,76,.52)!important;border:1px solid rgba(255,255,255,.12)!important;box-shadow:0 2px 0 rgba(0,0,0,.28)!important;
    backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(2px);z-index:72!important
  }
  body[data-view="home"] .hud-dock .hud-icons,body[data-view="home"] .hud-dock.open .hud-icons{display:none!important}
  body[data-view="home"] .hud-dock .hud-gold{position:static!important;inset:auto!important;height:36px!important;padding:0 8px!important;border:0!important;border-image:none!important;background:transparent!important}
  body[data-view="home"] .hud-dock .online-counter{position:static!important;inset:auto!important;min-height:36px!important;height:36px!important;padding:0 8px!important;border:0!important;border-left:1px solid rgba(255,255,255,.14)!important;border-image:none!important;background:transparent!important}

  .lobby-stage.touch-ui .lobby-joy{
    display:block!important;position:absolute!important;left:max(18px,env(safe-area-inset-left))!important;bottom:max(14px,env(safe-area-inset-bottom))!important;
    width:108px!important;height:108px!important;border:0!important;border-radius:0!important;background-color:transparent!important;
    background-image:url(assets/ui/gamepad.png)!important;background-repeat:no-repeat!important;background-size:768px 816px!important;background-position:-312px -192px!important;
    box-shadow:none!important;opacity:.56;image-rendering:pixelated;touch-action:none;z-index:71!important;transition:opacity .08s linear,transform .08s linear
  }
  .lobby-stage.touch-ui .lobby-joy:active{opacity:.84;transform:scale(.98)}
  .lobby-stage.touch-ui .lobby-joy i{display:none!important}

  .lobby-stage.touch-ui .lobby-action-btn{
    display:block!important;position:absolute!important;right:max(20px,env(safe-area-inset-right))!important;bottom:max(22px,env(safe-area-inset-bottom))!important;
    width:60px!important;height:60px!important;padding:0!important;border:0!important;outline:0!important;border-radius:0!important;background-color:transparent!important;
    background-image:url(assets/ui/gamepad.png)!important;background-repeat:no-repeat!important;background-size:768px 816px!important;background-position:-18px -90px!important;
    box-shadow:none!important;opacity:.58;image-rendering:pixelated;touch-action:manipulation;z-index:71!important;transition:opacity .08s linear,transform .08s linear
  }
  .lobby-stage.touch-ui .lobby-action-btn:active{opacity:.9;transform:scale(.92)}

  .lobby-stage.touch-ui .lobby-chat-toggle,.lobby-stage.touch-ui.chat-open .lobby-chat-toggle{
    display:grid!important;left:50%!important;right:auto!important;bottom:max(12px,env(safe-area-inset-bottom))!important;transform:translateX(-50%)!important;
    width:50px!important;height:50px!important;border:1px solid rgba(230,220,190,.22)!important;border-radius:0!important;background:rgba(64,64,70,.38)!important;
    box-shadow:none!important;color:#f5edd8!important;opacity:.76;z-index:72!important
  }
  .lobby-stage.touch-ui .lobby-chat-toggle:before{display:none!important}
  .lobby-stage.touch-ui .lobby-chat-toggle:active{opacity:1}
  .lobby-stage.touch-ui.chat-open .lobby-chat-box{bottom:calc(74px + var(--chat-keyboard-offset,0px))!important}

  .dock-admin{top:calc(60px + env(safe-area-inset-top))!important;right:calc(10px + env(safe-area-inset-right))!important;bottom:auto!important}
  .lobby-stage.touch-ui:not(.is-full):not(.native-full) .lobby-fs-btn{left:calc(10px + env(safe-area-inset-left))!important;right:auto!important;top:calc(10px + env(safe-area-inset-top))!important}
}

.lobby-cancel-btn{display:none}
@media(pointer:coarse){body[data-view="home"] .lobby-stage.touch-ui{position:fixed!important;inset:0!important;width:var(--game-width,100vw)!important;height:var(--game-height,100dvh)!important;border:0!important;z-index:60}.lobby-stage.touch-ui .lobby-cancel-btn{display:block;position:absolute;right:96px;bottom:max(18px,env(safe-area-inset-bottom));width:48px;height:48px;z-index:71;background:transparent url(assets/ui/gamepad.png) no-repeat;background-size:614.4px 652.8px;background-position:-65px -72px;border:0;opacity:.58;image-rendering:pixelated;touch-action:manipulation}.lobby-cancel-btn:active{opacity:.9}.lobby-stage.touch-ui.chat-open .lobby-joy,.lobby-stage.touch-ui.chat-open .lobby-action-btn,.lobby-stage.touch-ui.chat-open .lobby-cancel-btn{visibility:hidden}}
/* Chat names in the hall: plain names in light gold; supporter names keep their gradient colours.
   A text-shadow shows through gradient text (background-clip:text) and made them look black, so
   the outline for readability is a drop-shadow filter instead. */
.lobby-chat-log .chat-msg b{color:#ffd66e!important}
.lobby-chat-log .chat-msg b.pname{color:transparent!important}
.lobby-chat-log .chat-msg b.pname,.lobby-stage.chat-min .lobby-chat-log .chat-msg b.pname{text-shadow:none!important;filter:drop-shadow(0 1px 0 #000) drop-shadow(0 0 2px #000)}
.lobby-stage.chat-min .lobby-chat-log .chat-msg b.pname *{text-shadow:none!important}
.lobby-chat-log .chat-msg b.pname-admin{background-image:linear-gradient(100deg,#c9ccd2 0%,#e3ba55 30%,#ffe5a0 55%,#e3ba55 78%,#c9ccd2 100%)!important}
/* no hint banner over the hall ("Haz clic en el cartel..."): the stations already react to the pointer */
.lobby-stage .lobby-hint{display:none!important}

/* ===== Window animations (hall windows, auction, player menu, players panel) ===== */
@keyframes arcBackIn{from{opacity:0}to{opacity:1}}
@keyframes arcPanelIn{0%{opacity:0;transform:translateY(14px) scale(.94)}65%{opacity:1;transform:translateY(-2px) scale(1.012)}100%{opacity:1;transform:none}}
@keyframes arcPanelOut{from{opacity:1;transform:none}to{opacity:0;transform:translateY(8px) scale(.96)}}
@keyframes arcMenuIn{from{opacity:0;transform:scale(.9)}to{opacity:1;transform:none}}
@keyframes arcRowIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.modal-backdrop{animation:arcBackIn .16s ease-out both}
.modal-backdrop>.modal{animation:arcPanelIn .26s cubic-bezier(.2,.9,.25,1) both}
.modal-backdrop.modal-closing{position:fixed;inset:0;z-index:95;pointer-events:none;animation:arcBackIn .18s ease-in reverse both}
.modal-backdrop.modal-closing>.modal{animation:arcPanelOut .18s ease-in both}
.hall-panel-body.fresh .panel{animation:arcRowIn .32s ease-out both}
.hall-panel-body.fresh .panel:nth-child(2){animation-delay:.04s}.hall-panel-body.fresh .panel:nth-child(3){animation-delay:.08s}.hall-panel-body.fresh .panel:nth-child(4){animation-delay:.12s}
.lobby-menu:not([hidden]){animation:arcMenuIn .16s cubic-bezier(.2,.9,.25,1.1) both;transform-origin:top left}
.social-drawer{transition:transform .26s cubic-bezier(.2,.9,.25,1),visibility .26s!important}
.social-drawer.open .social-user,.social-drawer.open .social-me{animation:arcRowIn .28s ease-out both}
@media (prefers-reduced-motion:reduce){.modal-backdrop,.modal-backdrop>.modal,.hall-panel-body .panel,.lobby-menu,.social-drawer .social-user,.social-drawer .social-me{animation:none!important}.social-drawer{transition:none!important}}
/* The players panel goes above the header identity card */
.social-drawer{z-index:130!important}
/* Names in the players panel: lighter admin gradient (the site one starts and ends in black) */
.social-drawer b.pname-admin{background-image:linear-gradient(100deg,#c9ccd2 0%,#e3ba55 30%,#ffe5a0 55%,#e3ba55 78%,#c9ccd2 100%)!important}
@media(pointer:coarse) and (min-width:900px) and (min-height:600px){
 .lobby-stage.touch-ui .lobby-joy{width:144px!important;height:144px!important;background-size:1024px 1088px!important;background-position:-416px -256px!important}
 .lobby-stage.touch-ui .lobby-action-btn{width:78px!important;height:78px!important;background-size:998.4px 1060.8px!important;background-position:-23.4px -117px!important}
 .lobby-stage.touch-ui .lobby-cancel-btn{right:124px!important;width:64px!important;height:64px!important;background-size:819.2px 870.4px!important;background-position:-86.67px -96px!important}
}
@media(pointer:coarse){
 .lobby-stage.touch-ui .lobby-joy{left:max(18px,env(safe-area-inset-left),var(--native-safe-left,0px))!important}
 .lobby-stage.touch-ui .lobby-action-btn{right:max(20px,env(safe-area-inset-right),var(--native-safe-right,0px))!important}
}

/* ===== Private chat window (friends): pixel art, compact, draggable by its title bar ===== */
.message-dialog{border:20px solid transparent!important;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 20px round!important;background:none!important;border-radius:0!important;box-shadow:0 10px 30px #000a!important}
.message-dialog,.message-dialog *{font-family:'ArcDigits','Pixelify Sans',sans-serif!important}
.message-dialog *{border-radius:0!important}
.message-dialog .message-dialog-heading{cursor:grab;user-select:none}
.message-dialog.dragging .message-dialog-heading{cursor:grabbing}
.message-dialog.compact:not(.minimized){width:min(400px,calc(100vw - 24px))!important;height:min(500px,calc(100dvh - 40px))!important}
@media (min-width:761px){.message-dialog.compact:not(.minimized){inset:auto 18px 70px auto}}

/* ===== Guided duel panel: big and easy to read ===== */
body .tutorial-coach{max-width:min(560px,calc(100vw - 24px))!important;padding:18px 20px 16px!important;font-size:18px!important;line-height:1.5!important}
body .tutorial-coach b{font-size:24px!important;margin-bottom:8px!important}
body .tutorial-coach p b{font-size:inherit!important}
body .tutorial-coach .tutorial-kicker{font-size:13px}
body .tutorial-coach p{margin:0 0 14px!important}
body .tutorial-coach .tutorial-actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:flex-end}
body .tutorial-coach .tutorial-actions .btn{min-height:46px;padding:10px 18px;font-size:17px}
@media (max-width:700px),(max-height:520px){
  body .tutorial-coach{max-width:min(440px,calc(100vw - 16px))!important;font-size:16px!important;padding:12px 14px!important}
  body .tutorial-coach b{font-size:19px!important}
  body .tutorial-coach .tutorial-actions .btn{min-height:42px;font-size:15px;padding:8px 14px}
}

/* ===== New-player hall guide (pixel art) ===== */
.hall-guide{position:fixed;left:50%;bottom:calc(16px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:125;display:flex;gap:16px;align-items:flex-start;width:min(640px,calc(100vw - 24px));padding:18px;border:20px solid transparent;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 20px round;color:#f3e6c4;font-family:'ArcDigits','Pixelify Sans',sans-serif;box-shadow:0 12px 34px #000b;animation:arcPanelIn .3s ease}
.hall-guide .hg-face{flex:0 0 96px;width:96px;height:96px;background:#120c16;border:3px solid #a9894f;image-rendering:pixelated}
.hall-guide .hg-face svg{display:block;width:100%;height:100%;animation:hgBob 1.6s steps(2) infinite}
.hall-guide .hg-body{flex:1;min-width:0}
.hall-guide .hg-title{font-size:26px;color:#ffd66e;text-shadow:2px 2px #09070e;display:flex;gap:10px;align-items:center}
.hall-guide .hg-icon{font-size:30px}
.hall-guide .hg-text{font-size:20px;line-height:1.45;margin:8px 0 12px}
.hall-guide .hg-dots{display:flex;gap:6px;margin-bottom:12px}
.hall-guide .hg-dots i{width:12px;height:12px;background:#3a2a4a;border:2px solid #6b5a3a}
.hall-guide .hg-dots i.done{background:#a9894f}
.hall-guide .hg-dots i.on{background:#ffd66e;border-color:#fff0c0}
.hall-guide .hg-buttons{display:flex;gap:10px;flex-wrap:wrap}
.hall-guide .hg-btn{min-height:52px;min-width:56px;padding:10px 20px;font:inherit;font-size:20px;color:#f3e6c4;background:#2a1e36;border:3px solid #a9894f;box-shadow:inset -3px -3px #0008,inset 3px 3px #ffffff18;cursor:pointer}
.hall-guide .hg-btn.primary{background:#7a5a1e;color:#fff4dc;border-color:#ffd66e;flex:1}
.hall-guide .hg-btn:active{transform:translateY(2px)}
.hall-guide .hg-btn:disabled{opacity:.55;cursor:default;filter:saturate(.55)}
.hall-guide.travelling .hg-text{color:#d7c7a6}
.hall-guide .hg-btn:focus-visible{outline:3px solid #7cf2a0;outline-offset:2px}
.hall-guide .hg-skip{margin-top:10px;background:none;border:0;color:#bfae8a;font:inherit;font-size:15px;text-decoration:underline;cursor:pointer}
.hg-hand{position:fixed;left:0;top:0;z-index:124;width:48px;height:56px;margin:-4px 0 0 -18px;pointer-events:none;image-rendering:pixelated}
.hg-hand svg{display:block;width:100%;height:100%;animation:hgPoint .8s steps(2) infinite;filter:drop-shadow(2px 2px 0 #000a)}
.hg-ring{position:fixed;left:0;top:0;z-index:123;width:120px;height:120px;margin:-60px 0 0 -60px;pointer-events:none;border:4px dashed #ffd66e;border-radius:50%;animation:hgPulse 1.2s ease-in-out infinite}
@keyframes hgPoint{0%,100%{transform:translateY(10px)}50%{transform:translateY(0)}}
@keyframes hgPulse{0%,100%{opacity:.9;scale:1}50%{opacity:.45;scale:1.12}}
@keyframes hgBob{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@media (max-width:1100px),(max-height:700px),(pointer:coarse){
  /* Phones/tablets: the guide is a compact HUD card, not a large modal. JS parks it
     on the opposite side of the highlighted object so the player can actually see the tour. */
  .hall-guide{width:min(360px,calc(100vw - 16px));gap:7px;padding:5px;border-width:9px;bottom:8px;max-height:42vh;overflow:hidden}
  .hall-guide .hg-face{flex:0 0 42px;width:42px;height:42px;border-width:2px}
  .hall-guide .hg-title{font-size:15px;line-height:1.05;gap:5px}.hall-guide .hg-icon{font-size:16px}
  .hall-guide .hg-text{font-size:12.5px;line-height:1.22;margin:3px 0 5px;min-height:2.45em}
  .hall-guide .hg-dots{gap:3px;margin-bottom:5px}.hall-guide .hg-dots i{width:7px;height:7px;border-width:1px}
  .hall-guide .hg-buttons{gap:4px;flex-wrap:nowrap}
  .hall-guide .hg-btn{min-height:30px;min-width:34px;font-size:12px;padding:3px 7px;border-width:2px}
  .hall-guide .hg-skip{font-size:11px;margin-top:4px}
  .hg-ring{width:76px;height:76px;margin:-38px 0 0 -38px}
  .hg-hand{width:36px;height:42px;margin:-3px 0 0 -14px}
}
@media (prefers-reduced-motion:reduce){.hg-hand svg,.hg-ring,.hall-guide .hg-face svg{animation:none}}

/* ===== Notices: big, in the middle of the screen, easy to see ===== */
html body .toast-stack{top:14%!important;bottom:auto!important;left:50%!important;right:auto!important;transform:translateX(-50%);width:min(560px,calc(100vw - 24px))!important;z-index:9500!important;justify-items:center}
html body .toast-stack .toast{font-size:19px!important;line-height:1.4;padding:14px 20px!important;border-width:3px!important;text-align:center;width:100%;box-shadow:0 10px 30px #000c,inset 2px 2px #ffffff14!important;animation:toastPop .25s steps(3)}
html body .toast-stack .toast.bad{background:#3a1420!important;border-color:#ff6b6b!important;color:#ffe2e2}
html body .toast-stack .toast.good{background:#14361f!important;border-color:#7cf2a0!important;color:#e6ffe9}
@keyframes toastPop{from{transform:scale(.8);opacity:0}to{transform:scale(1);opacity:1}}
@media (max-width:700px){html body .toast-stack .toast{font-size:16px!important;padding:10px 14px!important}}

/* ===== Dominio (realm management) window, pixel art ===== */
.domain-panel{position:fixed;inset:0;z-index:140;display:grid;place-items:center;background:#05030acc;padding:12px;font-family:'ArcDigits','Pixelify Sans',sans-serif;color:#f3e6c4}
.domain-panel .dm-frame{width:min(1080px,100%);height:min(760px,100%);display:flex;flex-direction:column;border:22px solid transparent;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 22px round;box-shadow:0 14px 40px #000c;animation:arcPanelIn .3s ease;overflow:hidden}
.domain-panel .dm-head{display:flex;justify-content:space-between;align-items:center;padding:0 4px 8px;border-bottom:3px solid #a9894f}
.domain-panel .dm-head b{font-size:22px;color:#ffd66e;text-shadow:2px 2px #09070e}
.domain-panel .dm-x{width:40px;height:40px;font:inherit;font-size:24px;color:#f3e6c4;background:#3a1420;border:3px solid #c96364;cursor:pointer}
.domain-panel .dm-main{flex:1;overflow:auto;padding:10px 4px 4px;scrollbar-color:#a9894f #1b1227}
.domain-panel.busy .dm-main{cursor:progress;opacity:.75}
.domain-panel h2{margin:0;font-size:26px;color:#ffd66e;text-shadow:2px 2px #09070e}
.domain-panel h3{margin:16px 0 8px;font-size:18px;color:#ffd66e;border-bottom:2px dashed #6b5a3a;padding-bottom:4px}
.domain-panel .dm-lead{font-size:16px;line-height:1.45;margin:6px 0 12px;color:#e9dcc0}
.domain-panel .dm-empty{opacity:.75;font-size:16px;padding:10px}
.domain-panel .bad{color:#ff9a9a}
.domain-panel .dm-btn{min-height:40px;padding:6px 14px;font:inherit;font-size:16px;color:#f3e6c4;background:#2a1e36;border:3px solid #a9894f;box-shadow:inset -3px -3px #0008,inset 3px 3px #ffffff18;cursor:pointer}
.domain-panel .dm-btn.primary{background:#7a5a1e;color:#fff4dc;border-color:#ffd66e}
.domain-panel .dm-btn.big{min-height:56px;font-size:21px;padding:10px 28px}
.domain-panel .dm-btn.small{min-height:32px;font-size:14px;padding:3px 10px}
.domain-panel .dm-btn.ghost{background:transparent}
.domain-panel .dm-btn:disabled{opacity:.45;cursor:not-allowed}
.domain-panel .dm-btn:not(:disabled):active{transform:translateY(2px)}
.domain-panel input,.domain-panel select{font:inherit;font-size:16px;color:#f3e6c4;background:#120c16;border:2px solid #6b5a3a;padding:6px 8px}
/* founding */
.domain-panel .dm-found{text-align:center;display:grid;gap:12px;justify-items:center}
.domain-panel .dm-schools{display:grid;grid-template-columns:repeat(5,1fr);gap:10px;width:100%}
.domain-panel .dm-school{display:grid;justify-items:center;gap:6px;padding:12px 8px;font:inherit;color:#f3e6c4;background:#1b1227;border:3px solid #4a3a5a;cursor:pointer;transition:transform .12s}
.domain-panel .dm-school img{width:96px;height:96px;image-rendering:pixelated}
.domain-panel .dm-school b{font-size:19px;color:var(--sc)}
.domain-panel .dm-school small{font-size:13px;line-height:1.35;opacity:.85}
.domain-panel .dm-school:hover{transform:translateY(-3px);border-color:var(--sc)}
.domain-panel .dm-school.on{border-color:var(--sc);background:#2a1e36;box-shadow:0 0 0 3px #000,0 0 18px var(--sc)}
.domain-panel .dm-school.on img{animation:hgBob 1s steps(2) infinite}
.domain-panel .dm-field{display:grid;gap:6px;font-size:16px;width:min(360px,100%)}
/* realm */
.domain-panel .dm-top{display:flex;gap:12px;align-items:center}
.domain-panel .dm-sig{width:64px;height:64px;image-rendering:pixelated}
.domain-panel .dm-top small{font-size:14px;opacity:.85}
.domain-panel .dm-hud{display:grid;grid-template-columns:repeat(7,1fr);gap:8px;margin:12px 0}
.domain-panel .dm-res{display:flex;gap:8px;align-items:center;padding:8px;background:#120c16;border:2px solid #6b5a3a}
.domain-panel .dm-res>span{font-size:24px}
.domain-panel .dm-res small{display:block;font-size:12px;opacity:.75}
.domain-panel .dm-res b{display:block;font-size:17px;color:#fff4dc}
.domain-panel .dm-res i{display:block;font-style:normal;font-size:12px;color:#bfae8a}
.domain-panel .dm-say{margin:0 0 10px;padding:10px 14px;font-size:17px;border:3px solid #7cf2a0;background:#14361f;text-align:center}
.domain-panel .dm-say.bad{border-color:#ff6b6b;background:#3a1420}
.domain-panel .dm-tabs{display:flex;gap:6px;flex-wrap:wrap;margin-bottom:10px}
.domain-panel .dm-tabs button{font:inherit;font-size:16px;padding:8px 12px;color:#e9dcc0;background:#1b1227;border:3px solid #4a3a5a;cursor:pointer}
.domain-panel .dm-tabs button.on{color:#fff4dc;background:#5a3f16;border-color:#ffd66e}
.domain-panel .dm-tips p{margin:0 0 6px;padding:8px 12px;font-size:15px;border-left:6px solid #a9894f;background:#1b1227}
.domain-panel .dm-tips p.bad{border-color:#ff6b6b}.domain-panel .dm-tips p.warn{border-color:#ffd66e}.domain-panel .dm-tips p.good{border-color:#7cf2a0}
.domain-panel .dm-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.domain-panel .dm-grid.three{grid-template-columns:repeat(3,1fr)}
.domain-panel .dm-card{display:grid;justify-items:center;gap:4px;padding:10px;background:#1b1227;border:2px solid #4a3a5a;text-align:center}
.domain-panel .dm-card>span{font-size:26px}
.domain-panel .dm-card b{font-size:18px;color:#fff4dc}
.domain-panel .dm-card small{font-size:13px;opacity:.85;line-height:1.35}
.domain-panel .dm-card.left{justify-items:start;text-align:left}
.domain-panel .dm-actions{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:10px}
.domain-panel .dm-turns{display:flex;gap:6px;align-items:center;font-size:14px}
.domain-panel .dm-turns input{width:80px}
.domain-panel .dm-result{margin-top:12px;padding:10px;font-size:16px;background:#120c16;border:2px dashed #a9894f}
.domain-panel .dm-build{display:grid;gap:6px}
.domain-panel .dm-brow{display:grid;grid-template-columns:36px 1fr auto 90px;gap:10px;align-items:center;padding:8px;background:#1b1227;border:2px solid #4a3a5a}
.domain-panel .dm-brow>span{font-size:24px}
.domain-panel .dm-brow b{font-size:17px}.domain-panel .dm-brow i{font-style:normal;font-size:13px;opacity:.75}
.domain-panel .dm-brow small{display:block;font-size:13px;opacity:.85}
.domain-panel .dm-brow em{font-style:normal;font-size:13px;color:#bfae8a}
.domain-panel .dm-buildbar{position:sticky;bottom:0;display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:10px;padding:10px;background:#120c16;border:3px solid #a9894f;font-size:15px}
.domain-panel .dm-bar{height:12px;width:100%;background:#120c16;border:2px solid #6b5a3a}
.domain-panel .dm-bar span{display:block;height:100%;background:#ffd66e}
.domain-panel .dm-list{display:grid;gap:6px}
.domain-panel .dm-li{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:8px 10px;background:#1b1227;border:2px solid #4a3a5a}
.domain-panel .dm-li.me{border-color:#ffd66e}
.domain-panel .dm-li img{width:32px;height:32px;image-rendering:pixelated}
.domain-panel .dm-li b{font-size:16px}.domain-panel .dm-li small{font-size:13px;opacity:.8;flex:1}
.domain-panel .dm-li em{font-style:normal;color:#ffd66e;min-width:36px}
@media (max-width:860px){
  .domain-panel{padding:0}
  .domain-panel .dm-frame{height:100%;border-width:14px}
  .domain-panel .dm-schools{grid-template-columns:repeat(2,1fr)}
  .domain-panel .dm-school img{width:72px;height:72px}
  .domain-panel .dm-hud{grid-template-columns:repeat(3,1fr)}
  .domain-panel .dm-grid{grid-template-columns:repeat(2,1fr)}
  .domain-panel .dm-brow{grid-template-columns:30px 1fr 70px}.domain-panel .dm-brow em{display:none}
}
@media (max-width:520px){.domain-panel .dm-hud{grid-template-columns:repeat(2,1fr)}.domain-panel .dm-res>span{font-size:18px}.domain-panel .dm-res b{font-size:15px}.domain-panel .dm-tabs button{font-size:14px;padding:6px 8px}}

/* ===== Watching a game from the hall: small pixel window ===== */
.spectate-window{position:fixed;right:18px;top:90px;z-index:128;width:min(460px,calc(100vw - 16px));max-height:calc(100dvh - 120px);display:flex;flex-direction:column;border:18px solid transparent;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 18px round;box-shadow:0 12px 32px #000c;color:#f3e6c4;font-family:'ArcDigits','Pixelify Sans',sans-serif;animation:arcPanelIn .25s ease}
.spectate-window .spec-head{display:flex;gap:6px;align-items:center;cursor:grab;user-select:none;padding-bottom:6px;border-bottom:2px solid #a9894f}
.spectate-window .spec-head b{flex:1;font-size:15px;color:#ffd66e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.spectate-window .spec-head b span{color:#bfae8a;font-size:12px}
.spectate-window .spec-head button{width:30px;height:30px;font:inherit;font-size:16px;color:#f3e6c4;background:#2a1e36;border:2px solid #a9894f;cursor:pointer}
.spectate-window .spec-head button[data-spec="close"]{background:#3a1420;border-color:#c96364}
.spectate-window .spec-body{overflow:auto;padding-top:6px}
.spectate-window.minimized .spec-body{display:none}
.spectate-window .spec-info{font-size:12px;color:#bfae8a;margin-bottom:4px}
.spectate-window .spec-result{padding:6px;text-align:center;font-size:16px;color:#ffd66e;border:2px solid #ffd66e;margin-bottom:6px}
.spectate-window .spectate-side{margin:0 0 6px!important;padding:6px!important;border-radius:0!important;background:#1b1227!important;border:2px solid #4a3a5a!important}
.spectate-window .spectate-side.active{border-color:#ffd66e!important}
.spectate-window .spectate-head{gap:6px}
.spectate-window .spectate-head .avatar{width:26px;height:26px;font-size:12px}
.spectate-window .spectate-name b{font-size:13px}.spectate-window .spectate-name small{font-size:11px}
.spectate-window .spectate-stats{font-size:12px;gap:6px}
.spectate-window .spectate-board{display:flex;flex-wrap:wrap;gap:4px;min-height:58px}
.spectate-window .spectate-card{width:44px!important;height:62px!important;min-width:0!important}
.spectate-window .spec-log{font-size:12px;color:#d8cbb0;display:grid;gap:2px}
.spectate-window .spec-wait{font-size:14px;opacity:.8}
@media (max-width:760px){.spectate-window{left:8px;right:8px;top:auto;bottom:calc(70px + env(safe-area-inset-bottom));width:auto;max-height:55dvh}}

/* ===== Arena duel window (realm game duels in the hall) ===== */
.arena-duel{position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);z-index:150;width:min(620px,calc(100vw - 16px));max-height:calc(100dvh - 24px);display:flex;flex-direction:column;border:20px solid transparent;border-image:url(assets/lobby/ui-panel-ornate.png) 8 fill / 20px round;box-shadow:0 14px 40px #000d;color:#f3e6c4;font-family:'ArcDigits','Pixelify Sans',sans-serif;animation:arcPanelIn .3s ease}
.arena-duel .ad-head{display:flex;justify-content:space-between;align-items:center;padding-bottom:8px;border-bottom:2px solid #a9894f}
.arena-duel .ad-head b{font-size:18px;color:#ffd66e}
.arena-duel .ad-head button{width:34px;height:34px;font:inherit;font-size:20px;color:#f3e6c4;background:#3a1420;border:2px solid #c96364;cursor:pointer}
.arena-duel .ad-vs{display:grid;grid-template-columns:1fr auto 1fr;gap:10px;align-items:center;margin:12px 0}
.arena-duel .ad-x{font-size:28px;color:#ff6b6b;text-shadow:2px 2px #09070e;animation:hgBob 1s steps(2) infinite}
.arena-duel .ad-side{display:grid;justify-items:center;gap:4px;padding:10px;background:#1b1227;border:3px solid #4a3a5a;text-align:center;transition:opacity .4s,filter .4s}
.arena-duel .ad-side img{width:72px;height:72px;image-rendering:pixelated}
.arena-duel .ad-side b{font-size:17px;color:#fff4dc}.arena-duel .ad-side small{font-size:12px;opacity:.75}
.arena-duel .ad-side em{font-style:normal;font-size:13px;color:#bfae8a}
.arena-duel .ad-bar{width:100%;height:14px;background:#120c16;border:2px solid #6b5a3a}
.arena-duel .ad-bar span{display:block;height:100%;width:100%;background:#7cd36b;transition:width .35s steps(6)}
.arena-duel .ad-side.b .ad-bar span{background:#5fc8ff}
.arena-duel .ad-side.hit{animation:adHit .35s steps(3)}
.arena-duel .ad-side.down{opacity:.5;filter:grayscale(1)}
@keyframes adHit{0%,100%{transform:translateX(0)}33%{transform:translateX(-6px);border-color:#ff6b6b}66%{transform:translateX(6px)}}
.arena-duel .ad-log{flex:1;min-height:120px;max-height:240px;overflow:auto;padding:8px;background:#120c16;border:2px solid #4a3a5a;font-size:14px;line-height:1.45}
.arena-duel .ad-log p{margin:0 0 4px}.arena-duel .ad-log p.round{color:#ffd66e;margin-top:6px}
.arena-duel .ad-result{margin-top:10px;padding:10px;text-align:center;font-size:20px;color:#ffd66e;border:3px solid #ffd66e;background:#2a1e0e;animation:toastPop .3s steps(3)}
@media (max-width:520px){.arena-duel .ad-side img{width:48px;height:48px}.arena-duel .ad-x{font-size:20px}}
.domain-panel .dm-born{text-align:center;padding:12px;margin-bottom:12px;border:3px solid #ffd66e;background:#2a1e0e;animation:toastPop .4s steps(3)}
.domain-panel .dm-born h3{margin:0 0 6px;border:0;font-size:22px}
.domain-panel .dm-arconte{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.domain-panel .dm-stats{display:grid;gap:6px;width:100%;margin-top:6px}
.domain-panel .dm-stat{display:grid;grid-template-columns:96px 1fr 28px;gap:8px;align-items:center;font-size:14px}
.domain-panel .dm-stat i{height:10px;background:#120c16;border:2px solid #4a3a5a}
.domain-panel .dm-stat em{display:block;height:100%;background:#ffd66e}
.domain-panel .dm-stat b{font-size:15px;text-align:right}
.domain-panel .dm-gift{margin:10px 0 0;padding:8px;border:2px dashed #ffd66e;font-size:15px}
@media (max-width:620px){.domain-panel .dm-arconte{grid-template-columns:1fr}}
.modal.world-intro{max-width:min(620px,calc(100vw - 24px))}
.world-intro .wi-lead{font-size:17px;line-height:1.45}
.world-intro .wi-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}
.world-intro .wi-grid>div{display:grid;gap:4px;justify-items:center;text-align:center;padding:12px;border:2px solid #a9894f;background:#1b1227}
.world-intro .wi-grid span{font-size:34px}.world-intro .wi-grid b{font-size:18px;color:#ffd66e}.world-intro .wi-grid p{margin:0;font-size:15px}
@media (max-width:560px){.world-intro .wi-grid{grid-template-columns:1fr}}
/* Dominio tutorial */
.domain-panel .dm-frame{position:relative}
.domain-panel .dm-focus{outline:4px solid #ffd66e!important;outline-offset:3px;box-shadow:0 0 0 8px #ffd66e33!important;animation:dmFocus 1s ease-in-out infinite;position:relative;z-index:2}
@keyframes dmFocus{50%{outline-color:#fff4dc}}
.domain-panel .dm-coach{position:absolute;left:50%;bottom:10px;transform:translateX(-50%);z-index:5;width:min(560px,calc(100% - 20px));padding:14px 16px;background:#18111e;border:4px solid #ffd66e;box-shadow:0 10px 30px #000c;animation:toastPop .25s steps(3)}
.domain-panel .dm-coach>b{display:block;font-size:22px;color:#ffd66e;margin-bottom:6px}
.domain-panel .dm-coach p b{display:inline;font-size:inherit;color:#ffd66e;margin:0}
.domain-panel .dm-coach p{margin:0 0 10px;font-size:18px;line-height:1.45}
.domain-panel .dm-coach-dots{display:flex;gap:6px;margin-bottom:10px}
.domain-panel .dm-coach-dots i{width:12px;height:12px;background:#3a2a4a;border:2px solid #6b5a3a}
.domain-panel .dm-coach-dots i.done{background:#a9894f}.domain-panel .dm-coach-dots i.on{background:#ffd66e;border-color:#fff0c0}
.domain-panel .dm-coach-btns{display:flex;gap:8px;flex-wrap:wrap}
.domain-panel .dm-coach-btns .dm-btn{min-height:48px;font-size:18px}
.domain-panel .dm-coach-btns .primary{flex:1}
.world-intro .wi-grid.one{grid-template-columns:1fr}
@media (prefers-reduced-motion:reduce){.domain-panel .dm-focus{animation:none}}

/* Icon buttons (window close ×, etc.) are always square: they used to inherit the min-height of
   normal buttons and came out taller than wide. */
html body .btn.icon{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;padding:0!important;display:inline-grid!important;place-items:center;line-height:1!important;flex:0 0 36px}
/* Dominio: art of the realm game (resource icons, section medallions) */
.domain-panel .dm-res .dm-ico{width:34px;height:34px;display:block;object-fit:contain}
.domain-panel .dm-tabs button{display:inline-flex;align-items:center;gap:6px}
.domain-panel .dm-tab-ico{width:26px;height:26px;object-fit:contain;margin:-4px 0}
.domain-panel .dm-tabs button:not(.on) .dm-tab-ico{filter:saturate(.7) brightness(.85)}
.domain-panel .dm-card-ico{width:56px;height:56px;object-fit:contain;display:block}
@media (max-width:520px){.domain-panel .dm-res .dm-ico{width:26px;height:26px}.domain-panel .dm-tab-ico{width:20px;height:20px}}
/* Action cards: the turns field and the button always sit at the bottom, aligned across cards */
.domain-panel .dm-actions .dm-card{display:flex;flex-direction:column;align-items:center}
.domain-panel .dm-actions .dm-card .dm-turns{margin-top:auto;padding-top:6px}
.domain-panel .dm-hud{grid-template-columns:repeat(7,1fr)}
.domain-panel .dm-res>span{font-size:26px;min-width:34px;text-align:center}
.domain-panel .dm-yield{margin-top:4px;font-size:12px!important;color:#bfae8a;opacity:1!important}
.domain-panel .dm-yield b{color:#ffd66e;font-size:inherit}
@media (max-width:1000px){.domain-panel .dm-hud{grid-template-columns:repeat(4,1fr)}}
@media (max-width:520px){.domain-panel .dm-hud{grid-template-columns:repeat(2,1fr)}}
.domain-panel .dm-hud{gap:6px}
.domain-panel .dm-res{padding:6px;gap:6px;min-width:0}
.domain-panel .dm-res b{font-size:15px;white-space:nowrap}
.domain-panel .dm-res i{font-size:11px}
.domain-panel .dm-res .dm-ico{width:28px;height:28px}
/* Small spectator window: card badges (+ATQ/DEF, attacking) would cover the tiny cards */
.spectate-window .battle-bonus{display:none!important}
.spectate-window .battle-attacking-badge{transform:scale(.6);transform-origin:top left}
.spectate-window .spectate-head .avatar{overflow:hidden;padding:0}
.spectate-window .spectate-head .avatar .portrait-art{width:100%;height:100%;display:block}
.spectate-bar{display:flex;align-items:center;font-size:15px;color:#e9dcc0}

/* Hall guide: Oren's portrait from the prologue */
.hall-guide .hg-portrait{display:block;width:100%;height:100%;background:url(assets/portraits/actors-2.png) 0 0/400% 200%;image-rendering:pixelated;animation:hgBob 1.6s steps(2) infinite}

/* Guide text is typed letter by letter: keep room for it so the panel does not jump */
.hall-guide .hg-text{min-height:3.3em}

/* Classic RPG typing: the part of the text not written yet keeps its place */
.tw-off{visibility:hidden}

/* Classic mode: the gold coin of the HUD spins (16-bit coin from the dungeon pack) */
.art-retro .pixel-coin{background:url(assets/lobby/retro/anim16.png) 0 -128px/64px 160px no-repeat!important;image-rendering:pixelated;animation:retroCoin .6s steps(4) infinite}
@keyframes retroCoin{from{background-position:0 -128px}to{background-position:-64px -128px}}

/* ===== Classic mode (16-bit, SNES/Mega Drive): windows, buttons and bars from the Dark Ages UI
   pack (assets/ui/classic/). Only active with body.art-retro, so the modern look is untouched. ===== */
body.art-retro .lobby-menu,body.art-retro .auction-modal,body.art-retro .hall-panel,body.art-retro .social-drawer,
body.art-retro .modal,body.art-retro .hall-guide{border:22px solid transparent!important;border-image:url(assets/ui/classic/frame.png) 22 fill / 22px stretch!important;background:none!important;border-radius:0!important;box-shadow:0 6px 0 #0009!important;image-rendering:pixelated}
body.art-retro .modal{background-clip:padding-box!important}
body.art-retro .lobby-chat-log,body.art-retro .lobby-chat-box .chat-send .input:not(#_){border:12px solid transparent!important;border-image:url(assets/ui/classic/panel.png) 12 fill / 12px stretch!important;background:none!important;image-rendering:pixelated}
body.art-retro .btn:not(#_),body.art-retro .hall-panel .btn:not(#_),body.art-retro .lobby-chat-box .chat-send .btn:not(#_),body.art-retro .auction-modal .btn:not(#_),body.art-retro .hall-guide .hg-btn:not(#_){border:6px solid transparent!important;border-width:6px 10px!important;border-image:url(assets/ui/classic/btn.png) 6 10 fill / 6px 10px stretch!important;background:none!important;border-radius:0!important;box-shadow:none!important;color:#e9dcc0!important;image-rendering:pixelated}
body.art-retro .btn.primary:not(#_):not(#__),body.art-retro .hall-guide .hg-btn.primary:not(#_):not(#__){border-image-source:url(assets/ui/classic/btn-primary.png)!important;color:#fff4dc!important;text-shadow:0 2px 0 #102033!important}
body.art-retro .btn.ghost:not(#_):not(#__),body.art-retro .btn.danger:not(#_):not(#__),body.art-retro .btn.icon:not(#_):not(#__),body.art-retro .hall-panel .btn.ghost:not(#_):not(#__),body.art-retro .hall-panel .btn.icon:not(#_):not(#__),body.art-retro .auction-modal .btn.ghost:not(#_):not(#__){border-image-source:url(assets/ui/classic/btn-alt.png)!important}
body.art-retro .btn:active:not(#_),body.art-retro .hall-guide .hg-btn:active:not(#_){transform:translateY(2px)}
body.art-retro .hud-dock .hud-gold,body.art-retro .hud-dock .online-counter,body.art-retro .social-icons .hud-icon,body.art-retro .social-logout{border:8px solid transparent!important;border-image:url(assets/ui/classic/slot.png) 8 fill / 8px stretch!important;background:none!important}
body.art-retro .px-bar,body.art-retro .header-account .mini-xp{border-image-source:url(assets/ui/classic/bar.png)!important;border-image-slice:3 12 fill!important;border-image-width:5px 12px!important}
body.art-retro .toast{border:12px solid transparent!important;border-image:url(assets/ui/classic/panel.png) 12 fill / 12px stretch!important;background:none!important;border-radius:0!important}
body.art-retro .modal .panel,body.art-retro .hall-panel .panel{border:12px solid transparent!important;border-image:url(assets/ui/classic/panel.png) 12 fill / 12px stretch!important;background:none!important;border-radius:0!important;box-shadow:none!important}
body.art-retro .input:not(#_),body.art-retro .select:not(#_){border:8px solid transparent!important;border-image:url(assets/ui/classic/slot.png) 8 fill / 8px stretch!important;background:none!important;border-radius:0!important;color:#e9dcc0!important}
body.art-retro .select option{background:#1b2321;color:#e9dcc0}

/* Web key hints: floating text, no box, fades in now and then (see startKeyHints) */
.lobby-keyhint{position:absolute;left:20px;top:132px;transform:translate(-8px,0);z-index:6;opacity:0;transition:opacity .5s,transform .5s;color:#f3e6c4;font:16px "ArcDigits","Pixelify Sans",sans-serif;text-shadow:0 2px 0 #000,0 0 6px #000;pointer-events:none;white-space:nowrap}
.lobby-keyhint.show{opacity:1;transform:translate(0,0)}
.lobby-keyhint kbd{display:inline-block;margin:0 4px;padding:1px 6px;border:2px solid #ffd66e;border-bottom-width:4px;color:#ffd66e;background:#120c16cc;font:inherit;font-size:14px;text-shadow:none}
.lobby-stage.touch-ui .lobby-keyhint{display:none}

/* ===== Classic (16-bit) hall: HUD pieces still in the modern style ===== */
/* Player chip (top right) and the "pick your portrait" banner: Dark Ages windows */
body.art-retro .header-account .player-chip:not(#_):not(#__){border:12px solid transparent!important;border-image:url(assets/ui/classic/panel.png) 12 fill / 12px stretch!important;background:none!important;box-shadow:none!important;border-radius:0!important}
body.art-retro .portrait-nudge:not(#_){border:12px solid transparent!important;border-image:url(assets/ui/classic/panel.png) 12 fill / 12px stretch!important;background:none!important;box-shadow:none!important;padding:2px 6px!important}
body.art-retro .portrait-nudge button:not(#_){border:6px solid transparent!important;border-width:6px 10px!important;border-image:url(assets/ui/classic/btn-primary.png) 6 10 fill / 6px 10px stretch!important;background:none!important;box-shadow:none!important;color:#fff4dc!important}
/* Character menu buttons, chat minimise, settings gear and online counter */
body.art-retro .lobby-menu button:not(#_){border:6px solid transparent!important;border-width:6px 10px!important;border-image:url(assets/ui/classic/btn.png) 6 10 fill / 6px 10px stretch!important;background:none!important;color:#e9dcc0!important;margin:2px 0}
body.art-retro .lobby-menu button:not(#_):hover,body.art-retro .lobby-menu button:not(#_):focus-visible{border-image-source:url(assets/ui/classic/btn-primary.png)!important;color:#fff4dc!important}
body.art-retro .lobby-chat-min:not(#_),body.art-retro .hud-dock .admin-open:not(#_),body.art-retro .hud-dock .online-counter:not(#_){border:8px solid transparent!important;border-image:url(assets/ui/classic/slot.png) 8 fill / 8px stretch!important;background:none!important;box-shadow:none!important;border-radius:0!important}
body.art-retro .lobby-menu hr,body.art-retro .lobby-menu .menu-sep{border-color:#8a7448!important}

/* Direct trade panel (opened for both players when a trade request is accepted) */
#tradeRoot .trade-panel{width:min(1100px,calc(100vw - 24px))!important;max-height:calc(100dvh - 40px);overflow:auto}
#tradeRoot .trade-panel .trade-layout{display:grid;grid-template-columns:1.1fr 1fr 1fr;gap:12px}
#tradeRoot .trade-panel .trade-offer{max-height:52vh;overflow:auto}
#tradeRoot .trade-status{margin:12px 0 8px;color:#f3e6c4;font-size:14px}
#tradeRoot .modal-backdrop{z-index:120}
@media(max-width:820px){#tradeRoot .trade-panel .trade-layout{grid-template-columns:1fr}}
.coming-soon-modal{max-width:460px}
.coming-soon-big{font-size:28px;color:#ffd66e;text-align:center;margin:10px 0 6px;font-family:"ArcDigits","Pixelify Sans",sans-serif}

/* Advisor NPCs (Maestro, Archivera) */
.npc-modal{max-width:640px}
.npc-intro{font-size:15px;line-height:1.5}
.npc-report{margin:8px 0 12px;padding:10px 12px;border:1px dashed #8a7448;font-size:14px}
.npc-report p{margin:4px 0}
.npc-ask{margin-top:14px}
.npc-ask label{display:block;margin-bottom:6px;font-size:13px;color:#d6c39a}
.npc-ask-row{display:flex;gap:8px}.npc-ask-row .input{flex:1}
.npc-answer{margin-top:12px;font-size:15px;line-height:1.55;max-height:38vh;overflow:auto}
.npc-answer p{margin:6px 0}

/* Venta de cartas on phones: Buy / Sell tabs, listing cards with a big image, price and full-width button */
.sale-tabs{display:none}
.market-item .market-terms{display:block;color:#ffd66e;font-size:13px;margin:2px 0}
@media (max-width:820px),(pointer:coarse){
  .sale-tabs{display:flex;gap:8px;margin:10px 0}
  .sale-tabs .btn{flex:1;min-height:48px;font-size:16px}
  .sale-grid{display:block!important}
  .sale-grid[data-tab="buy"] .sale-sell,.sale-grid[data-tab="sell"] .sale-buy{display:none!important}
  .auction-entry .panel-body{flex-direction:column;align-items:stretch;gap:8px}
  .auction-entry .panel-body .btn{width:100%;min-height:44px}
  .market-item{display:grid!important;grid-template-columns:64px 1fr;gap:8px 12px;align-items:center;padding:10px!important}
  .market-item img{width:64px!important;height:auto!important;grid-row:span 2}
  .market-item .market-terms{font-size:16px}
  .market-item>.btn{grid-column:1 / -1;width:100%;min-height:46px;font-size:16px}
  .sale-sell .select,.sale-sell .input{min-height:48px;font-size:16px}
  .sale-sell .actions .btn:not(#_),.market-item>.btn:not(#_),.auction-entry .panel-body .btn:not(#_),.sale-tabs .btn:not(#_){width:100%;min-height:48px;font-size:16px}
}

/* Training box (training table / Maestro) */
.training-box{max-width:620px}
.training-box .training-options{display:grid;grid-template-columns:1fr;gap:10px;margin:10px 0 14px}
.training-box .training-options .field span{display:block;font-size:13px;color:#d6c39a;margin-bottom:4px}

.clan-panel .clan-current{display:flex;align-items:center;gap:8px;margin:0 0 10px}.clan-sigil{width:24px;height:24px;image-rendering:pixelated}.clan-name{text-shadow:1px 1px 0 #000}.clan-modal .clan-row{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px solid #ffffff14}.clan-modal .clan-row .btn{margin-left:auto}.clan-dot{width:12px;height:12px;flex:0 0 12px;box-shadow:0 0 0 2px #000}.clan-create{display:grid;gap:8px;margin-bottom:14px}.clan-create input[type=color]{width:64px;height:34px;padding:0;border:2px solid #c99a3e;background:none}.clan-preview b{text-shadow:1px 1px 0 #000}

.soon-flash{position:fixed;left:50%;top:42%;transform:translate(-50%,-50%);z-index:3000;padding:12px 22px;background:#120c16;border:3px solid #c99a3e;box-shadow:0 0 0 3px #120c16,4px 4px 0 6px #0008;color:#ffd66e;font:bold 24px "Pixelify Sans",sans-serif;text-shadow:2px 2px 0 #000;cursor:pointer;animation:soon-flash 2.4s steps(12) forwards;pointer-events:auto}@keyframes soon-flash{0%{opacity:0;transform:translate(-50%,-40%)}12%,75%{opacity:1;transform:translate(-50%,-50%)}100%{opacity:0}}

.npc-modal{max-width:460px}.npc-modal .npc-report{border:0;padding:0;margin:0 0 12px}.npc-verdict{font-family:'ArcDigits','Pixelify Sans',sans-serif;font-size:17px;margin:0 0 6px!important}.npc-verdict.ok{color:#8fe3a7}.npc-verdict.bad{color:#ff9a8a}.npc-stats{color:#cbbbdb;font-size:14px}.npc-tip{font-size:14px;color:#f2cf73}.npc-actions{flex-wrap:wrap;gap:8px}.npc-modal .npc-ask{margin-top:10px}
@media(max-width:560px){.npc-actions .btn{flex:1 1 40%}}

/* Hall panels: use the viewport instead of floating in the middle with wasted margins. */
#modalRoot:has(.hall-panel)>.modal-backdrop{
  place-items:start center!important;
  padding:6px!important;
}
#modalRoot:has(.hall-panel) .hall-panel{
  width:100%!important;
  max-width:none!important;
  max-height:calc(100dvh - 12px)!important;
}
/* Panels and contextual windows own the foreground. Hide the global fullscreen control and
   the hall overview/zoom control while a window is open, so neither can overlap panel chrome/content. */
body:has(#modalRoot .modal-backdrop) .fs-toggle,
body:has(#modalRoot .modal-backdrop) .lobby-overview-btn,
body:has(#tradeRoot .modal-backdrop) .fs-toggle,
body:has(#tradeRoot .modal-backdrop) .lobby-overview-btn,
body:has(.lobby-stage .lobby-menu:not([hidden])) .fs-toggle,
body:has(.lobby-stage .lobby-menu:not([hidden])) .lobby-overview-btn{
  display:none!important;
}

.shop-gold{margin:8px 0 0;font-family:"ArcDigits","Pixelify Sans",sans-serif;color:#cbbbdb}.shop-gold b{color:#f2cf73}.shop-gold.short b{color:#ff9a8a}

/* minimised chat: the button sits under the last lines instead of over them */
.lobby-stage.chat-min .lobby-chat-box{padding-bottom:52px}
.lobby-stage.chat-min .lobby-chat-log{padding-left:0!important}

/* settings gear (everyone) and, just above it, the admin button */
.dock-settings{position:fixed;right:58px;bottom:64px;z-index:64;width:30px;height:30px;padding:0;display:grid;place-items:center;cursor:pointer;background:#120c16cc;border:2px solid #c99a3e;box-shadow:0 0 0 2px #120c16}
.dock-settings:hover{background:#2a1d10}
.dock-settings .px-ico,.dock-admin .px-ico{width:18px;height:18px;image-rendering:pixelated}
body .dock-admin{bottom:100px!important}
body[data-view="duel"] .dock-settings,body[data-view="spectate"] .dock-settings{display:none!important}
@media(max-width:820px),(pointer:coarse){.dock-settings{right:10px;bottom:calc(52px + env(safe-area-inset-bottom));width:40px;height:40px}body .dock-admin{right:10px!important;bottom:calc(98px + env(safe-area-inset-bottom))!important}}
.settings-modal{max-width:560px}
.settings-modal .set-sec{padding:12px 0;border-bottom:1px dashed #6a5636}
.settings-modal .set-sec:last-child{border:0}
.settings-modal h3{margin:0 0 8px;font-family:'ArcDigits','Pixelify Sans',sans-serif;color:#f2cf73}
.settings-modal .btn{min-height:44px}
.settings-modal details{margin-top:8px}.settings-modal summary{cursor:pointer;font-family:'ArcDigits','Pixelify Sans',sans-serif;padding:8px 0}
.set-keys{display:grid;gap:6px}.set-keys span{display:flex;gap:10px;align-items:center}.set-keys b{min-width:110px;padding:2px 6px;background:#2a1c2d;border:2px solid #6a5636;font-family:'ArcDigits','Pixelify Sans',sans-serif;text-align:center}


/* ===== Personal Guarida editor =====
   Owners get the same direct-manipulation editor as the hall plus a scrollable sprite palette.
   It is intentionally available on touch devices too; size/rotation controls replace mouse-wheel/R. */
.castle-palette[hidden]{display:none!important}
.castle-palette{
  position:fixed;left:12px;top:74px;z-index:92;
  width:min(360px,calc(100vw - 24px));max-height:calc(100dvh - 92px);
  display:flex;flex-direction:column;overflow:hidden;
  border:16px solid transparent;border-image:url(assets/ui/classic/frame.png) 22 fill / 16px stretch;
  background:none;color:#f3e6c4;box-shadow:0 10px 0 #0008,0 18px 38px #000b;
  font-family:"ArcDigits","Pixelify Sans",sans-serif;image-rendering:pixelated
}
.castle-palette-head{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;padding:2px 3px 8px;border-bottom:2px solid #7a5a32}
.castle-palette-head>div{min-width:0}.castle-palette-head b{display:block;color:#ffd66e;font-size:17px;line-height:1.1}.castle-palette-head span{display:block;margin-top:3px;color:#cdbf9e;font-size:10px;line-height:1.2}
.castle-palette-head>button,.castle-palette-tools button{
  appearance:none;border:5px solid transparent;border-image:url(assets/ui/classic/btn.png) 6 10 fill / 5px 8px stretch;
  background:none;color:#efe5cf;font:700 14px/1 "ArcDigits","Pixelify Sans",sans-serif;cursor:pointer;image-rendering:pixelated
}
.castle-palette-head>button{width:34px;height:30px;padding:0;font-size:20px;flex:0 0 auto}
.castle-palette-tools{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;padding:7px 2px}
.castle-palette-tools button{min-height:32px;padding:2px 4px}.castle-palette-tools button:hover{filter:brightness(1.18)}
.castle-palette-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px;overflow:auto;overscroll-behavior:contain;padding:2px 2px 5px;scrollbar-width:thin;scrollbar-color:#b88b42 #17111d}
.castle-palette-item{
  appearance:none;min-width:0;min-height:82px;padding:4px 2px 5px;
  display:grid;grid-template-rows:54px minmax(0,1fr);place-items:center;gap:2px;
  border:2px solid #59452f;background:#15101acc;color:#e9dcc0;cursor:pointer;
  font:700 9px/1.05 "ArcDigits","Pixelify Sans",sans-serif;text-align:center;image-rendering:pixelated
}
.castle-palette-item canvas{width:58px;height:52px;max-width:100%;image-rendering:pixelated;pointer-events:none}
.castle-palette-item span{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;pointer-events:none}
.castle-palette-item:hover,.castle-palette-item.selected{border-color:#ffd66e;background:#2b1c24;color:#fff0c0;box-shadow:inset 0 0 0 1px #a8782d}
/* Do not hide a sprite while its real image is still loading. */
.castle-palette-item.loading canvas{opacity:.42}
.castle-palette-item.loading{border-color:#766248;cursor:progress}
.castle-palette-item.loading span{color:#b8a789}
.lobby-stage.castle-editable.editing .lobby-edit-help{display:inline}
body:not([data-view="home"]) .castle-palette{display:none!important}

@media(pointer:coarse),(max-width:850px){
  /* Hall editing stays desktop/admin-only; personal Guarida editing is available everywhere. */
  .lobby-stage.castle-editable .lobby-editor:not([hidden]){display:flex!important;right:12px!important;bottom:calc(74px + env(safe-area-inset-bottom))!important;z-index:94!important}
  .lobby-stage.castle-editable.editing .lobby-editor .lobby-edit-help{display:none!important}
  .castle-palette{
    left:6px;top:max(6px,env(safe-area-inset-top));width:min(320px,46vw);max-height:calc(100dvh - 12px);
    border-width:10px;border-image-width:10px
  }
  .castle-palette-head b{font-size:13px}.castle-palette-head span{font-size:8px}
  .castle-palette-tools{gap:2px;padding:4px 1px}.castle-palette-tools button{min-height:27px;font-size:12px}
  .castle-palette-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:3px}
  .castle-palette-item{min-height:64px;grid-template-rows:42px minmax(0,1fr);font-size:8px;padding:2px}
  .castle-palette-item canvas{width:46px;height:40px}
}

/* Object tools stay usable on small desktop and touch castle editors. */
.lobby-object-tools{display:none;gap:6px;flex-wrap:wrap}.lobby-stage.editing .lobby-object-tools{display:flex}.lobby-stage.editing .lobby-edit-help{display:none!important}.lobby-editor:not([hidden]){display:flex!important;max-width:calc(100vw - 24px);flex-wrap:wrap}.lobby-object-tools button{min-height:44px!important;box-sizing:border-box!important;border:2px solid #c99a3e!important}.lobby-stage.editing .lobby-editor{background:#18111ef2;padding:6px;border:2px solid #d6aa4e}

/* Deck builder: one header, a thin pixel border and no nested ornamental frames. */
body .modal.hall-panel[data-panel="deck"]{border:2px solid #8a7044!important;border-image:none!important;background:#161d18!important;filter:none!important;padding:0!important}
body .modal.hall-panel[data-panel="deck"] .hall-panel-body{padding:8px!important}
body .modal.hall-panel[data-panel="deck"] .page{padding:0!important}
body .modal.hall-panel[data-panel="deck"] .panel{border:0!important;border-image:none!important;box-shadow:none!important;background:none!important}
body .modal.hall-panel[data-panel="deck"] .panel-head{padding:8px!important;min-height:48px;border-bottom:1px solid #8a704466!important;gap:8px;flex-wrap:wrap}
body .modal.hall-panel[data-panel="deck"] .panel-body{padding:8px!important}
body .modal.hall-panel[data-panel="deck"] .deck-library>.panel-head>.actions{margin-left:auto;gap:8px;flex-wrap:wrap}

body .modal.hall-panel[data-panel="deck"] .deck-library>.panel-head>.actions{display:flex!important;width:auto!important;grid-template-columns:none!important}body .modal.hall-panel[data-panel="deck"] .deck-library>.panel-head>.actions>.btn{width:auto!important;flex:0 0 auto!important}


/* Guarida sprite catalog controls */
.castle-palette-filter{display:grid;grid-template-columns:minmax(0,1fr) 118px;gap:5px;padding:2px 2px 5px}.castle-palette-filter input,.castle-palette-filter select{min-width:0;height:32px;box-sizing:border-box;border:2px solid #6a5636;background:#120c16;color:#f3e6c4;padding:4px 6px;font:700 10px/1 "ArcDigits","Pixelify Sans",sans-serif;outline:none}.castle-palette-filter input:focus,.castle-palette-filter select:focus{border-color:#ffd66e}.castle-palette-meta{display:flex;justify-content:space-between;gap:8px;padding:0 3px 5px;color:#bfae8a;font-size:8px;line-height:1.2}.castle-palette-meta [data-castle-count]{color:#ffd66e;white-space:nowrap}.castle-palette-empty{grid-column:1/-1;padding:18px 8px;text-align:center;color:#cdbf9e;font-size:10px}.castle-palette-pages{display:grid;grid-template-columns:38px 1fr 38px;align-items:center;gap:5px;padding:6px 2px 1px;border-top:2px solid #59452f}.castle-palette-pages span{text-align:center;color:#e9dcc0;font-size:9px}.castle-palette-pages button{appearance:none;min-height:28px;border:2px solid #7a5a32;background:#18111e;color:#ffd66e;font:700 12px/1 "ArcDigits","Pixelify Sans",sans-serif;cursor:pointer}.castle-palette-pages button:disabled{opacity:.35;cursor:default}
@media(pointer:coarse),(max-width:850px){.castle-palette-tools{grid-template-columns:repeat(7,1fr)}.castle-palette-filter{grid-template-columns:minmax(0,1fr) 92px;gap:3px}.castle-palette-filter input,.castle-palette-filter select{height:28px;font-size:8px;padding:2px 4px}.castle-palette-meta{font-size:7px}.castle-palette-meta span:last-child{display:none}.castle-palette-pages{padding-top:4px}.castle-palette-pages button{min-height:25px}}


/* ===== Phase 3: contextual player interaction ===== */
.lobby-menu.player-actions-menu{
  width:min(360px,calc(100vw - 24px))!important;
  min-width:0!important;
}
.lobby-player-actions{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:5px;
  padding-top:7px;
}
.lobby-player-actions>button,
.lobby-player-actions>.lobby-friend-action>button,
.lobby-self-actions>button{
  box-sizing:border-box!important;
  width:100%!important;
  min-height:48px!important;
  display:grid!important;
  grid-template-columns:28px minmax(0,1fr)!important;
  align-items:center!important;
  gap:6px!important;
  padding:6px 8px!important;
  border:2px solid #564126!important;
  background:#120c16!important;
  color:#ead9b1!important;
  text-align:left!important;
  font-family:"ArcDigits","Pixelify Sans",sans-serif!important;
}
.lobby-player-actions>button>span{
  display:grid;
  place-items:center;
  width:24px;
  height:24px;
  color:#ffd66e;
  font-size:17px;
}
.lobby-player-actions>button>b{font-size:12px;font-weight:700}
.lobby-player-actions>.lobby-friend-action{
  display:contents;
}
.lobby-player-actions>.lobby-friend-action>button{
  grid-column:auto!important;
}
.lobby-player-actions>button:hover:not(:disabled),
.lobby-player-actions>.lobby-friend-action>button:hover:not(:disabled),
.lobby-player-actions>button.pad-focus,
.lobby-player-actions>.lobby-friend-action>button.pad-focus,
.lobby-self-actions>button.pad-focus{
  outline:3px solid #79e0c1!important;
  outline-offset:1px!important;
  border-color:#79e0c1!important;
  background:#21172a!important;
  color:#fff0c0!important;
}
.lobby-player-actions button:disabled{opacity:.35!important}
.lobby-self-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:7px}
.lobby-self-actions>button{grid-template-columns:1fr!important;text-align:center!important}
@media(max-width:560px),(pointer:coarse){
  .lobby-menu.player-actions-menu{width:min(330px,calc(100vw - 18px))!important}
  .lobby-player-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lobby-player-actions>button,.lobby-player-actions>.lobby-friend-action>button{min-height:44px!important}
  .lobby-self-actions{grid-template-columns:1fr}
}


/* ===== Phase 3: the Hall itself is the gameplay navigation =====
   Keep the account portrait HUD, but the legacy web navigation can never unfold here. */
body[data-view="home"] #appShell>.sidebar>.brand,
body[data-view="home"] #appShell>.sidebar>.nav,
body[data-view="home"] #appShell>.sidebar>#languageFlags,
body[data-view="home"].hall-nav-open #appShell>.sidebar>.brand,
body[data-view="home"].hall-nav-open #appShell>.sidebar>.nav,
body[data-view="home"].hall-nav-open #appShell>.sidebar>#languageFlags{
  display:none!important;
  opacity:0!important;
  visibility:hidden!important;
  pointer-events:none!important;
}
body[data-view="home"].hall-nav-open #appShell>.sidebar{
  background:transparent!important;
  border-bottom-color:transparent!important;
  box-shadow:none!important;
}

/* Starter thumbnails remain absent until their decoded crop is visibly nonempty. */
.castle-palette-item[hidden]{display:none!important}

@media(pointer:coarse),(max-width:850px){.lobby-edit-toggle{min-width:44px!important;min-height:44px!important}.castle-palette-pages button{min-height:44px}.castle-palette-filter select{height:44px}.lobby-editor:not([hidden]){z-index:94!important}}
/* Regression guard: keep the desktop hall controls in a fixed non-overlapping rail. */
@media (min-width:851px) and (pointer:fine){
  body[data-view="home"] .lobby-nav-toggle{top:12px!important;left:12px!important}
  body[data-view="home"] .lobby-overview-btn{position:fixed!important;top:12px!important;left:124px!important;margin:0!important;z-index:103!important}
}


@media(any-pointer:coarse){
  .hall-menu-back{
    width:44px!important;
    height:44px!important;
    min-width:44px!important;
    min-height:44px!important;
    flex-basis:44px!important;
  }
  .hall-menu-back-row{min-height:48px}
}

/* Global rule: every visible return control is icon-only and square. */
.hall-return{
 width:44px!important;
 min-width:44px!important;
 max-width:44px!important;
 height:44px!important;
 min-height:44px!important;
 max-height:44px!important;
 padding:0!important;
 display:none;
 align-items:center!important;
 justify-content:center!important;
 gap:0!important;
 border-radius:0!important;
 line-height:1!important;
 font-size:20px!important;
 overflow:hidden!important;
 box-sizing:border-box!important;
}
@media (pointer:coarse),(max-width:850px){
 body:not([data-view="home"]):not([data-view="duel"]):not([data-view="spectate"]) .hall-return{
  display:flex!important;
 }
}

/* Self actions have enough width for complete labels inside the ornate frame. */
.lobby-self-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
body.art-retro .lobby-self-actions>button:not(#_){display:flex!important;align-items:center!important;justify-content:center!important;min-width:0!important;min-height:48px!important;padding:4px!important;font-size:13px!important;line-height:1.2!important;white-space:normal!important;overflow-wrap:normal;word-break:normal;text-align:center!important}
.lobby-self-actions>button:last-child{grid-column:1 / -1}

body .lobby-menu:has(.lobby-self-actions){width:min(300px,calc(var(--game-width,100vw) - 20px));min-width:0!important}

/* Mobile editor controls: separate the toggle from the inventory HUD and leave space
   for the room, the sprite palette, the gamepad and safe-area insets. */
@media (pointer:coarse),(max-width:850px){
  .lobby-stage .lobby-editor:not([hidden]),
  .lobby-stage.castle-editable .lobby-editor:not([hidden]){
    display:flex!important;position:fixed!important;
    top:calc(8px + env(safe-area-inset-top))!important;
    right:calc(8px + env(safe-area-inset-right))!important;
    bottom:auto!important;left:auto!important;
    z-index:94!important;
  }
  .lobby-stage.editing .lobby-editor:not([hidden]),
  .lobby-stage.castle-editable.editing .lobby-editor:not([hidden]){
    top:auto!important;
    bottom:calc(64px + env(safe-area-inset-bottom))!important;
    max-width:calc(100vw - 16px)!important;
    max-height:calc(100dvh - 86px)!important;
    overflow-y:auto;
    overscroll-behavior:contain;
  }
  .lobby-stage.editing .lobby-object-tools{max-width:100%;gap:4px}
  .lobby-editor .lobby-edit-toggle{min-width:44px!important;min-height:44px!important}
}


/* Dominio: integrated Arch heroes and inventory, original pixel panel palette. */
.domain-panel .dm-hero-screen{display:grid;gap:12px;min-width:0}
.domain-panel .dm-hero-header{display:flex;gap:18px;align-items:center;justify-content:space-between;border-bottom:2px solid #7f622d;padding:4px 0 12px}
.domain-panel .dm-hero-header>div{min-width:0}
.domain-panel .dm-hero-header small{display:block;letter-spacing:.08em;color:#d9b66d;font-size:11px}
.domain-panel .dm-hero-header h3{border:0;margin:2px 0 4px;font-size:24px}
.domain-panel .dm-hero-header p{margin:0;font-size:14px;line-height:1.45;color:#d3c2a7}
.domain-panel .dm-hero-header button{flex-shrink:0}
.domain-panel .dm-hero-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.domain-panel .dm-hero-summary>span{display:grid;gap:4px;justify-items:center;padding:10px 4px;background:linear-gradient(180deg,#24192c,#120c16);border:2px solid #695032}
.domain-panel .dm-hero-summary b{font-size:24px;color:#ffd66e}
.domain-panel .dm-hero-summary small{font-size:12px;color:#d6c5a9}
.domain-panel .dm-hero-mode,.domain-panel .dm-hero-filter{display:flex;gap:6px;flex-wrap:wrap}
.domain-panel .dm-hero-mode button,.domain-panel .dm-hero-filter button{min-height:36px;background:#1a1223;border:2px solid #715735;color:#e5d7b9;padding:6px 14px;cursor:pointer;font:inherit;font-size:14px}
.domain-panel .dm-hero-mode button.on,.domain-panel .dm-hero-filter button.on{background:#624618;border-color:#ffd66e;color:#fff6d7}
.domain-panel .dm-hero-controls{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap}
.domain-panel .dm-hero-search{display:grid;gap:4px;font-size:13px;min-width:min(230px,100%)}
.domain-panel .dm-hero-search input{width:100%;min-height:38px}
.domain-panel .dm-hero-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(280px,100%),1fr));gap:10px}
.domain-panel .dm-hero-card{display:grid;gap:10px;align-content:start;padding:14px;background:linear-gradient(155deg,#2a1a2b,#120c16 70%);border:3px solid #685038;box-shadow:inset 0 0 0 2px #070509;min-width:0}
.domain-panel .dm-hero-card.fallen{filter:saturate(.55);border-color:#604a55}
.domain-panel .dm-hero-card-head{display:flex;align-items:center;gap:10px;min-width:0}
.domain-panel .dm-hero-card-head>div{min-width:0;flex:1}
.domain-panel .dm-hero-card-head strong{font-size:17px;color:#ffdf9c;display:block;overflow-wrap:anywhere}
.domain-panel .dm-hero-card-head small{display:block;font-size:12px;color:#cbbd9e}
.domain-panel .dm-hero-sigil,.domain-panel .dm-hero-neutral{width:56px;height:56px;flex:0 0 56px;object-fit:contain;image-rendering:pixelated}
.domain-panel .dm-hero-neutral{display:grid;place-items:center;font-size:32px;color:#ffd66e;border:2px solid #715735}
.domain-panel .dm-hero-status{padding:4px 6px;border:1px solid #6caa70;color:#a9eac0;font-size:11px}
.domain-panel .dm-hero-card.fallen .dm-hero-status{border-color:#bd7575;color:#f3b2b2}
.domain-panel .dm-hero-xp small{font-size:12px;color:#eadab7}
.domain-panel .dm-hero-xp>div{height:12px;border:2px solid #6f5531;background:#100917;margin-top:5px;overflow:hidden}
.domain-panel .dm-hero-xp i{display:block;height:100%;background:repeating-linear-gradient(90deg,#ffdb76 0 13px,#ad7c2c 13px 16px);image-rendering:pixelated}
.domain-panel .dm-hero-stats{display:flex;gap:6px;flex-wrap:wrap}
.domain-panel .dm-hero-stats span{flex:1;display:flex;justify-content:space-between;gap:8px;padding:5px;background:#0d0a14;border:1px solid #51432c;font-size:11px}
.domain-panel .dm-hero-stats b{color:#ffdc79;font-size:13px}
.domain-panel .dm-hero-detail{display:grid;gap:10px;border-top:1px solid #705532;padding-top:10px}
.domain-panel .dm-hero-skills{display:flex;gap:5px;flex-wrap:wrap}
.domain-panel .dm-hero-skills span{border:1px solid #90703c;background:#39280e;color:#fff1cd;padding:4px 6px;font-size:12px}
.domain-panel .dm-hero-skills span.locked{border-color:#50505b;background:#20202c;color:#a9a5b4}
.domain-panel .dm-hero-muted{font-size:13px;color:#bfaf94;line-height:1.4}
.domain-panel .dm-hero-notice{padding:18px;background:#211725;border-left:5px solid #dbb35f}
.domain-panel .dm-hero-notice strong{color:#ffe29c;font-size:18px}
.domain-panel .dm-hero-notice p{margin:8px 0 0;line-height:1.5}
.domain-panel .dm-hero-inventory{display:grid;gap:8px}
.domain-panel .dm-hero-item{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:10px 12px;background:#1a1321;border:2px solid #5c4934}
.domain-panel .dm-hero-item>div{display:grid;gap:5px;min-width:0}
.domain-panel .dm-hero-item strong{font-size:16px;color:#ffdda4}
.domain-panel .dm-hero-item small{font-size:13px;color:#ddc9a6}
.domain-panel .dm-hero-screen [hidden]{display:none!important}
@media(max-width:600px){
  .domain-panel .dm-hero-header{align-items:flex-start;flex-wrap:wrap}
  .domain-panel .dm-hero-summary{grid-template-columns:repeat(2,minmax(0,1fr))}
  .domain-panel .dm-hero-card-head strong{font-size:15px}
  .domain-panel .dm-hero-sigil,.domain-panel .dm-hero-neutral{width:46px;height:46px;flex-basis:46px}
  .domain-panel .dm-hero-mode button{flex:1}
}


/* Dominio Héroes: tabs as a 16-bit quick-select strip, touch-friendly on phones. */
.domain-panel .dm-hero-mode{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-inline:contain;scroll-snap-type:x proximity;scrollbar-color:#947139 #120c16;padding-bottom:5px}
.domain-panel .dm-hero-mode button{flex:0 0 auto;white-space:nowrap;scroll-snap-align:start;min-height:44px;font-size:14px}
.domain-panel .dm-hero-mini-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(240px,100%),1fr));gap:8px}
.domain-panel .dm-hero-line{display:flex;flex-direction:column;gap:5px;align-items:flex-start;padding:10px 12px;border:2px solid #705534;background:#1b1224;font-size:13px;min-width:0}
.domain-panel .dm-hero-line strong{color:#f9da98;font-size:15px;overflow-wrap:anywhere}
.domain-panel .dm-hero-line small{color:#d4c5a6;font-size:12px;line-height:1.4}
.domain-panel .dm-hero-line .dm-hero-skills{margin-top:4px}
.domain-panel .dm-hero-line>.dm-hero-line{border:0;background:transparent;padding:0}
.domain-panel .dm-hero-screen>.dm-hero-notice{margin-block:6px}
@media(max-width:600px){.domain-panel .dm-hero-mode{margin-inline:-2px;padding-bottom:9px}.domain-panel .dm-hero-mode button{min-height:48px;font-size:13px}.domain-panel .dm-hero-mini-grid{grid-template-columns:1fr}}

/* TR Arch Tavern auction: escrows are real server-side transactions. */
.domain-panel .dm-hero-auction{gap:9px;justify-content:flex-start;border-color:#9a7138}
.domain-panel .dm-hero-auction label.dm-hero-search{width:100%;max-width:230px;min-width:0}
.domain-panel .dm-hero-auction [data-tavern-bid]{font:inherit;color:#ffe8bb;background:#0c0710;border:2px solid #8a6436;min-height:44px;padding:8px;width:100%}
.domain-panel .dm-hero-auction-winning{font-weight:bold;color:#a9eac0!important}
.domain-panel .dm-hero-auction button{min-height:44px}


/* Handheld-RPG doorway transition: no HTML panel, just a quick pixel-dark fade. */
.lobby-stage.room-transition::after{
  content:"";position:absolute;inset:0;z-index:95;pointer-events:none;
  background:#0a0810;animation:arcanum-door-cross .68s steps(6,end) both;
}
@keyframes arcanum-door-cross{
  0%{opacity:0}35%,65%{opacity:1}100%{opacity:0}
}
@media(prefers-reduced-motion:reduce){
  .lobby-stage.room-transition::after{animation-duration:.15s}
}
