#game-room[data-game="castle"] .room-layout{grid-template-columns:minmax(0,1fr)}#game-room[data-game="castle"] .control-panel,#game-room[data-game="castle"] .history-bar,#game-room[data-game="castle"] .room-title,#game-room[data-game="castle"] .table-heading,#game-room[data-game="castle"] #actions,#game-room[data-game="castle"] #round-meter{display:none}#game-room[data-game="castle"] .table-panel{padding:0;border:0;background:none;box-shadow:none}#game-room[data-game="castle"] #stage{display:block;font-size:16px;min-height:0;padding:0;background:none;border:0;margin:0;overflow:visible}#game-room[data-game="castle"] .room-heading{margin-bottom:18px}.castle-screen{width:100%;color:#eff2fc;text-align:left}.castle-screen button{font-size:14px;min-height:42px;border-radius:8px;padding:10px 15px;white-space:normal;line-height:1.4}.castle-screen h2{font-size:clamp(32px,4vw,52px);letter-spacing:-1px;font-weight:750;margin:12px 0}.castle-screen h3{font-size:22px;margin:0 0 20px;font-weight:700}.castle-screen p{font-size:16px;line-height:1.6}.castle-hero{position:relative;min-height:255px;background:linear-gradient(90deg,#111b2aee,#111b2a94 50%,#111b2a0a),url('/assets/castle-field.webp') center/cover;border:1px solid #7483a580;border-radius:15px;padding:36px;margin-bottom:24px;box-sizing:border-box}.castle-hero p{color:#d1e0f2;margin:10px 0 24px}.castle-hero .eyebrow{color:#c8a0ff}.castle-hero-tags{display:flex;gap:10px;flex-wrap:wrap}.castle-hero-tags span{font-size:14px;padding:7px 12px;border:1px solid #a998e04d;background:#242d45b3;border-radius:6px}.castle-lobby-layout{display:grid;grid-template-columns:330px minmax(0,1fr);gap:22px}.castle-setup,.castle-open-battles,.castle-troops,.castle-command,.castle-results,.castle-waiting{background:#1a2534;border:1px solid #3f4e66;border-radius:12px;padding:24px;box-sizing:border-box;min-width:0}.castle-format{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:24px}.castle-format button,.castle-lane-buttons button,.castle-role-filters button,.castle-presets button{background:#283347;border:1px solid #4c5e79;color:#d6e1f4}.castle-screen button.selected{background:#713bb2;border:1px solid #bf86ff;color:#fff;box-shadow:0 0 0 1px #bf86ff40}.castle-setup label{display:flex;flex-wrap:wrap;gap:10px;font-size:15px;align-items:center;color:#e0e8f7;margin:18px 0}.castle-setup label>strong{margin-left:auto;color:#d2a3ff}.castle-setup input:not([type="checkbox"]){width:100%;box-sizing:border-box;min-width:0;font-size:17px;border-color:#56698b;background:#111b29;padding:13px}.castle-setup input[type="range"]{accent-color:#a269ee;padding:0;border:0}.castle-setup small,.castle-small{font-size:14px!important;line-height:1.6;color:#aabbd4;margin:12px 0}.castle-setup .castle-practice{padding:14px;background:#122e2a;border:1px solid #296b56;border-radius:8px;line-height:1.5}.castle-practice input{width:20px;height:20px;accent-color:#30e4a1}.castle-presets{display:flex;gap:6px;flex-wrap:wrap}.castle-presets button{padding:7px 11px;min-height:36px;flex:1}.castle-entry-summary{display:flex;flex-direction:column;gap:16px;padding:18px 0;border-top:1px solid #39495f;margin:18px 0}.castle-entry-summary span{display:flex;justify-content:space-between;font-size:14px;gap:12px}.castle-entry-summary strong{color:#43e7aa;font-size:17px}#castle-create{width:100%;justify-content:center;background:#a663ef;color:#fff;border-color:#c789ff;min-height:48px}.castle-section-title{display:flex;justify-content:space-between;align-items:center;gap:18px;flex-wrap:wrap;margin-bottom:20px}.castle-section-title h3{margin:0}.castle-section-title>span{font-size:14px;color:#aebdd5}.castle-battle-row{width:100%;display:flex;align-items:center;gap:16px;justify-content:space-between;background:#111c2b;border:1px solid #3b4f68;margin-bottom:10px;text-align:left;padding:16px!important}.castle-row-mark{display:grid;place-items:center;background:#493365;border:1px solid #8c62b6;border-radius:8px;width:45px;height:45px;flex-shrink:0;font-size:29px}.castle-battle-row>span:nth-child(2){flex:1;min-width:0}.castle-battle-row strong{display:block;overflow-wrap:anywhere;font-size:16px}.castle-battle-row small{display:block;font-size:14px;color:#a8bdd8;margin-top:5px;line-height:1.5}.castle-state{font-size:13px;border:1px solid #8361af;padding:6px 10px;border-radius:6px;flex-shrink:0}.castle-state.active{color:#46f0b4;border-color:#43b390}.castle-empty{padding:35px 25px;background:#122030;border:1px dashed #586a85;border-radius:10px}.castle-empty strong{font-size:21px}.castle-empty p{color:#b8cae1;margin-bottom:0}.castle-roster-preview{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:10px;margin-top:30px}.castle-roster-preview>div{text-align:center;min-width:0}.castle-roster-preview span:last-child{display:block;font-size:13px;margin-top:8px;overflow-wrap:anywhere}.mob-icon{display:block;width:70px;height:70px;flex-shrink:0;margin:0 auto;background-image:url('/assets/castle-mobs.webp');background-size:600% 800%;background-repeat:no-repeat;filter:drop-shadow(0 4px 5px #0006)}.castle-roster-preview .mob-icon{width:min(70px,100%);aspect-ratio:1;height:auto}.castle-rules{font-size:15px;border:1px solid #3e4d64;border-radius:10px;padding:18px 22px;margin-top:24px;background:#172131}.castle-rules summary{cursor:pointer;color:#cda5ff;font-weight:700}.castle-rules p{color:#bacbe1}.castle-match-top{display:flex;gap:20px;align-items:center;justify-content:space-between;margin-bottom:20px}.castle-match-top>span{font-size:15px;color:#bfcae0}.castle-match-top>div{text-align:right}.castle-match-top small{display:block;font-size:12px;letter-spacing:1px;color:#a7bdd9}.castle-match-top strong{font-size:25px;color:#d5b4ff;font-variant-numeric:tabular-nums;display:block;margin-top:5px}.castle-match-pot{display:flex;gap:20px;justify-content:space-between;background:#172637;border:1px solid #47586f;padding:18px 24px;border-radius:10px;margin-bottom:20px}.castle-match-pot span{font-size:13px;color:#abbcd6}.castle-match-pot strong{display:block;margin-top:7px;font-size:19px;color:#51eab5}.castle-players{display:grid;grid-template-columns:minmax(0,1fr) 45px minmax(0,1fr);gap:15px;align-items:center;margin:18px 0}.castle-team-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:10px}.castle-seat{padding:16px;background:#182c3e;border:1px solid #4d92ad;border-radius:9px;min-height:116px;box-sizing:border-box;min-width:0}.castle-seat.purple{background:#30233f;border-color:#a468cd}.castle-seat.fallen{opacity:.6;background:#211c27}.castle-seat>div:first-child{display:flex;flex-direction:column;gap:6px;margin-bottom:14px}.castle-seat strong{font-size:15px;overflow-wrap:anywhere;line-height:1.4}.castle-seat small{font-size:12px;letter-spacing:.5px;color:#afc5da}.castle-seat>span{font-size:13px;font-variant-numeric:tabular-nums;color:#c1d2e4;display:block;margin-top:8px}.castle-seat button{display:block;width:100%;margin-top:10px;padding:8px}.castle-health{height:7px;background:#0f1722;border-radius:5px;overflow:hidden}.castle-health>i{height:100%;background:#51c4ed;display:block;transition:width .4s}.castle-seat.purple .castle-health>i{background:#c381f6}.castle-vs{text-align:center;font-weight:800;color:#e1c6ff;font-size:17px}.castle-waiting{margin-bottom:18px}.castle-waiting h3{margin-bottom:8px}.castle-waiting p{color:#b9cce4}.castle-waiting small{display:block;font-size:14px;line-height:1.6;color:#b6c6db;margin-top:18px}.castle-field-wrap{position:relative;overflow:hidden;border-radius:12px;border:1px solid #657488;background:#172639;box-shadow:0 12px 28px #0004}.castle-field-wrap canvas{display:block;width:100%;height:auto;aspect-ratio:1200 / 680}.castle-field-status{position:absolute;top:15px;left:50%;transform:translateX(-50%);font-size:15px;font-weight:800;text-align:center;background:#111928d9;border:1px solid #8161ac;border-radius:7px;padding:9px 18px;max-width:80%;pointer-events:none}.castle-field-status:empty{display:none}.castle-lane-labels{position:absolute;inset:0;pointer-events:none}.castle-lane-labels span{position:absolute;left:50%;transform:translateX(-50%);font-size:12px;color:#e0edf6;background:#142430a6;padding:4px 10px;border-radius:4px}.castle-lane-labels span:nth-child(1){top:30%}.castle-lane-labels span:nth-child(2){top:54%}.castle-lane-labels span:nth-child(3){top:78%}.castle-command{margin:20px 0;background:#22283d;border-color:#716192}.castle-supply{display:flex;justify-content:space-between;gap:20px;align-items:center;padding-bottom:18px;border-bottom:1px solid #5b526d}.castle-supply span{font-size:14px;color:#b8c8df}.castle-supply>div>span{font-size:12px;letter-spacing:1px}.castle-supply strong{display:block;margin-top:6px;font-size:27px;color:#51ebad}.castle-deploy-controls{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-top:18px;flex-wrap:wrap}.castle-picked{display:flex;align-items:center;gap:14px;min-width:180px}.castle-picked .mob-icon{width:55px;height:55px}.castle-picked strong{font-size:17px;display:block}.castle-picked span:last-child{font-size:14px;color:#acbdd8;display:block;margin-top:5px}.castle-lane-buttons{display:flex;gap:7px}.castle-lane-buttons button{min-width:70px}#castle-deploy{min-width:160px;min-height:48px;justify-content:center}#castle-retry{margin-top:15px}.castle-troops{margin-top:24px}.castle-section-title label{font-size:14px;display:flex;align-items:center;gap:12px}.castle-section-title input{width:210px;font-size:15px;background:#111b28;border-color:#4c5e79}.castle-role-filters{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:20px}.castle-role-filters button{padding:7px 11px;min-height:36px;font-size:13px}.castle-troop-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.castle-troop{display:flex;align-items:center;gap:12px;text-align:left;background:#222f41;border:1px solid #485b78;color:white;padding:14px!important;min-width:0}.castle-troop>div{min-width:0}.castle-troop .mob-icon{width:60px;height:60px}.castle-troop strong{font-size:15px;display:block;line-height:1.4}.castle-troop>div>span{font-size:14px;color:#5be9b4;display:block;margin-top:5px}.castle-troop small{font-size:12px;display:block;margin-top:7px;color:#b2c3dc;line-height:1.6}.castle-troop p{font-size:13px;margin:8px 0 0;color:#bccbe0;line-height:1.5}.castle-troop.locked{opacity:.48}.castle-troop[hidden]{display:none!important}.castle-results{margin-top:22px;border-color:#649f8d;background:#17342f}.castle-results p{color:#c2d9d8}.castle-results>div{display:flex;gap:14px;flex-wrap:wrap}.castle-results>div>span{padding:12px 18px;background:#10241f;border:1px solid #44665f;border-radius:7px;font-size:14px;line-height:1.6}.castle-results .mine{border-color:#48e9ab}.castle-results strong{display:block;color:#54edb0;font-size:20px}
@media(max-width:1400px){.castle-troop-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.castle-troop{flex-direction:column;align-items:flex-start}.castle-troop .mob-icon{margin:auto}.castle-lobby-layout{grid-template-columns:300px minmax(0,1fr)}}
@media(max-width:950px){.castle-lobby-layout{grid-template-columns:minmax(0,1fr)}.castle-setup{display:block}.castle-roster-preview{grid-template-columns:repeat(6,minmax(0,1fr))}.castle-match-top{flex-wrap:wrap}.castle-team-list{grid-template-columns:1fr}.castle-supply{flex-wrap:wrap}.castle-field-status{font-size:14px;top:8px;padding:6px 12px}.castle-troop-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:600px){.castle-hero{min-height:230px;padding:24px;background-position:center}.castle-hero h2{font-size:35px}.castle-setup,.castle-open-battles,.castle-troops,.castle-command,.castle-results,.castle-waiting{padding:18px}.castle-players{gap:8px;grid-template-columns:minmax(0,1fr) 25px minmax(0,1fr)}.castle-seat{padding:12px}.castle-seat strong{font-size:14px}.castle-vs{font-size:13px}.castle-match-pot{gap:12px;padding:15px}.castle-match-pot strong{font-size:16px}.castle-match-pot span{font-size:12px}.castle-lane-labels{display:none}.castle-battle-row{gap:10px}.castle-row-mark{display:none}.castle-state{padding:5px;font-size:12px}.castle-roster-preview{grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.castle-troop-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.castle-deploy-controls{gap:15px}.castle-lane-buttons{width:100%}.castle-lane-buttons button{flex:1;min-width:0}#castle-deploy{width:100%}.castle-section-title label{width:100%;flex-wrap:wrap}.castle-section-title input{width:100%;box-sizing:border-box}.castle-field-status{max-width:88%;font-size:12px}.castle-rules{padding:16px}.castle-match-top{gap:12px}.castle-match-top>span{font-size:13px}.castle-troop p{font-size:13px}.castle-troop>div>span{font-size:13px}}
@media(prefers-reduced-motion:reduce){.castle-health>i{transition:none}}
.castle-current-battle{padding:18px;background:#152034;border:1px solid #72549b;border-radius:9px;margin:18px 0}.castle-current-battle>span{display:block;font-size:14px;color:#b7c5de}.castle-current-battle strong{display:block;font-size:21px;margin:8px 0;color:#e1c2ff}.castle-current-battle small{display:block;font-size:14px;line-height:1.6}.castle-battle-collection{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:28px}.castle-battle-card{display:flex;flex-direction:column;align-items:flex-start;background:#202e43;border:1px solid #566485;text-align:left;padding:18px!important;color:#edf2ff;min-width:0}.castle-battle-card .mob-icon{width:88px;height:88px;margin:0 auto 12px}.castle-battle-card strong{font-size:17px;line-height:1.4}.castle-battle-card>span:not(.mob-icon){font-size:17px;color:#64f0bb;margin-top:8px}.castle-battle-card small{font-size:14px;margin-top:8px;color:#c5d1e7}.castle-battle-card p{font-size:14px;margin-bottom:0;color:#c7d4e7}.castle-restrictions{border:1px solid #536784;padding:14px;border-radius:8px;font-size:14px}.castle-restrictions summary{cursor:pointer;font-weight:700;color:#d4b5ff}.castle-restrictions p{font-size:14px}.castle-ban-grid{display:grid;grid-template-columns:1fr;max-height:360px;overflow:auto;margin-bottom:14px}.castle-setup .castle-ban-grid label{display:flex;flex-wrap:nowrap;margin:0;padding:6px;border-bottom:1px solid #394862;font-size:14px}.castle-ban-grid .mob-icon{width:34px;height:34px;margin:0}.castle-ban-grid input{accent-color:#a66ef2;width:18px;height:18px;flex-shrink:0}.castle-seat .castle-seat-person{flex-direction:row;align-items:center;gap:10px}.castle-seat-person>div{min-width:0}.castle-seat-person small{display:block;margin-top:5px}.castle-seat .player-head{width:34px;height:34px;flex-shrink:0}.castle-map-tag{position:absolute;z-index:2;display:flex;align-items:center;gap:7px;background:#102336ed;border:1px solid #5cc6ef;border-radius:6px;padding:6px 8px;max-width:22%;box-sizing:border-box;pointer-events:none}.castle-map-tag.left{left:1%}.castle-map-tag.right{right:1%;background:#30213bed;border-color:#c586f7}.castle-map-tag>span:last-child{min-width:0}.castle-map-tag strong{font-size:13px;line-height:1.3;display:block;overflow-wrap:anywhere}.castle-map-tag small{font-size:12px;display:block;margin-top:3px;color:#bde3f4}.castle-map-tag .player-head{width:28px;height:28px;flex-shrink:0}.castle-map-tag.fallen{opacity:.6}.castle-seat-person .player-head img,.castle-map-tag .player-head img{image-rendering:pixelated}
@media(max-width:1200px){.castle-battle-collection{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.castle-battle-card{padding:14px!important}.castle-battle-card strong{font-size:15px}.castle-battle-card p{font-size:14px}.castle-seat .castle-seat-person{flex-wrap:wrap}.castle-map-tag{gap:3px;padding:3px;max-width:28%}.castle-map-tag strong{font-size:12px}.castle-map-tag small{display:none}.castle-map-tag .player-head{width:18px;height:18px}}

.castle-pending{padding:16px;background:#203b46;border:1px solid #4ca6a7;border-radius:8px;margin:0 0 20px}.castle-pending>strong{font-size:17px}.castle-pending p{font-size:14px;margin:8px 0 14px}.castle-pending button{width:100%;justify-content:center}.castle-pending small{display:block;margin-bottom:0}.castle-error{color:#ffbdbd!important;font-size:14px!important;line-height:1.5;padding:12px;background:#4c2331;border:1px solid #a65770;border-radius:7px}

.castle-assigned-lane{font-size:13px;color:#bbc7dd;padding:10px 14px;border:1px solid #364263;border-radius:10px}.castle-finish{position:relative;overflow:hidden;text-align:center;padding:80px 24px;min-height:480px;background:radial-gradient(ellipse at top,#393367 0%,#131c30 65%);border:1px solid #69719c;border-radius:22px}.castle-finish.winner{background:radial-gradient(ellipse at top,#22675b 0%,#131c30 70%);border-color:#52dbaa;box-shadow:0 0 60px #33d99c20}.castle-finish.defeat{background:radial-gradient(ellipse at top,#633750 0%,#131c30 70%)}.castle-finish h2{font-size:clamp(36px,7vw,76px);line-height:1.1;letter-spacing:-2px;margin:24px 0;color:#fff}.castle-finish.winner h2{color:#80ffc4}.castle-finish p{color:#c6d2e5;margin:14px 0}.castle-finish-amount{display:block;font-size:clamp(40px,7vw,72px);line-height:1.15;color:#fff;overflow-wrap:anywhere}.castle-finish-amount span{display:block;font-size:16px;letter-spacing:2px;color:#a8c6bd;margin-top:12px}.castle-finish-team{display:flex;justify-content:center;gap:10px;flex-wrap:wrap;margin:24px 0}.castle-finish-team span{background:#ffffff0c;border:1px solid #ffffff20;border-radius:30px;padding:10px 18px;overflow-wrap:anywhere}.castle-finish .primary{min-width:200px;min-height:50px;margin-top:18px}.castle-net{font-size:13px}@media(max-width:600px){.castle-finish{padding:50px 16px;min-height:420px}.castle-assigned-lane{order:3;width:100%;text-align:center}}

/* Keep the army and battlefield visible together. */
.castle-combat-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:18px;align-items:start}.castle-battle-column{position:sticky;top:18px;min-width:0}.castle-armory{display:flex;flex-direction:column;min-width:0;max-height:calc(100dvh - 100px);min-height:500px}.castle-armory .castle-command{margin:0 0 12px;padding:16px;flex-shrink:0}.castle-armory .castle-supply{gap:8px;padding-bottom:12px;align-items:start;flex-direction:column}.castle-armory .castle-supply strong{font-size:24px}.castle-armory .castle-supply>span{font-size:13px}.castle-armory .castle-deploy-controls{gap:10px;padding-top:12px}.castle-armory .castle-picked{width:100%}.castle-armory .castle-assigned-lane{padding:6px 10px;width:100%;text-align:center;box-sizing:border-box}.castle-armory #castle-deploy{width:100%}.castle-armory .castle-troops{display:flex;flex-direction:column;overflow:hidden;min-height:180px;padding:16px;flex:1}.castle-armory .castle-troops>.castle-small{display:none}.castle-armory .castle-section-title{gap:10px;margin-bottom:10px}.castle-armory .castle-section-title h3{font-size:18px}.castle-armory .castle-section-title label{display:block;width:100%;font-size:14px}.castle-armory .castle-section-title input{display:block;box-sizing:border-box;width:100%;min-width:0;margin-top:6px}.castle-armory .castle-role-filters{display:flex;gap:5px;overflow-x:auto;flex-wrap:nowrap;padding-bottom:8px;flex-shrink:0}.castle-armory .castle-role-filters button{padding:6px 10px;min-height:34px;flex-shrink:0;font-size:13px}.castle-armory .castle-troop-grid{display:grid;grid-template-columns:1fr;gap:8px;overflow-y:auto;overscroll-behavior:contain;scrollbar-gutter:stable;min-height:0;padding-right:4px}.castle-armory .castle-troop{padding:10px!important;display:flex;gap:10px;text-align:left;align-items:center}.castle-armory .castle-troop .mob-icon{width:46px;height:46px;margin:0;flex-shrink:0}.castle-armory .castle-troop strong{font-size:15px}.castle-armory .castle-troop small{display:none}.castle-armory .castle-troop p{font-size:13px;margin:4px 0 0;line-height:1.4}.castle-armory .castle-troop>div{min-width:0}.castle-screen [hidden]{display:none!important}.castle-combat-layout.live~.castle-rules{margin-top:18px}.castle-screen:has(.castle-combat-layout.live) .castle-seat{min-height:78px;padding:12px}.castle-screen:has(.castle-combat-layout.live) .castle-seat>span{font-size:12px}.castle-screen:has(.castle-combat-layout.live) .castle-seat-person{margin-bottom:8px}.castle-screen:has(.castle-combat-layout.live) .castle-match-pot{padding:12px 18px;margin-bottom:12px}.castle-screen:has(.castle-combat-layout.live) .castle-match-top{margin-bottom:12px}
@media(max-width:1000px){.castle-combat-layout{grid-template-columns:minmax(0,1fr) 280px;gap:12px}.castle-armory .castle-troop p{display:none}}@media(max-width:760px){.castle-combat-layout{display:flex;flex-direction:column;gap:12px}.castle-battle-column{position:sticky;top:0;z-index:3;width:100%;background:#111b2b}.castle-armory{width:100%;max-height:620px;min-height:0}.castle-armory .castle-command{margin-bottom:10px}.castle-armory .castle-supply{flex-direction:row;align-items:center}.castle-armory .castle-supply>span{max-width:45%}.castle-armory .castle-deploy-controls{display:grid;grid-template-columns:1fr 1fr}.castle-armory .castle-picked{min-width:0}.castle-armory .castle-assigned-lane{grid-column:1/-1;order:3}.castle-armory .castle-troop-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:260px}.castle-armory .castle-troops{flex:auto}.castle-armory .castle-troop{gap:6px}.castle-armory .castle-troop .mob-icon{width:36px;height:36px}.castle-armory .castle-troop strong{font-size:14px}}
.castle-combat-layout{container-type:inline-size}.castle-armory{position:sticky;top:18px;height:clamp(500px,calc((100cqw - 338px)*.5667),700px);max-height:none;min-height:0}.castle-armory .castle-command{padding:12px}.castle-armory .castle-supply{flex-direction:row;align-items:center;gap:8px;padding-bottom:10px}.castle-armory .castle-supply strong{font-size:21px}.castle-armory .castle-supply>span{font-size:12px;max-width:43%}.castle-armory .castle-deploy-controls{display:grid;grid-template-columns:minmax(0,1fr) 112px;gap:8px;padding-top:10px}.castle-armory .castle-picked{min-width:0;gap:8px}.castle-armory .castle-picked .mob-icon{width:32px;height:32px;margin:0}.castle-armory .castle-picked strong{font-size:14px}.castle-armory .castle-picked span:last-child{font-size:12px}.castle-armory .castle-assigned-lane{grid-column:1/-1;grid-row:2;font-size:12px}.castle-armory #castle-deploy{grid-column:2;grid-row:1;min-width:0;padding:8px;min-height:46px}.castle-armory .castle-troops{margin-top:0;min-height:0;padding:12px}.castle-armory .castle-troop{flex-direction:row;min-height:62px}.castle-armory .castle-troop p{display:none}.castle-armory .castle-section-title label{font-size:13px}.castle-armory .castle-section-title input{padding:8px;font-size:14px}.castle-armory .castle-role-filters button{min-height:30px}.castle-armory .castle-troop .mob-icon{width:38px;height:38px}
@media(max-width:1000px) and (min-width:761px){.castle-armory{height:clamp(480px,calc((100cqw - 292px)*.5667),650px)}}@media(max-width:760px){.castle-armory{position:static;height:auto;max-height:600px}.castle-armory .castle-deploy-controls{grid-template-columns:1fr 1fr}.castle-armory .castle-troops{min-height:300px}.castle-armory .castle-troop-grid{max-height:220px}.castle-armory .castle-troop strong{font-size:13px}}
@media(min-width:761px){.castle-armory .castle-troop-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}.castle-armory .castle-troop{gap:6px;padding:8px!important}.castle-armory .castle-troop .mob-icon{width:28px;height:28px}.castle-armory .castle-troop strong{font-size:14px;overflow-wrap:anywhere}.castle-armory .castle-troop>div>span{font-size:13px}}

#castle-queue-status{display:block;font-size:13px;color:#afddff;padding-top:8px;font-variant-numeric:tabular-nums}

.castle-current-battle>.mob-icon{width:104px;height:104px;margin:0 auto 12px}.castle-browse .castle-section-title>div{min-width:0}.castle-browse .castle-section-title p{font-size:14px;color:#b9c9df;margin:8px 0 0}.castle-browse #castle-new{background:#9c4ee8;border-color:#ca8bff;min-height:48px}.castle-browse .castle-battle-row>.mob-icon{width:84px;height:84px;margin:0;flex-shrink:0}.castle-browse .castle-pending{margin-bottom:24px}.castle-browse .castle-pending>.castle-battle-row{margin:12px 0 0}.castle-live-heading{margin-top:28px}#castle-browse{margin-bottom:20px}.castle-current-battle{text-align:center}@media(max-width:600px){.castle-browse{padding:16px}.castle-browse .castle-section-title{align-items:stretch}.castle-browse #castle-new{width:100%}.castle-browse .castle-battle-row{display:grid;grid-template-columns:58px minmax(0,1fr);gap:12px}.castle-browse .castle-battle-row>.mob-icon{width:58px;height:58px}.castle-browse .castle-state{grid-column:2;justify-self:start}.castle-browse .castle-battle-row small{font-size:12px}}

.castle-mode{grid-template-columns:1fr 1fr}.castle-players.ffa-players{grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}.ffa-players .castle-seat{padding:12px;min-width:0}.ffa-tag{right:auto!important;max-width:22%;box-sizing:border-box;background:#122232ed}.castle-targets{grid-column:1/-1;width:100%;display:grid;gap:6px}.castle-targets>span{font-size:11px;letter-spacing:1px;color:#c4d1e5}.castle-targets button{display:flex;align-items:center;gap:8px;text-align:left;padding:6px 8px!important;min-width:0}.castle-targets button>span{min-width:0;overflow-wrap:anywhere}.castle-targets small{display:block;font-size:11px;color:#bfcfe3}.castle-targets .player-head{width:22px;height:22px;flex-shrink:0}.castle-armory:has(.castle-targets){height:700px}.ffa-players .castle-seat:nth-child(3){border-color:#ffad62;background:#392c26}.ffa-players .castle-seat:nth-child(4){border-color:#65edac;background:#20372f}@media(max-width:760px){.castle-players.ffa-players{grid-template-columns:repeat(2,minmax(0,1fr))}.castle-armory:has(.castle-targets){height:auto;max-height:780px}.ffa-tag{max-width:24%;padding:4px!important}.ffa-tag strong{font-size:10px}.ffa-tag .player-head{display:none}.castle-targets{grid-template-columns:repeat(3,minmax(0,1fr))}.castle-targets>span{grid-column:1/-1}.castle-targets button{font-size:11px!important}.castle-targets small{display:none}}

/* Use the available desktop width for a readable arena and armory. */
/* Keep the troop picker level with the battlefield instead of ending early. */
#game-room[data-game="castle"]{max-width:none;width:100%;box-sizing:border-box;padding:24px clamp(16px,2vw,40px) 40px}.castle-combat-layout{grid-template-columns:minmax(0,1fr) clamp(360px,25vw,440px);gap:24px}.castle-armory,.castle-armory:has(.castle-targets){height:clamp(660px,calc(100dvh - 170px),920px);max-height:none}.castle-armory .castle-command{padding:20px;margin-bottom:16px}.castle-armory .castle-supply strong{font-size:30px}.castle-armory .castle-supply>span{font-size:14px;line-height:1.5}.castle-armory .castle-deploy-controls{grid-template-columns:minmax(0,1fr) 150px;gap:14px;padding-top:16px}.castle-armory .castle-picked .mob-icon{width:48px;height:48px}.castle-armory .castle-picked strong{font-size:17px}.castle-armory .castle-picked span:last-child{font-size:14px}.castle-armory #castle-deploy{min-height:56px;font-size:16px}.castle-targets{gap:8px;margin-top:6px}.castle-targets button{min-height:48px;padding:10px 12px!important;font-size:15px}.castle-targets .player-head{width:30px;height:30px}.castle-targets small{font-size:12px}.castle-armory .castle-troops{padding:18px}.castle-armory .castle-section-title h3{font-size:21px}.castle-armory .castle-section-title input{padding:12px;font-size:15px}.castle-armory .castle-role-filters button{min-height:38px;font-size:14px}.castle-armory .castle-troop{padding:12px!important;gap:10px;min-height:84px}.castle-armory .castle-troop .mob-icon{width:44px;height:44px}.castle-armory .castle-troop strong{font-size:16px}.castle-armory .castle-troop>div>span{font-size:14px}.castle-seat-person{gap:10px}.castle-players.ffa-players .castle-seat{padding:18px;min-height:108px}.castle-seat-person strong{font-size:16px;line-height:1.5}.castle-seat-person small{line-height:1.5;margin-top:6px}.castle-map-tag strong{font-size:14px}.ffa-tag{max-width:24%;padding:9px}.castle-armory .castle-troop-grid{gap:10px;padding-right:6px}
@media(max-width:1100px){.castle-combat-layout{grid-template-columns:minmax(0,1fr) 340px;gap:16px}.castle-armory .castle-deploy-controls{grid-template-columns:minmax(0,1fr) 130px}.castle-armory .castle-troop-grid{grid-template-columns:1fr}.castle-armory .castle-troop{min-height:70px}.castle-players.ffa-players{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){#game-room[data-game="castle"]{padding:16px 12px 28px}.castle-combat-layout{display:flex;gap:16px}.castle-armory,.castle-armory:has(.castle-targets){height:auto;max-height:850px;position:static}.castle-armory .castle-troop-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:340px}.castle-armory .castle-command{padding:16px}.castle-armory .castle-troop{padding:10px!important}.castle-armory .castle-troop .mob-icon{width:36px;height:36px}.castle-armory .castle-troop strong{font-size:14px}.castle-targets{grid-template-columns:1fr}.castle-targets small{display:block}.castle-players.ffa-players .castle-seat{padding:12px;min-height:90px}.ffa-tag{padding:4px;max-width:24%}.ffa-tag strong{font-size:10px}}

@media(min-width:761px){#game-room[data-game="castle"]{width:98%;margin-inline:auto}.castle-combat-layout{align-items:stretch}.castle-battle-column{align-self:start}.castle-armory,.castle-armory:has(.castle-targets){contain:size;height:auto;min-height:660px;align-self:stretch}.castle-armory .castle-troops{min-height:0;flex:1}.castle-armory .castle-troop-grid{flex:1;max-height:none;align-content:start}}

/* Bound the arena by viewport height on wide monitors, preserving the complete map. */
@media(min-width:1101px){#game-room[data-game="castle"]{width:96%;max-width:min(1800px,calc(max(480px,100dvh - 400px)*1.764706 + 448px));margin-inline:auto;padding:16px 24px 28px}.castle-combat-layout{grid-template-columns:minmax(0,1fr) 380px;gap:20px}.castle-armory,.castle-armory:has(.castle-targets){min-height:0;height:auto}.castle-screen:has(.castle-combat-layout.live) .castle-seat{min-height:78px;padding:12px}.castle-players.ffa-players .castle-seat{min-height:78px;padding:12px}.castle-battle-column{position:relative;top:auto}.castle-armory{position:relative;top:auto}}
@media(min-width:1101px) and (max-height:950px){.castle-armory .castle-command{padding:14px;margin-bottom:12px}.castle-armory .castle-supply strong{font-size:24px}.castle-armory .castle-deploy-controls{padding-top:10px;gap:10px}.castle-targets{gap:5px}.castle-targets button{min-height:38px;padding:6px 10px!important}.castle-targets .player-head{width:24px;height:24px}.castle-armory #castle-deploy{min-height:46px}.castle-armory .castle-troops{padding:14px}.castle-armory .castle-section-title h3{font-size:18px}.castle-armory .castle-section-title input{padding:8px}.castle-armory .castle-role-filters button{min-height:32px}.castle-armory .castle-troop{min-height:70px}}

/* The lobby is a centered menu, independent of the live arena's sizing. */
#game-room[data-game="castle"]:not(:has(.castle-combat-layout)){width:100%;max-width:1440px;margin-inline:auto;padding:28px 32px 40px}.castle-screen:not(:has(.castle-combat-layout)){max-width:1376px;margin-inline:auto}.castle-screen:not(:has(.castle-combat-layout)) .castle-hero{min-height:230px;padding:28px 32px}.castle-screen:not(:has(.castle-combat-layout)) .castle-hero h2{font-size:42px}.castle-screen:not(:has(.castle-combat-layout)) .castle-browse{padding:24px}@media(max-width:760px){#game-room[data-game="castle"]:not(:has(.castle-combat-layout)){padding:16px 12px 28px}.castle-screen:not(:has(.castle-combat-layout)) .castle-hero{padding:24px}.castle-screen:not(:has(.castle-combat-layout)) .castle-hero h2{font-size:35px}}

/* Deployment controls stay above the map; the side panel belongs to troop selection. */
.castle-battle-column>.castle-command{padding:16px;margin-bottom:16px}.castle-battle-column .castle-supply{display:flex;align-items:center;justify-content:space-between;gap:16px;padding-bottom:10px}.castle-battle-column .castle-supply strong{font-size:24px}.castle-battle-column .castle-supply>span{font-size:14px}.castle-battle-column .castle-deploy-controls{display:grid;grid-template-columns:minmax(0,1fr) 180px;gap:10px}.castle-battle-column .castle-picked{min-width:0;display:flex;align-items:center;gap:12px}.castle-battle-column .castle-picked .mob-icon{width:42px;height:42px;margin:0}.castle-battle-column .castle-picked span:last-child{font-size:14px}.castle-battle-column #castle-deploy{grid-column:2;grid-row:1;min-height:48px;justify-content:center}.castle-battle-column .castle-targets{grid-column:1/-1;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0}.castle-battle-column .castle-targets>span{grid-column:1/-1}.castle-battle-column .castle-targets button{min-height:42px;padding:8px!important;font-size:14px}.castle-battle-column #castle-queue-status{display:block;margin-top:8px;font-size:12px}.castle-armory .castle-troops{margin:0;min-height:360px;height:100%;flex:1}.castle-armory .castle-troop-grid{flex:1;min-height:220px;max-height:none}.castle-armory .castle-section-title,.castle-armory .castle-role-filters{flex-shrink:0}
@media(min-width:1101px){#game-room[data-game="castle"]:has(.castle-combat-layout){max-width:min(1800px,calc(max(360px,100dvh - 560px)*1.764706 + 448px))}.castle-armory{contain:size;min-height:0}.castle-armory .castle-troops{min-height:0}.castle-armory .castle-troop-grid{min-height:0}}@media(max-width:760px){.castle-battle-column .castle-deploy-controls{grid-template-columns:minmax(0,1fr) 130px}.castle-battle-column .castle-targets{gap:6px}.castle-battle-column .castle-targets .player-head{display:none}.castle-battle-column .castle-targets button{font-size:12px}.castle-armory .castle-troops{min-height:400px}.castle-armory .castle-troop-grid{max-height:400px}}

.castle-bot-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap;margin:12px 0 20px}.castle-bot-actions button{min-height:44px;padding:10px 20px}
