@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800;900&family=Rajdhani:wght@500;600;700;800&display=swap');
:root{color-scheme:dark}*,*::before,*::after{box-sizing:border-box}html{background:#050c18}body{--glow:#60d7ef;--edge:#3b7188;--surface:#10263b;--surface2:#091728;--ink:#eafaff;--muted:#94b4c9;--metal:#d7ae6b;background:radial-gradient(ellipse at 50% -15%,color-mix(in srgb,var(--glow) 18%,transparent),transparent 55%),linear-gradient(165deg,#071627,#050c18 72%)!important;color:var(--ink)!important;font-family:'Rajdhani',system-ui,sans-serif!important;min-height:100dvh;overflow-x:hidden}
body[data-theme=core]{--glow:#62d7f3;--edge:#356c88;--surface:#112a40;--surface2:#081829;--metal:#d8b36f}
body[data-theme=inferno]{--glow:#ff5c70;--edge:#95415a;--surface:#321b2b;--surface2:#1a0d19;--metal:#f5a68b}
body[data-theme=arcane]{--glow:#c28bff;--edge:#7d58ac;--surface:#281c42;--surface2:#140f29;--metal:#d3a8ff}
body[data-theme=aegis]{--glow:#5da6ff;--edge:#3c69ad;--surface:#142746;--surface2:#09172e;--metal:#b8eaff}
body[data-theme=solar]{--glow:#f7c66d;--edge:#9a7540;--surface:#32291c;--surface2:#19140c;--metal:#ffe0a1}
body[data-theme=titan]{--glow:#a9c8d7;--edge:#5b7789;--surface:#26333e;--surface2:#101c27;--metal:#e0e7ed}
.app-header,.arena-top,.tools{width:min(100% - 22px,1250px)!important;max-width:1250px!important;margin-inline:auto!important}.app-header{background:linear-gradient(100deg,color-mix(in srgb,var(--surface) 80%,transparent),#08121d)!important;border:1px solid var(--edge)!important;border-radius:13px!important;padding:10px 14px!important;box-shadow:0 5px 30px #0005!important;margin-top:9px!important}.brand-symbol{background:var(--surface)!important;border:1px solid var(--glow)!important;color:var(--glow)!important;box-shadow:0 0 18px color-mix(in srgb,var(--glow) 28%,transparent)!important}.brand h1{font-family:'Barlow Condensed',sans-serif!important;font-size:clamp(29px,4vw,46px)!important;letter-spacing:.08em!important;line-height:1!important}.brand h1 em{color:var(--glow)!important;font-style:normal!important}.brand-kicker,.brand-subtitle,.eyebrow,.tools-label{color:var(--muted)!important;letter-spacing:.16em!important}.icon-button{border:1px solid var(--edge)!important;background:var(--surface)!important;color:var(--ink)!important;border-radius:9px!important}.arena-top{margin-block:8px!important}.arena-heading{margin-bottom:5px!important}.matchbar{border:1px solid var(--edge)!important;background:var(--surface2)!important;border-radius:11px!important;padding:6px!important;gap:5px!important}.matchbar button,.matchbar span{background:var(--surface)!important;border:1px solid color-mix(in srgb,var(--edge) 70%,transparent)!important;color:var(--ink)!important;border-radius:7px!important;font-family:'Rajdhani',sans-serif!important;font-weight:800!important}
#board{width:min(100% - 22px,1250px)!important;max-width:1250px!important;margin:0 auto!important;gap:10px!important;min-width:0!important}#board .panel{position:relative!important;min-width:0!important;overflow:hidden!important;background:linear-gradient(145deg,color-mix(in srgb,var(--surface) 88%,#fff 3%),var(--surface2))!important;border:1px solid var(--edge)!important;border-top:3px solid var(--glow)!important;border-radius:14px!important;box-shadow:inset 0 0 32px #0004,0 12px 30px #0005!important;padding:clamp(10px,1.5vw,20px)!important;display:flex!important;flex-direction:column!important;gap:clamp(5px,1dvh,12px)!important}#board .panel::before{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(120deg,color-mix(in srgb,var(--glow) 9%,transparent),transparent 45%);opacity:.7}#board .panel::after{content:'';position:absolute;top:0;right:0;width:38px;height:38px;border-top:2px solid var(--metal);border-right:2px solid var(--metal);clip-path:polygon(100% 0,100% 100%,0 0);opacity:.85;pointer-events:none}#board .panel h2{font-family:'Barlow Condensed',sans-serif!important;letter-spacing:.12em!important;color:var(--metal)!important;font-size:clamp(17px,2.2vw,24px)!important;margin:0!important;text-transform:uppercase!important}#board .panel .lp{color:#f5fcff!important;font-family:'Barlow Condensed',Impact,sans-serif!important;font-size:clamp(58px,11vw,125px)!important;line-height:1!important;letter-spacing:.025em!important;font-variant-numeric:tabular-nums!important;text-shadow:0 0 26px color-mix(in srgb,var(--glow) 24%,transparent)!important;white-space:nowrap!important;overflow:visible!important;text-overflow:clip!important;margin:clamp(4px,1dvh,14px) 0!important}#board .panel .lp::after{content:'LIFE POINTS';display:block;color:var(--muted);font:700 11px 'Rajdhani',sans-serif;letter-spacing:.3em;margin-top:5px;text-shadow:none}#board .panel.active-turn{outline:1px solid var(--metal)!important;outline-offset:-4px!important}#board .panel .controls{gap:7px!important}#board .panel .controls button,#board .panel .compact-calc,#board .panel .entry button,#board .panel .bottom button{border-radius:9px!important;min-height:45px!important;font-family:'Barlow Condensed',sans-serif!important;font-size:clamp(16px,2.5vw,22px)!important;font-weight:800!important;background:var(--surface)!important;border:1px solid var(--edge)!important;color:var(--ink)!important}#board .panel .controls button[data-d^='-']{background:linear-gradient(180deg,#522339,#2a1626)!important;border-color:#a85472!important;color:#ffd2df!important}#board .panel .controls button[data-d='500'],#board .panel .controls button[data-d='1000']{background:linear-gradient(180deg,#1d4b43,#10322f)!important;border-color:#4caa91!important;color:#cbffe9!important}#board .panel .entry input{background:var(--surface2)!important;border:1px solid var(--edge)!important;color:var(--ink)!important;border-radius:7px!important;min-width:0!important}#board .panel .bottom{margin:0!important}#board .panel .bottom label{color:var(--muted)!important}.tools{background:var(--surface2)!important;border:1px solid var(--edge)!important;border-radius:12px!important;padding:10px!important;margin-top:9px!important}.tool-buttons{display:grid!important;grid-template-columns:repeat(6,minmax(0,1fr))!important;gap:6px!important}.tool-buttons button{min-width:0!important;margin:0!important;min-height:44px!important;padding:6px!important;font-family:'Rajdhani',sans-serif!important;font-size:clamp(12px,1.4vw,16px)!important;font-weight:800!important;border-radius:8px!important;border:1px solid var(--edge)!important;background:var(--surface)!important;color:var(--ink)!important}.tool-buttons button.danger{background:#412336!important;border-color:#8d4964!important}#clock{color:var(--glow)!important;font-family:'Barlow Condensed',sans-serif!important;font-size:26px!important;margin:4px 0!important}#history{background:var(--surface)!important;border-color:var(--edge)!important}#result{color:var(--metal)!important}dialog{background:linear-gradient(155deg,var(--surface),var(--surface2))!important;color:var(--ink)!important;border:1px solid var(--edge)!important;border-radius:15px!important;box-shadow:0 25px 75px #000c!important}dialog::backdrop{background:#020712d9!important;backdrop-filter:blur(5px)}.settings-dialog{max-height:90dvh!important}.settings-group{border-color:var(--edge)!important}.settings-dialog button,.settings-dialog select{background:var(--surface)!important;color:var(--ink)!important;border-color:var(--edge)!important}.theme-choice{border-color:var(--edge)!important;background:var(--surface2)!important}.theme-choice.selected{outline:2px solid var(--glow)!important}.theme-preview{background:linear-gradient(145deg,var(--surface),var(--surface2))!important}.theme-info{color:var(--ink)!important}.random-dialog{width:min(92vw,390px)!important;max-height:90dvh!important;background:radial-gradient(circle at 50% 20%,var(--surface),var(--surface2) 78%)!important;border:2px solid var(--glow)!important}.random-object{border-color:var(--glow)!important;background:radial-gradient(circle,var(--surface),var(--surface2))!important;box-shadow:0 0 35px color-mix(in srgb,var(--glow) 30%,transparent)!important}.random-title{color:var(--metal)!important}.duel-overlay{border-color:var(--glow)!important}
/* The feedback must outrank every theme rule, including animated number styles. */
#board .panel.loss{animation:core-damage 1.1s ease-out!important}#board .panel.gain{animation:core-heal 1.1s ease-out!important}#board .panel.loss .lp{color:#ff647d!important;animation:core-damage-text 1.1s ease-out!important}#board .panel.gain .lp{color:#57ff9c!important;animation:core-heal-text 1.1s ease-out!important}@keyframes core-damage{0%,40%{background:#692338!important;box-shadow:inset 0 0 55px #ff355d99,0 0 35px #ff355d88}100%{box-shadow:inset 0 0 32px #0004,0 12px 30px #0005}}@keyframes core-heal{0%,40%{background:#124c34!important;box-shadow:inset 0 0 55px #25f58c88,0 0 35px #25f58c88}100%{box-shadow:inset 0 0 32px #0004,0 12px 30px #0005}}@keyframes core-damage-text{0%,55%{color:#ff4568;text-shadow:0 0 25px #ff355d}100%{color:#f5fcff}}@keyframes core-heal-text{0%,55%{color:#45ffa1;text-shadow:0 0 25px #25ff91}100%{color:#f5fcff}}
/* Desktop / wide landscape: side-by-side cards; compact keeps only three essential controls. */
@media(min-width:760px){#board:not(.wide){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}#board.wide{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important}#board.wide .panel{min-height:360px!important}#board.wide .controls{display:flex!important;flex-direction:column!important;gap:9px!important}#board.wide .controls button[data-d='-500'],#board.wide .controls button[data-d='500']{display:none!important}#board.wide .compact-calc{display:block!important}}
@media(max-width:759px){.app-header{padding:7px 10px!important}.brand h1{font-size:29px!important}.brand-kicker{font-size:9px!important}.brand-subtitle{font-size:9px!important}.arena-heading{display:none!important}.matchbar{display:grid!important;grid-template-columns:1fr auto auto!important;gap:4px!important}.matchbar #turn{grid-column:1}.matchbar #turncount{grid-column:2}.matchbar #score{grid-column:3}.matchbar #matchwin{grid-column:1/3}.matchbar #matchreset{grid-column:3}.matchbar button,.matchbar span{font-size:12px!important;padding:4px!important;min-height:29px!important}#board:not(.wide){display:grid!important;grid-template-columns:1fr!important;grid-auto-rows:minmax(0,1fr)!important}#board:not(.wide) .panel .lp{font-size:clamp(48px,17vw,85px)!important;margin:0!important}#board:not(.wide) .panel .controls{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:5px!important}#board:not(.wide) .panel .controls button{font-size:clamp(13px,3.5vw,18px)!important;min-height:43px!important}#board:not(.wide) .panel .entry{margin:0!important}#board:not(.wide) .panel .bottom button{font-size:14px!important;min-height:36px!important}#board.wide{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-template-rows:minmax(0,1fr)!important;gap:7px!important}#board.wide .panel{height:100%!important;min-height:0!important;padding:clamp(7px,1.5vw,13px)!important;display:flex!important;flex-direction:column!important;justify-content:space-between!important}#board.wide .panel h2{font-size:clamp(13px,3.3vw,19px)!important;text-align:center!important}#board.wide .panel .lp{font-size:clamp(35px,9vw,65px)!important;text-align:center!important;margin:auto 0!important}#board.wide .panel .lp::after{font-size:9px!important;letter-spacing:.16em!important}#board.wide .controls{display:flex!important;flex-direction:column!important;gap:clamp(6px,1.2dvh,14px)!important;margin:0!important}#board.wide .controls button{height:clamp(45px,7.5dvh,72px)!important;min-height:0!important;width:100%!important}#board.wide .controls button[data-d='-500'],#board.wide .controls button[data-d='500']{display:none!important}#board.wide .controls button[data-d='1000']{order:1}#board.wide .controls button[data-d='-1000']{order:2}#board.wide .compact-calc{display:block!important;width:100%!important;min-height:clamp(44px,7dvh,64px)!important;margin:0!important;font-size:clamp(13px,3.5vw,19px)!important}#board.wide .entry,#board.wide .bottom{display:none!important}.tools{padding:7px!important}.tools-label{display:none!important}.tool-buttons{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important}.tool-buttons button{min-height:38px!important;font-size:12px!important}#history{display:none!important}#clock{font-size:20px!important}body.two-player{display:flex!important;flex-direction:column!important;min-height:100dvh!important;height:auto!important;max-height:none!important;overflow-y:auto!important}body.two-player #board{flex:1 0 auto!important}body.two-player #board.wide{flex:1 0 auto!important;min-height:clamp(310px,43dvh,620px)!important}body.two-player .tools{flex-shrink:0!important;margin-bottom:6px!important}}
@media(max-width:759px) and (orientation:landscape){.app-header{margin-top:3px!important}.brand-kicker,.brand-subtitle,.arena-heading{display:none!important}#board:not(.wide){grid-template-columns:repeat(2,minmax(0,1fr))!important;grid-auto-rows:auto!important}#board.wide{min-height:220px!important}#board.wide .panel{min-height:220px!important}#board.wide .controls button{height:40px!important}#board.wide .compact-calc{min-height:40px!important}.tool-buttons{grid-template-columns:repeat(6,minmax(0,1fr))!important}}
@media(max-height:620px) and (orientation:landscape){#board:not(.wide){grid-template-columns:repeat(2,minmax(0,1fr))!important}.tools{margin-top:5px!important}}
@media(max-width:365px){.brand h1{font-size:25px!important}#board.wide .panel .lp{font-size:clamp(30px,8vw,43px)!important}#board.wide .panel h2{font-size:12px!important}#board.wide .controls button{font-size:15px!important}}
@media(prefers-reduced-motion:reduce){#board .panel.gain,#board .panel.loss,#board .panel.gain .lp,#board .panel.loss .lp{animation:none!important}dialog::backdrop{backdrop-filter:none}}
body.power-save #board .panel.gain,body.power-save #board .panel.loss,body.power-save #board .panel.gain .lp,body.power-save #board .panel.loss .lp{animation:none!important}
