/* ==========================================================================
   HALLOWHOST — game UI: menus, setup screens, battle HUD, results.
   ========================================================================== */

.hh-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hh-center-row { justify-content: center; margin: 18px 0 8px; }
.hh-small { font-size: 0.92rem; }
.hh-dim { color: var(--hh-text-faint); font-family: var(--hh-font-body); text-transform: none; letter-spacing: 0; }
.hh-banner-icon { display: inline-block; margin-right: 6px; filter: drop-shadow(0 0 6px var(--army, #d9a441)); }
.hh-btn-big { padding: 14px 30px; font-size: 1.05rem; }
.hh-btn-huge { padding: 18px 46px; font-size: 1.35rem; min-width: 300px; }
.hh-select-sm { padding: 3px 6px; font-size: 0.9rem; }
.hh-section-title { font-family: var(--hh-font-head); color: var(--hh-gold); font-size: 1rem; letter-spacing: 0.18em; text-transform: uppercase; border-bottom: 1px solid rgba(217, 164, 65, 0.25); padding-bottom: 6px; margin: 4px 0 14px; }
.hh-check-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; cursor: pointer; }
.hh-versus { text-align: center; font-family: var(--hh-font-display); color: var(--hh-blood-hi); letter-spacing: 0.3em; text-transform: uppercase; font-size: 0.9rem; margin: 10px 0; text-shadow: 0 0 12px rgba(255, 74, 74, 0.5); }
kbd { font-family: var(--hh-font-head); font-size: 0.8rem; padding: 1px 6px; border: 1px solid var(--hh-iron-hi); border-bottom-width: 2px; border-radius: 3px; background: rgba(0, 0, 0, 0.4); color: var(--hh-parchment); }

/* ---------------------------------------------------------------- page header */

.hh-page-header { display: flex; align-items: center; gap: 18px; margin-bottom: 22px; max-width: 1400px; margin-left: auto; margin-right: auto; }
.hh-page-title { font-family: var(--hh-font-display); color: var(--hh-gold); font-size: clamp(1.6rem, 3.4vw, 2.6rem); margin: 0; text-shadow: 0 2px 0 #000, 0 0 30px rgba(255, 122, 24, 0.25); }
.hh-back { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 2rem; text-decoration: none; color: var(--hh-gold); border: 1px solid var(--hh-gold-dim); background: rgba(0, 0, 0, 0.4); border-radius: 50%; transition: all 0.15s; }
.hh-back:hover { color: #fff; box-shadow: var(--hh-glow-gold); }
.hh-header-action { margin-left: auto; }
.hh-fullscreen { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.hh-fullscreen-icon { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hh-page-header .hh-fullscreen { margin-left: auto; flex: none; }
.hh-page-header .hh-header-action ~ .hh-fullscreen { margin-left: 0; }

.hh-page { background: radial-gradient(ellipse at 50% -10%, rgba(80, 60, 140, 0.25), transparent 55%), radial-gradient(ellipse at 50% 120%, rgba(255, 110, 20, 0.12), transparent 50%), var(--hh-bg); }
.hh-page > .hh-panel, .hh-page > div:not(.hh-page-header) { max-width: 1400px; margin-left: auto; margin-right: auto; }
.hh-page .hh-panel { margin-bottom: 18px; }

/* ---------------------------------------------------------------- home */

.hh-home { position: absolute; inset: 0; overflow: hidden; background: var(--hh-bg); }
.hh-home-battle { position: absolute; inset: 0; pointer-events: none; }
.hh-home-menu { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 34px; transition: opacity 1.2s ease; z-index: 5; padding: 20px; }
.hh-home.attract .hh-home-menu { background: radial-gradient(ellipse at center, rgba(7, 6, 11, 0.55), rgba(7, 6, 11, 0.1) 70%); }
.hh-home.menu-hidden .hh-home-menu { opacity: 0; pointer-events: none; }
.hh-home-logo { margin: 0; text-transform: uppercase; font-family: var(--hh-font-display); font-weight: 900; font-size: clamp(3rem, 10vw, 7.5rem); letter-spacing: 0.08em; text-align: center; line-height: 1; color: transparent; background: linear-gradient(180deg, #ffe7a8 0%, #f6b542 40%, #c4500e 75%, #6e1a05 100%); -webkit-background-clip: text; background-clip: text; filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 40px rgba(255, 122, 24, 0.45)); animation: hh-logo-breathe 6s ease-in-out infinite; }
.hh-home-logo-pre { display: block; font-size: 0.42em; letter-spacing: 0.3em; margin-bottom: 0.08em; }
.hh-home-tag { text-align: center; font-family: var(--hh-font-head); letter-spacing: 0.4em; text-transform: uppercase; color: var(--hh-text-dim); font-size: clamp(0.7rem, 1.5vw, 1rem); margin-top: 10px; }
.hh-home-main { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.hh-home-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; }
.hh-home-links a { font-family: var(--hh-font-head); letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.95rem; text-decoration: none; color: var(--hh-text-dim); transition: color 0.15s, text-shadow 0.15s; }
.hh-home-links a:hover { color: var(--hh-gold-hi); text-shadow: 0 0 12px rgba(255, 179, 71, 0.6); }
.hh-attract-watch { position: absolute; bottom: 26px; }
@keyframes hh-logo-breathe { 0%, 100% { filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 30px rgba(255, 122, 24, 0.35)); } 50% { filter: drop-shadow(0 4px 0 #000) drop-shadow(0 0 60px rgba(255, 122, 24, 0.6)); } }

/* backdrop */
.hh-backdrop { position: absolute; inset: 0; overflow: hidden; }
.hh-bd-sky { position: absolute; inset: 0; background: linear-gradient(180deg, #05040c 0%, #120c26 45%, #2b1530 75%, #3d1a12 100%); }
.hh-bd-stars { position: absolute; inset: 0 0 40% 0; background-image: radial-gradient(1px 1px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 8%, #ddd, transparent), radial-gradient(1.5px 1.5px at 55% 25%, #fff, transparent), radial-gradient(1px 1px at 70% 12%, #ccd, transparent), radial-gradient(1px 1px at 85% 30%, #fff, transparent), radial-gradient(1px 1px at 20% 40%, #bbb, transparent), radial-gradient(1px 1px at 92% 6%, #fff, transparent), radial-gradient(1px 1px at 45% 45%, #aab, transparent); animation: hh-twinkle 5s ease-in-out infinite alternate; }
/* The moon: the real near side, a breathing glow, a pale halo ring tinged a sickly green that drifts towards violet,
   and two veils of mist turning opposite ways round it. Clouds drift across in front. */
.hh-bd-moon { position: absolute; width: clamp(140px, 18vw, 260px); aspect-ratio: 1; right: 14%; top: 9%; pointer-events: none; }
.hh-bd-moon-disc { position: absolute; inset: 0; border-radius: 50%; background: url('img/moon.webp') center / cover no-repeat, #d8cdb2; animation: hh-moon-breathe 9s ease-in-out infinite; }
.hh-bd-moon-halo { position: absolute; inset: -80%; border-radius: 50%; mix-blend-mode: screen;
    background: radial-gradient(circle, rgba(255, 238, 200, 0.26) 0, rgba(255, 214, 160, 0.12) 24%, transparent 40%),
                radial-gradient(circle, transparent 41%, rgba(170, 255, 205, 0.08) 44.5%, rgba(205, 255, 225, 0.2) 46.5%, rgba(180, 150, 255, 0.1) 49.5%, transparent 55%);
    animation: hh-halo-pulse 8s ease-in-out infinite, hh-halo-hue 26s ease-in-out infinite alternate; }
.hh-bd-moon-mist { position: absolute; inset: -42%; border-radius: 50%; mix-blend-mode: screen; filter: blur(12px);
    background: conic-gradient(from 0deg, transparent 0 6%, rgba(160, 255, 200, 0.32) 13%, transparent 22% 38%, rgba(185, 155, 255, 0.28) 47%, transparent 57% 69%, rgba(160, 255, 210, 0.26) 78%, transparent 88%);
    -webkit-mask: radial-gradient(circle, transparent 33%, #000 39%, #000 55%, transparent 71%); mask: radial-gradient(circle, transparent 33%, #000 39%, #000 55%, transparent 71%);
    animation: hh-mist-turn 46s linear infinite; }
.hh-bd-moon-mist.m2 { inset: -62%; filter: blur(18px); opacity: 0.75; animation-duration: 71s; animation-direction: reverse; }
@keyframes hh-moon-breathe {
    0%, 100% { box-shadow: 0 0 38px rgba(255, 240, 205, 0.45), 0 0 120px rgba(255, 210, 150, 0.2); }
    50% { box-shadow: 0 0 56px rgba(255, 244, 215, 0.6), 0 0 170px rgba(200, 255, 220, 0.24); }
}
@keyframes hh-halo-pulse { 0%, 100% { opacity: 0.6; transform: scale(0.97); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes hh-halo-hue { from { filter: hue-rotate(0deg); } to { filter: hue-rotate(-55deg); } }
@keyframes hh-mist-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .hh-bd-moon * { animation: none !important; } }
.hh-bd-cloud { position: absolute; height: 60px; border-radius: 50px; background: rgba(20, 14, 34, 0.75); filter: blur(10px); animation: hh-drift linear infinite; }
.hh-bd-cloud.c1 { width: 420px; top: 18%; animation-duration: 90s; }
.hh-bd-cloud.c2 { width: 300px; top: 28%; animation-duration: 120s; animation-delay: -50s; opacity: 0.7; }
.hh-bd-cloud.c3 { width: 520px; top: 10%; animation-duration: 150s; animation-delay: -100s; opacity: 0.5; }
.hh-bd-skyline { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 75%; }
.hh-bd-window { animation: hh-flicker 3s infinite; }
.hh-bd-window.w2 { animation-delay: -1.2s; } .hh-bd-window.w3 { animation-delay: -2.1s; }
.hh-bd-glow { filter: drop-shadow(0 0 6px #ff9d3a); animation: hh-flicker 2.2s infinite; }
.hh-bd-glow.w2 { animation-delay: -0.7s; } .hh-bd-glow.w3 { animation-delay: -1.5s; }
.hh-bd-fog { position: absolute; left: -20%; right: -20%; height: 30%; bottom: 0; background: radial-gradient(ellipse at 30% 80%, rgba(120, 110, 160, 0.22), transparent 60%), radial-gradient(ellipse at 75% 90%, rgba(120, 110, 160, 0.18), transparent 55%); animation: hh-fog 30s ease-in-out infinite alternate; }
.hh-bd-fog.f2 { animation-duration: 45s; animation-direction: alternate-reverse; bottom: -5%; opacity: 0.8; }
.hh-bd-bat { position: absolute; font-size: 22px; filter: brightness(0) drop-shadow(0 0 2px rgba(255, 200, 150, 0.3)); animation: hh-bat 18s linear infinite; }
.hh-bd-bat.b1 { top: 22%; } .hh-bd-bat.b2 { top: 32%; animation-duration: 24s; animation-delay: -8s; font-size: 16px; } .hh-bd-bat.b3 { top: 15%; animation-duration: 30s; animation-delay: -15s; font-size: 13px; }
@keyframes hh-drift { from { transform: translateX(-40vw); } to { transform: translateX(140vw); } }
@keyframes hh-twinkle { from { opacity: 0.6; } to { opacity: 1; } }
@keyframes hh-flicker { 0%, 100% { opacity: 1; } 45% { opacity: 0.75; } 50% { opacity: 0.4; } 55% { opacity: 0.9; } }
@keyframes hh-fog { from { transform: translateX(-4%); } to { transform: translateX(4%); } }
@keyframes hh-bat { 0% { transform: translate(-10vw, 0) scale(1); } 25% { transform: translate(25vw, -4vh) scale(0.9); } 50% { transform: translate(55vw, 3vh) scale(1.05); } 75% { transform: translate(85vw, -3vh) scale(0.95); } 100% { transform: translate(115vw, 1vh) scale(1); } }

/* ---------------------------------------------------------------- play hub */

.hh-mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.hh-mode-card { position: relative; display: block; padding: 26px 24px; min-height: 190px; text-decoration: none; color: var(--hh-text); background: linear-gradient(160deg, rgba(40, 30, 54, 0.9), rgba(12, 9, 18, 0.95)); border: 1px solid var(--hh-iron-hi); box-shadow: var(--hh-shadow); overflow: hidden; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.hh-mode-card::after { content: ''; position: absolute; inset: auto -30% -60% auto; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, var(--accent), transparent 65%); opacity: 0.18; transition: opacity 0.2s; }
.hh-mode-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 30px color-mix(in srgb, var(--accent) 35%, transparent); }
.hh-mode-card:hover::after { opacity: 0.35; }
.hh-mode-icon { font-size: 2.6rem; filter: drop-shadow(0 0 12px var(--accent)); }
.hh-mode-name { font-family: var(--hh-font-display); font-size: 1.45rem; color: var(--hh-gold-hi); margin: 10px 0 6px; }
.hh-mode-desc { color: var(--hh-text-dim); line-height: 1.45; position: relative; z-index: 1; }

/* ---------------------------------------------------------------- setup */

.hh-setup-grid { display: grid; grid-template-columns: 300px minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.hh-setup-grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .hh-setup-grid, .hh-setup-grid.two { grid-template-columns: 1fr; } }
.hh-presets { display: flex; flex-direction: column; gap: 6px; max-height: calc(100vh - 160px); overflow-y: auto; }
.hh-preset { display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 9px 10px; background: rgba(0, 0, 0, 0.25); border: 1px solid transparent; color: var(--hh-text); cursor: pointer; font-family: var(--hh-font-body); transition: all 0.12s; }
.hh-preset:hover { border-color: var(--hh-iron-hi); background: rgba(255, 255, 255, 0.04); }
.hh-preset.on { border-color: var(--hh-gold); background: rgba(217, 164, 65, 0.08); }
.hh-preset b { display: block; font-family: var(--hh-font-head); font-size: 1rem; color: var(--hh-gold-hi); }
.hh-preset small { color: var(--hh-text-dim); font-size: 0.9rem; line-height: 1.3; }
.hh-preset-icon { font-size: 1.6rem; width: 32px; text-align: center; }
.hh-army-slot { display: flex; gap: 14px; padding: 14px; margin-bottom: 8px; background: linear-gradient(90deg, color-mix(in srgb, var(--army) 18%, transparent), rgba(0, 0, 0, 0.25) 60%); border: 1px solid color-mix(in srgb, var(--army) 45%, #000); border-left: 4px solid var(--army); }
.hh-army-slot-banner { font-size: 3rem; width: 64px; text-align: center; filter: drop-shadow(0 0 14px var(--army)); }
.hh-army-slot-body { flex: 1; min-width: 0; }
.hh-army-select { width: 100%; font-family: var(--hh-font-head); font-size: 1.05rem; color: #fff; margin: 4px 0 8px; }
.hh-army-desc { color: var(--hh-text-dim); font-size: 1rem; line-height: 1.4; }
.hh-army-cmd { margin-top: 6px; font-size: 0.98rem; }
.hh-army-cmd b { color: var(--army); }
.hh-army-meta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-top: 10px; font-size: 0.92rem; color: var(--hh-text-dim); }
.hh-army-meta label { display: flex; gap: 6px; align-items: center; }
.hh-bf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.hh-bf { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--hh-iron); color: var(--hh-text-dim); cursor: pointer; font-family: var(--hh-font-head); font-size: 0.8rem; letter-spacing: 0.04em; transition: all 0.12s; }
.hh-bf:hover { color: var(--hh-text); border-color: var(--hh-iron-hi); }
.hh-bf.on { color: #fff; border-color: var(--hh-gold); background: rgba(217, 164, 65, 0.1); box-shadow: inset 0 0 18px rgba(217, 164, 65, 0.15); }
.hh-bf-icon { font-size: 1.5rem; }
.hh-options-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.hh-setup-actions { display: flex; flex-direction: column; align-items: stretch; gap: 10px; margin-top: 18px; }
.hh-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--hh-iron-hi); width: fit-content; }
.hh-seg button { padding: 8px 14px; background: rgba(0, 0, 0, 0.35); color: var(--hh-text-dim); border: none; border-right: 1px solid var(--hh-iron); cursor: pointer; font-family: var(--hh-font-head); font-size: 0.9rem; }
.hh-seg button:last-child { border-right: none; }
.hh-seg button.on { background: linear-gradient(180deg, #a2410d, #5c1f07); color: #fff; }

/* ---------------------------------------------------------------- daily / history / stats / bestiary / settings */

.hh-daily { text-align: center; max-width: 900px !important; }
.hh-daily-vs { display: flex; align-items: center; justify-content: center; gap: 30px; flex-wrap: wrap; }
.hh-daily-army { flex: 1; min-width: 240px; padding: 16px; }
.hh-daily-banner { font-size: 4rem; filter: drop-shadow(0 0 20px var(--army)); }
.hh-daily-name { font-family: var(--hh-font-display); font-size: 1.5rem; color: var(--army); margin: 8px 0; }
.hh-daily-where { font-family: var(--hh-font-head); letter-spacing: 0.08em; color: var(--hh-parchment); margin-top: 10px; }
.hh-empty { text-align: center; }
.hh-history { display: flex; flex-direction: column; gap: 8px; }
.hh-history-row { cursor: pointer; padding: 12px 18px; margin-bottom: 0 !important; border-left: 3px solid var(--hh-iron-hi); }
.hh-history-row.won { border-left-color: var(--hh-ok); }
.hh-history-row.lost { border-left-color: var(--hh-blood); }
.hh-history-when { font-size: 0.88rem; color: var(--hh-text-faint); }
.hh-history-armies { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--hh-font-head); margin: 4px 0; }
.hh-history-army { color: var(--hh-text-dim); }
.hh-history-army.won { color: var(--army); text-shadow: 0 0 10px color-mix(in srgb, var(--army) 50%, transparent); }
.hh-history-meta { font-size: 0.95rem; color: var(--hh-text-dim); }
.hh-history-detail { margin-top: 10px; }
.hh-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.hh-table th { font-family: var(--hh-font-head); font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--hh-gold); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--hh-iron-hi); }
.hh-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.hh-stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hh-big-stat { text-align: center; margin-bottom: 0 !important; }
.hh-big-stat b { display: block; font-family: var(--hh-font-display); font-size: 2rem; color: var(--hh-gold-hi); }
.hh-big-stat small { color: var(--hh-text-dim); letter-spacing: 0.1em; text-transform: uppercase; font-family: var(--hh-font-head); font-size: 0.8rem; }
.hh-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.hh-tab { padding: 8px 20px; font-family: var(--hh-font-head); letter-spacing: 0.1em; background: rgba(0, 0, 0, 0.35); color: var(--hh-text-dim); border: 1px solid var(--hh-iron); cursor: pointer; }
.hh-tab.on { color: #fff; border-color: var(--hh-gold); background: rgba(217, 164, 65, 0.12); }
.hh-unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; margin-bottom: 18px; }
.hh-unit-card { margin-bottom: 0 !important; padding: 14px 16px; }
.hh-unit-head { display: flex; gap: 12px; align-items: center; }
.hh-unit-head b { display: block; font-family: var(--hh-font-head); color: var(--hh-gold-hi); }
.hh-unit-head small { color: var(--hh-text-faint); font-size: 0.88rem; }
.hh-unit-icon { font-size: 2rem; }
.hh-unit-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.95rem; color: var(--hh-parchment); }
.hh-unit-traits { margin-top: 6px; font-size: 0.88rem; color: var(--hh-ghost-dim); }
.hh-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 18px; align-items: start; }

/* ================================================================ battle */

.hh-battle { position: absolute; inset: 0; overflow: hidden; background: #000; user-select: none; }
.hh-battle-host { position: absolute; inset: 0; }
.hh-battle-attract .hh-battle-host { pointer-events: none; }
.hh-battle-error { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 640px; z-index: 30; }
.hh-battle-error pre { white-space: pre-wrap; max-height: 200px; overflow: auto; font-size: 0.75rem; color: var(--hh-text-dim); }

/* loading */
.hh-loading { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 35%, rgba(80, 60, 140, 0.3), transparent 60%), #07060b; }
.hh-loading-inner { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 20px; }
/* The menu's real moon (img/moon.webp) in miniature, with the same ghostly ring and turning mist. */
.hh-loading-moon { position: relative; width: 110px; height: 110px; margin: 18px 0 8px; border-radius: 50%; background: url('img/moon.webp') center / cover no-repeat, #d8cdb2; box-shadow: 0 0 50px rgba(255, 240, 205, 0.5), 0 0 110px rgba(200, 255, 220, 0.18); animation: hh-moon-pulse 3s ease-in-out infinite; }
.hh-loading-moon::before { content: ''; position: absolute; inset: -55%; z-index: -1; border-radius: 50%; mix-blend-mode: screen;
    background: radial-gradient(circle, transparent 41%, rgba(170, 255, 205, 0.1) 44.5%, rgba(205, 255, 225, 0.24) 46.5%, rgba(180, 150, 255, 0.12) 49.5%, transparent 55%);
    animation: hh-halo-pulse 8s ease-in-out infinite, hh-halo-hue 26s ease-in-out infinite alternate; }
.hh-loading-moon::after { content: ''; position: absolute; inset: -38%; z-index: -1; border-radius: 50%; mix-blend-mode: screen; filter: blur(8px);
    background: conic-gradient(from 0deg, transparent 0 6%, rgba(160, 255, 200, 0.32) 13%, transparent 22% 38%, rgba(185, 155, 255, 0.28) 47%, transparent 57% 69%, rgba(160, 255, 210, 0.26) 78%, transparent 88%);
    -webkit-mask: radial-gradient(circle, transparent 33%, #000 39%, #000 55%, transparent 71%); mask: radial-gradient(circle, transparent 33%, #000 39%, #000 55%, transparent 71%);
    animation: hh-mist-turn 30s linear infinite; }
@media (prefers-reduced-motion: reduce) { .hh-loading-moon, .hh-loading-moon::before, .hh-loading-moon::after { animation: none; } }
.hh-loading-vs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; font-family: var(--hh-font-display); font-size: clamp(1.2rem, 3vw, 2rem); }
.hh-loading-army { color: var(--army); text-shadow: 0 0 20px color-mix(in srgb, var(--army) 50%, transparent), 0 2px 0 #000; }
.hh-loading-versus { font-family: var(--hh-font-head); font-size: 0.88rem; letter-spacing: 0.4em; color: var(--hh-blood-hi); text-transform: uppercase; }
.hh-loading-where { font-family: var(--hh-font-head); color: var(--hh-text-dim); letter-spacing: 0.12em; }
.hh-loading-bar { width: min(420px, 80vw); height: 6px; border: 1px solid var(--hh-gold-dim); background: rgba(0, 0, 0, 0.5); }
.hh-loading-fill { height: 100%; background: linear-gradient(90deg, var(--hh-blood), var(--hh-pumpkin)); box-shadow: 0 0 12px var(--hh-pumpkin); transition: width 0.3s; }
.hh-loading-stage { font-style: italic; color: var(--hh-parchment); }
.hh-loading-tip { max-width: 520px; color: var(--hh-text-faint); font-size: 1rem; }

/* top bar */
.hh-topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); width: min(820px, 92vw); z-index: 10; pointer-events: none; display: flex; flex-direction: column; align-items: stretch; gap: 4px; }
.hh-topbar-armies { display: flex; justify-content: space-between; gap: 10px; }
.hh-topbar-army { flex: 1; min-width: 0; padding: 6px 12px; background: linear-gradient(180deg, rgba(14, 11, 20, 0.88), rgba(14, 11, 20, 0.7)); border: 1px solid color-mix(in srgb, var(--army) 50%, #000); border-top: 2px solid var(--army); }
.hh-topbar-army:nth-child(even) { text-align: right; }
.hh-topbar-army.defeated { opacity: 0.45; filter: grayscale(0.8); }
.hh-topbar-name { font-family: var(--hh-font-head); font-weight: 700; font-size: 1.05rem; color: var(--army); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 0 #000; }
.hh-topbar-meta { display: flex; gap: 12px; font-size: 0.95rem; color: var(--hh-parchment); }
.hh-topbar-army:nth-child(even) .hh-topbar-meta { justify-content: flex-end; }
.hh-routing { color: var(--hh-blood-hi); }
.hh-balance { display: flex; height: 8px; border: 1px solid #000; outline: 1px solid var(--hh-gold-dim); background: #000; overflow: hidden; }
.hh-balance-seg { background: linear-gradient(180deg, color-mix(in srgb, var(--army) 100%, #fff 25%), var(--army) 50%, color-mix(in srgb, var(--army) 60%, #000)); transition: width 0.6s ease; box-shadow: inset -1px 0 0 rgba(0, 0, 0, 0.6); }
.hh-topbar-clock { display: flex; justify-content: center; gap: 10px; align-items: center; font-family: var(--hh-font-head); font-size: 1rem; }
.hh-clock { padding: 1px 10px; background: rgba(0, 0, 0, 0.6); border: 1px solid var(--hh-iron-hi); color: var(--hh-parchment); letter-spacing: 0.1em; }
.hh-paused { color: var(--hh-warn); letter-spacing: 0.2em; animation: hh-flicker 1.6s infinite; }
.hh-speed { color: var(--hh-ghost); }
.hh-event-chip { padding: 1px 10px; background: rgba(90, 10, 20, 0.7); border: 1px solid var(--hh-blood); color: #ffd7d7; }

/* announcements */
.hh-announce-big { position: absolute; left: 0; right: 0; top: 22%; z-index: 12; text-align: center; pointer-events: none; animation: hh-announce 3.4s ease forwards; }
.hh-announce-big.kind-victory { animation-duration: 6s; top: 30%; }
.hh-announce-text { display: inline-block; padding: 10px 50px; font-family: var(--hh-font-display); font-weight: 900; font-size: clamp(1.4rem, 3.6vw, 2.8rem); letter-spacing: 0.06em; color: #fff3e0; text-shadow: 0 3px 0 #000, 0 0 28px var(--army); background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.7) 20%, rgba(0, 0, 0, 0.7) 80%, transparent); }
.hh-announce-big.kind-event .hh-announce-text, .hh-announce-big.kind-broken .hh-announce-text { color: #ffd0d0; text-shadow: 0 3px 0 #000, 0 0 30px #ff2a2a; }
.hh-announce-big.kind-spell .hh-announce-text { color: #e8d0ff; text-shadow: 0 3px 0 #000, 0 0 30px #a070ff; }
.hh-announce-big.kind-victory .hh-announce-text { font-size: clamp(2rem, 5vw, 4rem); color: var(--hh-gold-hi); }
.hh-announce-sub { font-style: italic; color: var(--hh-parchment); text-shadow: 0 2px 4px #000; margin-top: 4px; font-size: 1.05rem; }
@keyframes hh-announce { 0% { opacity: 0; transform: scale(1.25); letter-spacing: 0.3em; } 10% { opacity: 1; transform: scale(1); letter-spacing: 0.06em; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
.hh-feed { position: absolute; right: 12px; top: 120px; width: 340px; z-index: 9; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.hh-feed-item { padding: 3px 10px; font-size: 0.95rem; color: var(--hh-parchment); background: linear-gradient(90deg, transparent, rgba(10, 8, 16, 0.75) 25%); border-right: 2px solid var(--army); text-align: right; animation: hh-feed-in 0.3s ease, hh-feed-out 1s ease 9s forwards; }
.hh-feed-time { color: var(--hh-text-faint); font-size: 0.82rem; margin-right: 4px; }
.hh-feed-item.kind-rout, .hh-feed-item.kind-broken { color: #ffb0b0; }
.hh-feed-item.kind-rally { color: #b0ffc8; }
.hh-feed-item.kind-capture { color: var(--hh-gold-hi); }
@keyframes hh-feed-in { from { opacity: 0; transform: translateX(20px); } }
@keyframes hh-feed-out { to { opacity: 0; } }

/* AI thoughts */
.hh-thoughts { position: absolute; left: 12px; top: 90px; width: 330px; z-index: 9; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.hh-thought-card { padding: 8px 10px; background: rgba(10, 8, 16, 0.8); border: 1px solid color-mix(in srgb, var(--army) 40%, #000); border-left: 3px solid var(--army); }
.hh-thought-card.defeated { opacity: 0.4; }
.hh-thought-head { display: flex; align-items: center; gap: 4px; }
.hh-thought-name { font-family: var(--hh-font-head); font-weight: 700; color: var(--army); font-size: 1rem; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hh-thought-plan { font-family: var(--hh-font-head); font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase; padding: 1px 6px; border: 1px solid var(--army); color: #fff; }
.hh-thought-sub { display: flex; gap: 10px; font-size: 0.88rem; color: var(--hh-text-dim); margin: 2px 0 4px; }
.hh-thought-list { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; line-height: 1.35; }
.hh-thought-list li { color: var(--hh-parchment); }
.hh-thought-list b { font-family: var(--hh-font-head); font-size: 0.74rem; letter-spacing: 0.06em; color: var(--hh-text-dim); margin-right: 4px; text-transform: uppercase; }

/* spectator controls */
.hh-controls { position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; max-width: 96vw; }
.hh-control-group { display: flex; background: rgba(10, 8, 16, 0.85); border: 1px solid var(--hh-iron-hi); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6); }
.hh-ctl { padding: 8px 12px; min-width: 42px; background: transparent; border: none; border-right: 1px solid var(--hh-iron); color: var(--hh-text-dim); font-family: var(--hh-font-head); font-size: 0.92rem; cursor: pointer; transition: all 0.12s; }
.hh-ctl:last-child { border-right: none; }
.hh-ctl:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.hh-ctl.on { color: #fff; background: linear-gradient(180deg, rgba(162, 65, 13, 0.85), rgba(92, 31, 7, 0.85)); }
.hh-director { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%); z-index: 9; font-family: var(--hh-font-head); font-size: 0.82rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--hh-text-faint); pointer-events: none; }
.hh-focus-card { position: absolute; left: 12px; bottom: 12px; z-index: 9; display: flex; gap: 10px; width: 340px; padding: 10px; background: rgba(10, 8, 16, 0.85); border: 1px solid color-mix(in srgb, var(--army) 45%, #000); border-left: 3px solid var(--army); pointer-events: none; }
.hh-focus-icon { font-size: 2.2rem; width: 48px; text-align: center; }
.hh-focus-follow { pointer-events: auto; align-self: center; display: flex; flex-direction: column; align-items: center; min-width: 54px; padding: 5px 6px; background: linear-gradient(180deg, #2a2233, #15111b); border: 1px solid var(--hh-iron); color: var(--hh-parchment); font-size: 1rem; cursor: pointer; }
.hh-focus-follow small { font-family: var(--hh-font-head); font-size: 0.7rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hh-text-dim); margin-top: 1px; }
.hh-focus-follow:hover { border-color: var(--hh-gold); }
.hh-focus-follow.on { background: linear-gradient(180deg, #a2410d, #5c1f07); border-color: var(--hh-pumpkin-hi); }
.hh-focus-body { flex: 1; min-width: 0; }
.hh-focus-name { font-family: var(--hh-font-head); font-weight: 700; color: var(--army); }
.hh-focus-meta { font-size: 0.9rem; color: var(--hh-text-dim); margin-bottom: 4px; }
.hh-focus-note { font-style: italic; font-size: 0.92rem; color: var(--hh-parchment); margin-top: 4px; }
.hh-bar { position: relative; height: 16px; background: rgba(0, 0, 0, 0.6); border: 1px solid #000; margin-top: 3px; }
.hh-bar span { position: absolute; inset: 0; font-size: 0.78rem; line-height: 15px; padding-left: 4px; color: #fff; text-shadow: 0 1px 1px #000; }
.hh-bar-fill { height: 100%; transition: width 0.4s; }
.hh-bar-fill.hp { background: linear-gradient(90deg, #6b1414, #c43a2a); }
.hh-bar-fill.morale { background: linear-gradient(90deg, #6e5414, #d9a441); }
.hh-bar-fill.ammo { background: linear-gradient(90deg, #1d4a7a, #6fb6ff); }

/* endless night */
.hh-wave-chip { padding: 1px 10px; background: rgba(40, 10, 60, 0.75); border: 1px solid #8a5cd6; color: #ecdcff; }
.hh-endless-foe { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--hh-blood); background: rgba(90, 10, 20, 0.25); }
.hh-endless-rules { color: var(--hh-text-dim); line-height: 1.5; padding-left: 18px; }
.hh-upgrade-backdrop { background: radial-gradient(ellipse at center, rgba(30, 6, 40, 0.65), rgba(4, 3, 8, 0.85)); }
.hh-upgrade { text-align: center; padding: 20px; animation: hh-results-in 0.5s ease; }
.hh-upgrade-title { font-family: var(--hh-font-display); font-weight: 900; font-size: clamp(1.8rem, 4vw, 3rem); color: #e0c0ff; text-shadow: 0 3px 0 #000, 0 0 40px rgba(160, 112, 255, 0.6); }
.hh-upgrade-sub { color: var(--hh-text-dim); font-style: italic; margin-bottom: 22px; }
.hh-upgrade-cards { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.hh-upgrade-card { position: relative; width: 220px; min-height: 260px; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 24px 16px; background: linear-gradient(170deg, #2c1f3c, #120c18); border: 1px solid #6a4a9a; color: var(--hh-text); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; font-family: var(--hh-font-body); }
.hh-upgrade-card:hover { transform: translateY(-6px); border-color: #d0b0ff; box-shadow: 0 0 30px rgba(160, 112, 255, 0.55); }
.hh-upgrade-card.rarity-rare { border-color: var(--hh-gold); box-shadow: inset 0 0 30px rgba(217, 164, 65, 0.15); }
.hh-upgrade-icon { font-size: 3.4rem; filter: drop-shadow(0 0 14px #a070ff); }
.hh-upgrade-name { font-family: var(--hh-font-head); font-weight: 700; font-size: 1.15rem; color: var(--hh-gold-hi); text-transform: uppercase; letter-spacing: 0.06em; }
.hh-upgrade-desc { color: var(--hh-parchment); line-height: 1.4; }
.hh-upgrade-rarity { position: absolute; top: 8px; right: 10px; font-family: var(--hh-font-head); font-size: 0.75rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--hh-gold); }

/* objectives */
.hh-objectives { padding: 8px 12px; background: rgba(10, 8, 16, 0.82); border: 1px solid var(--hh-iron-hi); border-left: 3px solid var(--hh-gold); pointer-events: none; }
.hh-objective { font-size: 1rem; color: var(--hh-parchment); margin-top: 3px; }
.hh-objective-mark { color: var(--hh-gold); margin-right: 6px; }
.hh-objective.done { color: var(--hh-ok); text-decoration: line-through; }
.hh-objective.done .hh-objective-mark { color: var(--hh-ok); }
.hh-objective.failed { color: var(--hh-blood-hi); }

/* campaign */
.hh-campaign { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 18px; }
@media (max-width: 1000px) { .hh-campaign { grid-template-columns: 1fr; } }
.hh-campaign-map { position: relative; aspect-ratio: 1.3; background: radial-gradient(ellipse at 50% 60%, rgba(60, 50, 30, 0.35), transparent 70%), linear-gradient(160deg, #1d1912, #0d0b08); border: 1px solid var(--hh-gold-dim); overflow: hidden; }
.hh-campaign-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.hh-mission-node { position: absolute; transform: translate(-50%, -50%); width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--hh-font-display); font-weight: 900; background: #1d1724; border: 2px solid var(--hh-iron-hi); color: var(--hh-text-faint); cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
.hh-mission-node.unlocked { border-color: var(--hh-pumpkin); color: #fff; box-shadow: 0 0 18px rgba(255, 122, 24, 0.5); animation: hh-flicker 2.5s infinite; }
.hh-mission-node.done { border-color: var(--hh-ok); color: var(--hh-ok); background: #12261a; animation: none; }
.hh-mission-node.selected { transform: translate(-50%, -50%) scale(1.2); box-shadow: 0 0 26px var(--hh-gold); }
.hh-mission-node.locked { cursor: not-allowed; opacity: 0.6; }
.hh-mission-label { position: absolute; transform: translate(-50%, 26px); font-family: var(--hh-font-head); font-size: 0.8rem; color: var(--hh-parchment); white-space: nowrap; text-shadow: 0 1px 3px #000; pointer-events: none; }
.hh-mission-story { font-size: 1.05rem; line-height: 1.6; color: var(--hh-parchment); font-style: italic; }
.hh-scenario-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.hh-scenario-card { margin-bottom: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.hh-scenario-card h3 { font-family: var(--hh-font-head); color: var(--hh-gold-hi); margin: 0; }
.hh-scenario-vs { font-family: var(--hh-font-head); font-size: 1rem; }

/* sandbox */
.hh-sandbox-presets { margin-bottom: 14px; max-width: 1400px; }
.hh-sandbox-row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.hh-sandbox-row .hh-select { flex: 1; min-width: 0; }
.hh-count { width: 90px; }

/* tournament */
.hh-tourney-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 12px; margin-bottom: 14px; }
.hh-bracket { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: center; margin-bottom: 18px; }
@media (max-width: 900px) { .hh-bracket { grid-template-columns: 1fr; } }
.hh-bracket-round { display: flex; flex-direction: column; gap: 12px; justify-content: space-around; height: 100%; }
.hh-match { margin-bottom: 0 !important; padding: 12px 14px; text-align: center; }
.hh-match.next { border-color: var(--hh-ghost); box-shadow: 0 0 18px rgba(125, 255, 176, 0.3); }
.hh-match .hh-versus { margin: 4px 0; font-size: 0.8rem; }
.hh-contender { font-family: var(--hh-font-head); color: var(--army); }
.hh-contender.lost { opacity: 0.4; text-decoration: line-through; }
.hh-contender.won { text-shadow: 0 0 12px var(--army); }
.hh-champion { text-align: center; border-color: var(--army); }
.hh-champion-name { font-family: var(--hh-font-display); font-size: 2rem; color: var(--army); text-shadow: 0 0 30px var(--army); }

/* minimap */
.hh-minimap { position: absolute; right: 12px; bottom: 22px; width: 180px; height: 180px; z-index: 8; border: 1px solid var(--hh-gold-dim); box-shadow: 0 4px 18px rgba(0, 0, 0, 0.7); cursor: crosshair; image-rendering: auto; }
.hh-battle-player .hh-minimap { top: 52px; bottom: auto; }
.hh-battle-player .hh-feed { top: 246px; }

/* dominion economy */
.hh-economy { grid-column: 2; grid-row: 1; align-self: end; width: 270px; padding: 6px 8px; background: rgba(10, 8, 16, 0.88); border: 1px solid var(--hh-iron-hi); }
.hh-player-bottom:has(.hh-economy) .hh-abilities { grid-row: 2; }
.hh-resources { display: flex; flex-wrap: wrap; gap: 2px 10px; font-family: var(--hh-font-head); font-size: 0.92rem; margin-bottom: 4px; }
.hh-hold { font-size: 0.86rem; color: var(--hh-gold-hi); margin-bottom: 4px; }
.hh-recruit-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; }
.hh-recruit { position: relative; aspect-ratio: 1; background: #15111b; border: 1px solid var(--hh-iron); cursor: pointer; filter: grayscale(0.85) brightness(0.6); }
.hh-recruit.ok { filter: none; border-color: var(--hh-gold-dim); }
.hh-recruit.ok:hover { border-color: var(--hh-gold); box-shadow: 0 0 10px rgba(217, 164, 65, 0.5); }
.hh-recruit-icon { font-size: 1.25rem; }
.hh-recruit-count { position: absolute; right: 1px; bottom: 0; font-size: 0.72rem; color: #fff; font-family: var(--hh-font-head); }
.hh-queue { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; font-size: 0.85rem; }
.hh-queued small { color: var(--hh-text-dim); font-size: 0.76rem; }

/* construction */
.hh-build { grid-column: 1; grid-row: 1; justify-self: end; align-self: end; padding: 4px 8px; background: rgba(10, 8, 16, 0.88); border: 1px solid var(--hh-iron-hi); }
.hh-build .hh-label { font-size: 0.72rem; }
.hh-build-grid { display: grid; grid-template-columns: repeat(6, 42px); gap: 3px; }
.hh-recruit.on { border-color: var(--hh-ghost); box-shadow: 0 0 10px rgba(125, 255, 176, 0.6); }

/* frame rate */
.hh-fps { position: absolute; right: 6px; bottom: 1px; z-index: 25; font: 600 11px/1.2 ui-monospace, Consolas, monospace; color: #4dff6a; text-shadow: 0 1px 2px #000; pointer-events: none; }

/* pause / results modals */
.hh-modal-backdrop { position: absolute; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(4, 3, 8, 0.6); backdrop-filter: blur(2px); }
.hh-pause { display: flex; flex-direction: column; gap: 10px; width: min(420px, 92vw); text-align: center; }
.hh-pause-volumes { text-align: left; margin: 8px 0; display: grid; gap: 4px; }
.hh-keys { font-size: 0.92rem; color: var(--hh-text-dim); display: grid; gap: 6px; margin: 6px 0 10px; }
.hh-results-backdrop { background: radial-gradient(ellipse at center, rgba(4, 3, 8, 0.55), rgba(4, 3, 8, 0.85)); }
.hh-results { width: min(940px, 95vw); max-height: 92vh; overflow-y: auto; animation: hh-results-in 0.6s ease; }
@keyframes hh-results-in { from { opacity: 0; transform: translateY(20px) scale(0.98); } }
.hh-results-head { text-align: center; margin-bottom: 16px; }
.hh-results-title { font-family: var(--hh-font-display); font-weight: 900; font-size: clamp(1.8rem, 4.6vw, 3.4rem); color: var(--hh-gold-hi); text-shadow: 0 3px 0 #000, 0 0 40px rgba(255, 122, 24, 0.45); }
.hh-results-title.victory { color: #ffe08a; }
.hh-results-title.defeat { color: #ff6a6a; text-shadow: 0 3px 0 #000, 0 0 40px rgba(255, 30, 30, 0.45); }
.hh-results-sub { color: var(--hh-text-dim); font-style: italic; }
.hh-results-armies { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.hh-results-army { padding: 12px 14px; background: rgba(0, 0, 0, 0.35); border: 1px solid color-mix(in srgb, var(--army) 40%, #000); border-top: 3px solid var(--army); }
.hh-results-army.lost { opacity: 0.75; }
.hh-results-army-name { font-family: var(--hh-font-head); font-weight: 700; color: var(--army); }
.hh-results-army-verdict { font-size: 0.82rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--hh-text-dim); margin-bottom: 6px; }
.hh-results-army.won .hh-results-army-verdict { color: var(--hh-gold); }
.hh-results-army dl { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin: 0; font-size: 1rem; }
.hh-results-army dt { color: var(--hh-text-dim); }
.hh-results-army dd { margin: 0; font-family: var(--hh-font-head); color: var(--hh-parchment); }
.hh-results-mvp { display: flex; gap: 14px; align-items: center; margin: 16px 0; padding: 10px 14px; background: linear-gradient(90deg, rgba(217, 164, 65, 0.12), transparent); border-left: 3px solid var(--hh-gold); }
.hh-mvp-icon { font-size: 2.4rem; }
.hh-results-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin: 12px 0; }
.hh-fun-stat { display: flex; flex-direction: column; align-items: center; padding: 8px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--hh-iron); }
.hh-fun-stat span { font-size: 1.5rem; }
.hh-fun-stat b { font-family: var(--hh-font-display); font-size: 1.3rem; color: var(--hh-gold-hi); }
.hh-fun-stat small { color: var(--hh-text-dim); font-size: 0.85rem; text-align: center; }
.hh-results-timeline { font-size: 0.95rem; columns: 2 280px; margin: 10px 0; color: var(--hh-text-dim); }
.hh-results-timeline span { color: var(--hh-text-faint); margin-right: 6px; font-size: 0.85rem; }
.hh-results-timeline .kind-victory, .hh-results-timeline .kind-event, .hh-results-timeline .kind-hero { color: var(--hh-parchment); }
.hh-results-buttons { justify-content: center; margin-top: 12px; }
.hh-results-reopen { position: absolute; top: 80px; left: 50%; transform: translateX(-50%); z-index: 20; }

/* player HUD */
.hh-player-top-right { position: absolute; top: 10px; right: 12px; z-index: 10; }
/* Opening pause: an arrow under the 1x button until the battle first runs. */
.hh-ctl.hh-start-target { position: relative; color: #fff; animation: hh-start-glow 1.1s ease-in-out infinite alternate; }
.hh-start-prompt { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; animation: hh-start-bob 1.1s ease-in-out infinite; }
.hh-start-prompt::before { content: ''; border: 12px solid transparent; border-top: none; border-bottom: 16px solid var(--hh-pumpkin-hi); filter: drop-shadow(0 0 6px rgba(255, 122, 24, 0.8)); }
.hh-start-prompt span { padding: 8px 18px; white-space: nowrap; font-family: var(--hh-font-head); font-weight: 700; font-size: 1.1rem; letter-spacing: 0.12em; text-transform: uppercase; color: #fff3e2; text-shadow: 0 1px 0 #000;
    background: linear-gradient(180deg, #c4500e, #6e2408); border: 1px solid var(--hh-pumpkin-hi); box-shadow: 0 0 22px rgba(255, 122, 24, 0.6), 0 6px 18px rgba(0, 0, 0, 0.6); }
.hh-start-prompt:hover span { background: linear-gradient(180deg, #e0621a, #8a300c); }
@keyframes hh-start-bob { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 7px); } }
@keyframes hh-start-glow { from { box-shadow: inset 0 0 0 1px rgba(255, 179, 71, 0.4); } to { box-shadow: inset 0 0 0 2px var(--hh-pumpkin-hi), 0 0 16px rgba(255, 122, 24, 0.8); } }
/* Selected company card and objectives; drops below the top bar when the screen is too narrow for both side by side. */
.hh-player-top-left { position: absolute; left: 12px; top: 10px; z-index: 9; width: 340px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
@media (max-width: 1540px) { .hh-player-top-left { top: 112px; } }
.hh-unit-card { pointer-events: auto; padding: 10px 12px; background: linear-gradient(180deg, rgba(22, 17, 30, 0.93), rgba(10, 8, 16, 0.88)); border: 1px solid color-mix(in srgb, var(--army) 45%, #000); border-top: 3px solid var(--army); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.6); }
.hh-uc-head { display: flex; gap: 12px; align-items: stretch; }
.hh-uc-portrait { flex: none; width: 124px; height: 124px; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--army) 28%, #2c2338), #0c0910 78%); border: 1px solid var(--hh-iron-hi); }
.hh-uc-portrait img { width: 100%; height: 100%; object-fit: contain; }
.hh-uc-icon { font-size: 3.4rem; filter: drop-shadow(0 2px 3px #000); }
.hh-uc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hh-uc-name { font-family: var(--hh-font-head); font-weight: 700; font-size: 1.15rem; line-height: 1.2; color: var(--army); text-shadow: 0 1px 0 #000; overflow-wrap: anywhere; }
.hh-uc-crown { color: var(--hh-gold-hi); margin-right: 5px; }
.hh-uc-type { font-size: 0.95rem; color: var(--hh-parchment); }
.hh-uc-state { font-size: 0.92rem; color: var(--hh-text-dim); margin-bottom: auto; padding-bottom: 4px; }
.hh-uc-stats { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 0.95rem; }
.hh-uc-stats caption { caption-side: top; text-align: left; font-family: var(--hh-font-head); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--hh-gold); padding-bottom: 3px; border-bottom: 1px solid rgba(217, 164, 65, 0.25); }
.hh-uc-stats tr:nth-child(even) { background: rgba(255, 255, 255, 0.035); }
.hh-uc-stats th { text-align: left; font-weight: 400; color: var(--hh-text-dim); padding: 2px 6px 2px 4px; white-space: nowrap; }
.hh-uc-stats td { text-align: right; font-weight: 700; color: var(--hh-text); padding: 2px 12px 2px 0; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }
.hh-uc-stats td:last-child { padding-right: 4px; }
.hh-uc-traits { margin-top: 6px; font-size: 0.9rem; color: var(--hh-ghost); }
.hh-uc-more { margin-top: 6px; font-size: 0.88rem; font-style: italic; color: var(--hh-text-dim); }
.hh-targeting { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); z-index: 11; padding: 6px 18px; background: rgba(40, 10, 60, 0.85); border: 1px solid #a070ff; color: #f0e0ff; font-size: 1.05rem; pointer-events: none; }
.hh-player-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 6px 10px; padding: 0 12px 16px; pointer-events: none; }
.hh-player-bottom > * { pointer-events: auto; }
.hh-orders { grid-column: 1; grid-row: 1; display: flex; gap: 2px; align-items: stretch; width: fit-content; background: rgba(10, 8, 16, 0.85); border: 1px solid var(--hh-iron-hi); padding: 3px; }
.hh-order { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; padding: 4px 6px; background: linear-gradient(180deg, #2a2233, #15111b); border: 1px solid var(--hh-iron); color: var(--hh-parchment); font-size: 1.2rem; cursor: pointer; }
.hh-order small { font-family: var(--hh-font-head); font-size: 0.72rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hh-text-dim); margin-top: 1px; }
.hh-order:hover:not(:disabled) { border-color: var(--hh-gold); }
.hh-order.on { background: linear-gradient(180deg, #a2410d, #5c1f07); border-color: var(--hh-pumpkin-hi); }
.hh-order.danger:hover:not(:disabled) { border-color: var(--hh-blood-hi); }
.hh-order:disabled { opacity: 0.35; cursor: default; }
.hh-order-sep { width: 1px; background: var(--hh-iron-hi); margin: 2px 4px; }
.hh-cards { grid-column: 1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-end; max-height: 236px; overflow-y: auto; }
.hh-card { position: relative; width: 88px; height: 112px; background: linear-gradient(180deg, #2c2338, #120e18); border: 1px solid var(--hh-iron-hi); cursor: pointer; overflow: hidden; transition: transform 0.08s, border-color 0.1s; }
.hh-card:hover { border-color: var(--hh-gold-dim); transform: translateY(-2px); }
.hh-card.selected { border-color: var(--hh-ghost); box-shadow: 0 0 12px rgba(125, 255, 176, 0.5), inset 0 0 16px rgba(125, 255, 176, 0.15); }
.hh-card.engaged { background: linear-gradient(180deg, #4a2020, #160c0e); }
.hh-card.routing { animation: hh-card-rout 0.8s infinite alternate; }
.hh-card.dead { opacity: 0.3; filter: grayscale(1); }
@keyframes hh-card-rout { from { border-color: var(--hh-blood); } to { border-color: #ff9a9a; } }
.hh-card-icon { font-size: 2.4rem; text-align: center; margin-top: 8px; filter: drop-shadow(0 2px 2px #000); }
.hh-card-count { position: absolute; top: 2px; right: 4px; font-family: var(--hh-font-head); font-weight: 700; font-size: 0.98rem; color: #fff; text-shadow: 0 1px 2px #000; }
.hh-card-crown { position: absolute; top: 1px; left: 4px; color: var(--hh-gold-hi); font-size: 1rem; }
.hh-card-state { position: absolute; top: 22px; right: 4px; font-size: 1rem; color: var(--hh-warn); }
.hh-card-bars { position: absolute; left: 3px; right: 3px; bottom: 31px; display: flex; flex-direction: column; gap: 1px; }
.hh-card-bar { height: 4px; }
.hh-card-bar.hp { background: #d23a2a; }
.hh-card-bar.morale { background: #d9a441; }
.hh-card-bar.ammo { background: #6fb6ff; }
.hh-card-name { position: absolute; left: 0; right: 0; bottom: 2px; font-family: var(--hh-font-body); font-weight: 600; font-size: 0.74rem; line-height: 1.05; text-align: center; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; hyphens: auto; overflow-wrap: break-word; color: var(--hh-parchment); padding: 0 2px; }
.hh-abilities { grid-column: 2; grid-row: 1 / span 2; align-self: end; width: 270px; padding: 8px; background: rgba(10, 8, 16, 0.88); border: 1px solid var(--hh-iron-hi); }
.hh-fear { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font-family: var(--hh-font-head); }
.hh-fear-bar { flex: 1; height: 8px; background: #000; border: 1px solid var(--hh-iron-hi); }
.hh-fear-bar div { height: 100%; background: linear-gradient(90deg, #4a1a6e, #b070ff); box-shadow: 0 0 8px #a070ff; transition: width 0.4s; }
.hh-ability-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.hh-ability { position: relative; aspect-ratio: 1; background: radial-gradient(circle at 50% 35%, #3a2a4a, #120c18); border: 1px solid var(--hh-iron-hi); cursor: pointer; filter: grayscale(0.9) brightness(0.6); transition: all 0.12s; }
.hh-ability.ready { filter: none; border-color: #8a6ad0; box-shadow: inset 0 0 10px rgba(160, 112, 255, 0.35); }
.hh-ability.ready:hover { border-color: #d0b0ff; box-shadow: 0 0 14px rgba(160, 112, 255, 0.7); }
.hh-ability.ultimate.ready { border-color: var(--hh-gold); box-shadow: 0 0 12px rgba(217, 164, 65, 0.5); }
.hh-ability.targeting { border-color: #fff; animation: hh-flicker 0.8s infinite; }
.hh-ability-icon { font-size: 1.55rem; }
.hh-ability-cd { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--hh-font-head); font-weight: 700; color: #fff; background: rgba(0, 0, 0, 0.55); font-size: 1rem; }
.hh-ability-cost { position: absolute; right: 1px; bottom: 0; font-size: 0.74rem; color: #d8c0ff; font-family: var(--hh-font-head); text-shadow: 0 1px 1px #000; }

@media (max-width: 760px) {
    .hh-thoughts { display: none; }
    .hh-feed { width: 200px; top: 150px; }
    .hh-topbar-meta { font-size: 0.8rem; gap: 6px; }
    .hh-abilities { width: 160px; }
    .hh-ability-grid { grid-template-columns: repeat(4, 1fr); }
    .hh-focus-card { display: none; }
    .hh-player-top-left { width: 260px; }
    .hh-uc-portrait { width: 84px; height: 84px; }
    .hh-uc-stats, .hh-uc-traits { display: none; }
}

/* ------------------------------------------------------------------ Halloween Castle Siege: title-page event card */
.hh-home-row { flex-direction: row; flex-wrap: wrap; justify-content: center; }
.hh-event-card { position: relative; display: grid; grid-template-columns: 210px 1fr; gap: 22px; align-items: center; width: min(760px, 100%); padding: 22px 26px 22px 18px; text-decoration: none; color: var(--hh-text);
    background: linear-gradient(160deg, rgba(58, 40, 22, 0.92), rgba(16, 11, 20, 0.96) 70%); border: 1px solid #b07a30; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(255, 150, 40, 0.18); overflow: hidden; transition: transform 0.15s, box-shadow 0.15s; }
.hh-event-card:hover { transform: translateY(-3px); box-shadow: 0 22px 70px rgba(0, 0, 0, 0.75), 0 0 60px rgba(255, 160, 50, 0.35); }
.hh-event-ribbon { position: absolute; top: 32px; right: -50px; width: 200px; transform: rotate(45deg); text-align: center; line-height: 1.15; background: linear-gradient(90deg, #c4500e, #ff9a2a); color: #160a02; font-family: var(--hh-font-head); font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; font-size: 0.7rem; padding: 4px 0; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); z-index: 2; }
.hh-event-art { position: relative; display: block; height: 170px; border-radius: 4px; overflow: hidden; background: linear-gradient(180deg, #2a2434 0%, #5a4a5a 45%, #c27a4a 80%, #3a2a24 100%); }
.hh-event-tier { position: absolute; left: 50%; bottom: calc(14px + var(--k) * 15px); width: calc(190px - var(--k) * 24px); height: 22px; transform: translateX(-50%); border-radius: 50% 50% 4px 4px / 60% 60% 4px 4px;
    background: linear-gradient(180deg, #f2ecdc, #b9b2a2); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 2px 4px rgba(0, 0, 0, 0.35); }
.hh-event-tier::after { content: ''; position: absolute; left: 6%; right: 6%; top: -4px; height: 5px; background: repeating-linear-gradient(90deg, #ece6d6 0 6px, transparent 6px 10px); }
.hh-event-spire { position: absolute; left: 50%; bottom: 118px; width: 14px; height: 60px; transform: translateX(-50%); background: linear-gradient(90deg, #d8d2c2, #fffaf0, #c8c0b0); clip-path: polygon(50% 0, 100% 30%, 100% 100%, 0 100%, 0 30%); }
.hh-event-moon { position: absolute; right: 18px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff4d8, #f2b860); box-shadow: 0 0 24px rgba(255, 190, 90, 0.7); }
.hh-event-text { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; position: relative; z-index: 1; }
.hh-event-name { font-family: var(--hh-font-display); font-weight: 900; font-size: clamp(1.8rem, 4vw, 2.7rem); color: var(--hh-gold-hi); line-height: 1; text-shadow: 0 3px 0 #000, 0 0 24px rgba(255, 150, 40, 0.5); }
.hh-event-desc { color: var(--hh-text-dim); line-height: 1.5; max-width: 46ch; }
@media (max-width: 640px) {
    .hh-event-card { grid-template-columns: 1fr; padding: 16px; }
    .hh-event-art { height: 130px; }
    .hh-event-tier { bottom: calc(10px + var(--k) * 11px); height: 17px; width: calc(160px - var(--k) * 20px); }
    .hh-event-spire { bottom: 86px; height: 44px; }
}

/* ------------------------------------------------------------------ siege setup */
.hh-siege-citadel { position: relative; height: 150px; margin: 16px 0 6px; border-radius: 4px; overflow: hidden; background: linear-gradient(180deg, #4a4654 0%, #8a8290 55%, #4a4038 100%); }
.hh-siege-tier { position: absolute; left: 50%; bottom: calc(8px + var(--k) * 15px); width: calc(92% - var(--k) * 11%); height: 20px; transform: translateX(-50%); border-radius: 50% 50% 3px 3px / 70% 70% 3px 3px;
    background: linear-gradient(180deg, #f2ecdc, #a8a090); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.2); }
.hh-siege-spire { position: absolute; left: 50%; bottom: 112px; width: 12px; height: 40px; transform: translateX(-50%); background: #fffaf0; clip-path: polygon(50% 0, 100% 35%, 100% 100%, 0 100%, 0 35%); }

/* ------------------------------------------------------------------ siege HUD */
.hh-siege-hud { position: absolute; top: 104px; left: 50%; transform: translateX(-50%); z-index: 6; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; width: min(600px, calc(100% - 32px)); }
.hh-siege-clockbar { pointer-events: auto; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; padding: 8px 16px; background: rgba(10, 8, 14, 0.78); border: 1px solid var(--hh-iron-hi); box-shadow: var(--hh-shadow); }
.hh-siege-clock { font-family: var(--hh-font-display); font-size: 1.5rem; color: var(--hh-gold-hi); min-width: 4.2ch; text-align: center; }
.hh-siege-light { font-family: var(--hh-font-head); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.85rem; color: var(--hh-text-dim); }
.hh-siege-dial { position: relative; width: 140px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #c8c8c8 0%, #d8a060 20%, #6a4a8a 32%, #18203a 45%, #0a0e1c 75%, #4a5a9a 92%, #ffc890 100%); }
.hh-siege-dial i { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; background: #fff; box-shadow: 0 0 6px #fff; }
.hh-siege-wave { font-family: var(--hh-font-head); color: var(--hh-text); }
.hh-siege-wave b { color: var(--hh-gold-hi); }
.hh-siege-build { pointer-events: auto; width: 100%; padding: 8px 12px; background: linear-gradient(160deg, rgba(48, 36, 22, 0.92), rgba(14, 10, 18, 0.94)); border: 1px solid #b07a30; box-shadow: var(--hh-shadow); display: flex; flex-direction: column; gap: 10px; }
.hh-siege-build-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; }
.hh-siege-build-title { font-family: var(--hh-font-display); font-size: 1rem; color: var(--hh-gold-hi); }
.hh-siege-build-sub { color: var(--hh-text-dim); font-size: 0.9rem; line-height: 1.35; }
.hh-siege-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hh-siege-muster { display: flex; flex-wrap: wrap; gap: 6px; }
.hh-siege-muster .hh-recruit { width: auto; min-width: 54px; padding: 4px 8px; gap: 4px; display: inline-flex; align-items: center; }
.hh-siege-muster small { color: var(--hh-text-dim); }
.hh-siege-assault { pointer-events: none; text-align: center; color: var(--hh-text-dim); font-size: 0.95rem; text-shadow: 0 1px 3px #000; }
.hh-siege-assault b { color: #ff8a6a; }
.hh-siege-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.hh-siege-chip { padding: 2px 8px; border: 1px solid var(--hh-iron-hi); background: rgba(10, 8, 14, 0.7); font-size: 0.9rem; color: var(--hh-text); }
.hh-siege-chip.bad { border-color: #a02020; color: #ffb0a0; }
.hh-siege-horn { animation: hh-horn-pulse 1.6s ease-in-out infinite; }
@keyframes hh-horn-pulse { 0%, 100% { box-shadow: 0 0 0 rgba(255, 160, 50, 0); } 50% { box-shadow: 0 0 22px rgba(255, 160, 50, 0.65); } }
@media (max-width: 700px) { .hh-siege-hud { top: 96px; } .hh-siege-dial { display: none; } }
