/* ════════════════════════════════════════════════════════════════════════
   MARSHALFIELD UI · "Royal Treasury" design system
   Dark lacquered panels, engraved gold trim, Cinzel headings, smooth motion.
   Loaded after style.css and theme-dark.css (which maps the old parchment colours).
   ════════════════════════════════════════════════════════════════════════ */
:root {
  --u-bg0: #0b0704; --u-bg1: #140d07; --u-bg2: #1d140b; --u-bg3: #2a1d10;
  --u-gold: #e8b84a; --u-gold-hi: #fff0b8; --u-gold-mid: #f2c25a; --u-gold-lo: #b8861f; --u-gold-dd: #6b4a14;
  --u-text: #f6e9cc; --u-text2: #d9c6a2; --u-mut: #a8916c; --u-line: rgba(232, 184, 74, 0.22); --u-line2: rgba(232, 184, 74, 0.4);
  --u-red: #c8402c; --u-red-hi: #ff8a70; --u-green: #8fe06a; --u-blue: #6aa8ff; --u-purple: #b98aff;
  --u-r: 14px; --u-r-sm: 10px; --u-r-lg: 20px;
  --u-ease: cubic-bezier(.2, .9, .25, 1); --u-spring: cubic-bezier(.2, 1.2, .3, 1);
  --u-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.4);
  --u-panel: linear-gradient(180deg, #24180d 0%, #170f08 55%, #120b06 100%);
  --u-gold-grad: linear-gradient(180deg, #fff0b8 0%, #f2c25a 42%, #d9a03a 70%, #b8861f 100%);
  /* the old parchment ink variables now mean "light ink on a dark panel" */
  --ink: #f6e9cc;
}

/* ── foundations ───────────────────────────────────────────────────────── */
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
::selection { background: rgba(232, 184, 74, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--u-gold-mid); outline-offset: 3px; border-radius: 6px; }
* { scrollbar-width: thin; scrollbar-color: #9a7022 rgba(0, 0, 0, 0.25); }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.22); border-radius: 10px; }
*::-webkit-scrollbar-thumb { border-radius: 10px; border: 2px solid transparent; background: linear-gradient(180deg, #f2c25a, #8a5a12) padding-box; }
*::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #ffe08a, #b8861f) padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* every screen eases in */
.screen.active { animation: u-screen-in 0.45s var(--u-ease) both; }
@keyframes u-screen-in { from { opacity: 0; } }

/* ── panels (everything that used to be parchment) ─────────────────────── */
.parchment, .paper, :is(.parchment, .paper).paper-edge {
  --ink-dark: #fff1cf; --ink-mid: rgba(246, 233, 204, 0.72); --ink-soft: rgba(232, 184, 74, 0.28); --ink-wash: rgba(255, 228, 170, 0.06); --ink-line: rgba(232, 184, 74, 0.25);
  color: var(--u-text);
  background-color: var(--u-bg1);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(242, 194, 90, 0.14), transparent 60%),
    radial-gradient(ellipse 70% 60% at 100% 110%, rgba(140, 60, 20, 0.16), transparent 60%),
    repeating-linear-gradient(45deg, rgba(232, 184, 74, 0.018) 0 1px, transparent 1px 18px),
    var(--u-panel);
  background-size: auto; background-repeat: no-repeat; background-position: 0 0;
  border: 1px solid var(--u-line2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 5px rgba(20, 12, 6, 0.6), inset 0 0 0 6px rgba(232, 184, 74, 0.14), inset 0 1px 0 rgba(255, 230, 170, 0.12);
  -webkit-mask-image: none; mask-image: none;
}
:is(.parchment, .paper) * { mix-blend-mode: normal !important; }
:is(.parchment, .paper) :is(h2, h3, h4, p, li, b, small, label, .sub, .note, .k, .v) { text-shadow: none; }
:is(.parchment, .paper) h2 { color: var(--u-text); }
:is(.parchment, .paper) p, :is(.parchment, .paper) li { color: var(--u-text2); text-shadow: none; }
:is(.parchment, .paper) .sub, :is(.parchment, .paper) .note { color: var(--u-mut); }
.parchment a:not(.btn) { color: var(--u-gold-mid); }

/* ── the window ───────────────────────────────────────────────────────── */
.modal { background: radial-gradient(ellipse at center, rgba(10, 6, 3, 0.55), rgba(5, 3, 1, 0.82)); backdrop-filter: blur(6px) saturate(0.85); -webkit-backdrop-filter: blur(6px) saturate(0.85); }
.modal.show { animation: u-fade 0.28s ease both; }
.modal.closing { animation: u-fade-out 0.19s ease both; pointer-events: none; }
.modal.preview { background: radial-gradient(ellipse at 50% 60%, rgba(8, 5, 2, 0.05), rgba(8, 5, 2, 0.6)); backdrop-filter: none; -webkit-backdrop-filter: none; }
@keyframes u-fade { from { opacity: 0; } }
@keyframes u-fade-out { to { opacity: 0; } }
.paper-drop { filter: none; width: min(640px, 100%); }
.paper-drop:has(.wide) { width: min(920px, 100%); }
.modal-card.paper-edge, .modal-card {
  border-radius: var(--u-r-lg); padding: 38px 40px 30px;
  box-shadow: var(--u-shadow), 0 0 0 1px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 5px rgba(20, 12, 6, 0.6), inset 0 0 0 6px rgba(232, 184, 74, 0.16), inset 0 1px 0 rgba(255, 230, 170, 0.14);
  animation: none;
}
.modal-card.enter { animation: u-card-in 0.42s var(--u-spring) both; }
.modal-card.swap { animation: u-card-swap 0.32s var(--u-ease) both; }
.modal.closing .modal-card { animation: u-card-out 0.19s ease both; }
@keyframes u-card-in { from { opacity: 0; transform: translateY(18px) scale(0.96); } }
@keyframes u-card-swap { from { opacity: 0.35; transform: translateY(6px); } }
@keyframes u-card-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
/* gold corner ornaments */
.modal-card::before, .modal-card::after {
  content: ''; position: absolute; width: 46px; height: 46px; pointer-events: none; opacity: 0.85;
  border: 2px solid var(--u-gold); border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; top: 12px; left: 12px;
  -webkit-mask: linear-gradient(135deg, #000 30%, transparent 75%); mask: linear-gradient(135deg, #000 30%, transparent 75%);
}
.modal-card::after { left: auto; right: 12px; top: auto; bottom: 12px; transform: rotate(180deg); }

.modal-card h2 {
  font: 900 clamp(26px, 3.6vw, 38px) var(--deco); line-height: 1.08; text-align: center; letter-spacing: 0.01em;
  background: linear-gradient(180deg, #fff6d4 8%, #f2c25a 55%, #b8861f 100%); -webkit-background-clip: text; background-clip: text; color: transparent !important;
  filter: drop-shadow(0 2px 10px rgba(240, 180, 70, 0.22)); text-shadow: none !important;
}
.modal-card h3 { font: 900 13px var(--caps); letter-spacing: 0.18em; text-transform: uppercase; color: var(--u-gold) !important; margin: 22px 0 10px; display: flex; align-items: center; gap: 10px; }
.modal-card h3::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--u-line2), transparent); }
.modal-card p { color: var(--u-text2); font-size: 16.5px; line-height: 1.55; }
.modal-card p b, .modal-card li b { color: var(--u-text); }
.modal-card .sub { color: var(--u-mut); font-size: 16px; text-align: center; margin-top: 6px; }
.divider { height: 16px; width: 62%; margin: 14px auto 18px; background:
  linear-gradient(90deg, transparent, var(--u-line2) 30%, var(--u-line2) 70%, transparent) center / 100% 1px no-repeat,
  radial-gradient(circle, var(--u-gold) 0 3px, transparent 3.5px) center / 16px 16px no-repeat; }
.divider::before { content: none; }

/* close button */
.modal-card .x, .parchment .x, .cmp-brief .x {
  top: 18px; right: 18px; width: 38px; height: 38px; display: grid; place-items: center; z-index: 3;
  border-radius: 50%; font-size: 15px; line-height: 1; color: var(--u-gold-hi); background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--u-line2); transition: transform 0.25s var(--u-spring), background 0.2s, border-color 0.2s, color 0.2s;
}
.modal-card .x:hover, .parchment .x:hover, .cmp-brief .x:hover { transform: rotate(90deg) scale(1.06); background: rgba(200, 64, 44, 0.35); border-color: var(--u-red-hi); color: #fff; }

/* ── buttons ──────────────────────────────────────────────────────────── */
.btn, :is(.parchment, .paper) .btn:not(.btn-dark):not(.btn-battle) {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 46px; padding: 11px 22px; border-radius: 12px;
  font: 900 14.5px var(--caps); letter-spacing: 0.07em; text-transform: uppercase;
  color: #2a1708; text-shadow: 0 1px 0 rgba(255, 245, 210, 0.45);
  background: var(--u-gold-grad); border: 1px solid #8a5d18;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(120, 70, 10, 0.35), 0 6px 18px rgba(240, 170, 60, 0.22), 0 2px 4px rgba(0, 0, 0, 0.4);
  transition: transform 0.18s var(--u-spring), box-shadow 0.25s, filter 0.2s;
  filter: none;
}
.btn:hover, :is(.parchment, .paper) .btn:not(.btn-dark):not(.btn-battle):hover { transform: translateY(-2px); filter: brightness(1.04); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), inset 0 -3px 0 rgba(120, 70, 10, 0.35), 0 10px 26px rgba(240, 170, 60, 0.35), 0 3px 6px rgba(0, 0, 0, 0.45); }
.btn:active, :is(.parchment, .paper) .btn:not(.btn-dark):not(.btn-battle):active { transform: translateY(1px) scale(0.985); box-shadow: inset 0 2px 5px rgba(90, 50, 8, 0.45), 0 2px 6px rgba(0, 0, 0, 0.4); }
.btn:disabled, .btn[disabled] { filter: grayscale(0.85) brightness(0.62); cursor: not-allowed; transform: none !important; box-shadow: none; }
.btn svg { width: 19px; height: 19px; }
.btn small { font: italic 400 13px var(--serif); text-transform: none; letter-spacing: 0; opacity: 0.85; }
.btn-sm, :is(.parchment, .paper) .btn-sm { min-height: 38px; padding: 7px 15px; font-size: 12.5px; border-radius: 10px; }
.btn-big { min-height: 56px; padding: 14px 30px; font-size: 18px; }

.btn-dark, :is(.parchment, .paper) .btn-dark {
  color: var(--u-gold-hi); text-shadow: none;
  background: linear-gradient(180deg, rgba(255, 230, 170, 0.07), rgba(0, 0, 0, 0.25)), #1a1109;
  border: 1px solid var(--u-line2); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.1), 0 4px 12px rgba(0, 0, 0, 0.35);
}
.btn-dark:hover, :is(.parchment, .paper) .btn-dark:hover { color: #fff; border-color: var(--u-gold); background: linear-gradient(180deg, rgba(255, 230, 170, 0.12), rgba(0, 0, 0, 0.2)), #22170c; transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.14), 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 16px rgba(232, 184, 74, 0.15); }
.btn-dark:active, :is(.parchment, .paper) .btn-dark:active { transform: translateY(1px); background: #120b06; }

.btn-battle, :is(.parchment, .paper) .btn-battle {
  color: #fff4e4; text-shadow: 0 1px 2px rgba(60, 0, 0, 0.7);
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 190, 160, 0.45), transparent 70%), linear-gradient(180deg, #d8492f 0%, #a8281a 55%, #7a160d 100%);
  border: 1px solid #f2c25a; border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 210, 190, 0.5), inset 0 -3px 0 rgba(60, 0, 0, 0.45), 0 0 0 3px rgba(200, 64, 44, 0.18), 0 8px 24px rgba(200, 60, 40, 0.35), 0 2px 5px rgba(0, 0, 0, 0.5);
  animation: none;
}
.btn-battle:hover, :is(.parchment, .paper) .btn-battle:hover { filter: brightness(1.08); transform: translateY(-2px); box-shadow: inset 0 1px 0 rgba(255, 210, 190, 0.5), inset 0 -3px 0 rgba(60, 0, 0, 0.45), 0 0 0 4px rgba(242, 194, 90, 0.25), 0 12px 30px rgba(220, 70, 40, 0.45); }
.btn-battle:not(:disabled) { animation: u-battle-glow 2.6s ease-in-out infinite; }
@keyframes u-battle-glow { 50% { box-shadow: inset 0 1px 0 rgba(255, 210, 190, 0.5), inset 0 -3px 0 rgba(60, 0, 0, 0.45), 0 0 0 5px rgba(242, 194, 90, 0.16), 0 10px 32px rgba(230, 80, 40, 0.55); } }

.icon-btn {
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: var(--u-gold-hi);
  background: radial-gradient(circle at 50% 30%, rgba(255, 230, 170, 0.12), transparent 70%), #160e07;
  border: 1px solid var(--u-line2); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 230, 170, 0.12);
  transition: transform 0.2s var(--u-spring), border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.icon-btn:hover { transform: translateY(-2px) scale(1.04); border-color: var(--u-gold); color: #fff; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55), 0 0 16px rgba(232, 184, 74, 0.25); }
.icon-btn.off { color: #7b6a50; }
.actions { gap: 12px; margin-top: 26px; }

/* ── fields ───────────────────────────────────────────────────────────── */
.modal-card input:not([type=range]):not([type=checkbox]), .modal-card select, .modal-card textarea,
.parchment .field input, .parchment .field textarea, .parchment .field select, .parchment .forge select, .parchment textarea, .cmp-brief input {
  -webkit-appearance: none; appearance: none;
  background: linear-gradient(180deg, #100a05, #1a1109) !important; color: var(--u-text) !important;
  border: 1px solid var(--u-line2) !important; border-radius: 12px !important;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55) !important; padding: 11px 14px; font-family: var(--serif);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal-card select { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, #e8b84a 50%), linear-gradient(135deg, #e8b84a 50%, transparent 50%), linear-gradient(180deg, #100a05, #1a1109) !important; background-position: right 17px center, right 12px center, 0 0 !important; background-size: 5px 5px, 5px 5px, 100% 100% !important; background-repeat: no-repeat !important; cursor: pointer; }
.modal-card select option { background: #1a1109; color: var(--u-text); }
.modal-card input:focus, .modal-card select:focus, .modal-card textarea:focus, .parchment .field input:focus, .parchment textarea:focus {
  outline: none; border-color: var(--u-gold-mid) !important; box-shadow: 0 0 0 3px rgba(242, 194, 90, 0.22), inset 0 2px 6px rgba(0, 0, 0, 0.55) !important;
}
.modal-card input::placeholder, .modal-card textarea::placeholder { color: #8a7656; font-style: italic; }
.modal-card input[type=range] { accent-color: var(--u-gold); }
.codebox code, .parchment .codebox code { color: var(--u-gold-hi) !important; background: rgba(0, 0, 0, 0.45) !important; border: 1px dashed var(--u-line2) !important; border-radius: 10px; padding: 8px 14px; }

/* ── content blocks inside windows ────────────────────────────────────── */
.stat, .parchment .stat { background: linear-gradient(180deg, rgba(255, 230, 170, 0.06), rgba(0, 0, 0, 0.2)); border: 1px solid var(--u-line) !important; border-radius: 12px; box-shadow: inset 0 1px 0 rgba(255, 230, 170, 0.06); padding: 12px 14px; }
.stat .k, .parchment .stat .k { color: var(--u-mut); }
.stat .v { color: var(--u-text); }
.stat .v.gold { color: var(--u-gold-mid); }
.stat .v.red { color: var(--u-red-hi); }
.army-list .chip, .parchment .army-list .chip { background: rgba(0, 0, 0, 0.3) !important; border: 1px solid var(--u-line) !important; color: var(--u-text) !important; border-radius: 999px; }
.toggle-row, .parchment .toggle-row { border-bottom: 1px solid var(--u-line) !important; color: var(--u-text); padding: 13px 2px; }
.toggle-row > span { color: var(--u-text2); }
.vol-row { border-bottom-color: var(--u-line) !important; color: var(--u-text) !important; }
.vol-row > output { color: var(--u-gold-mid) !important; }
input.vol::-webkit-slider-runnable-track { background: linear-gradient(90deg, #f2c25a 0 var(--p, 50%), rgba(255, 230, 170, 0.12) var(--p, 50%) 100%) !important; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6) !important; }
input.vol::-moz-range-track { background: rgba(255, 230, 170, 0.12) !important; }
input.vol::-moz-range-progress { background: #f2c25a !important; }
.film-opt, .parchment .film-opt { background: linear-gradient(180deg, rgba(255, 230, 170, 0.05), rgba(0, 0, 0, 0.2)) !important; border: 1px solid var(--u-line) !important; border-radius: 14px !important; color: var(--u-text); transition: transform 0.2s var(--u-spring), border-color 0.2s, box-shadow 0.2s !important; }
.film-opt:hover, .parchment .film-opt:hover { transform: translateY(-2px); border-color: var(--u-line2) !important; }
.film-opt.on, .parchment .film-opt.on { border-color: var(--u-gold) !important; background: linear-gradient(180deg, rgba(242, 194, 90, 0.16), rgba(0, 0, 0, 0.15)) !important; box-shadow: 0 0 0 1px var(--u-gold), 0 0 22px rgba(232, 184, 74, 0.22) !important; }
.film-opt small, .film-opt.style small { color: var(--u-mut) !important; }
.film-opt b { color: var(--u-text); }
.hook-chip { background: rgba(0, 0, 0, 0.35); border-color: var(--u-line2); color: var(--u-text); }
.hook-chip.on { background: #ffd400; color: #111; border-color: #111; }
.hook-input { background: #100a05 !important; }
.note { color: var(--u-mut) !important; }
.share-preview, .film-video { border: 1px solid var(--u-line2) !important; border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6); }
.result-title .rt.lose { color: #ff8a70; text-shadow: 0 0 30px rgba(220, 60, 40, 0.4); }
.result-title .rt.win { filter: drop-shadow(0 0 24px rgba(240, 180, 70, 0.35)); }
.bigstars svg:not(.on), .parchment .bigstars svg:not(.on) { color: rgba(255, 230, 170, 0.12) !important; filter: none !important; }

/* field manual */
.mtabs { gap: 4px; padding: 4px; margin: 6px auto 18px; border: 1px solid var(--u-line); border-radius: 999px; background: #0e0904; width: fit-content; max-width: 100%; box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.5); }
.mtabs button { border: 0 !important; border-radius: 999px; padding: 9px 16px; font: 700 12.5px var(--caps); letter-spacing: 0.06em; color: var(--u-mut) !important; background: none; transition: color 0.2s, background 0.2s; }
.mtabs button:hover { color: var(--u-text) !important; background: rgba(255, 230, 170, 0.06) !important; }
.mtabs button.on { color: #2a1708 !important; background: var(--u-gold-grad) !important; box-shadow: 0 2px 10px rgba(240, 180, 70, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important; text-shadow: none; }
.mpage h4, .mtroop h4 { color: var(--u-text) !important; }
.mlead { color: var(--u-text2) !important; }
.mnote { color: var(--u-text2) !important; border: 1px dashed var(--u-line2) !important; border-radius: 12px; background: rgba(255, 230, 170, 0.04); }
.mstep, .mtroop { border: 1px solid var(--u-line) !important; border-radius: 14px !important; background: linear-gradient(180deg, rgba(255, 230, 170, 0.05), rgba(0, 0, 0, 0.18)); padding: 14px !important; }
.mtip { border-bottom: 1px solid var(--u-line) !important; }
.mtip-i { border-color: var(--u-line2) !important; background: rgba(0, 0, 0, 0.35); }
.mtable th, .mtable td { border-bottom-color: var(--u-line) !important; color: var(--u-text2) !important; }
.mtable thead th { color: var(--u-gold) !important; }
.mtable tbody th { color: var(--u-text) !important; }
.mpage kbd { color: var(--u-gold-hi) !important; background: #0e0904 !important; border: 1px solid var(--u-line2) !important; border-radius: 6px; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.6) !important; }
.mtroop .gb { color: #a6e28a !important; } .mtroop .gb.b { color: #ff9a84 !important; }

/* ── title screen ─────────────────────────────────────────────────────── */
#title.active { background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(10, 6, 3, 0.05), rgba(8, 5, 2, 0.78) 100%), linear-gradient(180deg, rgba(8, 5, 2, 0.35), transparent 30%, transparent 70%, rgba(8, 5, 2, 0.55)); }
.title-wrap { padding: 18px 20px 90px; animation: u-title-in 0.9s var(--u-ease) both; }
@keyframes u-title-in { from { opacity: 0; transform: translateY(16px); } }
.title-logo img { filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.7)) drop-shadow(0 0 40px rgba(240, 180, 70, 0.18)); animation: u-float 7s ease-in-out infinite; }
@keyframes u-float { 50% { transform: translateY(-6px); } }
.tagline { letter-spacing: 0.5em !important; color: var(--u-gold-mid) !important; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
.me-chip { backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); border-color: var(--u-line2); transition: transform 0.2s var(--u-spring), border-color 0.2s, box-shadow 0.2s; }
.me-chip:hover { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.55), 0 0 18px rgba(232, 184, 74, 0.2); }

/* ── HUD (deployment & battle) ────────────────────────────────────────── */
.title-plate, .treasury, .enemy-plate, .side-switch, .strength, #sel-panel, .vol-pop, .speed, .hint {
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.title-plate { background: linear-gradient(180deg, rgba(38, 26, 14, 0.94), rgba(16, 10, 5, 0.92)) !important; border: 1px solid var(--u-line2) !important; border-top: 0 !important; border-radius: 0 0 18px 18px !important; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), inset 0 -1px 0 rgba(255, 230, 170, 0.08) !important; }
.title-plate::before, .title-plate::after { display: none !important; }
.tp-name { background: linear-gradient(180deg, #fff6d4, #f2c25a 60%, #c8902e); -webkit-background-clip: text; background-clip: text; color: transparent !important; text-shadow: none !important; }
.treasury, .enemy-plate { background: linear-gradient(180deg, rgba(38, 26, 14, 0.92), rgba(14, 9, 5, 0.9)) !important; border: 1px solid var(--u-line2) !important; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 230, 170, 0.1) !important; border-radius: 16px !important; }
.tray-wrap { background: linear-gradient(180deg, transparent, rgba(8, 5, 2, 0.75) 38%, rgba(8, 5, 2, 0.92)) !important; }
#sel-panel, #sel-panel.paper { border-radius: 16px !important; border: 1px solid var(--u-line2) !important; box-shadow: var(--u-shadow) !important; padding: 14px 16px !important; }
#sel-panel.paper .sp-head b { color: var(--u-text) !important; }
#sel-panel.paper .sp-head small { color: var(--u-mut) !important; }
.sp-row .btn { min-height: 36px; }
.hint { border-radius: 999px !important; }
.speed { border-radius: 999px !important; border: 1px solid var(--u-line2) !important; background: rgba(14, 9, 5, 0.88) !important; padding: 4px !important; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5) !important; }
.speed button { border-radius: 999px !important; transition: background 0.2s, color 0.2s; }
.speed button.on { background: var(--u-gold-grad) !important; color: #2a1708 !important; }
.strength { border-radius: 999px !important; border: 1px solid var(--u-line2) !important; background: rgba(14, 9, 5, 0.86) !important; box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5) !important; }
.vol-pop { border-radius: 16px !important; }

/* tooltip */
#tooltip, #tooltip.paper { border-radius: 14px !important; border: 1px solid var(--u-line2) !important; box-shadow: var(--u-shadow) !important; padding: 14px 16px !important; background-color: #160e07 !important; }
#tooltip.show { animation: u-pop 0.18s var(--u-ease) both; }
@keyframes u-pop { from { opacity: 0; transform: translateY(4px) scale(0.98); } }
#tooltip.paper h4 { color: var(--u-gold-hi) !important; }
#tooltip.paper p { color: var(--u-text2) !important; }
#tooltip.paper .bars { color: var(--u-mut) !important; }
#tooltip.paper .bars i { background: rgba(255, 230, 170, 0.1) !important; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6) !important; }
#tooltip.paper .bars i b { background: linear-gradient(90deg, #b8861f, #f2c25a) !important; }
#tooltip.paper .gb { color: #a6e28a !important; } #tooltip.paper .gb.b { color: #ff9a84 !important; }

/* toast */
#toast {
  top: 22px; padding: 12px 22px 12px 18px; border-radius: 999px; display: flex; align-items: center; gap: 10px;
  background: linear-gradient(180deg, rgba(42, 28, 14, 0.97), rgba(18, 11, 6, 0.97)); border: 1px solid var(--u-line2);
  font: 700 14.5px var(--caps); letter-spacing: 0.02em; color: var(--u-text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 22px rgba(232, 184, 74, 0.14);
  transform: translateX(-50%) translateY(-18px) scale(0.96); transition: opacity 0.28s ease, transform 0.42s var(--u-spring);
}
#toast::before { content: ''; flex: none; width: 9px; height: 9px; transform: rotate(45deg); background: var(--u-gold-mid); box-shadow: 0 0 10px var(--u-gold); }
#toast.show { transform: translateX(-50%) translateY(0) scale(1); }

/* announcement banner (To Battle!, Victory) */
.an-inner { filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.7)); }

/* ── campaign ─────────────────────────────────────────────────────────── */
.cmp-brief, .cmp-brief.parchment { border-radius: 20px !important; box-shadow: var(--u-shadow) !important; }
.cmp-brief h2 { background: linear-gradient(180deg, #fff6d4, #f2c25a 60%, #c8902e); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.cmp-brief h3 { color: var(--u-gold) !important; }
.cb-kicker { color: var(--u-gold-mid) !important; }
.cb-odds { border-color: var(--u-line) !important; border-radius: 12px; background: rgba(0, 0, 0, 0.25); }
.cb-unit { border-color: var(--u-line) !important; border-radius: 12px !important; background: rgba(0, 0, 0, 0.25); }
.cb-unit b { color: var(--u-text) !important; } .cb-unit small { color: var(--u-mut) !important; }
.cb-odds-row { color: var(--u-text2) !important; }
.cb-odds-row b.gold { color: var(--u-gold-mid) !important; } .cb-odds-row b.red { color: var(--u-red-hi) !important; }
.cb-best { color: var(--u-text2) !important; }
.cb-new { color: var(--u-text) !important; border-color: var(--u-line2) !important; background: rgba(242, 194, 90, 0.08) !important; border-radius: 12px; }
.cmp-realm { border-radius: 14px !important; transition: transform 0.2s var(--u-spring), border-color 0.2s, box-shadow 0.2s !important; }

/* ── profiles, leaderboards, weekly, armoury bits inside windows ──────── */
.wk-rule { background: linear-gradient(90deg, rgba(185, 138, 255, 0.14), rgba(185, 138, 255, 0.03)) !important; border-color: rgba(185, 138, 255, 0.4) !important; border-radius: 14px !important; }
.wk-rule b { color: var(--u-text) !important; } .wk-rule small { color: var(--u-text2) !important; }
.wk-ri { background: rgba(185, 138, 255, 0.18) !important; }
.wk-kicker { color: #cda8ff !important; }
.wk-board li, .hall-list li, .co-row, .vr, .pf-co, .pf-unit, .spoils-row, .lo-row, .pf-tile, .earn-row { background: linear-gradient(180deg, rgba(255, 230, 170, 0.05), rgba(0, 0, 0, 0.2)) !important; border: 1px solid var(--u-line) !important; border-radius: 12px !important; }
.wk-board li.top, .hall-list li.top { background: linear-gradient(90deg, rgba(242, 194, 90, 0.22), rgba(242, 194, 90, 0.03)) !important; border-color: rgba(242, 194, 90, 0.45) !important; }
.hall-list li:hover, .wk-board li.link:hover { border-color: var(--u-gold) !important; background: linear-gradient(90deg, rgba(242, 194, 90, 0.18), rgba(0, 0, 0, 0.1)) !important; }
.wn, .hn b, .co-main b, .vr b, .pf-co b, .pf-unit b, .lo-unit b, .wk-name, .spoils-row b, .spoils-total { color: var(--u-text) !important; }
.wg, .hv, .wr, .hr { color: var(--u-gold-mid) !important; }
.hn small, .pf-title { color: #ff9a84 !important; }
.pf-hero { border-color: var(--u-line2) !important; border-radius: 18px !important; background: radial-gradient(ellipse at 18% 50%, color-mix(in srgb, var(--pf1) 40%, transparent), transparent 70%), linear-gradient(135deg, rgba(255, 230, 170, 0.06), rgba(0, 0, 0, 0.25)) !important; }
.pf-name { background: linear-gradient(180deg, #fff6d4, #f2c25a 60%, #c8902e); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.pf-motto { color: var(--u-text2) !important; } .pf-meta { color: var(--u-mut) !important; }
.pf-tile b { color: var(--u-text) !important; } .pf-tile span { color: var(--u-gold) !important; } .pf-tile small { color: var(--u-mut) !important; }
.pf-honours span { box-shadow: 0 2px 8px rgba(240, 180, 70, 0.25); }
.pf-wk { border-radius: 12px !important; background: rgba(185, 138, 255, 0.1) !important; }
.pf-wk b { color: var(--u-text) !important; } .pf-wk span { color: #cda8ff !important; } .pf-wk small { color: var(--u-mut) !important; }
.pf-wk.gold { background: var(--u-gold-grad) !important; } .pf-wk.gold b, .pf-wk.gold span, .pf-wk.gold small { color: #2a1708 !important; }
.pe-preview { background: linear-gradient(180deg, rgba(255, 230, 170, 0.06), rgba(0, 0, 0, 0.25)) !important; border-color: var(--u-line2) !important; border-radius: 18px !important; }
.pe-name { color: var(--u-text) !important; } .pe-title { color: #ff9a84 !important; } .pe-motto { color: var(--u-text2) !important; }
.pe-row > label { color: var(--u-gold) !important; }
.pe-mini, .pe-sig { background: rgba(0, 0, 0, 0.35) !important; border-radius: 10px !important; }
.pe-mini.on, .pe-sig.on { border-color: var(--u-gold) !important; background: rgba(242, 194, 90, 0.16) !important; box-shadow: 0 0 14px rgba(232, 184, 74, 0.25); }
.pe-sig svg { fill: var(--u-text) !important; }
.pe-sw button.on { box-shadow: 0 0 0 2px #140d07, 0 0 0 5px var(--u-gold) !important; }
.pf-skin { background: rgba(255, 230, 170, 0.08) !important; }
.pf-skin .uicon { fill: var(--u-mut) !important; }
.pf-skin.has .uicon { fill: #3b2208 !important; }
.wk-prizes { background: linear-gradient(90deg, rgba(242, 194, 90, 0.16), rgba(242, 194, 90, 0.03)) !important; border-color: var(--u-line2) !important; border-radius: 14px !important; }
.wk-prize-h { color: var(--u-gold) !important; }
.wk-result { background: rgba(185, 138, 255, 0.12) !important; color: var(--u-text) !important; border-radius: 14px !important; }
.vr.promoted { background: linear-gradient(90deg, rgba(242, 194, 90, 0.25), rgba(0, 0, 0, 0.1)) !important; }
.vr.enlisted { background: linear-gradient(90deg, rgba(143, 224, 106, 0.16), rgba(0, 0, 0, 0.1)) !important; }
.vr.lost { background: linear-gradient(90deg, rgba(200, 64, 44, 0.2), rgba(0, 0, 0, 0.1)) !important; }
.vr.lost b { color: #ff9a84 !important; }
.co-xp { background: rgba(255, 230, 170, 0.1) !important; }

/* ── sign-in card ─────────────────────────────────────────────────────── */
#gate.active { background: radial-gradient(ellipse at center, rgba(10, 6, 3, 0.35), rgba(5, 3, 1, 0.88)); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.gate-card { border-radius: 22px !important; box-shadow: var(--u-shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.6), inset 0 0 0 5px rgba(20, 12, 6, 0.6), inset 0 0 0 6px rgba(232, 184, 74, 0.16) !important; animation: u-card-in 0.55s var(--u-spring) both !important; }
.gate-card h2 { background: linear-gradient(180deg, #fff6d4, #f2c25a 60%, #c8902e); -webkit-background-clip: text; background-clip: text; color: transparent !important; }
.gate-card .sub { color: var(--u-mut) !important; }

/* ── loading screen polish ────────────────────────────────────────────── */
#loader.leaving { transition: opacity 0.6s ease, filter 0.6s ease; filter: blur(4px); }

/* ── small screens ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .modal-card.paper-edge, .modal-card { padding: 30px 18px 22px; border-radius: 18px; }
  .modal-card::before, .modal-card::after { width: 30px; height: 30px; top: 8px; left: 8px; }
  .modal-card::after { right: 8px; bottom: 8px; top: auto; left: auto; }
  .modal-card .x { top: 12px; right: 12px; }
  .mtabs { border-radius: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen.active, .modal-card.enter, .modal-card.swap, .modal.closing .modal-card, .btn-battle { animation: none !important; }
  .btn::after { display: none; }
}

/* ── large displays: scale the menu and windows up so they don't look lost ── */
@media (min-width: 1800px) and (min-height: 980px) {
  .paper-drop, .gate-drop { zoom: 1.2; }
}
@media (min-width: 2300px) and (min-height: 1200px) {
  .paper-drop, .gate-drop { zoom: 1.38; }
}
/* gold slider knobs */
input.vol::-webkit-slider-thumb { background: radial-gradient(circle at 35% 30%, #fff6d4, #f2c25a 45%, #a8761a) !important; border: 1px solid #6b4a14 !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), 0 0 10px rgba(242, 194, 90, 0.4) !important; }
input.vol::-moz-range-thumb { background: radial-gradient(circle at 35% 30%, #fff6d4, #f2c25a 45%, #a8761a) !important; border: 1px solid #6b4a14 !important; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6) !important; }
/* large displays: HUD pieces anchored to the edges scale up too */
@media (min-width: 1800px) and (min-height: 980px) {
  .title-plate, .treasury, .enemy-plate, #sel-panel, .hud-top > .icon-btn, .hud-right, .speed, .strength, .side-switch, .battle-feed, .hint,
  .cmp-brief, .cmp-realms, .cmp-realm-title, .cmp-top, #unit-tray .ucard, .tray-actions, #toast, #tooltip { zoom: 1.2; }
}
@media (min-width: 2300px) and (min-height: 1200px) {
  .title-plate, .treasury, .enemy-plate, #sel-panel, .hud-top > .icon-btn, .hud-right, .speed, .strength, .side-switch, .battle-feed, .hint,
  .cmp-brief, .cmp-realms, .cmp-realm-title, .cmp-top, #unit-tray .ucard, .tray-actions, #toast, #tooltip { zoom: 1.35; }
}

/* no sliding light sweeps on any surface */
.btn::after, .tt-card::after, .uc-shine, .av-cta::after { content: none !important; display: none !important; animation: none !important; }
