/* The Shattered Citadel — presentation layer, self-hosted assets and system fonts. */
:root {
    --bg-dark: #0b141b;
    --panel-bg: rgba(16, 27, 33, .95);
    --card-bg: rgba(24, 38, 44, .8);
    --border-color: #bba67a29;
    --border-hover: #cbb78b77;
    --text-primary: #e9e5da;
    --text-secondary: #a4b2b5;
    --text-muted: #829296;
    --blue-neon: #80cae2;
    --red-neon: #e5a096;
    --yellow-neon: #d9bf83;
    --font-ui: 'Segoe UI', system-ui, sans-serif;
    --font-digit: 'Segoe UI', system-ui, sans-serif;
    --font-retro: monospace;
}
body { background: #0a131a; overflow-y: auto; height: auto; min-height: 100dvh; }
body::before { content: ''; position: fixed; inset: 0; background: linear-gradient(#08121bd9, #08121bf2), url('assets/arcane-citadel.png') center / cover; z-index: -1; }
body:has(#game-screen.active) { overflow: hidden; }
#stars, #nebula { display: none; }
.glass-panel, .glass-card { backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 4px; box-shadow: none; }
.btn { border-radius: 3px; font-size: 11px; letter-spacing: 1.3px; min-height: 36px; }
.primary-btn { background: linear-gradient(120deg, #dbbf84, #ad8e55); color: #1b241f; box-shadow: 0 4px 18px #0004; border: 1px solid #efdaad80; }
.primary-btn:hover { box-shadow: 0 4px 25px #c7a86633; filter: brightness(1.09); }
.primary-btn:disabled { background: #35434a; color: #9caaae; }
.secondary-btn { border-color: #acb3a344; color: #c9d1ce; background: #14212780; }
.secondary-btn:hover { border-color: #baa675; background: #263a41; }
button:focus-visible, input:focus-visible, canvas:focus-visible { outline: 2px solid #efd198; outline-offset: 3px; }
.blue-text, .red-text, .glow-yellow { text-shadow: none; }
.animate-pulse { animation: none; }
#lobby-screen { max-width: 1280px; width: calc(100% - 56px); height: auto; min-height: calc(100dvh - 48px); margin: 24px auto; padding: 0 28px 20px; overflow: visible; background: #101b21ed; border: 1px solid #a5906138; }
.citadel-nav { height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.citadel-brand { font-family: Georgia, serif; font-size: 12px; letter-spacing: 3px; white-space: nowrap; }
.brand-sigil { font-size: 30px; color: #d4b97e; vertical-align: middle; margin-right: 9px; }
.nav-actions { display: flex; align-items: center; gap: 16px; }
#connection-label { color: #9fafaa; font-size: 10px; letter-spacing: 1.5px; text-transform: uppercase; }
#connection-label::before { content: ''; display: inline-block; width: 5px; height: 5px; background: #84b79a; border-radius: 50%; margin-right: 8px; }
.preference-btn { background: transparent; border: 1px solid #89948440; padding: 7px 9px; color: #b8c2bd; font: 10px var(--font-ui); cursor: pointer; border-radius: 3px; white-space: nowrap; }
.preference-btn[aria-pressed='true'] { color: #ebd49f; border-color: #b59a6177; }
.lobby-header { position: relative; min-height: 312px; margin: 0 -28px 22px; padding: 34px 48px; text-align: left; background: linear-gradient(90deg, #0a1722f5 0%, #0b1828ad 34%, #0b182810 74%), url('assets/arcane-citadel.png') 60% 54% / cover; border-block: 1px solid #9c8b652b; overflow: hidden; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { color: #d6bd85; font-size: 10px; letter-spacing: 4px; margin-bottom: 14px; }
.game-title { color: #eee9d9; -webkit-text-fill-color: initial; background: none; filter: none; font: 48px/.99 Georgia, 'Times New Roman', serif; letter-spacing: -1px; font-weight: normal; text-shadow: 0 3px 25px #020a12; }
.game-title em { color: #d4b77e; font-weight: normal; }
.game-subtitle { font-size: 12px; line-height: 1.8; letter-spacing: .2px; color: #c1cacc; margin: 16px 0 19px; }
.hero-play { padding: 12px 23px; font-size: 11px; }
.hero-play span { margin-left: 28px; font-size: 16px; }
.hero-caption { color: #b2c0c5; font-size: 10px; margin-left: 16px; }
.hero-chapter { position: absolute; bottom: 24px; right: 25px; color: #dfcfaa; font: 9px var(--font-ui); letter-spacing: 3px; }
#lobby-match-status { margin: 0 0 16px !important; padding: 9px 20px !important; border: 0; border-block: 1px solid #a9996d2a; background: #08151b66; }
#lobby-match-status > span:first-child { font-size: 10px !important; font-weight: 400 !important; }
.lobby-team-score { font-size: 12px; }
.lobby-team-record { color: #8b999c; font-size: 9px; }
.digital-clock { font-variant-numeric: tabular-nums; font-weight: 500; box-shadow: none; background: transparent; border: 0; color: #e0dacb; }
.lobby-room-selector { margin: 0 0 14px; padding: 12px 15px; background: #14232abf; }
.room-selector-title { letter-spacing: 2px; font-size: 10px; color: #c7b78e; }
.room-selector-header { margin-bottom: 10px; }
.game-room-tab { box-shadow: none !important; font-size: 11px; }
.game-room-tab.active { border-color: #bca36c; background: #ad976218; }
.lobby-setup { margin: 0 0 16px; padding: 0; gap: 16px; border: 0; }
.input-group label { font-size: 9px; letter-spacing: 1.7px; color: #b9ad91; margin-bottom: 7px; }
input[type='text'], #nickname-input, .chat-input-bar input { font-family: var(--font-ui); color: #e2e5dc; background: #0b171c; border: 1px solid #809a9c33; border-radius: 3px; font-size: 12px; }
#nickname-input { padding: 11px 14px; }
.lobby-columns { grid-template-columns: 1fr 1.04fr 1fr; gap: 16px; min-height: 310px; }
.team-panel, .lobby-chat-panel { padding: 17px 14px; background: #142229a8; }
.blue-team-panel { border-top: 2px solid #74b7cb99; }
.red-team-panel { border-top: 2px solid #c0807399; }
.team-title, .chat-title { font: 12px Georgia, serif; letter-spacing: 1.7px; padding-bottom: 13px; margin-bottom: 12px; }
.team-title > span { font-size: 19px; vertical-align: middle; margin-right: 5px; }
.team-title small { display: block; font: 8px var(--font-ui); color: #95a5a5; letter-spacing: 2px; margin-top: 7px; }
.chat-title { color: #bfb08e; padding-top: 7px; }
.slot-list { gap: 7px; }
.slot-item { padding: 9px; border-radius: 3px; min-height: 40px; border-color: #7f979e22; background: #0c171d88; gap: 6px; }
.slot-num { color: #879c9f; font-size: 10px; }
.slot-name { font-size: 11px; font-weight: 500; }
.slot-item > .text-muted { font-size: 8px; letter-spacing: 1px; }
.slot-item .btn { font-size: 9px; min-height: 27px; padding: 4px 8px; letter-spacing: .6px; }
.slot-item.my-slot { border-color: #cdb777; background: #c9b67413; }
.chat-messages, .combat-feed { background: #0b171c88; font-size: 11px; line-height: 1.65; }
#lobby-messages { max-height: 216px; }
.chat-input-bar { gap: 6px; }
.chat-input-bar input { min-width: 0; }
.lobby-footer { margin-top: 20px; padding-top: 16px; gap: 16px; }
.lobby-footer p { font-size: 11px; line-height: 1.8; }
.footer-hint { font-size: 10px; color: #81959b; }
.footer-hint kbd { font-size: 9px; }
.large-btn { font-size: 11px; padding: 14px 30px; }

/* Arena: the canvas has priority, with restrained brass and slate HUD panels. */
#game-screen { height: 100dvh; background: #0b161c; }
.hud-bar { height: 63px; padding: 0 18px; gap: 12px; border-radius: 0; margin-bottom: 10px; border-bottom: 1px solid #9b895640; z-index: 20; }
.hud-brand { font: 24px Georgia, serif; color: #d1b783; }
.hud-brand span { font-size: 10px; letter-spacing: 2px; vertical-align: middle; margin-left: 6px; }
.hud-label { font-size: 9px; letter-spacing: 2px; }
.hud-value { font: 28px Georgia, serif; }
.timer-display .digital-clock { font: 24px Georgia, serif; font-variant-numeric: tabular-nums; }
.orb-indicator { width: 27px; height: 27px; font-size: 8px; box-shadow: none !important; }
.game-layout { grid-template-columns: 190px minmax(0, 1fr) 208px; gap: 10px; padding: 0 10px; }
.sidebar { padding: 12px 9px; overflow-y: auto; }
.left-sidebar { align-self: stretch; }
.panel-header, .panel-header-small { font-size: 10px; font-weight: 500; letter-spacing: 2px; color: #b8ad94; }
.panel-header { text-align: left; margin: 4px 4px 12px; }
.player-list-container { gap: 6px; }
.player-card { padding: 8px; border-radius: 2px; gap: 5px; background: #0b171c99; font-size: 10px; }
.player-card-name { max-width: 93px; }
.player-card-stats { font-size: 8px; }
.player-card-header { font-weight: 500; }
.player-bar-mini { height: 3px; }
.hp-fill-mini, .hp-fill { background: linear-gradient(90deg, #367f70, #8cbba0); }
.mana-fill-mini, .mana-fill { background: linear-gradient(90deg, #376384, #89c2d9); }
.xp-fill-mini, .xp-fill { background: linear-gradient(90deg, #8d7747, #d6b774); }
.viewport-container { border: 1px solid #81998d4d; border-radius: 3px; }
#gameCanvas { image-rendering: auto; touch-action: none; }
.minimap-wrapper { border-color: #798b6d40; width: 152px; height: 152px; margin-inline: auto; }
.sub-panel { background: transparent; padding: 8px; }
.combat-log-panel { flex: 1; min-height: 120px; }
.game-chat-panel { max-height: 180px; }
.overlay-content, .results-box, .top-ten-box { border-color: #bba57566; background: #101e26f2; border-radius: 4px; }
#spectator-overlay .overlay-content { padding: 8px 14px; font-size: 11px; }
.game-footer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 390px); gap: 12px 20px; padding: 11px 18px; margin-top: 10px; max-height: none; overflow: visible; border-radius: 0; background: #101d24; }
.spellbar { display: flex; gap: 6px; align-items: center; }
.spell-button { --spell: #d3bb89; position: relative; width: 70px; height: 76px; border: 1px solid #9eb4b333; border-bottom-color: #af987555; background: linear-gradient(#23353b88, #101c24); border-radius: 3px; color: #c3cbc6; cursor: pointer; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; touch-action: none; }
.spell-button:hover, .spell-button.is-held { border-color: var(--spell); background: #293e45; }
.spell-button > span { font: 27px/1.05 Georgia, serif; color: var(--spell); text-shadow: 0 0 16px color-mix(in srgb, var(--spell) 40%, transparent); }
.spell-button kbd { position: absolute; top: 4px; left: 5px; font: 8px var(--font-ui); color: #859a9c; }
.spell-button b { font: 9px var(--font-ui); margin-top: 3px; }
.spell-button small { font: 8px var(--font-ui); color: #8e9e9d; }
.ember { --spell: #e6a07b; } .azure { --spell: #8ecbde; } .frost { --spell: #bacfdc; } .violet { --spell: #b4a4d1; }
.game-footer .controls-guide { grid-column: 1 / -1; grid-row: 2; font-size: 9px; gap: 5px 12px; padding-top: 9px; border-top: 1px solid #8e9a7722; }
.controls-guide span { white-space: normal; }
.controls-guide kbd { font-size: 8px; padding: 1px 3px; }
.player-status-hub { flex-direction: column; align-items: stretch; gap: 9px; }
.status-bar-group { flex-basis: auto; min-width: 0; }
.hud-bar-label { font-size: 9px; letter-spacing: .5px; }
.hud-bar-bg { height: 7px; border: 0; border-radius: 2px; }
#leave-game-btn { align-self: flex-end; min-height: 25px; font-size: 9px; }
.touch-pad { display: none; }
.target-picker { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 15; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 95%; padding: 10px; background: #0c1a23f5; border: 1px solid #bda87677; }
.target-picker button { min-width: 36px; min-height: 36px; color: #e4d7ba; background: #273a41; border: 1px solid #a69b7444; cursor: pointer; }
.target-picker[hidden] { display: none; }

@media (min-width: 1650px) { .game-layout { grid-template-columns: 215px minmax(0, 1fr) 235px; } .spell-button { width: 82px; } }
@media (min-width: 1400px) and (min-height: 900px) {
    #lobby-screen { max-width: 1600px; width: calc(100% - 80px); }
    .lobby-header { min-height: 230px; padding: 14px 56px; }
    .game-title { font-size: 44px; }
    .game-subtitle { line-height: 1.45; margin: 9px 0 11px; }
    .lobby-room-selector { padding-block: 9px; }
    .game-room-tab { min-height: 34px; }
    .lobby-columns { min-height: 280px; }
    .slot-list { gap: 5px; }
    .slot-item { min-height: 30px; padding: 4px 8px; }
    .lobby-footer { margin-top: 14px; padding-top: 12px; }
}
@media (max-width: 1100px) {
    .game-layout { grid-template-columns: minmax(0, 1fr) 185px; } .left-sidebar { display: none; }
    .hud-brand span { display: none; } .spell-button { width: 60px; }
    .game-footer { grid-template-columns: minmax(0, 1fr) 280px; padding: 10px; gap: 10px; }
    .hero-caption { display: none; } .lobby-columns { gap: 10px; }
}
@media (max-width: 800px) {
    #lobby-screen { width: calc(100% - 24px); margin: 12px auto; padding: 0 16px 18px; }
    .citadel-brand { letter-spacing: 1px; font-size: 10px; } .nav-actions { gap: 6px; } #connection-label { display: none; }
    .lobby-header { margin-inline: -16px; padding: 34px 28px; background-position: 65% center; }
    .lobby-columns { grid-template-columns: 1fr 1fr; min-height: 0; }
    .lobby-chat-panel { grid-column: 1 / -1; order: 3; height: 200px; }
    .lobby-footer { align-items: flex-start; } .lobby-footer p { font-size: 10px; }
    .game-layout { display: block; } .right-sidebar { display: none; }
    .hud-motion, .hud-brand, .orb-status > .hud-label { display: none; }
    .hud-bar { height: 52px; padding: 0 10px; gap: 6px; margin-bottom: 6px; }
    .hud-label { letter-spacing: 1px; } .hud-value { font-size: 23px; }
    .orb-indicators-container { gap: 4px; } .orb-indicator { width: 23px; height: 23px; font-size: 7px; }
    .game-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
    .game-footer .controls-guide { display: none; }
    .spellbar { flex: 1 1 auto; justify-content: center; gap: 4px; }
    .spell-button { width: clamp(37px, 7.5vw, 60px); height: 62px; } .spell-button b { font-size: 8px; } .spell-button small { font-size: 7px; }
    .player-status-hub { order: -1; flex: 1 1 100%; flex-direction: row; align-items: center; gap: 10px; }
    .status-bar-group { flex: 1; max-width: none; } #leave-game-btn { white-space: nowrap; margin-bottom: 2px; }
    .level-container { flex-basis: 37px; } .hud-bar-label { font-size: 8px; }
    .touch-pad { display: grid; grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(2, 30px); gap: 3px; }
    .touch-pad button { font-size: 16px; border: 1px solid #7b938e55; background: #24373d; color: #d7dccd; border-radius: 3px; touch-action: none; }
    .touch-pad button:first-child { grid-column: 2; } .touch-pad button:nth-child(2) { grid-row: 2; }
    .touch-pad button:nth-child(3) { grid-row: 2; } .touch-pad button:nth-child(4) { grid-row: 2; }
}
@media (max-width: 530px) {
    .nav-actions .preference-btn { font-size: 9px; padding: 7px; } .citadel-brand { font-size: 8px; } .brand-sigil { margin-right: 3px; }
    .lobby-header { min-height: 304px; padding: 30px 22px; } .game-title { font-size: 40px; } .hero-chapter { display: none; }
    .game-subtitle { max-width: 245px; font-size: 11px; } .eyebrow { font-size: 8px; }
    #lobby-match-status { gap: 8px !important; padding-inline: 5px !important; } #lobby-match-status > span:first-child { display: none; }
    .lobby-setup { flex-wrap: wrap; gap: 10px; } .lobby-setup .input-group { flex: 1 1 100%; }
    .lobby-columns { grid-template-columns: 1fr; } .lobby-chat-panel { grid-column: auto; } .lobby-footer { flex-direction: column; }
    .team-panel { padding: 13px; } .team-title small { display: inline; margin-left: 10px; } .team-title { margin-bottom: 8px; }
    .slot-item { min-height: 42px; } .slot-name { font-size: 12px; } .slot-item .btn { min-height: 32px; }
    .room-selector-title { font-size: 8px; } .lobby-room-selector { padding: 10px; } #create-game-btn { font-size: 8px; }
    .hud-audio { padding: 5px; font-size: 8px; } .orb-indicator { width: 21px; height: 21px; } .timer-display .digital-clock { font-size: 19px; padding: 4px; }
    .spellbar { flex-basis: 100%; } .spell-button { flex: 1; max-width: 52px; } .touch-pad { grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 33px); }
    .game-footer { gap: 7px; padding: 8px; } .game-layout { padding-inline: 6px; }
}
@media (max-height: 540px) and (orientation: landscape) {
    .hud-bar { height: 40px; margin-bottom: 4px; } .game-footer { gap: 6px; padding: 5px; }
    .game-layout { display: block; } .left-sidebar, .right-sidebar, .hud-motion { display: none; }
    .game-footer { display: flex; flex-wrap: nowrap; align-items: center; }
    .game-footer .controls-guide { display: none; }
    .player-status-hub { flex: 0 1 220px; flex-direction: column; gap: 5px; order: 0; max-width: 220px; }
    .status-bar-group { width: 100%; } .spellbar { flex: 1; gap: 3px; }
    .spell-button { width: 39px; height: 53px; } .spell-button small { display: none; }
    .touch-pad { display: grid; grid-template-columns: repeat(3, 36px); grid-template-rows: repeat(2, 25px); }
}
[data-reduced-motion='true'] *, [data-reduced-motion='true'] *::before, [data-reduced-motion='true'] *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
