:root{--bg:#eef0e9;--paper:#f9faf5;--ink:#18251e;--muted:#718074;--line:#d5dbd1;--lime:#d6fc66;--dark:#18251e;--orange:#f09a5e;--red:#cc5952;--radius:19px}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,"Segoe UI",Arial,sans-serif;font-size:14px;line-height:1.5}button,input,select{font:inherit}button,a,input,select{-webkit-tap-highlight-color:transparent}button{cursor:default;border:0;border-radius:10px;padding:12px 18px;font-weight:650;transition:background .16s,transform .16s}button:active{transform:translateY(1px)}button:disabled{opacity:.42;cursor:default;transform:none}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #538943;outline-offset:3px}a{color:inherit;cursor:default}h1,h2,h3,p{margin:0}h1{font-size:clamp(42px,5vw,70px);line-height:1.02;font-weight:800;letter-spacing:-3px}h2{font-size:28px;line-height:1.15;letter-spacing:-1px}h3{font-size:18px;letter-spacing:-.4px}.topbar{max-width:1376px;padding:26px 32px 24px;margin:auto;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line)}.brand{display:flex;align-items:center;gap:12px;text-decoration:none;font-weight:900;line-height:1.05;letter-spacing:1.1px;font-size:14px}.brand-die{width:42px;height:42px;background:var(--dark);color:var(--lime);display:grid;place-items:center;font-size:27px;border-radius:10px;transform:rotate(-6deg)}.brand-dot{color:#6e9f2f}.header-right{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted)}.live-dot{width:6px;height:6px;background:#5c9b58;border-radius:50%}.demo-badge{border:1px solid var(--line);border-radius:6px;padding:5px 8px;font-size:10px;letter-spacing:1.3px;margin-left:16px}main{max-width:1376px;margin:auto;padding:34px 32px 20px;min-height:calc(100vh - 170px)}.eyebrow{font:700 10px/1.4 "Segoe UI",sans-serif;letter-spacing:2px;color:var(--muted);text-transform:uppercase;margin-bottom:12px}.muted{color:var(--muted)}.primary{background:var(--lime);color:var(--ink)}.primary:hover:not(:disabled){background:#c7ef53}.secondary{background:#e8ece2;color:var(--ink);border:1px solid #d0d9c9}.secondary:hover:not(:disabled){background:#dde5d5}.dark-button{background:var(--dark);color:#f7fbef}.dark-button:hover:not(:disabled){background:#304132}.text-button{padding:4px 0;background:none;color:var(--muted);font-size:12px;text-decoration:underline;text-underline-offset:3px}.wide{width:100%}.small{font-size:12px;padding:8px 12px}.panel{background:var(--paper);border:1px solid var(--line);border-radius:var(--radius)}.panel-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.chip{font-size:10px;letter-spacing:1.1px;padding:5px 9px;border-radius:6px;background:#e8eddf;white-space:nowrap}.landing{display:grid;grid-template-columns:1.2fr 1fr;gap:52px;max-width:1100px;margin:30px auto 50px;align-items:center}.hero-copy{margin-top:22px;color:var(--muted);max-width:430px;font-size:16px;line-height:1.7}.hero-pips{display:flex;gap:8px;margin-bottom:30px}.hero-pips span{width:9px;height:9px;border-radius:2px;background:#b6c1ae}.hero-pips span:last-child{background:var(--ink)}.hero-figures{display:flex;align-items:flex-end;gap:18px;margin:30px 0 0;max-width:420px;border-bottom:1px solid var(--line);height:210px;position:relative}.hero-figures .pixel-fighter{width:120px;filter:drop-shadow(0 8px 0 #d2d9c8)}.hero-figures .pixel-fighter:nth-child(2){width:145px;align-self:center}.hero-note{font-size:11px;color:var(--muted);margin-top:14px;letter-spacing:.2px}.auth-panel{padding:30px;box-shadow:0 18px 60px #1c2c1610}.auth-tabs{display:flex;background:#e9ede3;padding:4px;border-radius:10px;margin-bottom:27px}.auth-tabs button{flex:1;background:none;padding:9px}.auth-tabs button.active{background:var(--paper);box-shadow:0 2px 6px #00000008}.auth-panel h2{margin-bottom:10px}.auth-panel p.muted{margin-bottom:23px;font-size:13px}.field{display:block;margin-top:16px;font-size:12px;font-weight:600}.field input{display:block;width:100%;padding:13px 14px;background:#f0f3ea;border:1px solid var(--line);border-radius:10px;color:var(--ink);margin-top:7px;font-size:14px}.auth-panel .primary{margin-top:23px;padding:15px}.auth-foot{font-size:11px;color:var(--muted);margin-top:20px;text-align:center}.page-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:26px;gap:20px}.page-heading h1{font-size:32px;letter-spacing:-1.2px}.page-heading p{color:var(--muted);font-size:12px;margin-top:5px}.nav-pills{display:flex;gap:4px;background:#e1e7dc;padding:4px;border-radius:11px}.nav-pills button{background:none;padding:9px 18px;font-size:12px}.nav-pills button.active{background:var(--paper)}.dashboard{display:grid;grid-template-columns:276px minmax(0,1fr) 252px;gap:20px;align-items:start}.profile{padding:23px}.profile .eyebrow{margin:0}.profile-name{font-size:23px;margin-top:3px;overflow-wrap:anywhere}.level-tag{background:var(--lime);width:38px;height:38px;border-radius:10px;display:grid;place-items:center;font-weight:800;font-size:18px;flex-shrink:0}.avatar-stage{position:relative;display:flex;align-items:center;justify-content:center;height:226px;background-image:linear-gradient(#dce3d65c 1px,transparent 1px),linear-gradient(90deg,#dce3d65c 1px,transparent 1px);background-size:22px 22px;border-radius:12px;background-color:#eef2e6;overflow:hidden;margin:19px 0}.avatar-stage:after{content:"";position:absolute;bottom:30px;width:110px;height:12px;background:#b9c5af;border-radius:50%;opacity:.65}.avatar-stage .pixel-fighter{width:145px;z-index:1;filter:drop-shadow(5px 6px 0 #bec9b55c);animation:breathe 3s ease-in-out infinite}.skin-label{position:absolute;bottom:8px;right:10px;font-size:9px;color:var(--muted);letter-spacing:1px;z-index:2}.pixel-fighter{shape-rendering:crispEdges;overflow:visible}.xp-head{display:flex;justify-content:space-between;font-size:10px;color:var(--muted);margin-bottom:5px}.bar{height:5px;background:#dce3d4;border-radius:8px;overflow:hidden}.bar>span{display:block;height:100%;background:#4f7250;border-radius:8px}.stats-grid{display:grid;gap:13px;margin:23px 0}.stat-line{display:grid;grid-template-columns:1fr auto;gap:7px;font-size:12px;align-items:center}.stat-line b{font-size:14px}.stat-line .bar{grid-column:1/-1;height:3px}.stat-line .bar>span{background:#98ae85}.profile-foot{border-top:1px solid var(--line);padding-top:14px;display:flex;justify-content:space-between;align-items:center}.profile-foot span{font-size:10px;color:var(--muted)}.arena-panel{background:var(--dark);border:1px solid #293b2d;border-radius:var(--radius);padding:28px;color:#f1f5ea;min-height:495px;position:relative;overflow:hidden}.arena-panel .eyebrow{color:#9eae99}.arena-panel .muted{color:#a2b09d}.arena-idle{min-height:320px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 8px}.arena-idle h2{font-size:34px;line-height:1.08;margin:15px 0 12px}.arena-idle p{font-size:13px;max-width:340px}.arena-mark{display:flex;gap:7px;transform:rotate(-8deg);margin:8px 0 16px}.arena-mark span{width:19px;height:19px;background:#405337;border-radius:4px}.arena-mark span:last-child{background:var(--lime)}.mode-buttons{display:grid;grid-template-columns:1fr 1fr;gap:12px;width:100%;margin-top:32px}.mode-button{text-align:left;padding:18px}.mode-button b{display:block;font-size:17px}.mode-button small{display:block;margin-top:5px;font-weight:400;font-size:11px;opacity:.7}.mode-button.pve{background:#2e4130;color:#e9f0e2;border:1px solid #486043}.arena-bottom{display:flex;justify-content:space-between;border-top:1px solid #3d4e3a;padding-top:17px;font-size:10px;color:#a2b09d;gap:12px}.arena-bottom b{color:#d6fc66;font-weight:600}.right-column{display:grid;gap:20px}.mini-rank,.hint-panel{padding:22px}.rank-list{list-style:none;padding:0;margin:0;display:grid;gap:16px}.rank-row{display:grid;grid-template-columns:16px 30px 1fr auto;gap:9px;align-items:center;font-size:12px}.rank-row .pixel-fighter{width:28px;height:32px}.rank-row .pos{color:var(--muted);font-size:11px}.rank-row .rank-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-weight:600}.rank-row .rank-level{font-size:9px;color:var(--muted)}.rank-row .score{font-variant-numeric:tabular-nums;font-weight:700}.rank-row.you .rank-name{color:#66862e}.hint-panel{background:#e5ebdc}.hint-panel h3{font-size:14px;margin-bottom:9px}.hint-panel p{font-size:12px;line-height:1.7;color:#75816c}.hint-icon{font-size:24px;margin-bottom:12px;display:block}.mini-summary{margin-top:20px;display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.mini-summary>div{padding:17px;background:var(--paper);border:1px solid var(--line);border-radius:13px}.mini-summary span{font-size:10px;color:var(--muted);display:block}.mini-summary strong{font-size:24px;letter-spacing:-1px}.battle-heading{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#a8b4a1}.battle-heading .chip{background:#2c3e2b;color:var(--lime)}.fighters{display:grid;grid-template-columns:1fr 55px 1fr;align-items:center;gap:12px;padding:19px 0 12px}.fighter-slot{text-align:center;min-width:0}.fighter-title{font-size:13px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.fighter-sub{font-size:10px;color:#9aa991;margin:2px 0 8px}.fighter-visual{height:148px;display:grid;place-items:center;position:relative}.fighter-visual:after{content:"";position:absolute;width:80px;height:10px;border-radius:50%;bottom:7px;background:#0c150b}.fighter-visual .pixel-fighter{width:100px;z-index:1;filter:drop-shadow(0 0 15px #c5f3690d)}.fighter-slot.current .pixel-fighter{animation:breathe 2s infinite}.fighter-slot.current .fighter-title{color:var(--lime)}.fighter-slot.enemy .pixel-fighter{transform:scaleX(-1)}.hp-line{display:flex;justify-content:space-between;font-size:10px;color:#afbea4;margin-top:8px}.hp-bar{height:7px;background:#34422e;border-radius:5px;margin-top:5px;overflow:hidden}.hp-bar span{display:block;height:100%;background:var(--lime);transition:width .4s}.enemy .hp-bar span{background:#e5a26a}.versus{font-weight:800;font-size:16px;text-align:center;color:#617357}.turn-banner{display:flex;align-items:center;justify-content:space-between;border-top:1px solid #3b4e34;padding:16px 0}.turn-banner strong{font-size:13px}.turn-banner small{display:block;color:#9aac92;font-size:10px;margin-top:2px}.clock{width:45px;height:45px;border:2px solid #5e7943;border-radius:50%;display:grid;place-items:center;font-size:18px;font-weight:750;font-variant-numeric:tabular-nums;color:var(--lime)}.clock.urgent{color:#ffb28c;border-color:#ffb28c}.roll-area{border:1px solid #425637;border-radius:12px;padding:17px;background:#22301e;min-height:140px}.roll-top{display:flex;justify-content:space-between;gap:10px;align-items:center}.roll-top span{font-size:9px;color:#acba9c;letter-spacing:1px}.roll-top h3{font-size:18px;margin-top:4px}.roll-pips{display:flex;gap:4px}.roll-pips i{height:7px;width:7px;border-radius:2px;background:#526249}.roll-pips i.used{background:var(--lime)}.attack-values{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-top:15px}.attack-values strong{font-size:27px;font-variant-numeric:tabular-nums;font-weight:700;line-height:1.1}.attack-values span{display:block;color:#9fb291;font-size:10px;margin-top:3px}.empty-attack{display:flex;align-items:center;justify-content:center;min-height:106px;color:#a4b298;text-align:center;font-size:12px;line-height:1.8}.battle-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}.battle-actions .secondary{background:#30402b;color:#d6e2cc;border-color:#506243}.action-hint{color:#93a28a;font-size:10px;line-height:1.5;margin-top:11px}.battle-log{margin-top:20px;padding:23px}.log-list{list-style:none;padding:0;margin:0;display:grid;gap:10px;max-height:220px;overflow:auto}.log-list li{display:flex;justify-content:space-between;gap:12px;padding-bottom:9px;border-bottom:1px solid #e3e8dc;font-size:11px}.log-list li:last-child{border:0}.log-list .damage{color:#9d5b39;font-weight:700;white-space:nowrap}.log-list small{display:block;color:var(--muted);font-size:10px;margin-top:3px}.search-radar{width:82px;height:82px;border:1px solid #6b8652;border-radius:50%;display:grid;place-items:center;position:relative;margin-bottom:20px}.search-radar:after{content:"";position:absolute;inset:-9px;border:1px solid #a5c87850;border-radius:50%;animation:pulse 1.6s infinite}.search-radar span{font-size:32px;color:var(--lime)}.search-time{margin-top:20px;font-size:11px;color:#9faf90;font-variant-numeric:tabular-nums}.end-title{font-size:40px!important;letter-spacing:-1px;color:var(--lime)}.reward-box{background:#2a3c24;padding:17px;border-radius:10px;text-align:left;width:100%;margin:20px 0}.reward-box strong{font-size:20px;color:var(--lime)}.reward-box p{font-size:12px;max-width:none}.reward-points{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}.reward-points span{background:#405633;border-radius:5px;padding:4px 8px;font-size:10px;color:#d6fc66}.stats-page{display:grid;gap:20px}.stat-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:18px}.stat-card{padding:25px}.stat-card .value{font-size:38px;font-weight:750;letter-spacing:-1.5px;margin-top:8px}.stat-card .eyebrow{margin:0;font-size:9px}.stat-card small{color:var(--muted);font-size:11px}.split-panels{display:grid;grid-template-columns:1fr 1fr;gap:20px}.mode-stat{padding:26px}.mode-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:18px;margin-top:24px}.mode-stat-grid strong{display:block;font-size:23px}.mode-stat-grid span{font-size:10px;color:var(--muted)}.ranking-panel{padding:28px}.ranking-toolbar{display:flex;justify-content:space-between;gap:20px;align-items:center;margin-bottom:24px}.rank-select{padding:11px 15px;background:#e8eddf;border:1px solid #cbd6bf;border-radius:9px;max-width:240px;color:var(--ink)}.full-ranking{width:100%;border-collapse:collapse}.full-ranking th{text-align:left;color:var(--muted);font-size:10px;font-weight:500;padding:10px 12px;border-bottom:1px solid var(--line)}.full-ranking td{padding:15px 12px;border-bottom:1px solid #e4e8df;font-size:13px}.full-ranking td:last-child,.full-ranking th:last-child{text-align:right}.table-player{display:flex;align-items:center;gap:13px;font-weight:600}.table-player .pixel-fighter{width:31px;height:38px}.full-ranking tr.self{background:#eaf2dc}.empty-table{text-align:center;padding:40px;color:var(--muted)}.rank-note{margin-top:20px;font-size:11px;color:var(--muted)}footer{max-width:1376px;margin:auto;padding:23px 32px;display:flex;justify-content:space-between;border-top:1px solid var(--line);color:var(--muted);font-size:10px;gap:20px}.toast{position:fixed;bottom:24px;left:50%;transform:translate(-50%,20px);background:#233121;color:#f5f9ef;border:1px solid #526547;border-radius:12px;padding:14px 22px;box-shadow:0 8px 30px #0002;max-width:min(500px,90vw);opacity:0;pointer-events:none;transition:.2s;z-index:50;font-size:13px}.toast.visible{opacity:1;transform:translate(-50%,0)}dialog{border:1px solid var(--line);border-radius:22px;background:var(--paper);color:var(--ink);padding:36px;max-width:540px;width:calc(100% - 32px);max-height:90vh}dialog::backdrop{background:#0c1a12aa;backdrop-filter:blur(4px)}dialog h2{font-size:31px}.dialog-close:not(.primary){position:absolute;right:14px;top:10px;background:none;font-size:26px;color:var(--muted);padding:4px 10px}dialog ol{padding-left:20px;margin:23px 0;font-size:13px;color:#53634b}dialog li{padding-left:7px;margin-bottom:11px}.rules-note{background:#e7eedc;padding:16px;border-radius:10px;font-size:11px;color:#67745d;margin-bottom:20px}.loading{height:60vh;display:flex;flex-direction:column;align-items:center;justify-content:center;color:var(--muted);gap:20px}.spinner{display:inline-block;height:26px;width:26px;border:2px solid #b8c7a9;border-top-color:#486c35;border-radius:50%;animation:spin .8s linear infinite}.mobile-logout{display:none}@keyframes spin{to{transform:rotate(360deg)}}@keyframes pulse{50%{transform:scale(1.12);opacity:.3}}@keyframes breathe{50%{translate:0 -4px}}@media(min-width:1500px){main{padding-top:44px}.arena-panel{min-height:530px}.arena-idle{min-height:355px}}@media(max-width:1150px){.dashboard{grid-template-columns:246px minmax(0,1fr)}.right-column{display:none}.landing{gap:30px}.topbar,main,footer{padding-left:24px;padding-right:24px}}@media(max-width:720px){.topbar{padding:18px 18px}.brand{font-size:11px}.brand-die{width:35px;height:35px;font-size:23px}.header-right{font-size:10px}.demo-badge{display:none}main{padding:25px 16px}.landing{grid-template-columns:1fr;margin:10px 0 20px;gap:27px}.hero{padding:0 8px}.hero h1{font-size:49px;letter-spacing:-2px}.hero-figures{display:none}.hero-pips{margin-bottom:20px}.hero-copy{font-size:14px;max-width:100%;margin-top:15px}.hero-note{margin-top:20px}.auth-panel{padding:24px}.page-heading{display:block;margin-bottom:22px}.page-heading h1{font-size:27px}.nav-pills{margin-top:18px;display:inline-flex;width:100%}.nav-pills button{flex:1;padding:9px}.dashboard{display:flex;flex-direction:column;gap:16px}.profile{width:100%;padding:17px 20px;display:grid;grid-template-columns:1fr 80px;column-gap:15px}.profile .panel-head{margin:0}.profile .level-tag{width:30px;height:30px;font-size:15px}.profile-name{font-size:20px}.profile .avatar-stage{grid-column:2;grid-row:1/5;height:120px;margin:0}.profile .avatar-stage .pixel-fighter{width:69px}.profile .avatar-stage:after{bottom:13px;width:50px}.profile .skin-label{display:none}.profile .xp-area{grid-column:1;margin-top:10px}.profile .stats-grid{display:flex;flex-wrap:wrap;gap:9px;margin:12px 0 0}.profile .stat-line{font-size:9px;display:flex;gap:3px}.profile .stat-line b{font-size:11px}.profile .stat-line .bar{display:none}.profile .profile-foot{margin:10px 0 0;padding:8px 0 0;grid-column:1}.profile-foot span{font-size:9px}.center-column{width:100%}.arena-panel{padding:20px;min-height:440px}.arena-idle{min-height:295px}.arena-idle h2{font-size:30px}.mode-buttons{gap:8px}.mode-button{padding:15px 12px}.mode-button b{font-size:14px}.mode-button small{font-size:10px}.arena-bottom{font-size:9px}.mini-summary{gap:8px;margin-top:15px}.mini-summary>div{padding:14px 12px}.mini-summary strong{font-size:21px}.fighters{gap:6px;grid-template-columns:1fr 32px 1fr}.fighter-visual{height:125px}.fighter-visual .pixel-fighter{width:83px}.fighter-title{font-size:12px}.fighter-sub{font-size:9px}.battle-actions button{font-size:12px;padding:12px 8px}.attack-values strong{font-size:25px}.attack-values span{font-size:9px}.battle-log{padding:20px}.stat-cards{grid-template-columns:1fr 1fr;gap:12px}.stat-card{padding:19px}.stat-card .value{font-size:30px}.split-panels{grid-template-columns:1fr}.ranking-panel{padding:20px 13px}.ranking-toolbar{display:block;padding:0 6px}.rank-select{margin-top:15px;width:100%;max-width:none}.full-ranking td,.full-ranking th{padding:12px 7px}.table-player{gap:7px;font-size:12px}.full-ranking td{font-size:12px}footer{padding:20px 17px;font-size:9px;align-items:center}footer>span{max-width:220px}.stat-card .eyebrow{letter-spacing:1px}.page-heading .muted{font-size:11px}dialog{padding:28px 22px}.hero-figures .pixel-fighter{width:90px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}

.battle-actions .secondary:hover:not(:disabled){background:#405639;color:#f1f8e5}
.combat-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px;margin-top:10px;text-align:left}.combat-stats>div{display:flex;justify-content:space-between;gap:5px;font-size:10px;color:#a5b79a}.combat-stats b{color:#eef4e7;font-size:11px}.battle-dialog{width:min(1480px,calc(100vw - 40px));max-width:none;height:min(940px,calc(100dvh - 40px));max-height:none;margin:auto;padding:22px;border-radius:22px;overflow:hidden}.battle-dialog-header{height:57px;display:flex;align-items:center;justify-content:space-between;padding:0 3px 17px;gap:20px}.battle-dialog-header .eyebrow{font-size:9px;margin-bottom:3px}.battle-dialog-header h2{font-size:22px}.battle-tabs{display:none}#battle-dialog-content{height:calc(100% - 57px)}.battle-modal-grid{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(345px,1fr);gap:20px;height:100%;min-height:0}.battle-modal-arena,.battle-modal-history{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}.battle-modal-arena .arena-panel{min-height:100%;padding:22px}.battle-modal-arena .fighters{padding-top:13px}.battle-modal-arena .fighter-visual{height:120px}.battle-modal-arena .fighter-visual .pixel-fighter{width:82px}.battle-modal-arena .arena-idle{min-height:400px}.battle-modal-history .battle-log{margin:0;padding:22px;height:100%;display:flex;flex-direction:column;overflow:hidden}.battle-modal-history .log-list{max-height:none;flex:1;min-height:0;overflow:auto;padding-right:8px}.detailed-log li{display:block;padding-bottom:13px}.combat-entry{width:100%;font-size:12px}.combat-entry summary{cursor:default;display:flex;align-items:start;justify-content:space-between;gap:14px;list-style:none;padding:3px 0}.combat-entry summary::-webkit-details-marker{display:none}.combat-entry summary:before{content:"+";font-size:15px;font-weight:700;color:#7a8b6b;flex-shrink:0}.combat-entry[open] summary:before{content:"−"}.combat-entry summary>span:first-of-type{flex:1;min-width:0;overflow-wrap:anywhere}.damage-explanation{margin:12px 0 0 22px;padding:13px;background:#eef2e7;border-radius:10px;font-size:11px;line-height:1.65;color:#53634a}.damage-explanation p+p{margin-top:9px}.damage-explanation b{color:#2e4528}.battle-modal-history .panel-head h3{font-size:19px}.battle-modal-history .damage{font-size:12px}.battle-modal-history .log-list small{line-height:1.55}.battle-dialog .dialog-close{position:static}@media(max-width:850px){.battle-dialog{width:100vw;height:100dvh;border:0;max-height:100dvh;margin:0;padding:12px;border-radius:0}.battle-dialog-header{height:56px;padding:0 3px 10px}.battle-dialog-header h2{font-size:20px}.battle-dialog-header .eyebrow{font-size:8px}.battle-tabs{display:flex;gap:6px;background:#e3eada;border-radius:10px;padding:4px;margin-bottom:10px;height:42px}.battle-tabs button{flex:1;padding:7px 10px;background:none;font-size:12px}.battle-tabs button.active{background:var(--paper)}.battle-tabs span{font-size:10px;margin-left:6px;color:#718765}#battle-dialog-content{height:calc(100% - 108px)}.battle-modal-grid{display:block}.battle-modal-grid[data-tab=fight] .battle-modal-history,.battle-modal-grid[data-tab=log] .battle-modal-arena{display:none}.battle-modal-arena,.battle-modal-history{height:100%}.battle-modal-arena .arena-panel{padding:17px 15px;border-radius:15px;min-height:100%}.battle-modal-history .battle-log{padding:18px 14px}.battle-modal-arena .fighter-visual{height:110px}.battle-modal-arena .fighter-visual .pixel-fighter{width:73px}.battle-modal-arena .fighters{padding-top:10px;gap:7px}.battle-modal-arena .fighter-title{font-size:12px}.battle-modal-arena .combat-stats{font-size:9px;gap:3px 8px}.battle-modal-arena .combat-stats>div{font-size:9px}.battle-modal-arena .combat-stats b{font-size:10px}.battle-modal-arena .turn-banner{padding:12px 0;margin-top:10px}.battle-modal-arena .roll-area{padding:14px;min-height:121px}.battle-modal-arena .attack-values{margin-top:12px}.battle-modal-arena .action-hint{font-size:9px}.battle-modal-arena .arena-idle{min-height:320px}.damage-explanation{font-size:11px;margin-left:8px}.battle-modal-history .log-list{padding-right:3px}}
.battle-sidebar{position:sticky;top:20px}.battle-sidebar .battle-log{margin-top:0;padding:20px}.battle-sidebar .panel-head{gap:6px}.battle-sidebar h3{font-size:16px}.battle-sidebar .chip{font-size:9px;padding:4px 6px}.battle-sidebar .log-list{max-height:min(55vh,560px);padding-right:4px}.battle-sidebar .log-list li>div{overflow-wrap:anywhere}.battle-summary{padding:20px}.battle-summary>div{display:flex;justify-content:space-between;align-items:center;margin-top:8px;color:var(--muted);font-size:12px}.battle-summary strong{font-size:22px;color:var(--ink)}.log-fab{display:none}.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}#battle-log-dialog{padding:34px 20px 20px;max-width:570px}#battle-log-dialog .battle-log{padding:15px 4px 0;border:0;margin:0}#battle-log-dialog .log-list{max-height:65dvh}.surrender-dialog{max-width:440px;padding:34px}.surrender-icon{height:54px;width:54px;display:grid;place-items:center;border-radius:15px;background:#f3e3d8;color:#a96745;font-size:30px;margin-bottom:22px}.surrender-copy{margin-top:17px;color:#6c7965;font-size:13px;line-height:1.8}.dialog-actions{display:grid;grid-template-columns:1.4fr 1fr;gap:10px;margin-top:25px}.dialog-actions .dialog-close{position:static!important;font-size:12px!important;padding:13px 10px!important;background:#e8ece2!important;color:var(--ink)!important}.danger-button{background:#a75143;color:#fff4ef;font-size:12px}.danger-button:hover:not(:disabled){background:#914639}@media(max-width:1150px){.log-fab{display:flex;align-items:center;gap:12px;position:fixed;right:20px;bottom:max(18px,env(safe-area-inset-bottom));z-index:15;background:var(--lime);color:var(--ink);box-shadow:0 5px 24px #10200936;border:1px solid #afce62;font-size:12px;padding:12px 16px}.log-fab span{border-radius:5px;min-width:22px;background:#20301b;color:#d6fc66;padding:2px 5px;font-size:10px}body:has(.log-fab) footer{padding-bottom:80px}}@media(max-width:720px){.surrender-dialog{padding:27px 23px}.surrender-dialog h2{font-size:28px}.log-fab{right:16px}}

/* Readable combat history; size is kept independently from live battle state. */
.battle-log .panel-head{flex-shrink:0;margin-bottom:12px;flex-wrap:wrap}
.history-font-toolbar{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:0 0 14px;margin-bottom:8px;border-bottom:1px solid #d5dbd1;flex-shrink:0;color:#344737;font-size:14px}
.history-font-controls{display:flex;align-items:center;gap:6px}
.history-font-controls button{min-width:44px;min-height:44px;padding:8px;font-size:16px;color:#18251e;cursor:default}
.history-font-value{min-width:46px;text-align:center;font-size:14px;font-weight:650;font-variant-numeric:tabular-nums;color:#26372b}
.battle-log .log-list{gap:16px}
.battle-log .log-list li,.battle-log .combat-entry{font-size:var(--log-font-size,16px);color:#18251e;line-height:1.6}
.battle-log .combat-entry summary{gap:10px;padding:7px 0}
.battle-log .combat-entry summary:before{font-size:var(--log-font-size,16px);color:#344737}
.battle-log .log-list small{font-size:max(14px,calc(var(--log-font-size,16px) - 2px));line-height:1.6;color:#435444;margin-top:6px}
.battle-log .log-list .damage{font-size:var(--log-font-size,16px);color:#884323}
.battle-log .damage-explanation{margin:12px 0 0;padding:16px;font-size:var(--log-font-size,16px);line-height:1.75;color:#26372b;overflow-wrap:anywhere}
.battle-log .damage-explanation p+p{margin-top:16px}
.battle-log .damage-explanation b{color:#18251e;font-weight:700}
.battle-log .damage-explanation p>b:first-child{display:block;margin-bottom:3px}
.battle-log .muted{color:#435444}
@media(max-width:850px){.battle-log .damage-explanation{padding:13px}.battle-log .combat-entry summary{flex-wrap:wrap}.battle-log .combat-entry summary>span:first-of-type{flex:1 1 65%}.battle-log .combat-entry summary>.damage{margin-left:auto}.history-font-toolbar{gap:8px}}

/* Wallet, equipment and player trading. */
.wallet-badge{background:#e4edce;color:#354a1e;border:1px solid #c8d5b3;border-radius:9px;padding:7px 11px;font-size:13px;font-weight:700;white-space:nowrap}.wallet-badge[hidden]{display:none}.nav-pills{flex-wrap:wrap}.page-heading{align-items:flex-start}.nav-pills button{padding:9px 13px}.gear-bonus{font-size:10px;color:#50772c;margin-left:3px}.reward-coins{font-size:21px;color:#d6fc66;font-weight:700;margin:8px 0}.reward-coins small{font-size:11px;font-weight:400;color:#b2c3a5;margin-left:7px}.economy-page{max-width:1250px;margin:auto}.economy-balance{display:flex;align-items:center;justify-content:space-between;padding:17px 22px;background:#e3ead8;border:1px solid #cbd5bf;border-radius:14px;margin-bottom:22px}.economy-balance>span{color:#495c3d;font-size:14px}.economy-balance strong{font-size:27px;font-variant-numeric:tabular-nums}.economy-balance small{font-size:13px;font-weight:500}.equipment-panel{padding:25px}.equipment-slots{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:12px}.equipment-slot{min-width:0;border:1px dashed #c8d3bd;border-radius:12px;padding:18px 12px;display:flex;align-items:center;flex-direction:column;text-align:center;gap:9px;background:#f0f3e9}.equipment-slot.filled{border-style:solid;background:#e9f0dd}.equipment-slot>span{font-size:12px;color:#536443}.equipment-slot>b{font-size:13px;overflow-wrap:anywhere}.equipment-slot .empty-slot{font-weight:400;color:#6b775f}.equipment-slot .item-stats{justify-content:center;margin:0}.equipment-slot .item-stats span{font-size:10px;padding:3px 5px}.item-icon{width:35px;height:35px;flex-shrink:0;color:#506939}.item-symbol{width:56px;height:56px;border-radius:12px;background:#e8efdb;display:grid;place-items:center;flex-shrink:0}.item-card-top{display:flex;align-items:center;gap:14px;min-width:0}.item-card-top>div:last-child{min-width:0}.item-card-top .eyebrow{font-size:9px;letter-spacing:1px;margin-bottom:5px}.item-card-top h3{font-size:18px;overflow-wrap:anywhere;line-height:1.3}.item-grid,.shop-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.item-card{padding:23px;display:flex;flex-direction:column;min-width:0}.item-stats{display:flex;gap:7px;flex-wrap:wrap;margin:18px 0 12px}.item-stats span{font-size:12px;background:#e9eee1;padding:5px 8px;border-radius:6px;color:#344833;white-space:nowrap}.item-stats b{color:#2f551a;margin-left:3px}.item-note,.item-seller{font-size:12px;color:#526048;line-height:1.6}.item-card-actions{margin-top:auto;padding-top:18px}.item-sale-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px;flex-wrap:wrap}.item-sale-row strong{font-size:20px}.item-sell-form{margin-top:15px;border-top:1px solid var(--line);padding-top:13px}.item-sell-form label,.shop-card label{font-size:12px;display:block;color:#40543b;margin-bottom:7px}.item-sell-form>div{display:flex;gap:7px}.item-sell-form input,.shop-card input{width:100%;min-width:0;border:1px solid #bdc9b2;border-radius:9px;padding:10px 12px;background:#fffef8;color:#18251e;font-size:16px}.item-sell-form button{padding:10px 12px}.economy-section-head{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;margin:28px 0 18px}.economy-section-head h2{font-size:23px}.economy-section-head h2 span{color:#60774e;font-weight:500;margin-left:7px}.economy-filters{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:14px;margin:20px 0}.economy-section-head .economy-filters{margin:0}.economy-filters label{display:flex;align-items:center;gap:12px;font-size:13px;color:#485b3d}.economy-filters select{background:#f9faf5;border:1px solid #bdc9b2;padding:10px 13px;border-radius:9px;max-width:210px;color:#18251e}.market-tabs{display:flex;gap:7px}.economy-empty{text-align:center;padding:50px 24px}.economy-empty p{margin:10px 0 20px;color:#526048}.economy-help{font-size:13px;color:#4c6044;line-height:1.8;margin-top:18px}.economy-pagination{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:24px;font-size:13px}.shop-intro,.market-intro{padding:26px;margin-bottom:24px;display:flex;align-items:center;justify-content:space-between;gap:35px}.shop-intro p:not(.eyebrow),.market-intro p:not(.eyebrow){margin-top:13px;font-size:14px;line-height:1.8;color:#485d3c;max-width:680px}.shop-intro h2,.market-intro h2{font-size:27px}.coin-note{min-width:220px;border-left:1px solid #ced8c3;padding-left:25px}.coin-note strong{font-size:26px;color:#4c702e;display:block}.coin-note span{font-size:12px;color:#536443;display:block;margin-top:8px;line-height:1.7}.shop-card{padding:24px}.shop-card label{margin-top:22px}.shop-preview{font-size:13px;color:#3e5432;line-height:1.7;margin:13px 0 20px;min-height:45px}.shop-grid>.economy-help{grid-column:1/-1}.shop-received{display:grid;grid-template-columns:1fr 1.5fr;gap:25px;align-items:center;background:#dfecc9;border:1px solid #b8ce95;border-radius:18px;padding:25px;margin-bottom:24px}.shop-received h2{font-size:25px}.shop-received p:not(.eyebrow){color:#526443;margin-top:10px}.shop-received .item-card{background:#f6faed}.market-intro button{flex-shrink:0}
@media(max-width:1150px){.page-heading{flex-direction:column}.equipment-slots{grid-template-columns:repeat(3,minmax(0,1fr))}.item-grid,.shop-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:720px){.header-right{flex-wrap:wrap;justify-content:flex-end;max-width:190px;gap:5px}.header-right>#online{font-size:9px}.wallet-badge{font-size:11px;padding:4px 7px}.nav-pills{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px}.nav-pills button{padding:10px 5px;font-size:11px}.economy-balance{padding:14px 17px}.economy-balance strong{font-size:23px}.equipment-panel{padding:19px 14px}.equipment-panel h2{font-size:23px}.equipment-slots{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.equipment-slot{padding:14px 9px}.item-grid,.shop-grid{grid-template-columns:1fr}.item-card,.shop-card{padding:20px}.shop-intro,.market-intro{display:block;padding:22px}.shop-intro h2,.market-intro h2{font-size:25px}.coin-note{margin-top:22px;border-left:0;border-top:1px solid #ced8c3;padding:18px 0 0}.shop-received{grid-template-columns:1fr;padding:18px;gap:15px}.economy-filters{align-items:stretch}.economy-filters label{flex-wrap:wrap;gap:8px}.market-tabs{width:100%}.market-tabs button{flex:1;padding:11px 8px}.market-intro button{margin-top:17px;width:100%}.economy-section-head{gap:14px}.economy-pagination{gap:10px;font-size:12px}.economy-pagination button{padding:10px}.item-icon{width:32px;height:32px}}

.xp-area{position:relative}.xp-head>span:last-child{display:flex;align-items:center;gap:6px}.xp-help{border:1px solid #aab99c;border-radius:50%;font-size:11px;font-weight:700;line-height:1;width:20px;height:20px;padding:0;background:#e2ebd5;color:#354d25;cursor:default}.xp-tooltip{position:absolute;z-index:35;left:0;top:calc(100% + 10px);width:min(310px,calc(100vw - 64px));padding:17px 19px;background:#253621;color:#f2f7e9;box-shadow:0 8px 30px #15200d33;border:1px solid #536d42;border-radius:12px;font-size:13px;line-height:1.65;opacity:0;visibility:hidden;pointer-events:none;transform:translateY(3px);transition:opacity .12s,transform .12s}.xp-tooltip>b{display:block;font-size:16px;color:#d6fc66;margin-bottom:8px}.xp-tooltip>span{display:block;margin:5px 0}.xp-tooltip>small{display:block;font-size:11px;color:#c2d0b4;margin-top:10px;padding-top:10px;border-top:1px solid #4d6041}.xp-area:hover .xp-tooltip,.xp-area:focus-within .xp-tooltip,.xp-area.tooltip-open .xp-tooltip{opacity:1;visibility:visible;transform:none}

/* Owner preference: default cursor everywhere; exceptions must be explicit. */
html{cursor:default}body,button,a,select,summary,label{cursor:default}input,textarea{cursor:text}input[type=button],input[type=submit],input[type=reset],input[type=checkbox],input[type=radio],input[type=range]{cursor:default}

/* Shared styled explanations; intentionally no native title or pointer cursor. */
[data-help]{cursor:default}[data-help]:focus-visible{outline:2px solid #789946;outline-offset:4px;border-radius:5px}.stat-help-card{position:fixed;z-index:1000;width:min(350px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;margin:0;padding:19px 21px;border:1px solid #4b633c;border-radius:14px;background:#24371f;color:#f4f8eb;box-shadow:0 10px 34px #10210b3d;font-size:14px;line-height:1.7;text-align:left;font-weight:400;letter-spacing:normal;cursor:default}.stat-help-card[hidden]{display:none}.stat-help-heading{display:flex;align-items:center;gap:10px;margin-bottom:10px}.stat-help-heading b{font-size:18px;line-height:1.35;color:#d6fc66}.stat-help-mark{display:grid;place-items:center;width:24px;height:24px;border:1px solid #8aa65d;border-radius:50%;color:#d6fc66;font-size:13px;font-weight:700;flex-shrink:0}.stat-help-card p{margin:0}.stat-help-context{border-top:1px solid #506440;margin-top:13px;padding-top:11px;color:#d9e7c6;font-size:13px;line-height:1.65}.item-stats [data-help]:focus-visible{outline-offset:2px}@media(max-width:720px){.stat-help-card{padding:17px 19px;font-size:14px}}

.stat-help-heading{padding-right:22px}.stat-help-close{position:absolute;right:6px;top:6px;width:30px;height:30px;padding:0;border-radius:7px;font-size:23px;line-height:1;background:transparent;color:#c9ddb6;cursor:default}.stat-help-close:hover{background:#3c512e;color:#f3fbe7}

.enchant-level{display:inline-block;padding:2px 6px;background:#dfeacb;color:#45672c;border:1px solid #b7ca98;border-radius:5px;font-size:12px;vertical-align:middle}.item-durability{margin:14px 0 12px;width:100%;font-size:12px;color:#42583b}.item-durability>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:5px}.item-durability.broken{color:#a24235}.item-durability.worn{color:#8c642b}.durability-track{height:5px;background:#dce5d1;border-radius:8px;overflow:hidden}.durability-track span{display:block;height:100%;background:#8aab59;border-radius:8px}.broken .durability-track{background:#e9cfc4}.worn .durability-track span{background:#be8846}.equipment-slot .item-durability{font-size:10px;margin:auto 0 3px;padding-top:3px}.vendor-button{margin-top:10px;color:#5c5237;background:#ebe7d8;border-color:#d6ceb6}.forge-intro{padding:27px;display:grid;grid-template-columns:minmax(0,1.3fr) minmax(260px,1fr);gap:35px;align-items:center}.forge-intro h2{font-size:29px}.forge-intro p:not(.eyebrow){margin-top:13px;color:#4c6044;line-height:1.8;font-size:14px}.scroll-shop{padding:24px;background:#e9eeda;border:1px solid #c8d4b2;border-radius:15px}.scroll-symbol{font-size:35px;color:#6a873c}.scroll-shop label,.forge-enchant-form label{display:block;font-size:12px;color:#3c5135;margin:15px 0 7px}.scroll-shop>div{display:flex;gap:8px}.scroll-shop input,.forge-enchant-form input{min-width:0;width:100%;padding:11px 12px;border:1px solid #bac8aa;border-radius:9px;background:#fffef8;color:#18251e;font-size:16px}.scroll-shop input{max-width:90px}.scroll-shop button{flex:1}.scroll-shop .scroll-price-preview{font-size:12px}.forge-repair{display:flex;align-items:center;justify-content:space-between;gap:9px;flex-wrap:wrap;padding:15px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-top:15px}.forge-repair>span{font-size:12px;color:#526644}.forge-repair button{font-size:12px;padding:10px}.forge-enchant-form{margin-top:auto}.forge-preview{font-size:12px;color:#4f6641;line-height:1.75;margin:12px 0 16px}.forge-warning{color:#98513d;font-size:13px;line-height:1.7;margin:14px 0}.forge-warning.panel{padding:15px 20px;background:#f4eadd}.trade-confirm{max-width:440px;padding:30px}.trade-confirm h2{font-size:26px;margin-bottom:15px}.trade-confirm p{color:#506346;font-size:14px;line-height:1.75}.trade-confirm .vendor-item-name{font-weight:700;color:#263d22}.vendor-receive{font-size:24px;font-weight:750;color:#50732f;margin:15px 0}.trade-confirm .dialog-actions{grid-template-columns:1fr}.reward-wear{border-top:1px solid #425236;padding-top:10px;color:#c8d6b9!important;font-size:12px!important;line-height:1.7}@media(max-width:850px){.forge-intro{grid-template-columns:1fr;padding:22px;gap:23px}.scroll-shop{padding:20px}.forge-intro h2{font-size:26px}}

.set-glow-white{--set-light:#ffffff;--set-tint:#ffffff75}.set-glow-green{--set-light:#70f495;--set-tint:#70f49555}.set-glow-red{--set-light:#ff665d;--set-tint:#ff665d55}.avatar-stage.set-glow{box-shadow:inset 0 0 32px var(--set-tint),0 0 19px var(--set-tint);border:1px solid var(--set-light)}.set-badge{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #c2cfb3;background:#e7eedb;padding:8px 10px;border-radius:8px;font-size:12px;color:#3d5431;line-height:1.4;margin:0 0 14px}.set-badge b{font-size:11px;white-space:nowrap}.set-badge.set-glow{border-color:var(--set-light);box-shadow:0 0 12px var(--set-tint)}.set-badge.set-glow-white{background:#f8fff5;color:#2c4327}.set-badge.set-glow-green{background:#daf3da;color:#28552d}.set-badge.set-glow-red{background:#f9e1d6;color:#7e3629}.equipment-panel .panel-head .set-badge{margin:0;min-width:170px}.equipment-panel .panel-head{flex-wrap:wrap}.fighter-visual.set-glow:after{box-shadow:0 0 22px var(--set-light)}@media(max-width:720px){.profile .panel-head{grid-column:1;grid-row:1}.profile .xp-area{grid-column:1;grid-row:2}.profile .stats-grid{grid-column:1;grid-row:3}.profile .profile-foot{grid-column:1;grid-row:4}.equipment-panel .panel-head .set-badge{width:100%}}

.fighter-visual.set-glow{background:radial-gradient(ellipse at center,var(--set-tint) 0%,transparent 70%);border-radius:12px}

/* Illustrated characters; equipment layers follow actual worn items. */
.character-figure{shape-rendering:geometricPrecision;overflow:visible;flex-shrink:0;max-width:100%}
.character-figure .character-item.is-broken{filter:grayscale(1);opacity:.65}
.avatar-stage .character-figure{width:164px;max-height:212px;filter:drop-shadow(0 6px 4px #253e3626)}
.avatar-stage:after{bottom:12px;width:102px;height:10px}
.fighter-visual .character-figure,.battle-modal-arena .fighter-visual .character-figure{width:130px;height:163px;filter:drop-shadow(0 4px 3px #07140d55)}
.fighter-visual,.battle-modal-arena .fighter-visual{height:170px}
.fighter-slot.enemy .character-figure{transform:none;scale:-1 1}
.hero-figures .character-figure{filter:drop-shadow(0 7px 4px #263d292b)}
.rank-row .character-figure{width:30px;height:38px}.table-player .character-figure{width:36px;height:45px}
@media(max-width:720px){.profile .avatar-stage .character-figure{width:88px;max-width:none;height:110px}.profile .avatar-stage:after{bottom:4px}.hero-figures .character-figure{width:90px}}
@media(max-width:850px){.battle-modal-arena .fighter-visual{height:143px}.battle-modal-arena .fighter-visual .character-figure{width:110px;height:138px}.battle-modal-arena .fighter-visual:after{bottom:4px}}

/* Server-confirmed combat motion, independent of polling and character mirroring. */
.fighter-puppet{display:grid;place-items:center;position:relative;z-index:1;width:100%;height:100%;transform-origin:center 86%}
.is-attacking .character-figure,.is-hit .character-figure,.is-dodging .character-figure{animation:none!important}
.combat-motion-panel .fighter-visual{isolation:isolate}
.combat-motion-caption{min-height:110px;border:1px solid #49603c;background:#253821;border-radius:14px;margin-top:17px;padding:23px;text-align:center;display:grid;align-content:center;gap:8px}
.combat-motion-caption strong{color:#e4f3cd;font-size:17px}.combat-motion-caption span{color:#c6d9b3;font-size:14px;line-height:1.6}
.combat-swipe{position:absolute;inset:4% -12% 0 26%;z-index:3;pointer-events:none;opacity:0;transform-origin:center;scale:1 1}
.combat-swipe.reverse{inset:4% 26% 0 -12%;scale:-1 1}.combat-swipe svg{width:100%;height:100%;fill:none;stroke:#f2e7ad;stroke-width:5;stroke-linecap:round;filter:drop-shadow(0 0 6px #f2e7ad66)}
.combat-swipe svg path+path{stroke:#fffbe5;stroke-width:2;opacity:.6}.combat-swipe.unarmed svg{stroke-width:3}
.combat-impact{position:absolute;left:calc(50% - 35px);top:32%;width:70px;height:70px;z-index:4;pointer-events:none;background:#ffe7a0;clip-path:polygon(50% 0,59% 32%,90% 10%,71% 42%,100% 50%,70% 58%,88% 90%,57% 70%,50% 100%,41% 70%,10% 90%,29% 58%,0 50%,30% 41%,12% 10%,42% 31%)}
.combat-impact.critical{background:#ffb279}.combat-impact.block{background:#b8e5ff;clip-path:none;border:4px solid #ddf2ff;border-radius:50%;background:transparent}.combat-impact.miss{background:none;clip-path:none;border:2px dashed #a3bda7;border-radius:50%;opacity:.5}
.combat-damage{position:absolute;top:8%;left:5%;right:5%;text-align:center;z-index:5;pointer-events:none;color:#ffe9b3;text-shadow:0 2px 5px #102416;font-size:24px;font-weight:800;line-height:1.2}.combat-damage b{white-space:nowrap}.combat-damage span{display:block;letter-spacing:1.5px;font-size:10px;margin-top:5px}.combat-damage.critical{color:#ffb085;font-size:28px}.combat-damage.block{color:#caeafa}.combat-damage.miss{color:#c5d6bc;font-size:18px}
@media(max-width:850px){.combat-damage{font-size:19px}.combat-damage.critical{font-size:23px}.combat-damage.miss{font-size:13px}.combat-damage span{font-size:8px}.combat-impact{width:54px;height:54px;left:calc(50% - 27px)}.combat-motion-caption{padding:18px;min-height:100px}.combat-motion-caption strong{font-size:15px}.combat-motion-caption span{font-size:12px}}

/* Battle sound preference stays visible while the arena content refreshes. */
.battle-window-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
#battle-sound-toggle[aria-pressed="false"]{color:var(--muted)}
@media(max-width:420px){.battle-dialog-header{flex-wrap:wrap;gap:10px}.battle-window-actions{gap:6px}.battle-window-actions .small{padding:8px 10px}}

/* Derived combat values in the profile, separate from the five level-up stats. */
.profile-combat{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:18px}
.profile-combat-card{min-width:0;padding:12px 10px;border:1px solid #d5ddcb;border-radius:11px;background:#edf2e5;display:flex;flex-direction:column;gap:3px;cursor:default}
.profile-combat-card.damage{background:#f4eee1;border-color:#e4dccb}
.profile-combat-card>span{font-size:11px;font-weight:650;color:#53664b}
.profile-combat-card.damage>span{color:#786244}
.profile-combat-card>b{font-size:24px;line-height:1.15;letter-spacing:-.7px;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.profile-combat-card>small{font-size:9px;color:#64745e;line-height:1.4}
.profile-combat-card.damage>small{color:#7c725e}
@media(max-width:720px){.profile .profile-combat{grid-column:1/-1;grid-row:3;margin-top:14px}.profile .stats-grid{grid-row:4;grid-column:1/-1}.profile .profile-foot{grid-row:5;grid-column:1/-1}.profile .avatar-stage{grid-row:1/3}.profile-combat-card{padding:10px 12px}.profile-combat-card>b{font-size:23px}.profile-combat-card>small{font-size:10px}}

/* Keep battle decisions visible while the fighter stage scrolls on small screens. */
.battle-dialog[open]{display:flex;flex-direction:column}
.battle-dialog-header{height:auto;min-height:57px;flex-shrink:0}
.battle-tabs{flex-shrink:0}
#battle-dialog-content{height:auto;flex:1;min-height:0}
@media(max-width:850px),(max-width:950px) and (max-height:520px){
 .battle-dialog{width:100%;height:100vh;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left))}
 .battle-dialog-header{min-height:48px;padding:0 2px 6px;gap:8px;flex-wrap:nowrap}
 .battle-dialog-header h2{font-size:17px;white-space:nowrap}
 .battle-dialog-header .eyebrow{font-size:7px;letter-spacing:1px}
 .battle-window-actions{gap:5px;flex-shrink:0}
 .battle-window-actions .small{padding:8px;min-height:44px;font-size:11px;white-space:nowrap}
 .battle-tabs{display:flex;gap:6px;background:#e3eada;border-radius:10px;padding:3px;margin:0 0 7px;height:38px}
 .battle-tabs button{flex:1;padding:5px 8px;background:none;font-size:12px}
 .battle-tabs button.active{background:var(--paper)}
 .battle-modal-grid{display:block;height:100%;min-height:0}
 .battle-modal-grid[data-tab=fight] .battle-modal-history,.battle-modal-grid[data-tab=log] .battle-modal-arena{display:none}
 .battle-modal-arena,.battle-modal-history{height:100%;min-height:0}
 .battle-modal-arena:has(.active-battle){overflow:hidden}
 .battle-modal-arena .active-battle{display:flex;flex-direction:column;height:100%;min-height:0;padding:0;border-radius:14px;overflow:hidden}
 .battle-stage{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:10px 12px}
 .battle-stage .battle-heading{gap:8px}
 .battle-stage .battle-heading [data-action=surrender]{padding:5px 0}
 .battle-stage .fighters{padding:7px 0 0;gap:5px;grid-template-columns:minmax(0,1fr) 25px minmax(0,1fr)}
 .battle-stage .fighter-sub{margin-bottom:3px}
 .battle-stage .fighter-visual{height:100px}
 .battle-stage .fighter-visual .character-figure{height:100px;width:80px}
 .battle-stage .hp-line{margin-top:4px;font-size:10px;gap:5px}
 .battle-stage .combat-stats{margin-top:7px;gap:3px 7px}
 .battle-stage .combat-stats>div{min-width:0;gap:3px;font-size:10px}
 .battle-stage .combat-stats b{font-size:10px}
 .battle-controls{flex-shrink:0;padding:8px 12px 10px;border-top:1px solid #425637;background:var(--dark)}
 .battle-controls .turn-banner{border:0;padding:0 0 7px;margin:0;gap:8px}
 .battle-controls .turn-banner strong{font-size:13px}
 .battle-controls .turn-banner small{font-size:10px;line-height:1.3}
 .battle-controls .clock{width:36px;height:36px;flex-shrink:0;font-size:16px}
 .battle-controls .roll-area{padding:9px 10px;min-height:94px}
 .battle-controls .empty-attack{min-height:74px;font-size:12px;line-height:1.5}
 .battle-controls .roll-top{gap:6px}
 .battle-controls .roll-top h3{font-size:15px;line-height:1.2;margin-top:2px}
 .battle-controls .roll-top span{font-size:8px}
 .battle-controls .roll-pips{flex-shrink:0}
 .battle-controls .attack-values{margin-top:8px;gap:6px}
 .battle-controls .attack-values strong{font-size:23px;overflow-wrap:anywhere}
 .battle-controls .attack-values span{font-size:9px;line-height:1.3;margin-top:2px}
 .battle-controls .battle-actions{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-top:8px}
 .battle-controls .battle-actions button{min-width:0;min-height:46px;padding:8px 5px;font-size:12px;line-height:1.3}
 .battle-controls .action-hint{font-size:9px;line-height:1.3;margin-top:6px}
 .battle-modal-history .battle-log{padding:14px 12px}
}
@media(max-width:950px) and (max-height:520px) and (orientation:landscape){
 .battle-dialog-header{min-height:40px;padding-bottom:3px}
 .battle-dialog-header .eyebrow{display:none}
 .battle-window-actions .small{min-height:36px}
 .battle-tabs{height:32px;margin-bottom:5px}
 .battle-modal-arena .active-battle{flex-direction:row}
 .battle-stage{flex:1 1 50%;padding:8px 10px}
 .battle-controls{flex:0 0 50%;min-width:0;border-top:0;border-left:1px solid #425637;padding:6px 10px;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column}
 .battle-controls .turn-banner{padding-bottom:4px}
 .battle-controls .clock{width:30px;height:30px;font-size:14px}
 .battle-controls .roll-area{min-height:80px;padding:7px 9px}
 .battle-controls .empty-attack{min-height:64px}
 .battle-controls .battle-actions{margin-top:auto;padding-top:6px;flex-shrink:0}
 .battle-controls .turn-banner,.battle-controls .roll-area,.battle-controls .action-hint{flex-shrink:0}
 .battle-controls .action-hint{margin-top:4px}
 .battle-stage .fighter-visual{height:85px}
 .battle-stage .fighter-visual .character-figure{height:85px;width:68px}
}

@media(max-width:950px) and (max-height:360px) and (orientation:landscape){.battle-controls .action-hint{display:none}}

@media(max-width:850px) and (max-height:600px) and (orientation:portrait){
 .battle-stage .fighter-visual{height:60px}
 .battle-stage .fighter-visual .character-figure{height:60px;width:48px}
 .battle-controls .action-hint{display:none}
}
@media(max-width:850px) and (max-height:520px) and (orientation:portrait){
 .battle-stage .fighter-visual,.battle-stage .fighter-sub{display:none}
 .battle-stage .battle-heading [data-action=surrender]{padding:2px 0}
 .battle-controls .turn-banner small{display:none}
 .battle-stage .combat-stats{margin-top:4px;gap:1px 5px}
 .battle-stage .combat-stats>div,.battle-stage .combat-stats b{font-size:9px;line-height:1.25}
}

/* Idle, attack and opponent turns share one stable control area. */
.battle-controls .roll-area{position:relative;height:142px;min-height:142px}
.battle-controls .empty-attack{height:100%;min-height:0}
.battle-controls .roll-top>div:first-child{min-width:0}
.battle-controls .roll-top h3{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.battle-dialog button{touch-action:manipulation}
.battle-controls .combat-motion-caption{position:absolute;inset:0;min-height:0;margin:0;padding:12px;border:0;border-radius:inherit;overflow:hidden}
.battle-controls .combat-motion-caption strong,.battle-controls .combat-motion-caption span{overflow-wrap:anywhere}
.combat-motion-panel .roll-area>:not(.combat-motion-caption){visibility:hidden}
@media(max-width:850px),(max-width:950px) and (max-height:520px){
 .battle-controls .roll-area{height:112px;min-height:112px}
 .battle-controls .empty-attack{min-height:0}
}
