.menu-actions #stronghold-game {
  min-height: 50px;
  padding-left: 44px;
  border-color: rgba(231, 181, 92, .68) !important;
  background: linear-gradient(100deg, rgba(73, 48, 20, .95), rgba(20, 35, 39, .96));
  color: #f5dfad;
  justify-content: flex-start;
}
.menu-actions #stronghold-game::before {
  content: "" !important;
  position: absolute;
  left: 11px;
  top: 50%;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  background-image: url("./assets/modes/last-lab-tower-v1.png") !important;
  background-position: center !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  filter: drop-shadow(0 0 4px rgba(80,224,212,.55)) !important;
  opacity: 1 !important;
}
.menu-actions #stronghold-game::after { content: "→"; margin-left: auto; color: #eac779; }
.menu-actions #stronghold-game b { font: 800 13px var(--display); }
.menu-actions #stronghold-game em {
  margin-left: 7px;
  padding: 2px 5px;
  border: 1px solid #d9b45f;
  color: #f4d68f;
  font: 800 7px var(--ui);
  font-style: normal;
  letter-spacing: .1em;
}

#stronghold-screen {
  min-height: calc(100dvh - 68px);
  background: radial-gradient(circle at 50% 44%, #193235 0, #081317 58%, #040a0d 100%);
  color: #e8dfca;
  overflow: hidden;
}
.stronghold-hud {
  height: 82px;
  display: grid;
  grid-template-columns: 170px minmax(260px, 1fr) 135px 170px auto;
  align-items: center;
  padding: 0 28px;
  border-bottom: 1px solid #75623d;
  background-image: repeating-linear-gradient(90deg, transparent 0 63px, rgba(197,162,100,.025) 64px), linear-gradient(180deg, #101d22, #081216);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
}
.stronghold-hud > div { min-width: 0; padding: 0 22px; border-left: 1px solid rgba(197,162,100,.18); }
.stronghold-hud > div:first-child { padding-left: 0; border-left: 0; }
.stronghold-hud small { color: #8f897b; font-size: 9px; letter-spacing: .12em; }
.stronghold-wave strong { display: flex; align-items: baseline; gap: 4px; margin-top: 4px; color: #f0e3c7; font: 700 28px var(--display); white-space: nowrap; }
.stronghold-wave i { flex: 0 0 auto; color: #77746d; font: 400 12px var(--ui); white-space: nowrap; }
.stronghold-health { position: relative; }
.stronghold-health > div:first-child { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stronghold-health span { color: #a7a092; font-size: 11px; }
.stronghold-health b { color: #e9d79f; font-size: 14px; transition: color .18s,text-shadow .18s; }
.stronghold-meter { height: 14px; margin-top: 9px; border: 1px solid #9e883d; background: #172126; overflow: hidden; }
.stronghold-meter [data-sh-hpbar] { display: block; width: 100%; height: 100%; background: #f4ce46; transition: width .15s linear; }
.stronghold-health.is-hit { animation: stronghold-hit .38s ease; }
@keyframes stronghold-critical { 50% { filter: brightness(1.55); } }
@keyframes stronghold-hit { 35% { background: rgba(226,66,55,.26); box-shadow: 0 0 18px rgba(226,66,55,.28); } }
.stronghold-stat small,.stronghold-stat b { display: block; }
.stronghold-stat b { margin-top: 5px; color: #e8d49d; font: 700 17px var(--display); white-space: nowrap; }
.stronghold-speed { display: flex; gap: 5px; border-left: 0 !important; padding-right: 0 !important; }
.stronghold-speed button { min-width: 45px; height: 44px; border: 1px solid #4e4c43; background: #0a1519; color: #aaa397; }
.stronghold-speed button.active { border-color: #d5b56c; background: #27312c; color: #f0d99f; box-shadow: inset 0 0 0 1px rgba(213,181,108,.22); }

.stronghold-stage { position: relative; height: calc(100dvh - 68px - 82px); overflow: hidden; }
.stronghold-stage canvas { display: block; width: 100%; height: 100%; touch-action: manipulation; image-rendering: pixelated; cursor: crosshair; }
.stronghold-arena-label {
  position: absolute; z-index: 3; left: 22px; top: 18px; display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border: 1px solid rgba(112,154,143,.28); background: rgba(5,15,18,.76); pointer-events: none;
}
.stronghold-arena-label > span { width: 8px; height: 8px; background: #67d8c1; box-shadow: 0 0 8px #67d8c1; }
.stronghold-arena-label b { color: #d8c18a; font: 400 11px var(--display); letter-spacing: .13em; }
.stronghold-arena-label small { color: #82958f; font-size: 9px; }
.stronghold-field-enemies { display: none; }
.stronghold-start {
  position: absolute; z-index: 7; left: 50%; bottom: 112px; transform: translateX(-50%); width: min(420px, calc(100% - 40px));
  min-height: 62px; padding: 10px 24px; border: 1px solid #dfc176; background: linear-gradient(100deg,#ead69f,#cbae67); color: #171916;
  box-shadow: 5px 5px 0 rgba(0,0,0,.48); text-align: left;
}
.stronghold-start b,.stronghold-start span { display: block; }
.stronghold-start b { font: 800 16px var(--display); }
.stronghold-start span { margin-top: 4px; font-size: 10px; color: #4d493d; }
.stronghold-manage-hint {
  position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, 72px); display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid rgba(102,218,194,.42); background: rgba(4,18,22,.84); color: #bcebe1; font-size: 10px;
}
.stronghold-manage-hint span { color: #68d9c1; }
.stronghold-loadout {
  position: absolute; z-index: 6; left: 50%; bottom: 16px; width: min(720px, calc(100% - 40px)); min-height: 78px; transform: translateX(-50%);
  display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 8px; align-items: stretch; padding: 8px;
  border: 1px solid rgba(190,157,88,.74); background: linear-gradient(145deg,rgba(8,24,28,.97),rgba(5,14,18,.97)); box-shadow: 7px 7px 0 rgba(0,0,0,.42);
}
.stronghold-loadout > header { display: flex; flex-direction: column; justify-content: center; padding: 0 7px; border-right: 1px solid rgba(189,154,83,.25); }
.stronghold-loadout > header small { color: #6ea496; font-size: 7px; letter-spacing: .12em; }
.stronghold-loadout > header b { margin-top: 5px; color: #e7d6ae; font: 700 12px var(--display); }
.stronghold-loadout > header span { margin-top: 6px; color: #6f8f88; font-size: 7px; }
.stronghold-loadout-slots { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; min-width: 0; }
.stronghold-loadout-slots button { position: relative; min-width: 0; display: flex; align-items: center; gap: 6px; overflow: hidden; padding: 5px; border: 1px solid color-mix(in srgb,var(--weapon,#4e6865) 58%,#314947); background: #09171b; text-align: left; }
.stronghold-loadout-slots button::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--weapon,#314947); opacity: .72; }
.stronghold-loadout-slots img { flex: 0 0 44px; width: 44px; height: 52px; object-fit: contain; object-position: center; border: 1px solid rgba(255,255,255,.1); background:#101b1f; }
.stronghold-loadout-slots .slot-copy { min-width: 0; }
.stronghold-loadout-slots .slot-copy b,.stronghold-loadout-slots .slot-copy small,.stronghold-loadout-slots .slot-copy em { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stronghold-loadout-slots .slot-copy b { color: #e1d6c1; font-size: 9px; }
.stronghold-loadout-slots .slot-copy small { margin-top: 3px; color: #7f9b94; font-size: 7px; }
.stronghold-loadout-slots .slot-copy em { margin-top: 4px; color: var(--weapon,#69d7bf); font: 700 8px var(--ui); font-style: normal; }
.stronghold-loadout-slots button.empty { display: grid; grid-template-columns: 1fr; place-items: center; gap: 0; color: #57726e; text-align: center; }
.stronghold-loadout-slots .slot-index { position: absolute; left: 5px; top: 4px; color: #536e69; font: 700 6px var(--ui); }
.stronghold-loadout-slots button.empty b { color: #66827d; font: 400 21px var(--ui); }
.stronghold-loadout-slots button.empty small { color: #59736f; font-size: 7px; }
.stronghold-reward { position:absolute; z-index:18; left:50%; top:50%; width:min(420px,calc(100% - 28px)); transform:translate(-50%,-50%); padding:18px; border:1px solid #c9a65d; background:linear-gradient(145deg,rgba(15,35,41,.99),rgba(5,14,18,.99)); box-shadow:10px 10px 0 rgba(0,0,0,.58),0 0 40px rgba(75,211,193,.1); text-align:center; }
.stronghold-reward::before { content:""; position:fixed; inset:0; z-index:-1; background:rgba(1,7,9,.72); backdrop-filter:blur(2px); }
.stronghold-reward header small { color:#6cd3c0; font-size:8px; letter-spacing:.18em; }
.stronghold-reward h2 { margin:6px 0 0; color:#f0deb4; font:800 21px var(--display); }
.stronghold-reward header p { margin:7px 0 0; color:#91aaa4; font-size:9px; }
.stronghold-reward-wheel { position:relative; width:176px; height:176px; margin:12px auto 8px; }
.stronghold-reward-wheel::before { content:""; position:absolute; z-index:2; left:50%; top:-5px; transform:translateX(-50%); width:0; height:0; border-left:8px solid transparent; border-right:8px solid transparent; border-top:17px solid #f4d681; filter:drop-shadow(0 2px 2px #000); }
.stronghold-reward-wheel span { position:absolute; z-index:2; inset:8%; border-radius:50%; box-shadow:0 0 30px rgba(62,224,202,.14); pointer-events:none; }
.stronghold-reward-wheel img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; image-rendering:pixelated; }
.stronghold-wheel-frame { z-index:0; filter:drop-shadow(0 7px 6px rgba(0,0,0,.55)); }
.stronghold-wheel-rotor { z-index:1; clip-path:circle(32% at 50% 46.5%); transform-origin:50% 46.5%; }
.stronghold-reward-wheel.is-spinning .stronghold-wheel-rotor { animation:stronghold-wheel-spin 1.4s cubic-bezier(.12,.72,.12,1) forwards; }
@keyframes stronghold-wheel-spin { from{transform:rotate(0)} to{transform:rotate(1800deg)} }
.stronghold-reward-result { margin:8px 0 10px; padding:10px; border:1px solid color-mix(in srgb,var(--reward-color) 70%,#344); background:color-mix(in srgb,var(--reward-color) 8%,#09171b); }
.stronghold-reward-result small,.stronghold-reward-result b,.stronghold-reward-result p { display:block; }
.stronghold-reward-result small { color:var(--reward-color); font-size:7px; letter-spacing:.14em; }
.stronghold-reward-result b { margin-top:5px; color:#f3e6c9; font:800 16px var(--display); }
.stronghold-reward-result p { margin:5px 0 0; color:#a2b4af; font-size:8px; line-height:1.5; }
.stronghold-reward-spin,.stronghold-reward-continue { width:100%; min-height:42px; border:1px solid #d5b469; background:linear-gradient(100deg,#ead69f,#cbae67); color:#171916; font:800 12px var(--display); }
.stronghold-reward-spin:disabled { filter:saturate(.35); color:#514c40; }
.stronghold-reward-note { display:block; margin-top:8px; color:#788e89; font-size:7px; }
.stronghold-wave-banner {
  position: absolute; z-index: 7; left: 50%; top: 80px; transform: translateX(-50%); min-width: 280px; padding: 13px 24px;
  border: 1px solid #bda05f; background: rgba(6,17,20,.94); box-shadow: 4px 4px 0 rgba(0,0,0,.45); text-align: center;
}
.stronghold-wave-banner b,.stronghold-wave-banner span { display: block; }
.stronghold-wave-banner b { color: #ecd398; font: 700 16px var(--display); }
.stronghold-wave-banner span { margin-top: 4px; color: #9daca8; font-size: 10px; }

.stronghold-research {
  position: absolute; z-index: 10; left: 50%; top: 50%; width: min(760px,calc(100% - 40px)); transform: translate(-50%,-58%);
  padding: 17px; border: 1px solid #b99b5c; background: linear-gradient(145deg,rgba(16,37,42,.98),rgba(6,15,19,.99)); box-shadow: 9px 9px 0 rgba(0,0,0,.5);
}
.stronghold-research > header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stronghold-research > header small { color: #69cbb8; font-size: 8px; letter-spacing: .16em; }
.stronghold-research > header h2 { margin: 5px 0 0; color: #f0dfbb; font: 700 20px var(--display); }
.stronghold-research > header > span { padding: 5px 8px; border: 1px solid rgba(221,111,91,.46); color: #e89d8e; font-size: 8px; }
.stronghold-research > p { margin: 10px 0 13px; color: #8ea19c; font-size: 9px; }
.stronghold-research-options { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.stronghold-research-options button { min-width: 0; min-height: 126px; padding: 12px; border: 1px solid color-mix(in srgb,var(--research) 65%,#344b49); border-top: 3px solid var(--research); background: rgba(7,21,25,.94); text-align: left; }
.stronghold-research-options button:hover { background: color-mix(in srgb,var(--research) 9%,#0a181c); box-shadow: inset 0 0 20px color-mix(in srgb,var(--research) 12%,transparent); }
.stronghold-research-options small,.stronghold-research-options b,.stronghold-research-options span,.stronghold-research-options em { display: block; }
.stronghold-research-options small { color: var(--research); font-size: 7px; letter-spacing: .1em; }
.stronghold-research-options b { margin-top: 10px; color: #eee1c9; font: 700 13px var(--display); }
.stronghold-research-options span { margin-top: 8px; color: #9db0ab; font-size: 9px; line-height: 1.45; }
.stronghold-research-options em { margin-top: 13px; color: var(--research); font-size: 8px; font-style: normal; }
.stronghold-research-options .stronghold-exclusive-augment { border-color: var(--research); background: radial-gradient(circle at 85% 12%,color-mix(in srgb,var(--research) 20%,transparent),transparent 42%),#071519; box-shadow: inset 0 0 24px color-mix(in srgb,var(--research) 8%,transparent); }
.stronghold-research-options .stronghold-exclusive-augment small::before { content:'◆ '; }
.stronghold-research-options .stronghold-exclusive-augment.is-awakening { border-width: 2px; border-top-width: 4px; background: radial-gradient(circle at 82% 12%,color-mix(in srgb,var(--research) 34%,transparent),transparent 46%),linear-gradient(135deg,color-mix(in srgb,var(--research) 12%,#071519),#071519 65%); box-shadow: inset 0 0 32px color-mix(in srgb,var(--research) 16%,transparent),0 0 16px color-mix(in srgb,var(--research) 18%,transparent); }
.stronghold-research-options .stronghold-exclusive-augment.is-awakening small::before { content:'✦ '; }

.stronghold-management {
  position: absolute; z-index: 12; right: 0; top: 0; bottom: 0; width: min(440px, 92vw); display: flex; flex-direction: column;
  border-left: 1px solid #a98c50; background: linear-gradient(145deg,#14262d,#081317 74%); box-shadow: -15px 0 35px rgba(0,0,0,.55);
  transform: translateX(103%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
}
.stronghold-management.is-open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.stronghold-management > header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 17px 18px; border-bottom: 1px solid rgba(197,162,100,.3); }
.stronghold-management > header small { color: #bd9f5f; font-size: 8px; letter-spacing: .17em; }
.stronghold-management > header h2 { margin: 5px 0 0; color: #eadfca; font: 700 19px var(--display); }
.stronghold-management > header button { width: 37px; height: 37px; border: 1px solid #46595a; background: #0a171c; color: #d9cfba; font-size: 24px; }
.stronghold-management-body { min-height: 0; overflow: auto; padding: 14px 14px 60px; }
.stronghold-tower-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid #79663d; background: rgba(28,45,47,.72); }
.stronghold-tower-card span,.stronghold-tower-card b { display: block; }
.stronghold-tower-card span { color: #82a099; font-size: 8px; letter-spacing: .12em; }
.stronghold-tower-card b { margin-top: 5px; color: #ecd69f; font: 700 16px var(--display); }
.stronghold-panel-fund { padding-left: 12px; border-left: 1px solid rgba(197,162,100,.24); }
.stronghold-panel-fund b { color: #f1ca70; }
.stronghold-tower-card button { min-height: 40px; padding: 5px 10px; border: 1px solid #a98b4d; background: #182c2d; color: #e4d1a3; font-size: 10px; }
.stronghold-tower-card button small { display: block; margin-top: 3px; color: #a18b5b; font-size: 8px; }
.stronghold-mode-rule { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 7px; padding: 8px 10px; border: 1px solid rgba(95,136,130,.28); background: rgba(6,19,23,.62); }
.stronghold-mode-rule b { color: #d7c393; font-size: 9px; }
.stronghold-mode-rule span { color: #889d97; font-size: 8px; text-align: right; }
.stronghold-core-summary,.stronghold-synergy-summary { margin-top: 8px; padding: 10px; border: 1px solid color-mix(in srgb,var(--core,#5f7772) 62%,#273b39); border-left: 3px solid var(--core,#5f7772); background: rgba(8,24,27,.78); }
.stronghold-core-summary small,.stronghold-core-summary b,.stronghold-core-summary span,.stronghold-synergy-summary small,.stronghold-synergy-summary b,.stronghold-synergy-summary span { display:block; }
.stronghold-core-summary small,.stronghold-synergy-summary small { color:var(--core,#69cbb8); font-size:7px; letter-spacing:.14em; }
.stronghold-core-summary b { margin-top:5px; color:#ebd99f; font-size:12px; }
.stronghold-core-summary span { margin-top:4px; color:#9cafaa; font-size:9px; line-height:1.45; }
.stronghold-protocol-summary { margin-top:8px; padding:10px; border:1px solid rgba(105,203,184,.28); background:rgba(7,20,24,.76); }
.stronghold-protocol-summary > small { color:#69cbb8; font-size:7px; letter-spacing:.14em; }
.stronghold-protocol-summary > div { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:8px; }
.stronghold-protocol-summary article { min-width:0; padding:7px 8px; border-left:2px solid #4f625f; background:rgba(19,35,38,.72); }
.stronghold-protocol-summary article.active { border-color:var(--protocol); box-shadow:inset 0 0 15px color-mix(in srgb,var(--protocol) 7%,transparent); }
.stronghold-protocol-summary b,.stronghold-protocol-summary span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stronghold-protocol-summary b { color:#d5d0c1; font-size:8px; }
.stronghold-protocol-summary article.active b { color:var(--protocol); }
.stronghold-protocol-summary span { margin-top:4px; color:#82958f; font-size:7px; }
.stronghold-synergy-summary { border-color:rgba(217,178,91,.38); border-left-color:#d9b25b; }
.stronghold-synergy-summary > small { color:#d9b25b; }
.stronghold-synergy-summary p { margin:8px 0 0; padding-top:7px; border-top:1px solid rgba(217,178,91,.16); }
.stronghold-synergy-summary p b { color:#f0d691; font-size:10px; }
.stronghold-synergy-summary p span { margin-top:3px; color:#9eaaa5; font-size:8px; line-height:1.4; }
.stronghold-synergy-summary p.is-hidden { border-color:color-mix(in srgb,var(--hidden) 35%,transparent); box-shadow:inset 2px 0 0 var(--hidden); padding-left:8px; }
.stronghold-synergy-summary p.is-hidden b { color:var(--hidden); text-shadow:0 0 10px color-mix(in srgb,var(--hidden) 55%,transparent); }
.stronghold-panel-section { margin-top: 14px; }
.stronghold-panel-section > header { margin-bottom: 8px; }
.stronghold-panel-section h3 { margin: 0; color: #e5dbc6; font-size: 13px; }
.stronghold-panel-section > header small { display: block; margin-top: 4px; color: #748884; font-size: 9px; }
.stronghold-upgrade-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }
.stronghold-upgrade-grid button { min-width: 0; min-height: 74px; padding: 9px; border: 1px solid #3f5552; background: #0d1c20; text-align: left; }
.stronghold-upgrade-grid button span,.stronghold-upgrade-grid button b,.stronghold-upgrade-grid button small { display: block; }
.stronghold-upgrade-grid button span { color: #cfc6b4; font-size: 10px; }
.stronghold-upgrade-grid button i { float: right; color: #68cfbb; font-size: 8px; font-style: normal; }
.stronghold-upgrade-grid button b { margin-top: 6px; overflow: hidden; color: #e5cd8e; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.stronghold-upgrade-grid button small { margin-top: 7px; color: #819690; font-size: 9px; }
.stronghold-upgrade-grid button:not(:disabled):hover { border-color: #c1a25b; background: #16282a; }
.stronghold-slots { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; }
.stronghold-slots button { min-width: 0; height: 57px; display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid #354c4c; background: #09161a; text-align: left; }
.stronghold-slots button.selected { border-color: #d5b25f; box-shadow: inset 0 0 0 1px rgba(213,178,95,.25); }
.stronghold-slots img { width: 38px; height: 43px; object-fit: cover; object-position: top; image-rendering: auto; }
.stronghold-slots span { min-width: 0; }
.stronghold-slots b,.stronghold-slots small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stronghold-slots b { color: #d9d0bd; font-size: 10px; }
.stronghold-slots small { margin-top: 5px; color: #7ebfac; font-size: 8px; }
.stronghold-slots .empty-slot { width: 100%; color: #657b78; font: 700 14px var(--display); text-align: center; }
.stronghold-slots .empty-slot small { color: #657b78; }
.stronghold-equipped-detail { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; margin-top: 7px; padding: 7px 8px; border: 1px solid rgba(93,147,136,.38); background: rgba(16,37,39,.68); }
.stronghold-equipped-detail > div { min-width: 0; }
.stronghold-equipped-detail b { color: #dfd4bf; font-size: 10px; }
.stronghold-equipped-detail p { margin: 4px 0 0; color: #80938f; font-size: 8px; line-height: 1.4; }
.stronghold-equipped-detail button { width: auto; min-width: 108px; min-height: 42px; display: grid; place-content: center; gap: 5px; padding: 6px 9px; border: 1px solid #b59855; background: #233532; color: #e8cf91; text-align: center; }
.stronghold-equipped-detail button strong { display: block; font-size: 10px; line-height: 1; white-space: nowrap; }
.stronghold-equipped-detail button small { display: flex; align-items: center; justify-content: center; gap: 6px; color: #aa925d; font-size: 7px; line-height: 1; white-space: nowrap; }
.stronghold-equipped-detail button small i { color: #d6bd7e; font-style: normal; }
.stronghold-evolution-options { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; margin-top:7px; }
.stronghold-evolution-options button { min-width:0; min-height:70px; padding:8px; border:1px solid #9c7ec5; background:linear-gradient(145deg,rgba(43,30,58,.9),rgba(9,23,27,.96)); text-align:left; }
.stronghold-evolution-options small,.stronghold-evolution-options b,.stronghold-evolution-options span { display:block; }
.stronghold-evolution-options small { color:#bba2df; font-size:6px; letter-spacing:.12em; }
.stronghold-evolution-options b { margin-top:5px; color:#f0ddff; font-size:10px; }
.stronghold-evolution-options span { margin-top:4px; color:#9c93a8; font-size:8px; line-height:1.4; }
.stronghold-scientist-list { display: grid; gap: 6px; }
.stronghold-scientist-list article { display: grid; grid-template-columns: 47px 1fr 64px; gap: 8px; align-items: center; min-height: 66px; padding: 7px; border: 1px solid #334848; border-left: 2px solid var(--weapon); background: rgba(8,20,24,.86); }
.stronghold-scientist-list img { width: 47px; height: 52px; object-fit: cover; object-position: top; }
.stronghold-scientist-list article > div { min-width: 0; }
.stronghold-scientist-list b,.stronghold-scientist-list span { display: block; }
.stronghold-scientist-list b { color: #ddd3c0; font-size: 10px; }
.stronghold-scientist-list span { margin-top: 3px; color: var(--weapon); font-size: 9px; }
.stronghold-scientist-list p { margin: 4px 0 0; color: #748782; font-size: 8px; line-height: 1.35; }
.stronghold-scientist-list button { min-height: 37px; padding: 3px; border: 1px solid var(--weapon); background: #132124; color: #d9c68e; font-size: 8px; }
.stronghold-management button:disabled { opacity: .42; filter: grayscale(.6); cursor: default; }
.stronghold-recruit > button { width:100%; min-height:48px; padding:10px; border:1px solid #d5b25f; background:#d6bd79; color:#111d20; font-weight:800; }
.stronghold-recruit-choices { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; margin:8px 0; }
.stronghold-recruit-choices button { position:relative; min-width:0; min-height:154px; padding:7px; overflow:hidden; border:1px solid var(--weapon); background:linear-gradient(180deg,color-mix(in srgb,var(--weapon) 10%,#102126),#091418); text-align:left; }
.stronghold-recruit-choices img { width:100%; height:84px; padding:2px; object-fit:contain; object-position:center; background:#071216; opacity:.96; }
.stronghold-recruit-choices small,.stronghold-recruit-choices b,.stronghold-recruit-choices span,.stronghold-recruit-choices em { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stronghold-recruit-choices small { margin-top:5px; color:var(--weapon); font-size:7px; }
.stronghold-recruit-choices b { margin-top:4px; color:#ebe0c9; font-size:10px; }
.stronghold-recruit-choices span { margin-top:3px; color:#9fb0ab; font-size:8px; }
.stronghold-recruit-choices em { margin-top:5px; color:#f0ca70; font-size:7px; font-style:normal; }
.stronghold-recruit > p,.stronghold-empty-inventory { color:#a4b9b0; font-size:11px; line-height:1.6; }
.stronghold-equipped-detail p { font-size:11px; line-height:1.7; color:#becbc5; }
.stronghold-equipped-detail p strong { color:#f3d78e; }
.stronghold-scientist-list p { font-size:10px; line-height:1.6; color:#a6bbb2; }
.stronghold-presets > div { display:grid; gap:6px; }
.stronghold-presets article { display:grid; grid-template-columns:minmax(0,1fr) 78px; gap:6px; }
.stronghold-presets article > button { min-width:0; min-height:46px; padding:8px 10px; border:1px solid #3f5f59; background:#0a1a1e; color:#d9cfba; text-align:left; }
.stronghold-presets article > button:first-child b,.stronghold-presets article > button:first-child span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.stronghold-presets article > button:first-child b { color:#ebd28f; font-size:10px; }
.stronghold-presets article > button:first-child span { margin-top:5px; color:#89a49d; font-size:8px; }
.stronghold-presets article > button:last-child { border-color:#806d43; color:#d8bf80; font-size:8px; text-align:center; }
.stronghold-presets article > button:not(:disabled):hover { border-color:#d0ae5f; background:#13272a; }
.stronghold-build-summary { margin-top:18px; padding:12px; border:1px solid #425a52; background:#0b1b20; }
.stronghold-build-summary h3 { color:#e7cf91; font-size:12px; }
.stronghold-build-summary p { color:#a4b9b0; font-size:11px; line-height:1.6; }
.stronghold-build-summary .stronghold-augment-summary { padding-left:8px; border-left:2px solid #79e6d4; color:#bfe8df; }
@media(min-width:761px) and (max-width:1150px){
 .stronghold-hud{grid-template-columns:100px minmax(150px,1fr) auto;padding:0 16px;}
 .stronghold-stat{display:none;}
 .stronghold-hud > div{padding-left:12px;padding-right:12px;}
 .stronghold-health > div:first-child > span{display:none;}
}

.stronghold-end {
  position: absolute; z-index: 15; left: 50%; top: 50%; width: min(480px, calc(100% - 32px)); transform: translate(-50%,-50%);
  padding: 28px; border: 1px solid #b59a5e; background: rgba(8,20,25,.97); box-shadow: 8px 8px 0 rgba(0,0,0,.55); text-align: center;
}
.stronghold-end > small { color: #b99854; font-size: 9px; letter-spacing: .18em; }
.stronghold-end h2 { margin: 10px 0; color: #ecdfc4; font: 700 23px var(--display); }
.stronghold-end p { color: #91a29e; font-size: 11px; line-height: 1.6; }
.stronghold-end > div { display: flex; justify-content: center; gap: 26px; margin: 20px 0; }
.stronghold-end > div span { color: #81918d; font-size: 10px; }
.stronghold-end > div b { display: block; margin-top: 4px; color: #e2ca8b; font: 700 20px var(--display); }
.stronghold-end footer { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stronghold-end footer button { min-height: 45px; border: 1px solid #58645d; background: #0d191d; color: #d6cdbb; }
.stronghold-end footer .primary { border-color: #d4b66d; background: #ddc686; color: #171915; }

@media (min-width:761px){
  #menu-screen .menu-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  #menu-screen .menu-actions #new-game,#menu-screen .menu-actions #stronghold-game { grid-column: 1 / -1; }
  #menu-screen .menu-actions #stronghold-game { min-width: 0; padding-left: 44px; }
  #menu-screen .menu-actions #continue-game,#menu-screen .menu-actions #infinite-game { min-width: 0; }
}

@media (max-width:760px){
  #menu-screen .menu-actions #stronghold-game { grid-column: 1 / -1; min-width: 0; min-height: 50px; padding: 0 12px 0 48px; }
  #menu-screen .menu-actions #stronghold-game b { font-size: 13px; }
  #menu-screen .menu-actions #stronghold-game::after,#menu-screen .menu-actions #stronghold-game em { display: none; }
  #menu-screen .menu-actions #stronghold-game::before { left: 11px; }
  #stronghold-screen { min-height: calc(100dvh - 52px); }
  .stronghold-hud { position: relative; height: 76px; grid-template-columns: 68px minmax(0,1fr) 132px; align-items: center; padding: 8px; }
  .stronghold-hud > div { min-height: 52px; padding: 3px 6px 0; }
  .stronghold-wave strong { margin-top: 2px; gap: 2px; font-size: 19px; }
  .stronghold-wave i { font-size: 10px; }
  .stronghold-wave small { font-size: 6px; }
  .stronghold-health > div:first-child { display: block; }
  .stronghold-health > div:first-child > span { display: none; }
  .stronghold-health b { font-size: 9px; white-space: nowrap; }
  .stronghold-meter { height: 14px; margin-top: 7px; }
  .stronghold-stat { display: none; }
  .stronghold-speed { position: static; z-index: auto; width: auto; display: grid; grid-column: 3; grid-row: 1; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 3px; min-height: 52px !important; padding: 8px 0 0 6px !important; border-left: 1px solid rgba(197,162,100,.18) !important; }
  .stronghold-speed button { min-width: 0; width: auto; height: 33px; background: rgba(7,18,21,.94); font-size: 9px; }
  .stronghold-stage { height: calc(100dvh - 52px - 76px); }
  .stronghold-stage canvas { height: 100%; }
  .stronghold-arena-label { left: 8px; top: 8px; padding: 6px 8px; }
  .stronghold-arena-label b { font-size: 7px; }
  .stronghold-arena-label small { display: none; }
  .stronghold-field-enemies { position: absolute; z-index: 4; right: 8px; top: 8px; display: flex; align-items: center; gap: 7px; min-height: 29px; padding: 5px 9px; border: 1px solid rgba(219,91,79,.48); background: rgba(25,12,13,.84); pointer-events: none; }
  .stronghold-field-enemies span { color: #ba8379; font-size: 7px; letter-spacing: .1em; }
  .stronghold-field-enemies b { color: #f08b79; font: 700 12px var(--display); }
  .stronghold-start { bottom: 116px; min-height: 54px; padding: 8px 18px; }
  .stronghold-start b { font-size: 13px; }
  .stronghold-loadout { left: 7px; right: 7px; bottom: 7px; width: auto; min-height: 98px; transform: none; grid-template-columns: minmax(0,1fr); grid-template-rows: 20px 68px; gap: 4px; padding: 5px; box-shadow: none; }
  .stronghold-loadout > header { grid-column: 1; grid-row: 1; flex-direction: row; align-items: center; justify-content: flex-start; gap: 7px; padding: 0 4px; border-right: 0; }
  .stronghold-loadout > header small { font-size: 5px; }
  .stronghold-loadout > header b { margin: 0; font-size: 9px; }
  .stronghold-loadout > header span { margin:0 0 0 auto; font-size:6px; }
  .stronghold-loadout-slots { grid-column: 1; grid-row: 2; gap: 4px; }
  .stronghold-loadout-slots button { display: block; padding: 3px; text-align: center; }
  .stronghold-loadout-slots img { width: 100%; height: 57px; object-fit: contain; object-position: center; }
  .stronghold-loadout-slots .slot-copy b,.stronghold-loadout-slots .slot-copy small { display: none; }
  .stronghold-loadout-slots .slot-copy em { position: absolute; left: 2px; right: 2px; bottom: 3px; margin: 0; padding: 2px 0; background: rgba(3,12,15,.88); font-size: 6px; text-align: center; }
  .stronghold-loadout-slots button.empty b { margin-top: 10px; font-size: 17px; }
  .stronghold-loadout-slots button.empty small { font-size: 5px; }
  .stronghold-management { top: 8%; bottom: 0; width: 100%; border: 1px solid #9b814b; border-bottom: 0; transform: translateY(104%); }
  .stronghold-management.is-open { transform: translateY(0); }
  .stronghold-management > header { padding: 13px 14px; }
  .stronghold-management > header h2 { font-size: 16px; }
  .stronghold-management-body { padding: 10px 10px 44px; }
  .stronghold-tower-card { gap: 8px; padding: 10px; }
  .stronghold-tower-card b { font-size: 12px; }
  .stronghold-panel-fund { padding-left: 8px; }
  .stronghold-tower-card button { padding: 5px 7px; font-size: 8px; }
  .stronghold-scientist-list article { grid-template-columns: 41px 1fr 58px; }
  .stronghold-scientist-list img { width: 41px; height: 48px; }
  .stronghold-recruit-choices button { min-height:142px; }
  .stronghold-recruit-choices img { height:76px; }
  .stronghold-wave-banner { top: 58px; min-width: 250px; padding: 10px 16px; }
  .stronghold-research { left: 8px; right: 8px; top: 44px; bottom: 142px; width: auto; transform: none; overflow: auto; padding: 12px; box-shadow: 5px 5px 0 rgba(0,0,0,.48); }
  .stronghold-research > header h2 { font-size: 15px; }
  .stronghold-research > header > span { font-size: 7px; }
  .stronghold-research > p { margin: 8px 0 9px; font-size: 8px; }
  .stronghold-research-options { grid-template-columns: 1fr; gap: 6px; }
  .stronghold-research-options button { min-height: 72px; padding: 8px 10px; }
  .stronghold-research-options b { margin-top: 5px; font-size: 11px; }
  .stronghold-research-options span { margin-top: 4px; font-size: 8px; }
  .stronghold-research-options em { margin-top: 6px; font-size: 7px; }
  .stronghold-mode-rule { align-items: flex-start; flex-direction: column; }
  .stronghold-mode-rule span { text-align: left; }
  .stronghold-end { padding: 22px 16px; }
  .stronghold-reward { width:calc(100% - 22px); padding:14px 13px; }
  .stronghold-reward h2 { font-size:17px; }
  .stronghold-reward-wheel { width:140px; height:140px; margin:9px auto 6px; }
  .stronghold-reward-result { margin:6px 0 8px; padding:8px; }
}

#menu-screen .menu-actions #stronghold-game {
 grid-column:auto;min-width:0;min-height:50px;padding:0 5px;justify-content:center;white-space:nowrap;
}
#menu-screen .menu-actions #stronghold-game::before,#menu-screen .menu-actions #stronghold-game::after {display:none;}
#menu-screen .menu-actions #event-game {
 grid-column:1 / -1;
 justify-content:flex-start;
 padding-left:48px;
}
.auction-entry,.auction-room{display:grid;gap:12px;padding:10px;}
.auction-entry input{display:block;width:100%;margin-top:6px;padding:10px;font-size:16px;}
.auction-bids{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;}
.auction-room button,.auction-entry button{min-height:42px;}
#panel:has(.lot-board){width:min(560px,calc(100vw - 20px));max-height:calc(100dvh - 20px);border:1px solid #b69661;border-radius:5px;background:linear-gradient(145deg,#182b33,#0b171b 70%);box-shadow:0 24px 80px #000b,0 0 0 3px #0b171b}
#panel:has(.lot-board)::backdrop{background:#03090dd9;backdrop-filter:blur(3px)}
#panel:has(.lot-board) .dialog-head{padding:13px 16px;background:#162832;border-bottom-color:#a687515c}
#panel:has(.lot-board) .dialog-head h2{margin:0;font-size:21px;color:#f1dba9}
#panel:has(.lot-board) #panel-content{padding:14px 16px 16px}
#panel:has(.lot-board) #close-panel{display:none}
#panel:has(.lot-board) .dialog-head>div{min-width:0}
#panel:has(.lot-board) .dialog-head .auction-skip{flex:none;min-height:38px;padding:6px 10px;border:1px solid #a58b60;border-radius:3px;background:#263337;color:#ead4a3;font:700 12px var(--display);white-space:nowrap}
#panel:has(.lot-board) .dialog-head .auction-skip:disabled{opacity:.55;cursor:default}
.auction-room.lot-board{gap:9px;padding:0;color:#ebe4d3;font-variant-numeric:tabular-nums}
.lot-top,.lot-wallet,.lot-offer{display:flex;align-items:center;justify-content:space-between;gap:8px}
.lot-top strong{font-size:13px;color:#e5d4ad}.lot-wallet span,.lot-board [data-score]{font-size:11px}
.lot-top [data-time]{padding:5px 8px;border:1px solid #ad885b70;background:#b5925b18;border-radius:3px;color:#f4d18c;font-size:12px;white-space:nowrap}
.lot-meter{height:4px;background:#30404a;border-radius:4px;overflow:hidden}.lot-meter i{display:block;height:100%;background:linear-gradient(90deg,#a57b43,#f0ca82)}
.lot-card{display:grid;grid-template-columns:96px minmax(0,1fr);align-items:center;gap:14px;min-height:116px;padding:10px;border:1px solid #756344;background:linear-gradient(115deg,#342b21,#19272a 65%,#142126)}
.lot-art{height:94px;display:grid;place-items:center;background:#101a1c;border:1px solid #806d4a}
.lot-art img{width:100%;height:92px;object-fit:contain;image-rendering:pixelated}
.lot-info{min-width:0}.lot-card small{color:#d7b474;font-size:12px}.lot-card h3{font-size:clamp(17px,4vw,22px);line-height:1.35;margin:6px 0;overflow-wrap:anywhere}
.lot-board .lot-card{border-color:var(--lot-color,#756344);background:linear-gradient(115deg,color-mix(in srgb,var(--lot-color,#756344) 16%,#182429),#19272a 65%,#142126)}
.lot-board .lot-art{border-color:color-mix(in srgb,var(--lot-color,#806d4a) 70%,#19272a);box-shadow:inset 0 0 15px color-mix(in srgb,var(--lot-color,#806d4a) 12%,transparent)}
.lot-board .lot-card small{color:var(--lot-color,#d7b474)}
.lot-board .lot-card h3{color:color-mix(in srgb,var(--lot-color,#e5e4dc) 65%,#fff)}
.lot-board .lot-meter i{background:linear-gradient(90deg,color-mix(in srgb,var(--lot-color,#a57b43) 75%,#314149),var(--lot-color,#f0ca82))}
.lot-board.lot-singularity .lot-card,.lot-board.lot-singularity .lot-art{animation:singularity-frame 4.5s linear infinite}
.lot-board.lot-singularity .lot-card small,.lot-board.lot-singularity .lot-card h3{
 background:linear-gradient(90deg,#ff516d,#ffd45b,#66f7a1,#55cfff,#aa72ff,#ff62d4,#ff516d);
 background-size:260% 100%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;
 animation:singularity-grade 3s linear infinite;font-weight:800;
}
.lot-board.lot-singularity .lot-meter i{background:linear-gradient(90deg,#ff6387,#ffd45b,#61edb3,#55cfff,#aa72ff,#ff62d4)}
@media(prefers-reduced-motion:reduce){.lot-board.lot-singularity .lot-card,.lot-board.lot-singularity .lot-art,.lot-board.lot-singularity .lot-card small,.lot-board.lot-singularity .lot-card h3{animation:none}}
.lot-offer{min-height:62px;padding:10px 12px;border-left:3px solid #e1bb72;background:#e1bb7210}.lot-offer strong{color:#f7d791;font-size:27px;white-space:nowrap}.lot-offer span{font-size:13px;color:#d5ded9}
.lot-wallet{color:#bfc9c3;padding:0 2px}.lot-wallet span:last-child{color:#f1dfb3}
.auction-history{display:flex;align-items:center;gap:6px;min-height:32px;overflow-x:auto;white-space:nowrap;color:#8eaaa8;font-size:11px;scrollbar-width:thin}
.auction-history span{padding:5px 7px;border:1px solid #536264;background:#1e3034;border-radius:3px;color:#cbd7d1}.auction-history .mine{border-color:#a88b56;color:#f3d28b}
.lot-board .auction-bids button{min-height:49px;background:#22363a;border:1px solid #68807a;font-weight:700;font-size:15px}
.lot-board .auction-bids button:active{background:#35514c}.lot-board .auction-bids button:last-child{border-color:#b39660;color:#f2d394;background:#483a2638}.lot-board button:disabled{opacity:.42}
.lot-board [data-score]{text-align:center;color:#9eb1ad}
@media(max-width:750px){#panel:has(.lot-board) .dialog-head{padding:10px 12px}#panel:has(.lot-board) #panel-content{padding:10px 12px 12px}.auction-room.lot-board{gap:7px}.lot-card{grid-template-columns:78px minmax(0,1fr);min-height:94px;gap:10px;padding:8px}.lot-art{height:78px}.lot-art img{height:76px}.lot-card h3{font-size:17px}.lot-offer{min-height:55px;padding:8px 10px}.lot-offer strong{font-size:23px}.lot-board .auction-bids button{min-height:45px;font-size:14px}}
@media(max-height:620px){.auction-room.lot-board{gap:5px}.lot-card{grid-template-columns:58px minmax(0,1fr);min-height:64px}.lot-art,.lot-art img{height:56px}.lot-offer{min-height:45px}.lot-board .auction-bids button{min-height:40px}.auction-history{min-height:25px}}
@media (max-width:374px){
  .stronghold-hud { grid-template-columns: 62px minmax(88px,1fr) 128px; }
  .stronghold-hud > div { padding-left: 4px; padding-right: 4px; }
  .stronghold-health b { font-size: 8px; }
  .stronghold-speed { padding-left: 4px !important; }
  .stronghold-speed button { font-size: 8px; }
}
