:root{--ink:#130d0a;--night:#071421;--navy:#102b47;--wine:#5a1824;--papyrus:#d5bd7e;--old-gold:#b88a38;--gold:#e0bd64;--bronze:#69401e;--ivory:#f2dfac;--blue:#275f89;--red:#8b2736}


*{box-sizing:border-box}

*{scrollbar-width:thin;scrollbar-color:#9b6d2f #160f0b}

*::-webkit-scrollbar{width:11px;height:11px}

*::-webkit-scrollbar-track{background:#160f0b;border:1px solid #51341b}

*::-webkit-scrollbar-thumb{background:#795126;border:2px solid #c69a48;border-radius:0}

html,body{margin:0;min-width:1024px;min-height:100%;background:#0d0907;color:var(--ivory);font-family:Tahoma,Verdana,sans-serif}

button{font:inherit;color:inherit;cursor:pointer}

button:disabled{cursor:not-allowed}

button:focus-visible{outline:2px solid #f0cb65;outline-offset:2px}

img{max-width:100%}

#app{min-height:100vh}


.arena-selection-header,.arena-select-team,.selection-main-panel,.arena-select-info,.arena-selection-footer,.classic-top,.element-box,.battle-log-panel,.right-panel,.info-panel,.duelist-back,.queue-modal,.exchange-modal,.passive-modal,.winner-card{position:relative;border:3px solid #2a160c;border-radius:0;outline:2px solid #9b6d2f;box-shadow:inset 0 0 0 1px #e2bc61,3px 4px 0 #100806a6}

.panel-title,.skills-heading,.panel-ribbon{padding:5px 8px;border-bottom:2px solid #2c170d;background:linear-gradient(#c99c4e,#80501f);color:#1c1009;font:900 9px Georgia;letter-spacing:1.6px;text-shadow:0 1px #efd996}


/* Selection */
.arena-selection-page{height:100vh;overflow:hidden;padding:7px 10px;display:grid;grid-template-rows:78px 32px minmax(0,1fr);gap:6px;background-color:#1b0f08;background-image:linear-gradient(90deg,#160a0560 0 8%,transparent 26% 74%,#160a0560 92%),linear-gradient(#120a0518,#120a0518),url("../assets/background/duel-monsters-original.jpg");background-position:center;background-size:cover;background-repeat:no-repeat}

.arena-selection-page:before{content:"";position:fixed;inset:0;pointer-events:none;box-shadow:inset 0 0 85px #080403cc}

.arena-selection-header,.selection-nav,.arena-selection-content{z-index:1;width:min(1700px,100%);margin:0 auto}

.arena-selection-header{display:grid;grid-template-columns:1fr minmax(330px,auto) 1fr;align-items:center;gap:14px;padding:8px 16px;background:linear-gradient(100deg,#2b170f,#765328 50%,#30160f);clip-path:polygon(0 0,99% 0,100% 18px,100% 100%,1% 100%,0 calc(100% - 18px))}

.selection-brand>span{display:block;color:#e2b85b;font:900 8px Tahoma;letter-spacing:3px}

.arena-selection-header h1{margin:1px 0;color:#f0d488;font:900 32px/1 Copperplate,"Copperplate Gothic Light",Papyrus,Georgia,serif;letter-spacing:5px;text-shadow:2px 2px #35100e}

.selection-match-copy{margin:0;color:#d8bd82;font:900 9px/1.45 Georgia;letter-spacing:1.5px;text-align:right}.selection-match-copy b{color:#f0cc6d;font-size:8px}

.selection-versus{display:flex;align-items:center;justify-content:center;gap:7px}

.selection-versus>span{color:#d5a13a;font:900 italic 25px Georgia;transform:rotate(-7deg);text-shadow:2px 2px #2a0d09}

.selection-duelist-mini{min-width:132px;min-height:54px;padding:4px 8px;display:flex;align-items:center;gap:7px;background:linear-gradient(90deg,#26170f,#5b3c20);border:1px solid #c08d3b;border-left:6px solid #755029;color:#f1ddaa}
.selection-duelist-mini img{width:40px;height:44px;object-fit:contain;filter:drop-shadow(2px 2px #160b07)}

.selection-duelist-mini small{display:block;color:#b98f4d;font:900 7px Tahoma;letter-spacing:2px}

.selection-duelist-mini b{display:block;margin-top:2px;font:900 12px Georgia}

.selection-nav{display:flex;gap:3px}

.selection-tab{min-width:164px;padding:7px 17px;border:2px solid #2d180d;border-radius:0;background:#21130d;color:#c9aa69;font:900 11px Georgia;letter-spacing:1.5px;box-shadow:inset 0 0 0 1px #805426}

.selection-tab.active{background:#8a5f2c;color:#fff0bd;box-shadow:inset 0 0 0 1px #e0bd65}


.arena-selection-content{min-height:0;display:grid;grid-template-columns:292px minmax(560px,1fr) 340px;grid-template-rows:minmax(0,1fr);grid-template-areas:"team roster info";gap:8px;align-content:stretch}
.arena-selection-content.duelist-selection-layout{grid-template-rows:minmax(0,1fr)}

.arena-select-team{grid-area:team;min-width:0;padding:10px;display:grid;grid-template-columns:1fr 1fr;grid-template-rows:auto minmax(0,1fr) auto auto auto;gap:8px;background:linear-gradient(135deg,#52361f,#241710 55%,#694821);color:#f0dfb2}

.team-panel-head{grid-column:1/-1;display:flex;justify-content:space-between;align-items:end;padding-bottom:3px;border-bottom:1px solid #a77c3b}

.team-panel-head span,.selection-grid-head span,.duelist-section-head span,.info-panel-head span,.team-duelist-pick small{display:block;color:#c89c52;font:900 7px Tahoma;letter-spacing:1.7px}

.team-panel-head b,.selection-grid-head b,.duelist-section-head b{display:block;color:#f0da9d;font:900 11px Georgia}

.team-panel-head>strong{color:#e8bf5e;font:900 18px Georgia}

.team-slot-list{grid-column:1/-1;display:grid;grid-template-columns:1fr;grid-auto-rows:clamp(104px,14vh,132px);align-content:start;gap:7px}

.team-slot{min-width:0;display:grid;grid-template-columns:24px 98px minmax(0,1fr);gap:7px;align-items:center;padding:6px;border:2px ridge #9b6c2e;border-radius:0;background:linear-gradient(90deg,#23170f,#4b3320);color:#f4e4b8;text-align:left}

.team-slot.empty{border-style:solid;border-color:#79562f;color:#c5ae7c;background:linear-gradient(90deg,#2b1a10,#4c331f);box-shadow:inset 0 0 0 1px #a67a38}

.team-slot .slot-number{color:#d6a84e;font:900 14px Georgia;text-align:center}

.team-slot img{width:96px;height:96px;object-fit:contain;background:#24190f;border:1px solid #946727}

.team-slot b{display:block;font:900 10px/1.15 Tahoma}

.team-slot small{display:block;margin-top:2px;color:#bda87a;font:7px Tahoma}

.team-duelist-pick{padding:7px;display:grid;grid-template-columns:42px 1fr;grid-template-rows:auto auto;align-items:center;gap:4px 7px;border:2px ridge #9a6d31;background:linear-gradient(90deg,#3b2416,#7a5527);color:#f2deb0}
.team-duelist-pick>img{grid-row:1;width:40px;height:48px;object-fit:contain;filter:drop-shadow(2px 2px #160b07)}
.team-duelist-pick>div{min-width:0}

.team-duelist-pick.opponent{border-color:#9a6d31;background:linear-gradient(90deg,#61231e,#60401f);color:#f2deb0}

.team-duelist-pick b{display:block;margin:4px 0 7px;font:900 13px Georgia}

.team-duelist-pick button,.selection-clear,.selection-start{width:100%;padding:8px;border:2px outset #b5863c;border-radius:0;background:#50311c;color:#f1d78f;font:900 9px Tahoma}.team-duelist-pick button{grid-column:1/-1}
.selection-clear{grid-column:1}
.selection-start{grid-column:1/-1;min-height:44px;font:900 14px Georgia;letter-spacing:1.5px}

.selection-clear{background:#68202c}

.selection-start{background:#a6762d;color:#fff0bd}

.selection-start:disabled,.selection-clear:disabled{filter:grayscale(1);opacity:.42}


.arena-select-main{grid-area:roster;min-height:0}

.selection-main-panel{height:100%;padding:7px 8px;overflow:hidden;background:linear-gradient(135deg,#2b1a11,#50331c 55%,#21140e);color:#f0dfb1}
.duelist-selection-layout .selection-main-panel{height:100%;overflow:hidden}

.selection-grid-head,.duelist-section-head,.info-panel-head{display:flex;justify-content:space-between;align-items:end;gap:7px}

.selection-grid-head{padding-bottom:4px;border-bottom:1px solid #926932}

.selection-grid-head>strong{color:#e7b655;font:900 9px Tahoma}

.monster-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:clamp(112px,18vh,165px);align-content:start;height:calc(100% - 29px);gap:7px;padding-top:7px}

.monster-tile{position:relative;min-width:0;height:100%;padding:3px;border:2px solid #7c5428;border-radius:0;background:#160f0c;color:#f3e1b2;text-align:center;transition:filter .16s,transform .16s}

.monster-tile:hover{filter:brightness(1.22);transform:translateY(-1px);border-color:#c49442}

.monster-tile img{display:block;width:100%;height:calc(100% - 27px);object-fit:contain;background:#0f0b09;border:1px solid #9d7131}

.monster-tile b{display:block;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:900 8px Tahoma}

.monster-slot-badge{position:absolute;top:3px;left:3px;z-index:2;width:20px;height:20px;display:grid;place-items:center;background:#761e2b;border:1px solid #e3bd5b;color:#ffe8a8;font:900 9px Tahoma}

.monster-tile.selected{border-color:#e1bc5d;background:#4f3318;box-shadow:inset 0 0 0 1px #f0d277}

.monster-tile.team-full:not(.selected){filter:grayscale(.85);opacity:.4}
.monster-tile:nth-child(7){grid-column:auto}


.arena-select-info{grid-area:info;height:100%;min-height:0;padding:8px;overflow:auto;background:linear-gradient(145deg,#5b3b20,#261810 58%,#402817);color:#f0dfb1}

.info-panel-head{padding-bottom:5px;border-bottom:1px solid #93682f}

.info-panel-head>b{max-width:65%;color:#e5b454;font:900 12px Georgia;text-align:right}

.select-focus-card,.select-duelist-profile{display:grid;grid-template-columns:88px 1fr;gap:7px;align-items:center;margin-top:6px;padding:5px;border:2px solid #80582a;background:#251810}

.select-focus-card img,.select-duelist-profile img{width:86px;height:84px;object-fit:contain;background:#0e0a08;border:1px solid #ad7b34}

.select-focus-card small,.select-duelist-profile small{color:#d3a34e;font:900 7px Tahoma}

.select-focus-card h2,.select-duelist-profile h2{margin:3px 0;font:900 16px Georgia}

.select-focus-card span,.select-duelist-profile span{color:#cbb98e;font-size:8px}

.select-focus-skills,.select-duelist-abilities{display:grid;gap:4px;margin-top:5px}

.select-focus-skill{display:grid;grid-template-columns:44px 1fr;gap:6px;padding:4px;border:1px solid #76502a;background:#20150f}

.select-focus-skill img{width:42px;height:42px;object-fit:cover;background:#100b09;border:1px solid #a87632}

.select-focus-skill b{display:block;color:#f0c76b;font:900 9px Tahoma}

.select-focus-skill small{display:block;margin-top:2px;color:#d6c59d;font:9px/1.25 Tahoma}

.duelist-section{padding-top:6px}

.duelist-section+.duelist-section{margin-top:6px;border-top:1px solid #88602e}

.duelist-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}

.arena-select-duelist{min-width:0;padding:4px;border:2px solid #73502b;border-radius:0;background:#1a120e;color:#f0dfb0;text-align:left}

.arena-select-duelist img{display:block;width:100%;height:clamp(110px,15vh,150px);object-fit:contain;background:#0d0908;border-bottom:1px solid #8a5d2a}

.duelist-tile-copy b{display:block;margin-top:3px;font:900 10px Georgia}

.duelist-tile-copy small{display:block;margin-top:2px;color:#bfa97d;font:7px/1.2 Tahoma}

.arena-select-duelist em{display:block;margin-top:2px;color:#dbab4c;font:900 6px Tahoma;font-style:normal}

.arena-select-duelist.kaiba-side{border-color:#3979a4}

.arena-select-duelist.yugi-side{border-color:#9c3543}

.arena-select-duelist.pegasus-side{border-color:#79508f}
.arena-select-duelist.joey-side{border-color:#a87831}

.arena-select-duelist.selected{box-shadow:inset 0 0 0 2px #e8c25f}

.arena-select-duelist.disabled{filter:grayscale(1);opacity:.35}

.select-empty-info{padding:12px;margin-top:6px;border:1px dashed #8d6531;background:#17100dcc;color:#bfae84;font-size:10px}

.arena-selection-footer{display:flex;align-items:center;justify-content:space-between;padding:3px 8px;background:#21150da8;color:#d4bd86;font:900 7px Tahoma;letter-spacing:1.5px}

.arena-selection-footer button{padding:3px 9px;border:1px outset #a77b38;background:#64202a;color:#f2d89a;font:900 7px Tahoma}


/* VS */
.duel-intro{position:fixed;inset:0;z-index:4000;overflow:hidden;background:#120b08;animation:duelIntroFade 3s linear forwards}

.duel-intro:before{content:"";position:absolute;inset:0;background-image:linear-gradient(90deg,#4f121a88,transparent 36% 64%,#40271488),url("../assets/background/duel-monsters-original.jpg");background-position:center;background-size:cover;background-repeat:no-repeat;filter:brightness(.62) saturate(.82)}

.duel-intro:after{content:"";position:absolute;inset:0;z-index:1;background:#08050452;box-shadow:inset 0 0 130px #000;pointer-events:none}

.duel-intro-versus{position:absolute;inset:0;z-index:2;display:grid;grid-template-columns:1fr minmax(140px,18vw) 1fr;align-items:center}

.duel-intro-side{height:100%;display:flex;align-items:flex-end}

.duel-intro-side.player{justify-content:flex-start;padding-left:3vw}

.duel-intro-side.enemy{justify-content:flex-end;padding-right:3vw}

.duel-intro-avatar{display:flex;flex-direction:column;align-items:center;gap:6px}

.duel-intro-avatar img{width:min(33vw,500px);height:min(72vh,690px);object-fit:contain;filter:drop-shadow(8px 10px 0 #0a0504a8)}

.duel-intro-avatar strong{color:#f3dfae;font:900 clamp(19px,2.6vw,38px) Georgia;text-transform:uppercase;letter-spacing:3px;text-shadow:3px 3px #2d0b0d}

.duel-intro-emblem{z-index:2;display:grid;place-items:center;align-content:center;min-height:230px;color:#d3a541;text-align:center;text-shadow:3px 4px #321407;transform:rotate(-4deg)}

.duel-intro-emblem:before,.duel-intro-emblem:after{content:"";width:3px;height:58px;background:#9f712c}

.duel-intro-emblem small,.duel-intro-emblem span{color:#cba653;font:900 clamp(8px,.9vw,12px) Georgia;letter-spacing:.25em}

.duel-intro-emblem b{padding-right:.12em;color:#d09d35;font:900 italic clamp(78px,11vw,158px)/.78 Georgia;letter-spacing:-.12em;-webkit-text-stroke:2px #4b260e}

@keyframes duelIntroFade{0%,88%{opacity:1}

100%{opacity:0}

}

/* Battle */
.arena-page{height:100vh;overflow:hidden;display:grid;grid-template-rows:58px minmax(0,1fr);position:relative;background-color:#090b0d;background-image:linear-gradient(#0a07053b,#07121b3b),url("../assets/background/battlefield.jpg");background-position:center;background-size:contain;background-repeat:no-repeat}
.arena-page:before{content:"";position:fixed;inset:0;pointer-events:none;box-shadow:inset 0 0 90px #020202e0}
.classic-top{z-index:3;display:grid;grid-template-columns:1fr 300px 1fr;align-items:center;padding:4px 10px;background:#1b120de8;color:#f0dda7}
.duelist-profile{display:flex;align-items:center;gap:6px}
.duelist-profile.enemy-profile{flex-direction:row-reverse;text-align:right}
.duelist-profile img{width:43px;height:43px;object-fit:contain}
.duelist-profile small{display:block;color:#bd9653;font:900 7px Tahoma;letter-spacing:1.8px}
.duelist-profile strong{display:block;font:900 13px Georgia}
.top-center{display:grid;grid-template-columns:1fr 70px;gap:4px;align-items:center;text-align:center}
.ready-button{padding:7px 9px;border:2px outset #c4933d;background:#681d29;color:#ffe2a0;font:900 10px Georgia}
.ready-button.ready-hidden{visibility:hidden}
.timer{padding:5px;border:2px inset #8c612d;background:#17100c;color:#efcf68;font:900 16px "Courier New"}
.initiative-line{grid-column:1/-1;color:#c4a36a;font:900 7px Tahoma;letter-spacing:1.8px}

.main-layout{z-index:2;min-height:0;display:grid;grid-template-columns:172px minmax(600px,1fr) 382px;gap:7px;padding:6px}
.left-panel{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);gap:6px}
.element-box{padding:7px;background:repeating-linear-gradient(0deg,#5b3e24ee 0 2px,#4d331eee 2px 4px);color:#f0dfb0}
.element-stack{display:grid;gap:3px;margin-top:5px}
.element-line{display:grid;grid-template-columns:15px 1fr auto;align-items:center;gap:4px;padding:4px;border:1px solid #694622;background:#17100c;font:900 8px Tahoma}
.element-line.light{border-left:4px solid #dec769}
.element-line.dark{border-left:4px solid #744487}
.element-line.fire{border-left:4px solid #b53a29}
.element-line.water{border-left:4px solid #3c83a7}
.element-dot{display:inline-block;width:12px;height:12px;border-radius:50%;box-shadow:inset 0 0 0 1px #fff1a666}
.element-dot.light{background:#ead675}
.element-dot.dark{background:#704382}
.element-dot.fire{background:#bd3d2a}
.element-dot.water{background:#438bad}
.element-dot.random{background:conic-gradient(#ead675 0 25%,#704382 25% 50%,#bd3d2a 50% 75%,#438bad 75%)}
.element-total{padding:5px 0;text-align:right;color:#d1ad66;font:900 8px Tahoma}
.utility-btn,.right-controls button{width:100%;padding:5px;border:2px outset #a67630;border-radius:0;background:#4b2e1a;color:#efd28a;font:900 7px Tahoma}

.battle-log-panel{min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr);padding:6px;background:linear-gradient(135deg,#49311fe8,#23170fe8);color:#f0dfb0}
.battle-log{min-height:0;overflow:auto;padding:6px;background:repeating-linear-gradient(0deg,#2d2117e8 0 18px,#33251ae8 18px 19px);border:2px inset #8a602d;color:#e4d3a8;font:9px/1.4 Tahoma}
.log-entry{display:flex;align-items:center;gap:3px;flex-wrap:wrap;padding:4px 1px;border-bottom:1px solid #56391f}
.log-avatar,.log-skill img,.log-target img{width:18px;height:18px;object-fit:cover;background:#100b09;border:1px solid #80572a}
.log-skill,.log-target{display:inline-flex;align-items:center;gap:3px;color:#e3b55a;font-weight:900}
.log-damage{color:#ff7c79;font-weight:900}
.log-heal{color:#72d09a;font-weight:900}
.log-analysis{color:#b9a475}
.log-empty{opacity:.65}

.battle-center{min-width:0;min-height:0;display:flex;justify-content:center}
.battle-board{width:100%;height:100%;min-height:0;display:grid;grid-template-rows:12px 120px clamp(158px,21vh,205px) 42px clamp(158px,21vh,205px) 120px 12px;align-content:center;gap:2px;padding:4px 7px;position:relative;overflow:hidden;border:4px ridge #6f4a22;outline:2px solid #b78439;background-color:#2b1a1170;background-image:linear-gradient(#571d283d 0 45%,#3b2a1630 48% 52%,#4b201d3d 55% 100%),url("../assets/background/battlefield.jpg");background-position:center;background-size:cover;background-repeat:no-repeat;box-shadow:inset 0 0 0 1px #d0a448,inset 0 0 24px #25140c8a}
.battle-board:before{content:"";position:absolute;left:5%;right:5%;top:50%;height:1px;background:#c69c466e}
.board-side-title{z-index:1;text-align:center;color:#e2c67f;font:900 7px Tahoma;letter-spacing:2.5px}
.opponent-title{color:#efaaa8}
.player-title{color:#efc79a}

.duelist-layer{position:relative;z-index:9;min-height:0;overflow:visible}
.duelist-back{height:100%;min-height:0;display:flex;align-items:center;gap:10px;padding:6px 12px;overflow:visible;border-width:3px;background:linear-gradient(90deg,#6c2b34e8,#3e2118e8 58%,#8c6632d9);color:#f1d9aa}
.duelist-back.player{background:linear-gradient(90deg,#8c6632e8,#3e2118e8 42%,#6c2b34e8);color:#f1d9aa}
.duelist-back.enemy{flex-direction:row-reverse;text-align:right}
.duelist-avatar{width:136px;height:112px;object-fit:contain;align-self:center;filter:drop-shadow(3px 4px 0 #1d0f09)}
.duelist-info{min-width:0;flex:1}
.duelist-info>small{display:block;color:#d0aa60;font:900 8px Tahoma;letter-spacing:1px}
.duelist-info>strong{display:block;font:900 15px Georgia}
.duelist-passives-row{display:flex;gap:3px;margin-top:2px;overflow:visible}
.enemy .duelist-passives-row{justify-content:flex-end}
.duelist-passive{position:relative;min-width:104px;display:grid;grid-template-columns:34px 1fr;align-items:center;gap:5px;padding:4px;border:2px ridge #9b6c31;border-radius:0;background:#3a2a1c;color:#f0dfb2;text-align:left}
.duelist-passive img{width:32px;height:32px;object-fit:cover}
.duelist-passive>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:900 8px Tahoma}
.duelist-passive>small,.duelist-passive>em{grid-column:2;color:#d3b979;font:700 7px Tahoma;font-style:normal}
.duelist-passive.unusable{opacity:1}
.duelist-passive.unusable>img,.duelist-passive.unusable>span,.duelist-passive.unusable>small,.duelist-passive.unusable>em{opacity:.42;filter:grayscale(1)}

.duelist-tooltip{display:none;position:fixed;z-index:2500;left:50%;top:72px;bottom:auto;transform:translateX(-50%);width:min(470px,calc(100vw - 24px));padding:12px;border:3px ridge #c28d3b;background:#17100d;color:#f0dfb1;opacity:1!important;filter:none!important;text-align:left;box-shadow:0 5px 0 #080403,0 0 0 2px #5b3b1d}
.duelist-tooltip img{float:left;width:42px;height:42px;object-fit:cover;margin-right:7px}
.duelist-tooltip b{font:900 10px Georgia}
.duelist-tooltip span{display:block;margin-top:3px;white-space:normal;font:9px/1.35 Tahoma}
.duelist-passive:hover .duelist-tooltip,.duelist-passive:focus .duelist-tooltip{display:block}
.duelist-chat{position:absolute;z-index:120;left:50%;top:50%;transform:translate(-50%,-50%);width:min(410px,50%);min-height:72px;overflow:hidden;padding:10px 15px 10px 20px;display:grid;align-content:center;gap:4px;border:3px ridge #a87835;background-color:#3a2418;background-image:linear-gradient(135deg,#59361f,#2d1c13 62%,#704822);color:#f3deb0;text-align:left;clip-path:polygon(9px 0,100% 0,100% calc(100% - 9px),calc(100% - 9px) 100%,0 100%,0 9px);box-shadow:inset 0 0 0 1px #d0a458,4px 5px 0 #160a07a8}
.duelist-chat:before{content:"◆";position:absolute;left:3px;top:3px;color:#70512b;font-size:8px}
.duelist-chat b{color:#e4b85f;font:900 8px Tahoma;letter-spacing:1px}
.duelist-chat span{font:900 12px/1.25 Georgia}
.duelist-chat.side-yugi,.duelist-chat.side-pegasus{border-color:#a87835;background-color:#3a2418;background-image:linear-gradient(135deg,#59361f,#2d1c13 62%,#704822);color:#f3deb0}

.fighter-row{z-index:5;min-height:0;overflow:visible;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch;padding:2px 6px}
.fighter{position:relative;min-width:0;min-height:0}
.fighter-card{height:100%;min-height:0;display:grid;grid-template-rows:auto minmax(0,1fr) auto;overflow:hidden;border:4px ridge #94505a;border-radius:0;background:linear-gradient(135deg,#6b343b,#3b2119);box-shadow:3px 4px 0 #241008a8;clip-path:polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px)}
.fighter.player .fighter-card{border-color:#94505a;background:linear-gradient(135deg,#6b343b,#3b2119)}
.fighter-nameplate{display:flex;justify-content:space-between;padding:3px 5px;background:#571923;color:#ffe0a1;font:900 8px Georgia}
.fighter.player .fighter-nameplate{background:#571923}
.fighter-nameplate small{color:#dfbd68;font:900 6px Tahoma}
.fighter-body,.fighter.player .fighter-body{position:relative;min-height:0;overflow:hidden;background-image:linear-gradient(#32170c82,#32170c82),url("../assets/background/monster-panel.jpg");background-position:center;background-size:cover;background-repeat:no-repeat}
.fighter-portrait-wrap{position:absolute;inset:0;overflow:hidden}
.fighter-portrait{width:100%;height:100%;display:block;object-fit:contain;object-position:center}
.fighter-info{position:absolute;inset:auto 5px 5px;display:grid;place-items:center;padding:3px;border:1px solid #b1843e;background:#1d120ded}
.target-caption{color:#edc867;font:900 7px Tahoma}
.hp-row{display:grid;grid-template-columns:1fr auto;align-items:center;gap:4px;padding:3px 5px;background:#b99758;color:#170d08}
.hp-track{height:9px;padding:1px;border:1px inset #57361c;background:#2d1a10}
.hp-track span{display:block;height:100%;transition:width 1.7s cubic-bezier(.22,.61,.36,1)}
.hp-track.enemy span{background:#a61c2d}
.hp-track.player span{background:#8f2932}
.hp-text{font:900 7px "Courier New"}
.fighter.dead{filter:grayscale(1);opacity:.36}
.fighter.targetable{cursor:pointer}
.fighter.targetable .fighter-card{animation:targetPulse 2.8s ease-in-out infinite}
.fighter.targetable:after{content:"";position:absolute;inset:-3px;border:2px solid #a87d39;pointer-events:none;animation:targetOutline 2.8s ease-in-out infinite}
@keyframes targetPulse{0%,100%{filter:brightness(.9);box-shadow:0 0 3px #6f4f22}
50%{filter:brightness(1.03);box-shadow:0 0 10px #b38843}
}
@keyframes targetOutline{0%,100%{opacity:.3}
50%{opacity:.72}
}
.arena-seal{z-index:2;display:grid;place-items:center;color:#d7ad5185;font:900 20px Georgia}
.arena-seal:before,.arena-seal:after{content:"";position:absolute;width:34%;height:1px;background:#b98a3a77}
.arena-seal:before{left:4%}
.arena-seal:after{right:4%}

.effect-tray{position:absolute;z-index:55;left:4px;right:4px;top:25px;display:flex;justify-content:center;align-items:flex-start;flex-wrap:wrap;gap:2px;pointer-events:none}
.effect-tray.empty{display:none}
.effect-badge{position:relative;display:flex;align-items:center;gap:3px;padding:2px 4px;border:2px ridge #a87834;border-radius:0;background:#e0ca91;color:#2b1a0f;font:900 7px Tahoma;pointer-events:auto;box-shadow:1px 2px 0 #1d0e08}
.effect-badge img{width:20px;height:20px;object-fit:cover;border:1px solid #6f4a22}
.effect-tooltip{position:fixed;z-index:3000;left:50%;bottom:10px;transform:translateX(-50%);width:min(430px,calc(100vw - 24px));display:grid;grid-template-columns:40px 1fr;gap:6px;padding:8px;border:2px solid #ac7d35;background:#17100df7;color:#efdeb0;opacity:0;pointer-events:none}
.effect-tooltip img{width:38px;height:38px;object-fit:cover}
.effect-tooltip b{font:900 10px Georgia}
.effect-tooltip small{color:#d5ad57;font:900 7px Tahoma}
.effect-tooltip>span{grid-column:1/-1;border-top:1px solid #66451f;padding-top:5px;font:9px/1.35 Tahoma}
.effect-badge:hover .effect-tooltip,.effect-badge:focus .effect-tooltip{opacity:1}
.monster-passive-badge{position:absolute;right:4px;top:23px;z-index:45;width:38px;height:38px;padding:3px;border:2px ridge #c0903e;background:#19110d;box-shadow:2px 2px 0 #130906}
.monster-passive-badge img{width:28px;height:28px;object-fit:cover}
.monster-passive-tooltip{display:none;position:fixed;z-index:3000;right:10px;bottom:10px;width:280px;padding:8px;border:2px solid #aa7933;background:#17100df7;color:#f0dfb0;font:9px/1.3 Tahoma}
.monster-passive-tooltip b,.monster-passive-tooltip span{display:block}
.monster-passive-badge:hover .monster-passive-tooltip{display:block}
/* Techniques */
.right-panel{min-height:0;overflow:auto;padding:6px;background:repeating-linear-gradient(0deg,#4b3421ed 0 2px,#3d291aed 2px 4px);color:#f3e2b7}.skills-heading{position:sticky;top:0;z-index:6}.skill-group{margin-top:5px;border:2px ridge #8e622c;background:#392719}.group-head{display:flex;align-items:center;gap:6px;padding:5px;background:linear-gradient(90deg,#67242e,#4f3220);color:#f7e5ba;border-bottom:2px ridge #9a7134}.group-head img{width:34px;height:34px;object-fit:contain;background:#312216;border:1px solid #b48235}.group-head b{display:block;font:900 10px Georgia}.group-head small{color:#e1bd6b;font:900 7px Tahoma}.skill-grid{display:grid;grid-template-columns:1fr;gap:3px;padding:3px}.skill{min-width:0;display:grid;grid-template-columns:50px 1fr;gap:6px;align-items:start;min-height:64px;padding:5px;border:2px ridge #815a2a;border-radius:0;background:#49321f;color:#f0e0b8;text-align:left}.skill.available:hover{filter:brightness(1.12);border-color:#c69b48}.skill.selected{border-color:#e4c368;box-shadow:inset 0 0 0 1px #e4c368}.skill.unusable{filter:grayscale(1);opacity:.34;background:#292929;color:#aaa}.skill.unusable img{filter:grayscale(1) brightness(.55)}.skill-art-wrap{position:relative}.skill-art-wrap img{width:48px;height:48px;object-fit:contain;object-position:center;background:#2d2015;border:1px solid #aa7830}.cooldown-badge{position:absolute;right:0;top:0;padding:1px 3px;background:#8f1f2d;border:1px solid #e9a0a7;color:#fff;font:900 9px Tahoma}.skill-copy{min-width:0}.skill-copy b{display:block;color:#f4ce77;font:900 10px/1.15 Tahoma}.skill.unusable .skill-copy b{color:#b5b5b5}.skill-copy>span{display:block;margin-top:2px;color:#e1d0aa;font:10px/1.3 Tahoma}.skill-copy small{display:block;margin-top:4px}.cost-icons{display:inline-flex;align-items:center;gap:2px;flex-wrap:wrap}.cost-icons .element-dot{width:8px;height:8px}.cost-label,.free-mark{color:#d2b77c;font:900 7px Tahoma}.cost-icons.large{padding:3px;border:1px inset #765026;background:#3a281a}.info-panel{margin-top:5px;padding:7px;background:#4b3421e8;color:#f1dfb3}.info-skill-head{display:flex;align-items:center;gap:7px;margin:5px 0}.info-skill-head img{width:50px;height:50px;object-fit:contain;background:#2e2015;border:1px solid #a87831}.info-skill-head b{display:block;font:900 11px Georgia}.info-skill-head small{color:#d0b77e;font-size:9px}.info-panel p{margin:5px 0;color:#ead9b3;font:10px/1.4 Tahoma}.skill-meta{display:flex;gap:3px;align-items:center;flex-wrap:wrap}.skill-meta>span{padding:2px 3px;border:1px solid #775328;background:#382619;color:#dfc58e;font:900 7px Tahoma}.right-controls{position:sticky;bottom:0;display:grid;grid-template-columns:1fr 1fr;gap:4px;padding-top:5px;background:#48311f}
/* Compact technique shelf: every move stays visible; the selected move remains fully described below. */
.skill-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px}
.skill{grid-template-columns:46px 1fr;gap:5px;align-items:center;min-height:58px;padding:4px}
.skill-art-wrap img{width:44px;height:44px;object-fit:contain}
.skill-copy b{font-size:9px;line-height:1.15;white-space:normal}
.skill-copy>span{display:none}
.skill-copy small{margin-top:3px}
.cost-icons .element-dot{width:7px;height:7px}

/* Dialogs */
.modal,.winner{position:fixed;inset:0;z-index:5000;display:grid;place-items:center;padding:16px;background:#080403dc}.queue-modal,.exchange-modal,.passive-modal,.winner-card{width:min(920px,94vw);max-height:92vh;overflow:auto;padding:14px;background:#23170ff7;color:#eddaab}.exchange-modal,.passive-modal{width:min(560px,92vw);text-align:center}.modal-head{display:flex;justify-content:space-between;align-items:center;padding-bottom:7px;border-bottom:1px solid #8e632e}.modal-head h2,.passive-modal h2{margin:3px 0;color:#edbd5a;font:900 20px Georgia}.queue-timer{color:#efc95e;font:900 22px "Courier New"}.queue-modal>p,.passive-modal p,.exchange-modal p{color:#d3c19a;font:10px/1.4 Tahoma}.review-list{display:grid;gap:5px}.review-row{display:grid;grid-template-columns:230px 1fr 200px;gap:7px;align-items:center;padding:5px;border:1px solid #765126;background:#17100c}.review-skill{display:flex;align-items:center;gap:6px}.review-skill img{width:44px;height:44px;object-fit:cover}.review-controls{display:flex;gap:3px;justify-content:flex-end}.review-controls button,.review-actions button,.passive-actions button,.step-back,.exchange-row button,.universal-energy-row button{min-width:30px;padding:6px 9px;border:2px outset #a77832!important;background:#4c2e19!important;color:#efd38c!important;font:900 10px Tahoma}.remove-skill{background:#681d28!important}.review-actions,.passive-actions{display:flex;justify-content:flex-end;gap:6px;margin-top:8px}.remaining-box,.universal-energy{margin-top:7px;padding:6px;border:1px solid #765029;background:#17100c}.remaining-title{text-align:center;color:#d7af57;font:900 8px Tahoma}.remaining-grid,.universal-energy-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin-top:5px}.remaining-element,.universal-energy-row{display:flex;align-items:center;justify-content:space-between;gap:3px;padding:4px;border:1px solid #67451f;background:#21160f;font:900 7px Tahoma}.exchange-row{display:grid;grid-template-columns:22px 1fr 36px 68px 36px;align-items:center;gap:6px;padding:6px;border-bottom:1px solid #65441f}.exchange-total{margin:8px}.exchange-receive-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:4px}.exchange-receive{padding:6px;border:2px outset #96682c;background:#362218;color:#edd7a3}.exchange-receive.chosen{box-shadow:inset 0 0 0 2px #d5ad57}.passive-art{width:84px;height:84px;object-fit:cover;border:2px solid #a67731}.passive-choices{display:grid;grid-template-columns:repeat(3,1fr);gap:5px;margin-top:6px}.passive-choices button{display:flex;align-items:center;gap:5px;padding:5px;border:1px solid #795228;background:#17100c;color:#eddcb0;text-align:left}.passive-choices img{width:46px;height:46px;object-fit:cover}.winner-card{width:min(520px,92vw);text-align:center}.winner-card h1{margin:8px;color:#e7bd5d;font:900 50px Georgia}.winner-card button{padding:8px 18px;border:2px outset #b18439;background:#5a371d;color:#f0d896}.queue-strip{padding:5px;border:1px solid #755027;background:#17100c}.queue-slots{display:flex;gap:4px;overflow:auto}.queue-slot{display:flex;align-items:center;gap:4px;min-width:120px;padding:3px;border:1px solid #6e4a24;background:#21160f}.queue-slot img{width:32px;height:32px;object-fit:cover}
.universal-energy{padding:11px}.remaining-title{font-size:11px;letter-spacing:1px}.universal-energy-grid{gap:8px;margin-top:9px}.universal-energy-row{min-height:52px;gap:7px;padding:7px 8px;font-size:10px}.universal-energy-row .element-dot{width:17px;height:17px}.universal-energy-row button{min-width:38px;min-height:34px;font-size:16px!important;padding:4px 10px!important}.remaining-element{min-height:34px;padding:7px;font-size:9px}
.enemy-preview-panel{width:min(900px,94vw);max-height:90vh;overflow:auto;padding:14px;border:4px ridge #9b6b2d;outline:2px solid #d0a24e;background:linear-gradient(135deg,#321c13f7,#17100cf7 60%,#4d2d19f7);color:#f0dfb2;box-shadow:8px 10px 0 #080403b5}.enemy-preview-panel .modal-head button{padding:7px 12px;border:2px outset #a87834;background:#5e211f;color:#f0d497;font:900 9px Tahoma}.enemy-preview-profile{display:grid;grid-template-columns:120px 1fr;gap:12px;align-items:center;margin:10px 0;padding:8px;border:2px ridge #835927;background:#21150f}.enemy-preview-profile img{width:116px;height:104px;object-fit:contain;background:#100b08}.enemy-preview-profile b,.enemy-preview-profile span{display:block}.enemy-preview-profile b{color:#edc466;font:900 16px Georgia}.enemy-preview-profile span{margin-top:5px;color:#cfbd94;font:10px/1.35 Tahoma}.enemy-preview-skills{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.enemy-preview-skill{display:grid;grid-template-columns:84px 1fr;gap:8px;padding:7px;border:2px ridge #755027;background:#20150f}.enemy-preview-skill>img{width:82px;height:82px;object-fit:contain;background:#100b08}.enemy-preview-skill b{display:block;color:#e9be60;font:900 12px Georgia}.enemy-preview-skill small{display:block;margin-top:2px;color:#bfa56f;font:900 7px Tahoma}.enemy-preview-skill p{margin:5px 0;color:#dfcfaa;font:9px/1.35 Tahoma}
/* Battle effects */
.battle-vfx-layer{position:absolute;inset:0;z-index:70;pointer-events:none;overflow:hidden}.damage-flash .fighter-card{animation:damageShake .38s}.fighter.is-stunned:before{content:"STUN";position:absolute;z-index:46;left:8px;top:29px;width:42px;height:42px;display:grid;place-items:center;pointer-events:none;border:4px double #d1a44b;border-radius:50%;background:#4f1718e8;color:#f0d58e;font:900 8px Georgia;letter-spacing:1px;box-shadow:2px 3px 0 #170806}.fighter.is-stunned .fighter-portrait{filter:sepia(.28) saturate(.72) brightness(.82)}@keyframes damageShake{25%{transform:translateX(-5px)}50%{transform:translateX(5px)}75%{transform:translateX(-2px)}}
/* Duelist declarations */
.battle-pointer-arrow{position:absolute;height:10px;transform-origin:0 50%;opacity:0;background:repeating-linear-gradient(90deg,#68151c 0 10px,#8e2029 10px 18px);border-block:2px solid #33090d;box-shadow:2px 3px 0 #160707;clip-path:polygon(0 28%,calc(100% - 24px) 28%,calc(100% - 24px) 0,100% 50%,calc(100% - 24px) 100%,calc(100% - 24px) 72%,0 72%)}
.battle-pointer-arrow.shown{opacity:1;animation:pointerStamp .95s steps(4,end) both}
.battle-pointer-arrow span{display:none}
.fighter.vfx-buff .fighter-card{animation:buffAuraOld 1.45s steps(5,end)}
@keyframes pointerStamp{0%{opacity:0;filter:brightness(.6)}18%,78%{opacity:1;filter:brightness(1)}100%{opacity:0;filter:brightness(.7)}}
@keyframes buffAuraOld{0%,100%{filter:none}20%,80%{filter:sepia(.25) brightness(1.08);box-shadow:0 0 0 4px #b3893f,0 0 0 7px #5e421f,inset 0 0 18px #d8b85f}50%{filter:sepia(.45) brightness(1.18);box-shadow:0 0 0 5px #d0aa52,0 0 0 9px #493017,inset 0 0 25px #f0d47a}}
.duelist-passive-toast{position:fixed;z-index:3200;left:50%;top:64px;transform:translateX(-50%);display:flex;align-items:center;gap:7px;padding:6px 11px;border:2px solid #a67631;background:#17100df5;color:#edd9a8;font:900 10px Georgia}.duelist-passive-toast img{width:28px;height:28px;object-fit:cover}.duelist-skill-cinematic{position:fixed;inset:0;z-index:2800;display:grid;grid-template-columns:minmax(250px,40vw) 1fr;align-items:center;padding:3vw 7vw;overflow:hidden;pointer-events:none;background:linear-gradient(90deg,#5a1b22f2,#18100df0 55%,#54351df2);animation:cinematicIn 2s linear forwards}.duelist-skill-cinematic.enemy{direction:rtl;background:linear-gradient(90deg,#501722f2,#18100df0 45%,#54351df2)}.duelist-skill-cinematic .cinematic-rays{position:absolute;inset:0;background:linear-gradient(115deg,transparent 0 43%,#b68a3440 44% 45%,transparent 46% 54%,#b68a3430 55% 56%,transparent 57%)}.duelist-skill-cinematic img{z-index:1;width:100%;height:84vh;object-fit:contain}.duelist-skill-cinematic>div:last-child{z-index:1;padding:18px;border-block:3px solid #9c7130;direction:ltr;color:#f2dda7;text-shadow:3px 3px #330d12}.duelist-skill-cinematic small{display:block;font:900 13px Tahoma;letter-spacing:4px}.duelist-skill-cinematic b{display:block;margin-top:7px;font:900 italic clamp(28px,4.5vw,66px)/1 Georgia;text-transform:uppercase}@keyframes cinematicIn{0%,88%{opacity:1;transform:none}100%{opacity:0}}
@media(max-width:1450px){.arena-selection-content{grid-template-columns:270px minmax(540px,1fr) 310px}.main-layout{grid-template-columns:154px minmax(570px,1fr) 360px;gap:5px;padding:5px}.fighter-row{gap:8px;padding-inline:3px}.duelist-avatar{width:118px}.duelist-passive{min-width:92px}.duelist-chat{width:min(360px,46%)}.skill{grid-template-columns:43px 1fr}.skill-art-wrap img{width:41px;height:41px}.right-panel{padding:4px}}
@media(max-width:1180px){html,body{min-width:1000px}.arena-selection-page,.arena-page{height:auto;min-height:100vh;overflow:auto}.main-layout{grid-template-columns:145px minmax(590px,1fr) 300px}.battle-board{min-height:650px}.monster-grid{grid-template-columns:repeat(6,minmax(72px,1fr))}}
@media(max-height:820px){.arena-selection-page{grid-template-rows:68px 30px minmax(0,1fr)}.arena-selection-content{grid-template-rows:minmax(0,1fr)}.selection-main-panel,.arena-select-info{height:100%}.team-slot-list{grid-auto-rows:104px}.monster-grid{grid-auto-rows:clamp(108px,17vh,138px)}.monster-tile{height:100%}.monster-tile img{height:calc(100% - 27px)}.arena-select-duelist img{height:88px}.arena-page{grid-template-rows:54px minmax(0,1fr)}.main-layout{padding:4px}.battle-board{grid-template-rows:10px 112px clamp(145px,21vh,175px) 36px clamp(145px,21vh,175px) 112px 10px}.duelist-avatar{height:104px}.fighter-nameplate,.hp-row{padding-block:2px}}
@media(max-height:700px){.selection-match-copy{display:none}.arena-selection-page{grid-template-rows:58px 28px minmax(0,1fr)}.arena-selection-content{grid-template-rows:minmax(0,1fr)}.team-slot-list{grid-auto-rows:90px}.team-slot img{width:78px;height:78px}.team-slot{grid-template-columns:20px 80px minmax(0,1fr)}.monster-grid{grid-auto-rows:100px}.select-focus-skill small{font-size:7px}.battle-board{grid-template-rows:10px 58px clamp(130px,22vh,155px) 14px clamp(130px,22vh,155px) 58px 10px}.duelist-avatar{height:54px}.duelist-passive{min-width:60px}.effect-tray{top:-15px}}

/* Final viewport guards: keep the old-game composition dense without hiding controls. */
@media(max-width:1450px){
  .skill{grid-template-columns:42px 1fr;min-height:54px}
  .skill-art-wrap img{width:40px;height:40px}
  .monster-grid{grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media(max-height:820px){
  .arena-selection-content{grid-template-rows:minmax(0,1fr)!important}
  .selection-main-panel,.arena-select-info{height:100%!important}
  .duelist-selection-layout{grid-template-rows:minmax(0,1fr)!important}
  .duelist-selection-layout .selection-main-panel{height:100%!important}
  .monster-grid{grid-template-columns:repeat(6,minmax(0,1fr));height:calc(100% - 29px)}
  .monster-tile{height:100%}
  .monster-tile img{height:calc(100% - 27px)}
  .arena-select-duelist img{height:100px}
  .battle-board{grid-template-rows:10px 112px clamp(145px,21vh,175px) 36px clamp(145px,21vh,175px) 112px 10px}
  .duelist-avatar{width:118px;height:104px}
  .duelist-chat{min-height:66px}
}
@media(max-height:700px){
  .arena-selection-content{grid-template-rows:minmax(0,1fr)!important}
  .selection-main-panel,.arena-select-info{height:100%!important}
  .duelist-selection-layout{grid-template-rows:minmax(0,1fr)!important}
  .duelist-selection-layout .selection-main-panel{height:100%!important}
  .monster-tile{height:100%}
  .monster-tile img{height:calc(100% - 27px)}
  .arena-select-duelist img{height:88px}
  .battle-board{grid-template-rows:10px 76px clamp(130px,21vh,155px) 16px clamp(130px,21vh,155px) 76px 10px}
  .duelist-avatar{width:78px;height:68px}
  .duelist-chat{flex-basis:220px;width:220px;min-width:200px;max-width:240px;min-height:54px;max-height:76px}
}

/* Joey / chance chamber and readability pass. */
.coin-flip-screen{position:fixed;inset:0;z-index:7000;display:grid;place-items:center;overflow:hidden;background:#080402;color:#f2dfaa;perspective:1100px}
.coin-backdrop{position:absolute;inset:-3%;background:linear-gradient(#120907bb,#120907ee),var(--coin-skill-art) center/cover no-repeat;filter:sepia(.25) contrast(1.25);transform:scale(1.06)}
.coin-chamber{position:relative;width:min(760px,90vw);padding:34px 26px;text-align:center;border:7px double #b27f32;outline:3px solid #3d210e;background:linear-gradient(135deg,#3b2115f2,#130b08f5 55%,#5a3219ed);box-shadow:0 0 0 6px #130a05,12px 14px 0 #050201}
.coin-chamber:before,.coin-chamber:after{content:"☥";position:absolute;top:12px;color:#bd8a3c;font:34px Georgia}.coin-chamber:before{left:18px}.coin-chamber:after{right:18px}
.coin-chamber small{color:#d1aa5b;font:900 11px Georgia;letter-spacing:3px}.coin-chamber h2{margin:7px 0 16px;color:#f2cd73;font:900 30px Georgia;text-shadow:3px 3px #35120d}.coin-chamber p{font:700 14px Georgia;color:#d8c18c}
.coin-stage{min-height:210px;display:flex;align-items:center;justify-content:center;gap:42px;perspective:900px;overflow:visible}
.arena-coin{position:relative;width:170px;height:190px;display:grid;place-items:center;filter:drop-shadow(8px 10px 4px #050201aa)}
.arena-coin img{width:166px;height:166px;object-fit:contain;transform:none}
.arena-coin>span{position:absolute;bottom:0;padding:3px 8px;border:1px solid #5e3714;background:#1a0e08e8;color:#f2d68c;font:900 10px Georgia;letter-spacing:1px}
.arena-coin.waiting{width:170px;height:170px;margin-bottom:20px;border:6px double #9b702e;border-radius:50%;background:radial-gradient(circle,#59401f 0 46%,#24160b 48% 100%);color:#dfbd6b}
.arena-coin.waiting b{font:900 58px Georgia;text-shadow:3px 3px #160b05}.arena-coin.waiting span{bottom:-22px}
.arena-coin.landed{animation:coinToss 1.2s cubic-bezier(.18,.7,.28,1) var(--coin-delay) both}
.coin-result{display:block;min-height:24px;color:#ffd77a;font:900 21px Georgia;letter-spacing:1px;text-shadow:2px 2px #3a120d}
.coin-flip-button{margin-top:10px;min-width:190px;padding:12px 22px;border:4px outset #bd8c39;background:#652126;color:#f7dd99;font:900 15px Georgia;letter-spacing:2px;text-shadow:2px 2px #260806}
@keyframes coinToss{0%{transform:translateY(34px) rotateY(0);opacity:.25}45%{transform:translateY(-76px) rotateY(720deg);opacity:1}78%{transform:translateY(7px) rotateY(1080deg)}100%{transform:translateY(0) rotateY(1440deg)}}

/* Readability pass: enlarge ordinary interface copy while leaving cinematic callouts untouched. */
.skill-copy b{font-size:11px}.cost-label,.free-mark{font-size:9px}.info-panel p{font-size:12px;line-height:1.48}.skill-meta>span{font-size:9px}.duelist-tooltip span{font-size:11px;line-height:1.45}.effect-tooltip>span{font-size:11px;line-height:1.45}.battle-log{font-size:10px;line-height:1.42}.team-slot b,.monster-tile b,.arena-select-duelist b{font-size:12px}.select-focus-card span,.select-duelist-profile span{font-size:10px}.passive-modal p,.queue-modal>p,.exchange-modal p{font-size:12px;line-height:1.48}
.fighter-nameplate span{font-size:11px}.fighter-nameplate small,.hp-text{font-size:9px}.group-head b{font-size:11px}.group-head small{font-size:9px}.element-line{font-size:11px}.element-total,.panel-title,.panel-ribbon,.queue-title{font-size:10px}.duelist-passive>span{font-size:10px}.duelist-passive>small,.duelist-passive>em{font-size:8px}.effect-badge{font-size:9px}.effect-tooltip b{font-size:12px}.effect-tooltip small{font-size:9px}.monster-passive-tooltip{font-size:11px;line-height:1.42}.enemy-preview-profile span,.enemy-preview-skill p{font-size:11px;line-height:1.42}.enemy-preview-skill small{font-size:9px}.remaining-element,.universal-energy-row{font-size:10px}.queue-modal>p,.review-row,.queue-slot{font-size:11px}

/* v91 roster pagination + Duelist Kingdom selection treatment */
.roster-pagination{display:flex;align-items:center;justify-content:center;gap:10px;margin-top:6px;min-height:31px}
.roster-pagination span{min-width:92px;text-align:center;color:#e7c26a;font:900 9px Georgia;letter-spacing:1.3px}
.roster-pagination button{width:45px;height:29px;border:2px outset #a67b36;border-radius:0;background:linear-gradient(#745126,#3b2615);color:#f6dda0;font:900 15px Georgia;text-shadow:1px 1px #1a0d07;clip-path:polygon(9px 0,100% 0,100% 100%,9px 100%,0 50%)}
.roster-pagination button:last-child{clip-path:polygon(0 0,calc(100% - 9px) 0,100% 50%,calc(100% - 9px) 100%,0 100%)}
.roster-pagination button:disabled{filter:grayscale(1);opacity:.28}
.selection-main-panel .monster-grid{height:calc(100% - 66px)}
.duelist-main-panel .duelist-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-rows:minmax(0,1fr)}
.random-cpu-note{grid-column:1/-1;padding:8px;border:2px ridge #8e612d;background:linear-gradient(90deg,#321d13,#5b381d);color:#e9d19a}
.random-cpu-note small{display:block;color:#b98a43;font:900 7px Tahoma;letter-spacing:1.5px}
.random-cpu-note b{display:block;margin-top:2px;color:#f0c96d;font:900 11px Georgia}
.random-cpu-note span{display:block;margin-top:2px;color:#bfae83;font:8px Tahoma}
.selection-duelist-mini.random-opponent{justify-content:center;text-align:center;background:linear-gradient(90deg,#3a2517,#6d4822)}

/* This aged parchment/card-back treatment exists ONLY in the Duelist selection UI. */
.duelist-selection-layout .arena-select-duelist{position:relative;overflow:hidden;background:linear-gradient(145deg,#24170f,#4f351d 60%,#17100c);box-shadow:inset 0 0 18px #0b0605}
.duelist-select-portrait{position:relative;display:block;width:100%;height:clamp(110px,15vh,150px);overflow:hidden;border:1px solid #9e6d2e;background:#1a100a;isolation:isolate}
.duelist-select-portrait::before{content:"";position:absolute;inset:-7px;z-index:-2;background-image:linear-gradient(#3b210867,#3b210867),var(--duelist-select-bg);background-size:cover;background-position:center;filter:sepia(.88) saturate(.58) contrast(1.22) brightness(.72)}
.duelist-select-portrait::after{content:"";position:absolute;inset:0;z-index:-1;background:repeating-linear-gradient(0deg,#24130718 0 1px,transparent 1px 3px),radial-gradient(circle at 50% 38%,transparent 20%,#160b0790 100%);mix-blend-mode:multiply;pointer-events:none}
.arena-select-duelist .duelist-select-portrait img,.select-duelist-profile .duelist-select-portrait img{position:relative;width:100%;height:100%;object-fit:contain;object-position:center bottom;background:transparent!important;border:0!important;filter:sepia(.16) saturate(.82) contrast(1.08) drop-shadow(2px 3px 2px #130805b8)}
.select-duelist-profile .duelist-select-portrait.large{width:86px;height:84px}
.select-duelist-profile>.duelist-select-portrait{grid-column:1;grid-row:1}
.duelist-selection-layout .duelist-tile-copy b{color:#f0cc70;text-shadow:1px 1px #170b06}

/* Card-frame images are intentionally cropped to icon art instead of showing tiny card text. */
.skill-art-wrap img,.info-skill-head img,.enemy-preview-skill>img,.duelist-passive img,.duelist-tooltip>img,.select-focus-skill img,.log-skill img{object-fit:cover!important;object-position:center 34%!important}
.skill-art-wrap img,.info-skill-head img,.duelist-passive img,.select-focus-skill img{background:#21150e}

@media(max-height:820px){
  .duelist-select-portrait{height:88px}
  .selection-main-panel .monster-grid{height:calc(100% - 62px)}
}
@media(max-height:700px){
  .duelist-select-portrait{height:78px}
  .roster-pagination{min-height:26px;margin-top:3px}
  .roster-pagination button{height:24px}
}

/* v91.2 CPU/QoL/layout pass */
.arena-selection-header{grid-template-columns:1fr auto;background:linear-gradient(100deg,#2b170fe8,#765328e4 50%,#30160fe8)}
.selection-header-ornament{justify-self:end;color:#d8b55f;font:900 13px Georgia;letter-spacing:2px;text-shadow:2px 2px #2a1008}
.arena-select-team{grid-template-columns:1fr 1fr;grid-template-rows:auto auto minmax(0,1fr) auto auto;background:linear-gradient(135deg,#52361fe8,#241710e9 55%,#694821e8)}
.team-duelist-pick{grid-column:1/-1}
.team-slot-list{grid-row:auto;min-height:0}
.selection-clear{grid-column:1/-1;margin-top:-2px}
.selection-start{grid-column:1/-1}
.selection-main-panel{background:linear-gradient(135deg,#2b1a11e8,#50331ce8 55%,#21140ee8)}
.arena-select-info{background:linear-gradient(145deg,#5b3b20e8,#261810ea 58%,#402817e8)}

.monster-main-panel{display:grid;grid-template-rows:auto minmax(0,1fr) 42px;gap:4px}
.monster-main-panel .monster-grid{height:auto!important;min-height:0;grid-template-rows:repeat(4,minmax(0,1fr));grid-auto-rows:auto;align-content:stretch;padding-top:4px}
.roster-pagination{align-self:center;margin-top:1px;min-height:40px;gap:14px}
.roster-pagination span{min-width:118px;font-size:13px;letter-spacing:1.7px;color:#f1cf78;text-shadow:1px 1px #1e0e07}
.roster-pagination button{width:52px;height:34px;clip-path:none!important;border:2px outset #a67b36;background:linear-gradient(#6c4923,#3a2514);color:#e9ca82;font-size:18px;line-height:1}
.roster-pagination button:last-child{clip-path:none!important}
.roster-pagination button:disabled{background:linear-gradient(#4c3622,#2b1e15);color:#8f7548;filter:none;opacity:.45}

/* Keep the original brown-yellow art mood, only age/mute it. */
.duelist-select-portrait::before{background-image:linear-gradient(#4d2b0e38,#4d2b0e38),var(--duelist-select-bg);filter:sepia(.48) saturate(1.12) contrast(1.1) brightness(.78)}
.duelist-select-portrait::after{background:repeating-linear-gradient(0deg,#5a351015 0 1px,transparent 1px 3px),radial-gradient(circle at 50% 38%,#e0ad4a0d 0 28%,#2612056e 100%);mix-blend-mode:multiply}
.arena-select-duelist .duelist-select-portrait img,.select-duelist-profile .duelist-select-portrait img{filter:sepia(.08) saturate(.95) contrast(1.04) drop-shadow(2px 3px 2px #130805b8)}

/* Battle spacing + future online profile scaffold. */
.battle-board{grid-template-rows:48px 120px clamp(158px,21vh,205px) 94px clamp(158px,21vh,205px) 120px 48px;gap:2px;overflow:hidden;padding:4px 7px}
.profile-layer{position:relative;z-index:20;display:flex;align-items:center}
.enemy-profile-layer{justify-content:flex-end}.player-profile-layer{justify-content:flex-start}
.match-profile{position:relative;min-width:190px;max-width:285px}
.match-profile-main{width:100%;display:grid;grid-template-columns:42px minmax(0,1fr);gap:7px;align-items:center;padding:4px 8px;border:2px ridge #9b6c31;background:linear-gradient(90deg,#3b2517e8,#6a4825e8);color:#f0ddb0;text-align:left;box-shadow:2px 3px 0 #130906aa}
.match-profile.enemy .match-profile-main{grid-template-columns:minmax(0,1fr) 42px;text-align:right}.match-profile.enemy .match-profile-main img{grid-column:2;grid-row:1}.match-profile.enemy .match-profile-main span{grid-column:1;grid-row:1}
.match-profile-main img{width:40px;height:40px;object-fit:contain;background:#160e0a;border:1px solid #a47632}
.match-profile-main b,.match-profile-main small{display:block}.match-profile-main b{font:900 10px Georgia}.match-profile-main small{margin-top:2px;color:#d4b569;font:900 8px Tahoma}
.match-profile-scroll{position:absolute;z-index:150;left:0;bottom:calc(100% + 5px);min-width:230px;padding:8px 10px;border:3px ridge #a77731;background:linear-gradient(145deg,#5f3b20f5,#21140ef8);box-shadow:4px 5px 0 #100806b8;color:#eedaa7;display:grid;gap:3px;font:9px Tahoma}
.match-profile.enemy .match-profile-scroll{left:auto;right:0;top:calc(100% + 5px);bottom:auto;text-align:right}
.match-profile-scroll b{color:#efc662;font:900 12px Georgia;border-bottom:1px solid #825928;padding-bottom:3px}
.duelist-layer{margin-block:0}.fighter-row{padding:2px 6px}

.right-controls{grid-template-columns:1fr 1fr}
.right-controls .back-home{grid-column:1/-1;background:#382417}
.winner-card .winner-home{display:block;margin:7px auto 0;background:#382417}

/* Contextual tooltips: always attached to the thing being inspected. */
.duelist-tooltip{position:absolute;left:50%;top:auto;bottom:calc(100% + 8px);transform:translateX(-50%);width:330px;max-width:44vw;z-index:5000}
.enemy .duelist-tooltip{bottom:calc(100% + 8px)}
.effect-tooltip{position:absolute;left:50%;top:auto;bottom:calc(100% + 7px);transform:translateX(-50%);width:330px;max-width:46vw;z-index:5000}
.monster-passive-tooltip{position:absolute;right:auto;left:50%;top:auto;bottom:calc(100% + 7px);transform:translateX(-50%);width:300px;max-width:45vw;z-index:5000}
.skill{position:relative;overflow:visible}
.skill-hover-tooltip{display:none;position:absolute;z-index:6000;left:50%;bottom:calc(100% + 7px);transform:translateX(-50%);width:320px;max-width:calc(100vw - 40px);padding:9px;border:3px ridge #b68437;background:#17100df9;color:#f0dfb1;box-shadow:3px 4px 0 #080403;text-align:left;pointer-events:none}
.skill-hover-tooltip b{display:block;color:#efc565;font:900 12px Georgia}.skill-hover-tooltip span{display:block;margin-top:4px;color:#ead9b3;font:10px/1.4 Tahoma;white-space:normal}
.skill:hover .skill-hover-tooltip,.skill:focus .skill-hover-tooltip,.skill.selected .skill-hover-tooltip{display:block}

@media(max-height:820px){
  .monster-main-panel .monster-grid{grid-template-rows:repeat(4,minmax(90px,1fr));grid-auto-rows:auto}
  .monster-main-panel .monster-tile img{height:calc(100% - 25px)}
  .battle-board{grid-template-rows:40px 112px clamp(145px,21vh,175px) 72px clamp(145px,21vh,175px) 112px 40px;gap:2px;padding:4px 7px}
  .roster-pagination{min-height:36px}.roster-pagination button{height:30px}.roster-pagination span{font-size:12px}
}
@media(max-height:700px){
  .arena-select-team{gap:5px}.team-duelist-pick{padding:4px}.team-duelist-pick b{margin:2px 0 4px}.team-duelist-pick>img{height:38px}
  .team-slot-list{grid-auto-rows:76px}.team-slot img{width:65px;height:65px}.team-slot{grid-template-columns:20px 67px minmax(0,1fr)}
  .monster-main-panel .monster-grid{grid-template-rows:repeat(4,minmax(76px,1fr))}
  .battle-board{grid-template-rows:34px 58px clamp(130px,22vh,155px) 58px clamp(130px,22vh,155px) 58px 34px;gap:2px;padding:4px 7px}
  .match-profile-main{padding:2px 5px}.match-profile-main img{width:32px;height:32px}.match-profile{min-width:165px}
}
.skill.unusable{opacity:1;filter:none;background:#292929;color:#aaa}
.skill.unusable>.skill-art-wrap,.skill.unusable>.skill-copy{filter:grayscale(1);opacity:.36}
.skill.unusable .skill-hover-tooltip{opacity:1!important;filter:none!important;color:#f0dfb1}
.monster-passive-badge:focus .monster-passive-tooltip{display:block}

/* v91.4 Duelist renders are real local RGBA PNG cutouts. No color-key filters or blend modes. */
.duelist-avatar,.duelist-select-portrait img,.selected-duelist-render,.duelist-profile img,.duel-intro-avatar img,.match-profile-main img{mix-blend-mode:normal;opacity:1}


/* v91.5 visual polish + global tooltip layer */
#global-tooltip-layer{position:fixed;inset:0;pointer-events:none;z-index:2147483000}
.global-floating-tooltip{position:fixed;width:min(360px,calc(100vw - 24px));padding:10px 12px;border:3px ridge #bc8a37;background:linear-gradient(180deg,#20120cf8,#120a07fb 58%,#28160cf8);color:#f3e3b7;box-shadow:0 10px 26px #000c,0 0 0 2px #5d3b1d, inset 0 0 0 1px #e0b764;clip-path:polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px)}
.global-floating-tooltip img{float:left;width:42px;height:42px;object-fit:cover;margin:0 9px 6px 0;border:1px solid #a57431;background:#120c09}
.global-floating-tooltip b{display:block;color:#f0c767;font:900 12px Georgia,serif;letter-spacing:.4px}
.global-floating-tooltip small{display:block;margin-top:2px;color:#d6b369;font:900 9px Tahoma}
.global-floating-tooltip>span,.global-floating-tooltip div span,.global-floating-tooltip span span{display:block;clear:none;margin-top:4px;color:#f1dfb6;font:11px/1.42 Tahoma;white-space:normal}
.global-floating-tooltip .effect-tooltip-duration{margin-top:2px}
.duelist-tooltip,.effect-tooltip,.monster-passive-tooltip,.skill-hover-tooltip{display:none!important}

.arena-selection-page,.arena-page{position:relative}
.arena-selection-page::after,.arena-page::after{content:"";position:fixed;inset:0;pointer-events:none;z-index:0;background:
  radial-gradient(circle at 5% 76%,rgba(255,182,83,.22) 0 0.8%,transparent 4%),
  radial-gradient(circle at 95% 76%,rgba(255,182,83,.22) 0 0.8%,transparent 4%),
  linear-gradient(90deg,rgba(58,35,15,.95) 0 5.5%,rgba(173,129,57,.58) 5.5% 6%,rgba(42,26,13,.0) 6% 94%,rgba(173,129,57,.58) 94% 94.5%,rgba(58,35,15,.95) 94.5%),
  repeating-linear-gradient(0deg,transparent 0 44px,rgba(225,182,89,.05) 44px 46px,transparent 46px 92px);opacity:.96}
.arena-selection-page::before,.arena-page::before{box-shadow:inset 0 0 130px #060302f2}

.arena-selection-header,.selection-nav,.arena-selection-content,.classic-top,.main-layout{position:relative;z-index:1}
.arena-selection-header,.classic-top{background:linear-gradient(180deg,#8c6a33f0 0,#3b2413f5 22%,#23150df8 80%,#6f4c24f0 100%);border-color:#2a160c;outline-color:#bf8e3d;box-shadow:inset 0 0 0 1px #f0ce78,0 8px 22px #0008}
.selection-nav{gap:8px;padding:0 2px}
.selection-tab{position:relative;min-width:188px;padding:10px 20px 9px;border:3px ridge #9d7333;background:linear-gradient(180deg,#2a1a11,#120b08 72%,#3f2a18);color:#e5c168;font:900 13px Georgia;letter-spacing:1.8px;box-shadow:inset 0 0 0 1px #70512a,0 4px 10px #0006}
.selection-tab.active{background:linear-gradient(180deg,#b5893d,#5b3a1e 42%,#24160d);color:#fff0be}

.arena-select-team,.selection-main-panel,.arena-select-info,.element-box,.battle-log-panel,.right-panel,.info-panel,.duelist-back,.queue-modal,.exchange-modal,.passive-modal,.winner-card,.match-profile-main,.match-profile-scroll{border:3px solid #2d180d;outline:2px solid #aa7b35;box-shadow:inset 0 0 0 1px #efc96d,0 8px 24px #0008;background-blend-mode:normal}
.arena-select-team,.selection-main-panel,.arena-select-info,.element-box,.battle-log-panel,.right-panel,.info-panel,.queue-modal,.exchange-modal,.passive-modal,.winner-card{background-image:
  linear-gradient(180deg,rgba(248,210,126,.08),rgba(30,17,10,.02) 18%,rgba(0,0,0,.18) 100%),
  repeating-linear-gradient(0deg,rgba(255,222,157,.025) 0 2px,rgba(0,0,0,0) 2px 11px),
  linear-gradient(135deg,#5d3e20ee,#281911f2 58%,#6d4a25ee)}
.arena-select-team::before,.selection-main-panel::before,.arena-select-info::before,.element-box::before,.battle-log-panel::before,.right-panel::before,.info-panel::before,.queue-modal::before,.exchange-modal::before,.passive-modal::before,.winner-card::before{content:"";position:absolute;inset:6px;pointer-events:none;border:1px solid rgba(243,198,101,.35);clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px)}
.arena-select-team::after,.selection-main-panel::after,.arena-select-info::after,.element-box::after,.battle-log-panel::after,.right-panel::after,.info-panel::after{content:"";position:absolute;inset:3px;pointer-events:none;background:radial-gradient(circle at 14px 14px,rgba(247,210,117,.18) 0 3px,transparent 3px),radial-gradient(circle at calc(100% - 14px) 14px,rgba(247,210,117,.18) 0 3px,transparent 3px),radial-gradient(circle at 14px calc(100% - 14px),rgba(247,210,117,.18) 0 3px,transparent 3px),radial-gradient(circle at calc(100% - 14px) calc(100% - 14px),rgba(247,210,117,.18) 0 3px,transparent 3px)}
.panel-title,.skills-heading,.panel-ribbon,.selection-grid-head,.duelist-section-head,.info-panel-head,.team-panel-head{position:relative;background:linear-gradient(180deg,#22140c,#070504 54%,#3f2817);border-bottom:2px ridge #8e642e;color:#f2d182;text-shadow:1px 1px #090504}
.team-panel-head,.selection-grid-head,.duelist-section-head,.info-panel-head{padding:8px 10px 7px}
.team-panel-head>strong,.selection-grid-head>strong,.info-panel-head>b{color:#ffd888}
.team-panel-head span,.selection-grid-head span,.duelist-section-head span,.info-panel-head span{color:#cfad61;font-size:8px;letter-spacing:2px}
.team-panel-head b,.selection-grid-head b,.duelist-section-head b{font-size:13px;letter-spacing:1px}

.team-slot,.monster-tile,.arena-select-duelist,.select-focus-card,.select-duelist-profile,.select-focus-skill,.skill,.duelist-passive,.effect-badge,.monster-passive-badge,.match-profile-main,.match-profile-scroll,.team-duelist-pick{background-image:linear-gradient(180deg,rgba(255,224,150,.06),rgba(0,0,0,0) 22%,rgba(0,0,0,.16) 100%),linear-gradient(145deg,#3b2618,#1c120d 68%,#4a311d);border-color:#94672d;box-shadow:inset 0 0 0 1px rgba(236,198,101,.16),0 4px 10px #0006}
.monster-tile img,.arena-select-duelist img,.team-slot img,.select-focus-card img,.select-duelist-profile img,.select-focus-skill img,.skill-art-wrap img,.duelist-passive img{background:linear-gradient(180deg,#0f0a08,#1d120c);border:1px solid #9a6d2c}
.arena-select-duelist,.monster-tile,.skill,.team-slot,.duelist-passive{clip-path:polygon(6px 0,100% 0,100% calc(100% - 6px),calc(100% - 6px) 100%,0 100%,0 6px)}
.monster-grid,.duelist-grid{padding:8px;background:linear-gradient(180deg,rgba(247,215,135,.05),rgba(0,0,0,.0)),repeating-linear-gradient(90deg,rgba(255,235,177,.03) 0 2px,transparent 2px 28px)}
.monster-main-panel,.duelist-main-panel,.ancient-duelist-roster{position:relative}
.monster-main-panel::before,.duelist-main-panel::before,.ancient-duelist-roster::before{content:"";position:absolute;inset:4px;pointer-events:none;border:1px solid rgba(242,206,114,.25)}

.arena-select-team,.selection-main-panel,.arena-select-info{background-image:linear-gradient(180deg,rgba(251,214,119,.05),rgba(26,16,11,.15) 22%,rgba(0,0,0,.28) 100%),repeating-linear-gradient(0deg,rgba(255,229,167,.03) 0 2px,transparent 2px 18px),radial-gradient(circle at 50% 0,rgba(255,208,97,.08),transparent 30%),linear-gradient(135deg,#684625f0,#261810f4 56%,#72502af0)}
.selected-duelist-render{filter:drop-shadow(3px 4px 2px #120806)}
.team-duelist-pick{grid-template-columns:48px 1fr;gap:8px;align-items:center}
.team-duelist-pick button,.selection-clear,.selection-start,.utility-btn,.right-controls button,.ready-button,.coin-flip-button,.arena-selection-footer button{background:linear-gradient(180deg,#2d1b11,#090605 60%,#402715);border:2px ridge #a27531;color:#f2d487;box-shadow:inset 0 0 0 1px rgba(233,198,108,.14),0 3px 8px #0006}
.selection-start,.ready-button,.coin-flip-button{background:linear-gradient(180deg,#ae7b33,#5a361b 48%,#22130b);color:#fff1be}
.selection-clear{background:linear-gradient(180deg,#6b2530,#35141a 60%,#16090b)}

.duelist-select-portrait,.team-slot img,.monster-tile img,.fighter-body{box-shadow:inset 0 0 0 1px rgba(244,214,129,.15)}
.duelist-select-portrait::before{filter:sepia(.58) saturate(1.1) contrast(1.12) brightness(.74)}
.duelist-select-portrait::after{background:repeating-linear-gradient(0deg,rgba(100,58,17,.10) 0 1px,transparent 1px 3px),radial-gradient(circle at 50% 38%,rgba(230,181,74,.10) 0 28%,rgba(38,18,5,.75) 100%)}

.arena-page{background-image:linear-gradient(#07050455,#05090d55),radial-gradient(circle at 50% 30%,rgba(255,208,117,.06),transparent 36%),url("../assets/background/battlefield.jpg");background-size:cover;background-position:center}
.classic-top{clip-path:polygon(10px 0,calc(100% - 10px) 0,100% 10px,100% calc(100% - 10px),calc(100% - 10px) 100%,10px 100%,0 calc(100% - 10px),0 10px)}
.main-layout{gap:10px;padding:9px}
.battle-board{overflow:visible;background-image:
  radial-gradient(circle at 6% 74%,rgba(255,157,72,.20) 0 2.5%,transparent 8%),
  radial-gradient(circle at 94% 74%,rgba(255,157,72,.20) 0 2.5%,transparent 8%),
  linear-gradient(90deg,rgba(50,29,13,.95) 0 6%,rgba(177,135,59,.55) 6% 6.4%,transparent 6.4% 93.6%,rgba(177,135,59,.55) 93.6% 94%,rgba(50,29,13,.95) 94%),
  repeating-linear-gradient(0deg,rgba(255,230,170,.04) 0 2px,transparent 2px 26px),
  linear-gradient(#5a261f3d 0 43%,#2f23173d 48% 52%,#6734263d 57% 100%),
  url("../assets/background/battlefield.jpg");background-size:cover;background-position:center;box-shadow:inset 0 0 0 1px #e3bc68,inset 0 0 28px #1a0d08a8,0 10px 26px #0008}
.battle-board:before{left:8%;right:8%;top:50%;height:1px;background:#d3ac5b6e;box-shadow:0 0 8px rgba(255,209,113,.22)}
.fighter-card,.duelist-back,.match-profile-main,.match-profile-scroll,.battle-log-panel,.right-panel,.element-box{background-image:linear-gradient(180deg,rgba(255,224,157,.06),rgba(0,0,0,0) 18%,rgba(0,0,0,.18) 100%),linear-gradient(145deg,#4c2d1f,#1a100c 66%,#5e3925)}
.fighter-card{overflow:visible;border-color:#a16f32}.fighter-body{overflow:visible;background-image:linear-gradient(#24150da2,#24150da2),url("../assets/background/monster-panel.jpg")}
.fighter-row,.duelist-layer,.duelist-back,.duelist-passives-row,.effect-tray,.match-profile,.profile-layer{overflow:visible}
.right-panel{overflow:visible;position:relative}
.right-controls{position:relative;bottom:auto;padding-top:8px;background:transparent}
.skill-group{background:linear-gradient(180deg,#2d1c13,#140c09 62%,#332114);border-color:#9f7432;overflow:visible}
.group-head{background:linear-gradient(180deg,#25160e,#070504 62%,#3b2516);border-bottom-color:#9a7134}
.skill{overflow:visible;align-items:start}.skill.available:hover{filter:brightness(1.08);transform:translateY(-1px)}
.effect-tray{top:26px}.effect-badge,.monster-passive-badge{pointer-events:auto}
.duelist-back{background:linear-gradient(90deg,#6b4024ef,#21140df0 48%,#6c2b34d9)}
.duelist-back.player{background:linear-gradient(90deg,#8b6432ef,#21140df0 48%,#6c2b34d9)}

.roster-pagination button{background:linear-gradient(180deg,#1f130c,#080504 58%,#3a2414);border:2px ridge #9e7331;box-shadow:0 3px 8px #0006;color:#f2d17e}
.roster-pagination span{color:#f2d17e;text-shadow:1px 1px #140904}

@media (max-width:1450px){.main-layout{gap:8px;padding:7px}}

/* ======================================================================
   v91.8 — FULL AI EGYPTIAN SKIN
   Built on the stable visual-polish/tooltips version. No engine changes.
   Generated art is used as the actual UI skin: borders, fills, backdrops,
   buttons, cards, sidebars, portraits, tooltips and battlefield frame.
   ====================================================================== */
:root{
  --skin-gold:#f2cf78;
  --skin-gold-hi:#ffe8a8;
  --skin-text:#f2e0b5;
  --skin-muted:#cbb17a;
  --skin-black:#0d0704;
}

/* Full-screen generated environments */
.arena-selection-page{
  background-image:
    linear-gradient(rgba(12,6,2,.30),rgba(12,6,2,.56)),
    url("../assets/reskin/lobby-backdrop.webp") !important;
  background-size:cover !important;
  background-position:center center !important;
  background-attachment:fixed !important;
}
.arena-page{
  background-image:
    linear-gradient(rgba(8,4,2,.22),rgba(8,4,2,.46)),
    url("../assets/reskin/battle-backdrop.webp") !important;
  background-size:cover !important;
  background-position:center center !important;
  background-attachment:fixed !important;
}

/* Ambient drifting desert dust — visual only */
.arena-selection-page::after,
.arena-page::after{
  content:"" !important;
  position:fixed !important;
  inset:-12% !important;
  z-index:0 !important;
  pointer-events:none !important;
  opacity:.30 !important;
  background-image:
    radial-gradient(circle,rgba(255,218,142,.24) 0 1px,transparent 1.6px),
    radial-gradient(circle,rgba(255,194,91,.15) 0 1px,transparent 1.5px),
    radial-gradient(circle,rgba(255,232,180,.11) 0 1px,transparent 1.4px) !important;
  background-size:73px 67px,111px 89px,151px 127px !important;
  background-position:0 0,30px 48px,80px 14px !important;
  animation:egyptDustDrift 24s linear infinite !important;
  box-shadow:none !important;
}
@keyframes egyptDustDrift{
  from{transform:translate3d(-2%,0,0)}
  to{transform:translate3d(7%,-5%,0)}
}
.arena-selection-header,.selection-nav,.arena-selection-content,.classic-top,.main-layout{position:relative;z-index:2}

/* Generated header plate — actual skin, not a background behind old blocks */
.arena-selection-header,
.classic-top{
  border:0 !important;
  outline:0 !important;
  border-radius:0 !important;
  clip-path:none !important;
  background:
    linear-gradient(rgba(9,4,2,.08),rgba(9,4,2,.12)),
    url("../assets/reskin/header-banner.webp") center / 100% 100% no-repeat !important;
  box-shadow:0 8px 24px rgba(0,0,0,.50) !important;
  padding:12px 30px !important;
  min-height:72px;
}
.selection-brand>span,.duelist-profile small{color:#d8b367 !important;text-shadow:0 2px 2px #000}
.arena-selection-header h1,.duelist-profile strong{color:var(--skin-gold-hi) !important;text-shadow:0 2px 3px #000,0 0 10px rgba(234,180,72,.22)}

/* reusable generated frame primitives */
.arena-select-team,
.arena-select-info,
.left-panel,
.right-panel{
  border:22px solid transparent !important;
  outline:0 !important;
  border-radius:0 !important;
  box-shadow:0 10px 28px rgba(0,0,0,.46) !important;
  clip-path:none !important;
  background:
    linear-gradient(rgba(12,7,4,.16),rgba(12,7,4,.26)),
    url("../assets/reskin/stone-tall.webp") center / cover repeat-y !important;
  border-image-source:url("../assets/reskin/panel-tall.webp") !important;
  border-image-slice:170 150 170 150 !important;
  border-image-width:22px !important;
  border-image-repeat:stretch !important;
}
.selection-main-panel,
.battle-board,
.duelist-back,
.battle-log-panel,
.info-panel,
.queue-modal,
.exchange-modal,
.passive-modal,
.winner-card,
.enemy-preview-panel{
  border:18px solid transparent !important;
  outline:0 !important;
  border-radius:0 !important;
  clip-path:none !important;
  box-shadow:0 10px 26px rgba(0,0,0,.44) !important;
  background:
    linear-gradient(rgba(11,6,3,.10),rgba(11,6,3,.18)),
    url("../assets/reskin/stone-wide.webp") center / cover repeat !important;
  border-image-source:url("../assets/reskin/panel-wide.webp") !important;
  border-image-slice:150 !important;
  border-image-width:18px !important;
  border-image-repeat:stretch !important;
}

/* Kill old CSS-drawn inner borders; the generated art is the border now */
.arena-select-team::before,.arena-select-team::after,
.arena-select-info::before,.arena-select-info::after,
.selection-main-panel::before,.selection-main-panel::after,
.element-box::before,.element-box::after,
.battle-log-panel::before,.battle-log-panel::after,
.right-panel::before,.right-panel::after,
.info-panel::before,.info-panel::after,
.duelist-back::before,.duelist-back::after,
.queue-modal::before,.queue-modal::after,
.exchange-modal::before,.exchange-modal::after,
.passive-modal::before,.passive-modal::after,
.winner-card::before,.winner-card::after{content:none !important;display:none !important}

/* Section-title bars use the generated button plaque */
.panel-title,.skills-heading,.panel-ribbon,
.team-panel-head,.selection-grid-head,.duelist-section-head,.info-panel-head,
.group-head{
  border:10px solid transparent !important;
  outline:0 !important;
  background:
    linear-gradient(rgba(8,4,2,.06),rgba(8,4,2,.18)),
    url("../assets/reskin/button-center.webp") center / cover repeat-x !important;
  border-image-source:url("../assets/reskin/button-frame.webp") !important;
  border-image-slice:120 !important;
  border-image-width:10px !important;
  border-image-repeat:stretch !important;
  color:var(--skin-gold-hi) !important;
  text-shadow:0 2px 2px #000 !important;
  min-height:42px;
  padding:6px 10px !important;
}
.team-panel-head span,.selection-grid-head span,.duelist-section-head span,.info-panel-head span,
.panel-title,.skills-heading,.panel-ribbon,.group-head small{color:#d9b66a !important}
.team-panel-head b,.selection-grid-head b,.duelist-section-head b,.info-panel-head b,.group-head b{color:#ffe5a0 !important}

/* Button family — generated Egyptian plaques */
.selection-tab,
.team-duelist-pick button,.selection-clear,.selection-start,
.utility-btn,.right-controls button,.ready-button,.coin-flip-button,
.passive-actions button,.modal-head button,.winner-card button,
.step-back,.queue-modal button,.exchange-modal button{
  border:10px solid transparent !important;
  outline:0 !important;
  border-radius:0 !important;
  clip-path:none !important;
  background:
    linear-gradient(rgba(11,6,3,.08),rgba(11,6,3,.18)),
    url("../assets/reskin/button-center.webp") center / cover repeat-x !important;
  border-image-source:url("../assets/reskin/button-frame.webp") !important;
  border-image-slice:120 !important;
  border-image-width:10px !important;
  border-image-repeat:stretch !important;
  box-shadow:0 4px 10px rgba(0,0,0,.32) !important;
  color:var(--skin-gold-hi) !important;
  text-shadow:0 2px 2px #000 !important;
}
.selection-tab:hover,.team-duelist-pick button:hover,.selection-clear:hover,.selection-start:hover,
.utility-btn:hover,.right-controls button:hover,.ready-button:hover,.coin-flip-button:hover,
.passive-actions button:hover,.winner-card button:hover{filter:brightness(1.12) saturate(1.04)}
.selection-tab.active,.selection-start,.ready-button,.coin-flip-button{filter:brightness(1.11)}

/* Generated card frames replace the generic brown boxes */
.team-duelist-pick,.team-slot,.monster-tile,.arena-select-duelist,
.select-focus-card,.select-duelist-profile,.select-focus-skill,
.skill-group,.skill,.duelist-passive,.effect-badge,.monster-passive-badge,
.match-profile-main,.match-profile-scroll,.enemy-preview-skill,.queue-slot,.review-row{
  border:13px solid transparent !important;
  outline:0 !important;
  border-radius:0 !important;
  clip-path:none !important;
  background:
    linear-gradient(rgba(9,5,3,.05),rgba(9,5,3,.14)),
    url("../assets/reskin/stone-card.webp") center / cover repeat !important;
  border-image-source:url("../assets/reskin/panel-card.webp") !important;
  border-image-slice:135 !important;
  border-image-width:13px !important;
  border-image-repeat:stretch !important;
  box-shadow:0 4px 12px rgba(0,0,0,.30) !important;
}
.monster-tile:hover,.arena-select-duelist:hover,.skill.available:hover{filter:brightness(1.12);transform:translateY(-1px)}
.monster-tile.selected,.arena-select-duelist.selected,.skill.selected,.team-slot.filled{filter:brightness(1.12);box-shadow:0 0 18px rgba(244,201,94,.24) !important}

/* Portrait and monster art frames */
.team-slot img,.monster-tile img,.arena-select-duelist img,
.select-focus-card img,.select-duelist-profile img,.select-focus-skill img,
.skill-art-wrap img,.info-skill-head img,.group-head img,
.duelist-passive img,.enemy-preview-profile img,.enemy-preview-skill img,
.match-profile-main img{
  border:11px solid transparent !important;
  outline:0 !important;
  background:#0b0604 !important;
  border-image-source:url("../assets/reskin/portrait-frame.webp") !important;
  border-image-slice:150 !important;
  border-image-width:11px !important;
  border-image-repeat:stretch !important;
  box-shadow:0 4px 10px rgba(0,0,0,.28) !important;
  padding:0 !important;
}
.duelist-select-portrait{
  border:12px solid transparent !important;
  outline:0 !important;
  background:rgba(12,6,3,.58) !important;
  border-image-source:url("../assets/reskin/portrait-frame.webp") !important;
  border-image-slice:150 !important;
  border-image-width:12px !important;
  border-image-repeat:stretch !important;
  box-shadow:0 4px 12px rgba(0,0,0,.30) !important;
}
.duelist-select-portrait::before,.duelist-select-portrait::after{content:none !important;display:none !important}
.duelist-select-portrait img{border:0 !important;background:transparent !important;box-shadow:none !important}

/* Selection page layout preserved; only breathing room adjusted for art */
.arena-selection-page{padding:10px 12px !important;gap:8px !important}
.arena-selection-content{gap:12px !important}
.arena-select-team{padding:6px 5px 7px !important}
.selection-main-panel{padding:7px 8px 9px !important}
.arena-select-info{padding:6px !important}
.team-slot-list{gap:8px !important}
.monster-grid,.duelist-grid{gap:8px !important;background:transparent !important;padding:8px !important}
.monster-main-panel .monster-grid{height:calc(100% - 68px) !important}

/* Pagination is now a carved control, not tiny text floating under the grid */
.roster-pagination{gap:14px !important;min-height:46px !important;margin-top:6px !important}
.roster-pagination button{
  min-width:52px !important;height:42px !important;
  border:9px solid transparent !important;
  background:url("../assets/reskin/button-center.webp") center/cover !important;
  border-image:url("../assets/reskin/button-frame.webp") 120 / 9px stretch !important;
  color:var(--skin-gold-hi) !important;
  font-size:18px !important;
}
.roster-pagination span{
  min-width:128px;padding:8px 14px !important;
  border:9px solid transparent !important;
  background:url("../assets/reskin/button-center.webp") center/cover !important;
  border-image:url("../assets/reskin/button-frame.webp") 120 / 9px stretch !important;
  color:var(--skin-gold-hi) !important;
  font:900 14px Georgia !important;
  text-align:center;
}

/* Battle page generated HUD */
.main-layout{gap:12px !important;padding:8px !important}
.left-panel,.right-panel{padding:6px !important;overflow:visible !important}
.element-box{
  border:14px solid transparent !important;
  background:url("../assets/reskin/stone-card.webp") center/cover repeat !important;
  border-image:url("../assets/reskin/panel-card.webp") 135 / 14px stretch !important;
  outline:0 !important;box-shadow:0 5px 14px rgba(0,0,0,.34) !important;
}
.battle-board{
  position:relative !important;
  overflow:visible !important;
  background-image:
    linear-gradient(rgba(12,6,2,.12),rgba(12,6,2,.30)),
    url("../assets/reskin/battle-backdrop.webp") !important;
  background-size:cover !important;
  background-position:center !important;
  border-image-source:url("../assets/reskin/panel-wide.webp") !important;
  box-shadow:0 12px 30px rgba(0,0,0,.52) !important;
}

/* Lit braziers on the battlefield: subtle animation, no gameplay involvement */
.battle-board::before,.battle-board::after{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  z-index:30 !important;
  bottom:12px !important;
  width:58px !important;height:92px !important;
  pointer-events:none !important;
  background:
    radial-gradient(ellipse at 50% 27%,rgba(255,244,188,.98) 0 7%,rgba(255,183,66,.96) 8% 20%,rgba(255,93,14,.60) 21% 31%,transparent 34%),
    radial-gradient(ellipse at 50% 53%,rgba(255,130,28,.28) 0 26%,transparent 49%),
    linear-gradient(90deg,transparent 24%,#503018 25% 75%,transparent 76%) !important;
  border:0 !important;
  box-shadow:none !important;
  filter:drop-shadow(0 0 12px rgba(255,158,37,.48));
  animation:arenaFire 1.9s ease-in-out infinite alternate !important;
}
.battle-board::before{left:13px !important}
.battle-board::after{right:13px !important;left:auto !important;animation-delay:.8s !important}
@keyframes arenaFire{
  0%{transform:translateY(1px) scale(.96,1);opacity:.85;filter:drop-shadow(0 0 8px rgba(255,142,28,.38))}
  55%{transform:translateY(-2px) scale(1.03,.96);opacity:1;filter:drop-shadow(0 0 15px rgba(255,184,68,.62))}
  100%{transform:translateY(0) scale(.99,1.05);opacity:.91;filter:drop-shadow(0 0 11px rgba(255,125,22,.50))}
}

/* Generated tall art becomes real side architecture around the arena */
.battle-center::before,.battle-center::after{
  content:"";position:absolute;top:18px;bottom:18px;width:42px;z-index:0;pointer-events:none;
  background:url("../assets/reskin/panel-tall.webp") center/100% 100% no-repeat;
  opacity:.92;filter:drop-shadow(0 8px 12px rgba(0,0,0,.36));
}
.battle-center::before{left:-18px}.battle-center::after{right:-18px}
.battle-board{z-index:1}

.duelist-back{padding:4px 8px !important}
.fighter-row{gap:12px !important;padding-inline:7px !important;overflow:visible !important}
.fighter-card{overflow:visible !important}
.fighter-body{background:rgba(8,4,2,.16) !important;overflow:visible !important}
.fighter-nameplate,.hp-row{background:rgba(8,4,2,.54) !important;border-color:rgba(236,195,103,.32) !important}
.skill-group{overflow:visible !important;padding:3px !important;margin-bottom:6px !important}
.skill-grid{gap:4px !important;padding:4px !important}
.skill{overflow:visible !important;padding:4px !important}
.right-controls{background:transparent !important;gap:5px !important}

/* Tooltips keep the stable global layer but now use generated card art */
.global-floating-tooltip{
  border:16px solid transparent !important;
  outline:0 !important;
  clip-path:none !important;
  background:
    linear-gradient(rgba(8,4,2,.08),rgba(8,4,2,.20)),
    url("../assets/reskin/stone-card.webp") center/cover repeat !important;
  border-image:url("../assets/reskin/panel-card.webp") 135 / 16px stretch !important;
  box-shadow:0 12px 28px rgba(0,0,0,.64) !important;
  color:var(--skin-text) !important;
  padding:10px 12px !important;
}
.global-floating-tooltip b{color:var(--skin-gold-hi) !important}
.global-floating-tooltip small{color:#d8b56b !important}
.global-floating-tooltip img{
  border:9px solid transparent !important;
  border-image:url("../assets/reskin/portrait-frame.webp") 150 / 9px stretch !important;
  background:#0a0503 !important;
}

/* Modals and overlays */
.modal{background:rgba(3,1,1,.76) !important;backdrop-filter:blur(2px)}
.passive-modal,.exchange-modal,.queue-modal,.enemy-preview-panel,.winner-card{padding:20px !important}
.modal-head{background:transparent !important;border:0 !important}

/* Typography and readability over art */
.team-slot b,.monster-tile b,.arena-select-duelist b,.select-focus-card h2,.select-duelist-profile h2,
.duelist-info strong,.fighter-nameplate span,.group-head b,.skill-copy b,.match-profile-main b{
  color:#ffe1a0 !important;text-shadow:0 2px 2px #000 !important;
}
.team-slot small,.arena-select-duelist small,.select-focus-card span,.select-duelist-profile span,
.select-focus-skill small,.skill-copy small,.duelist-info small,.match-profile-main small,.battle-log{
  color:#d8c094 !important;
}

/* Keep the visual skin responsive without changing the gameplay structure */
@media(max-width:1450px){
  .arena-select-team,.arena-select-info,.left-panel,.right-panel{border-width:16px !important;border-image-width:16px !important}
  .selection-main-panel,.battle-board,.duelist-back,.battle-log-panel,.info-panel{border-width:14px !important;border-image-width:14px !important}
  .battle-center::before,.battle-center::after{display:none}
}
@media(max-height:820px){
  .arena-selection-header,.classic-top{min-height:58px;padding:8px 22px !important}
  .panel-title,.skills-heading,.panel-ribbon,.team-panel-head,.selection-grid-head,.duelist-section-head,.info-panel-head,.group-head{min-height:34px;border-width:8px !important;border-image-width:8px !important;padding:3px 7px !important}
}

/* ======================================================================
   v91.9 — PERFORMANCE + VISUAL CLEANUP
   Keeps the v91.8 Egyptian art direction while removing the expensive
   giant border-images from repeated cards/icons and cleaning black bleed.
   ====================================================================== */

/* Monster-tab optimization: no fixed page raster + no full-page dust animation. */
.arena-selection-page{
  background-attachment:scroll !important;
}
.arena-selection-page::after{
  animation:none !important;
  transform:none !important;
  opacity:.10 !important;
}
.arena-page{background-attachment:scroll !important}

/* Main surfaces: AI textures remain, but black-leaking border-image canvases do not. */
.arena-select-team,
.arena-select-info,
.left-panel,
.right-panel{
  border:3px solid #8b632d !important;
  outline:1px solid rgba(236,196,105,.42) !important;
  border-image:none !important;
  background:
    linear-gradient(rgba(35,20,10,.08),rgba(10,5,2,.18)),
    url("../assets/reskin/stone-tall-small.webp") center / cover repeat-y !important;
  box-shadow:0 7px 20px rgba(0,0,0,.34),inset 0 0 0 1px rgba(255,224,145,.12) !important;
}
.selection-main-panel,
.battle-log-panel,
.info-panel,
.duelist-back,
.queue-modal,
.exchange-modal,
.passive-modal,
.winner-card,
.enemy-preview-panel{
  border:3px solid #8b632d !important;
  outline:1px solid rgba(236,196,105,.38) !important;
  border-image:none !important;
  background:
    linear-gradient(rgba(34,18,9,.06),rgba(9,4,2,.12)),
    url("../assets/reskin/stone-wide-small.webp") center / cover repeat !important;
  box-shadow:0 7px 18px rgba(0,0,0,.30),inset 0 0 0 1px rgba(255,224,145,.10) !important;
}
.battle-board{
  border:3px solid #9a7133 !important;
  outline:1px solid rgba(237,198,105,.38) !important;
  border-image:none !important;
}

/* Clean title bars. Keep the AI texture, lose the oversized black frame. */
.panel-title,.skills-heading,.panel-ribbon,
.team-panel-head,.selection-grid-head,.duelist-section-head,.info-panel-head,
.group-head{
  border:1px solid #9e7334 !important;
  outline:0 !important;
  border-image:none !important;
  min-height:0 !important;
  padding:6px 9px !important;
  background:
    linear-gradient(180deg,rgba(121,80,34,.18),rgba(20,10,5,.10)),
    url("../assets/reskin/button-center-small.webp") center / cover repeat-x !important;
  box-shadow:inset 0 0 0 1px rgba(249,220,141,.10) !important;
}

/* Buttons: thin carved edge instead of giant border artwork. */
.selection-tab,
.team-duelist-pick button,.selection-clear,.selection-start,
.utility-btn,.right-controls button,.ready-button,.coin-flip-button,
.passive-actions button,.modal-head button,.winner-card button,
.step-back,.queue-modal button,.exchange-modal button,
.roster-pagination button,.roster-pagination span{
  border:1px solid #aa7d39 !important;
  outline:1px solid rgba(53,29,13,.70) !important;
  border-image:none !important;
  border-radius:0 !important;
  background:
    linear-gradient(180deg,rgba(142,93,37,.14),rgba(14,7,4,.08)),
    url("../assets/reskin/button-center-small.webp") center / cover repeat-x !important;
  box-shadow:inset 0 0 0 1px rgba(255,225,146,.10),0 2px 5px rgba(0,0,0,.22) !important;
}

/* High-count selection cards: GPU-cheap generated texture, no filter/transform repaint. */
.monster-tile,
.arena-select-duelist,
.team-slot,
.team-duelist-pick,
.select-focus-card,
.select-duelist-profile,
.select-focus-skill{
  border:1px solid #9a7033 !important;
  outline:0 !important;
  border-image:none !important;
  background:
    linear-gradient(180deg,rgba(129,82,30,.08),rgba(13,7,4,.10)),
    url("../assets/reskin/stone-card-small.webp") center / cover no-repeat !important;
  box-shadow:inset 0 0 0 1px rgba(248,216,131,.08),0 2px 6px rgba(0,0,0,.18) !important;
  clip-path:none !important;
}
.monster-tile:hover,
.monster-tile.selected{
  filter:none !important;
  transform:none !important;
  border-color:#e0b65e !important;
  box-shadow:inset 0 0 0 1px rgba(255,226,139,.22),0 0 7px rgba(210,164,76,.18) !important;
}
.arena-select-duelist:hover,
.arena-select-duelist.selected{
  filter:none !important;
  transform:none !important;
  border-color:#ddb15a !important;
  box-shadow:inset 0 0 0 1px rgba(255,226,139,.18),0 0 6px rgba(210,164,76,.14) !important;
}
/* The old CHOOSE/SELECTED footer was the overlapping green-ish text. */
.arena-select-duelist>em{display:none !important}

/* ALL icon-sized art: no fat generated wrappers. */
.team-slot img,.monster-tile img,.arena-select-duelist img,
.select-focus-card img,.select-duelist-profile img,.select-focus-skill img,
.skill-art-wrap img,.info-skill-head img,.group-head img,
.duelist-passive img,.enemy-preview-profile img,.enemy-preview-skill img,
.match-profile-main img,.effect-badge img,.monster-passive-badge img,
.global-floating-tooltip img{
  border:1px solid #ad7d37 !important;
  outline:0 !important;
  border-image:none !important;
  padding:0 !important;
  background:#2b190d !important;
  box-shadow:inset 0 0 0 1px rgba(255,225,142,.08) !important;
}
.duelist-select-portrait{
  border:1px solid #9f7333 !important;
  outline:0 !important;
  border-image:none !important;
  background:linear-gradient(rgba(37,20,10,.15),rgba(10,5,2,.14)),url("../assets/reskin/stone-card-small.webp") center/cover no-repeat !important;
  box-shadow:none !important;
}
.duelist-select-portrait img{border:0 !important;background:transparent !important}

/* Battle monster cards: actual AI-generated Egyptian stone instead of red/brown flat fills. */
.fighter-card,
.fighter.player .fighter-card,
.fighter.enemy .fighter-card{
  border:2px solid #a47835 !important;
  outline:0 !important;
  border-image:none !important;
  clip-path:none !important;
  background:
    linear-gradient(180deg,rgba(110,69,26,.08),rgba(10,5,2,.08)),
    url("../assets/reskin/stone-card-small.webp") center / cover no-repeat !important;
  box-shadow:inset 0 0 0 1px rgba(255,225,143,.10),0 3px 8px rgba(0,0,0,.22) !important;
}
.fighter.player .fighter-card{border-color:#ae7840 !important}
.fighter.enemy .fighter-card{border-color:#9a7133 !important}
.fighter-body,.fighter.player .fighter-body,.fighter.enemy .fighter-body{
  background:transparent !important;
  overflow:hidden !important;
}
.fighter-nameplate{
  border:0 !important;
  border-bottom:1px solid rgba(209,161,70,.44) !important;
  background:rgba(35,18,8,.64) !important;
}
.hp-row{
  border:0 !important;
  border-top:1px solid rgba(209,161,70,.34) !important;
  background:rgba(28,13,7,.72) !important;
}

/* Monster effects/passives live in the center gap, never over the monster portrait. */
.effect-tray{
  z-index:64 !important;
  left:4px !important;
  right:34px !important;
  top:auto !important;
  display:flex !important;
  flex-wrap:nowrap !important;
  justify-content:flex-start !important;
  align-items:center !important;
  gap:3px !important;
  min-height:24px;
  overflow:visible !important;
}
.fighter.enemy .effect-tray{bottom:-29px !important}
.fighter.player .effect-tray{bottom:auto !important;top:-29px !important}
.effect-tray.empty{display:none !important}
.effect-badge{
  border:1px solid #a47735 !important;
  outline:0 !important;
  border-image:none !important;
  background:rgba(54,31,15,.94) !important;
  color:#f0d89c !important;
  box-shadow:0 2px 4px rgba(0,0,0,.28) !important;
  padding:2px 4px !important;
  min-height:23px !important;
  gap:3px !important;
  white-space:nowrap !important;
}
.effect-badge img{width:18px !important;height:18px !important}
.effect-badge strong{font-size:7px !important;line-height:1.1 !important}
.monster-passive-badge{
  z-index:65 !important;
  width:24px !important;height:24px !important;
  padding:2px !important;
  border:1px solid #b08037 !important;
  border-image:none !important;
  background:rgba(48,27,13,.96) !important;
  box-shadow:0 2px 4px rgba(0,0,0,.28) !important;
  right:4px !important;
}
.monster-passive-badge img{width:18px !important;height:18px !important}
.fighter.enemy .monster-passive-badge{top:auto !important;bottom:-29px !important}
.fighter.player .monster-passive-badge{top:-29px !important;bottom:auto !important}

/* Duelist row: keep space and readability; only a thin border on passives/skills. */
.duelist-back{
  border:2px solid #9d7132 !important;
  border-image:none !important;
  background:
    linear-gradient(90deg,rgba(96,59,23,.10),rgba(10,5,2,.04)),
    url("../assets/reskin/stone-wide-small.webp") center / cover repeat !important;
  padding:5px 9px !important;
}
.duelist-passives-row{gap:5px !important;overflow:visible !important}
.duelist-passive,.duelist-active-skill{
  min-width:82px !important;
  border:1px solid #9c7032 !important;
  border-image:none !important;
  outline:0 !important;
  padding:3px 4px !important;
  background:rgba(49,28,13,.76) !important;
  box-shadow:inset 0 0 0 1px rgba(239,201,110,.06) !important;
  clip-path:none !important;
}
.duelist-passive img,.duelist-active-skill img{
  width:32px !important;height:32px !important;
}
.duelist-passive>span{font-size:9px !important;line-height:1.12 !important}
.duelist-passive>small,.duelist-passive>em{font-size:7px !important}

/* Right-side monster technique list: readable images, no nested fat frames. */
.skill-group{
  border:1px solid #95692e !important;
  border-image:none !important;
  outline:0 !important;
  padding:3px !important;
  background:rgba(42,23,11,.58) !important;
  box-shadow:0 2px 5px rgba(0,0,0,.18) !important;
}
.group-head{
  border:0 !important;
  border-bottom:1px solid #8b612b !important;
  border-image:none !important;
  min-height:0 !important;
  padding:4px 5px !important;
  background:rgba(57,31,14,.72) !important;
}
.group-head img{width:32px !important;height:32px !important}
.skill-grid{gap:3px !important;padding:3px !important}
.skill{
  border:1px solid #8e642d !important;
  border-image:none !important;
  outline:0 !important;
  min-height:58px !important;
  grid-template-columns:46px 1fr !important;
  gap:5px !important;
  padding:4px !important;
  background:rgba(50,29,14,.72) !important;
  box-shadow:none !important;
  clip-path:none !important;
}
.skill.available:hover{
  filter:none !important;
  transform:none !important;
  border-color:#d2a44f !important;
  background:rgba(65,38,17,.80) !important;
}
.skill.selected{
  filter:none !important;
  border-color:#e0bc68 !important;
  box-shadow:inset 0 0 0 1px rgba(240,203,112,.18) !important;
}
.skill-art-wrap img{width:44px !important;height:44px !important}
.skill-copy b{font-size:10px !important;line-height:1.15 !important}

/* Player/opponent profile blocks: restore room that giant image borders stole. */
.match-profile{min-width:190px !important;max-width:285px !important}
.match-profile-main{
  border:1px solid #a07433 !important;
  border-image:none !important;
  outline:0 !important;
  grid-template-columns:42px minmax(0,1fr) !important;
  gap:7px !important;
  padding:4px 8px !important;
  background:rgba(45,26,13,.82) !important;
  box-shadow:0 2px 5px rgba(0,0,0,.22) !important;
}
.match-profile.enemy .match-profile-main{grid-template-columns:minmax(0,1fr) 42px !important}
.match-profile-main img{width:40px !important;height:40px !important;object-fit:contain !important}
.match-profile-main b{font-size:10px !important}.match-profile-main small{font-size:8px !important}
.match-profile-scroll{
  border:1px solid #a07433 !important;
  border-image:none !important;
  background:rgba(40,22,11,.96) !important;
  box-shadow:0 4px 9px rgba(0,0,0,.28) !important;
}

/* Left/right panels: no black seams between their children. */
.left-panel,.right-panel{gap:5px !important;padding:5px !important}
.element-box{
  border:1px solid #94682e !important;
  border-image:none !important;
  outline:0 !important;
  background:rgba(49,28,13,.68) !important;
  box-shadow:none !important;
}
.battle-log-panel,.info-panel{margin:0 !important}
.right-controls{background:transparent !important;padding-top:5px !important}

/* Global tooltip: thin border; icon remains full-size and unobscured. */
.global-floating-tooltip{
  border:2px solid #b1813a !important;
  border-image:none !important;
  outline:1px solid rgba(56,30,13,.72) !important;
  padding:9px 11px !important;
  background:
    linear-gradient(rgba(46,25,12,.30),rgba(17,8,4,.20)),
    url("../assets/reskin/stone-card-small.webp") center/cover no-repeat !important;
  box-shadow:0 8px 20px rgba(0,0,0,.46) !important;
}
.global-floating-tooltip img{width:42px !important;height:42px !important;margin-right:8px !important}

/* VS screen: fully in the new Egyptian skin; old anime group backdrop removed. */
.duel-intro{
  background:#120904 !important;
}
.duel-intro::before{
  background-image:
    linear-gradient(90deg,rgba(37,17,6,.66),rgba(15,7,3,.12) 36% 64%,rgba(37,17,6,.66)),
    url("../assets/reskin/battle-backdrop.webp") !important;
  background-size:cover !important;
  background-position:center !important;
  filter:none !important;
}
.duel-intro::after{
  background:linear-gradient(180deg,rgba(5,2,1,.12),rgba(5,2,1,.26)) !important;
  box-shadow:inset 0 0 150px rgba(0,0,0,.72),inset 0 0 0 2px rgba(207,158,68,.28) !important;
}
.duel-intro-side{position:relative !important}
.duel-intro-side::before{
  content:"" !important;
  display:block !important;
  position:absolute !important;
  top:4% !important;bottom:4% !important;width:54px !important;
  background:url("../assets/reskin/stone-tall-small.webp") center/100% 100% no-repeat !important;
  border:1px solid rgba(183,131,55,.34) !important;
  opacity:.86 !important;
  box-shadow:0 0 16px rgba(0,0,0,.36) !important;
}
.duel-intro-side.player::before{left:1.5vw !important}
.duel-intro-side.enemy::before{right:1.5vw !important}
.duel-intro-avatar strong{
  padding:5px 18px !important;
  border:1px solid #b1813b !important;
  background:rgba(39,20,9,.84) !important;
  color:#f4dda1 !important;
  text-shadow:0 2px 3px #000 !important;
}
.duel-intro-emblem{color:#e0ad48 !important}

/* Remove giant wrappers from passive/skill modals too. */
.passive-modal,.queue-modal,.exchange-modal,.enemy-preview-panel,.winner-card{
  border:3px solid #9d7132 !important;
  border-image:none !important;
}
.enemy-preview-skill,.queue-slot,.review-row{
  border:1px solid #94682e !important;
  border-image:none !important;
  background:rgba(47,27,13,.74) !important;
  box-shadow:none !important;
}
.enemy-preview-skill img,.enemy-preview-profile img{border:1px solid #a77934 !important;border-image:none !important}

/* No expensive backdrop blur. */
.modal{backdrop-filter:none !important}

/* Responsive: preserve original compact sizes instead of giant art borders. */
@media(max-width:1450px){
  .arena-select-team,.arena-select-info,.left-panel,.right-panel,
  .selection-main-panel,.battle-board,.duelist-back,.battle-log-panel,.info-panel{
    border-width:2px !important;
  }
}

/* Final v91.9 micro-polish */
.arena-selection-page::after{display:none !important}
.monster-grid{contain:layout paint style !important}
.monster-tile{contain:layout paint !important}
.team-slot.filled{filter:none !important;transform:none !important}
.duelist-profile img{width:46px !important;height:46px !important;border:0 !important;background:transparent !important;box-shadow:none !important}
.duelist-profile strong{font-size:13px !important}.duelist-profile small{font-size:8px !important}

/* ======================================================================
   v91.10 — visual polish rerun
   Fixes remaining duel/header visual issues without touching gameplay.
   ====================================================================== */

/* Selection header: keep text inside the banner and remove corner leakage. */
.arena-selection-header{
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:22px !important;
  min-height:64px !important;
  padding:10px 24px !important;
  background:
    linear-gradient(rgba(18,10,5,.10),rgba(18,10,5,.18)),
    url("../assets/reskin/header-banner.webp") center/100% 100% no-repeat !important;
  border:3px solid #8d642d !important;
  outline:1px solid rgba(239,202,112,.36) !important;
  box-shadow:0 8px 20px rgba(0,0,0,.34),inset 0 0 0 1px rgba(255,224,145,.10) !important;
}
.selection-brand{display:flex !important;flex-direction:column !important;justify-content:center !important;padding-left:6px !important;min-width:0 !important}
.selection-brand>span{font:900 9px/1.1 Georgia,"Times New Roman",serif !important;letter-spacing:2px !important;margin-bottom:2px !important}
.arena-selection-header h1{margin:0 !important;font:900 29px/1.02 Copperplate,"Copperplate Gothic Bold",Georgia,serif !important;letter-spacing:2px !important}
.selection-header-ornament{
  justify-self:end !important;
  align-self:center !important;
  padding:0 8px !important;
  color:#f1d084 !important;
  font:900 15px/1 Georgia,serif !important;
  letter-spacing:1.3px !important;
  text-shadow:0 2px 3px #000 !important;
}

/* Monster roster cards: artwork should fill the tile cleanly. */
.monster-tile{
  display:grid !important;
  grid-template-rows:minmax(0,1fr) auto !important;
  align-items:stretch !important;
  overflow:hidden !important;
  padding:3px !important;
}
.monster-tile img{
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  object-fit:cover !important;
  object-position:center !important;
  background:transparent !important;
}
.monster-tile b{
  display:block !important;
  padding:3px 2px 1px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
  font-size:11px !important;
  line-height:1.1 !important;
}
.monster-slot-badge{z-index:3 !important}

/* Pagination buttons should match the page capsule height, not dwarf it. */
.roster-pagination{gap:8px !important;min-height:32px !important;margin-top:4px !important}
.roster-pagination span{
  height:30px !important;
  min-width:104px !important;
  padding:0 12px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  font-size:12px !important;
}
.roster-pagination button{
  width:30px !important;
  height:30px !important;
  padding:0 !important;
  font-size:16px !important;
  line-height:1 !important;
}

/* Top battle banner: remove the duplicate duelist heads/names, keep only controls. */
.classic-top{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  min-height:48px !important;
  padding:6px 18px !important;
  background:
    linear-gradient(rgba(18,10,5,.10),rgba(18,10,5,.20)),
    url("../assets/reskin/header-banner.webp") center/100% 100% no-repeat !important;
  border:3px solid #8d642d !important;
  outline:1px solid rgba(239,202,112,.34) !important;
}
.classic-top .duelist-profile{display:none !important}
.top-center{grid-template-columns:auto 86px !important;gap:8px !important;width:auto !important}
.ready-button{min-width:150px !important}

/* Duel board proportions: trim the empty blurred bars. */
.battle-board{
  grid-template-rows:16px 88px clamp(158px,21vh,205px) 54px clamp(158px,21vh,205px) 88px 16px !important;
  gap:3px !important;
}

/* Remove the fake 3D flames/torches from the duel area. */
.battle-board::before,
.battle-board::after{content:none !important;display:none !important}

/* Duelist rows: crisp, less blurry, with more fitting typography. */
.duelist-back{
  background:
    linear-gradient(180deg,rgba(84,50,24,.18),rgba(20,10,5,.18)),
    url("../assets/reskin/stone-wide-small.webp") center/100% 100% no-repeat !important;
  padding:5px 9px !important;
  box-shadow:inset 0 0 0 1px rgba(245,214,126,.08),0 3px 9px rgba(0,0,0,.18) !important;
}
.duelist-info small{
  color:#d7b96f !important;
  font:900 8px/1.1 Georgia,serif !important;
  letter-spacing:1.3px !important;
  text-transform:uppercase !important;
  text-shadow:0 1px 2px #000 !important;
}
.duelist-info strong{
  color:#f3dfaa !important;
  font:900 15px/1.08 Copperplate,Georgia,serif !important;
  letter-spacing:1px !important;
  text-shadow:0 2px 3px #000 !important;
}
.duelist-avatar{filter:drop-shadow(0 2px 2px rgba(0,0,0,.30)) !important}

/* Health bars: restore visible HP text and give the bar a cleaner carved look. */
.hp-row{
  display:grid !important;
  grid-template-columns:minmax(0,1fr) auto !important;
  align-items:center !important;
  gap:8px !important;
  padding:4px 7px !important;
  background:rgba(22,10,5,.74) !important;
  border-top:1px solid rgba(214,165,73,.38) !important;
}
.hp-track{
  height:12px !important;
  padding:1px !important;
  background:#201108 !important;
  border:1px solid #90652c !important;
  box-shadow:inset 0 0 0 1px rgba(255,226,144,.08) !important;
}
.hp-track.player span{background:linear-gradient(90deg,#7f1418,#c43a43 60%,#ef8670) !important}
.hp-track.enemy span{background:linear-gradient(90deg,#8b1a24,#d04e53 60%,#f08c79) !important}
.hp-text{
  display:block !important;
  color:#f3ddb0 !important;
  font:900 10px/1 Georgia,"Times New Roman",serif !important;
  letter-spacing:.4px !important;
  text-shadow:0 1px 2px #000 !important;
}

/* The little YOU/CPU sublabels on monster nameplates are not needed visually. */
.fighter-nameplate small{display:none !important}
.fighter-nameplate span{
  font:900 10px/1.1 Copperplate,Georgia,serif !important;
  letter-spacing:.4px !important;
}

/* Keep effect trays clear and tidy. */
.effect-tray{gap:2px !important}
.effect-badge strong{font-size:6px !important;line-height:1.08 !important}

/* Ensure the duel intro / VS screen uses the Egyptian skin, not the anime group art. */
.duel-intro::before{
  background-image:
    linear-gradient(90deg,rgba(34,14,8,.55),transparent 32% 68%,rgba(34,14,8,.55)),
    url("../assets/reskin/lobby-backdrop.webp") !important;
  background-position:center !important;
  background-size:cover !important;
  background-repeat:no-repeat !important;
  filter:brightness(.60) saturate(.90) !important;
}


/* ======================================================================
   v91.21 — exact requested screenshot fixes from v91.10 base
   IMPORTANT: do not alter monster selection tiles/boxes or duel row/card
   sizing/positioning. Only header/pagination, Duelist-screen clutter, and
   online profile-card placement are changed below.
   ====================================================================== */

/* HOMEPAGE — center/fix the title while keeping the existing v91.10 banner. */
.arena-selection-header{
  position:relative !important;
  grid-template-columns:1fr auto 1fr !important;
  align-items:center !important;
  overflow:hidden !important;
}
.selection-brand{
  grid-column:2 !important;
  justify-self:center !important;
  align-items:center !important;
  padding-left:0 !important;
  text-align:center !important;
}
.arena-selection-header h1{
  text-align:center !important;
  white-space:nowrap !important;
}
.selection-header-ornament{
  grid-column:3 !important;
  justify-self:end !important;
  margin-right:4px !important;
}

/* HOMEPAGE — only the bottom pagination controls become a little smaller. */
.roster-pagination{
  gap:7px !important;
  min-height:28px !important;
  margin-top:4px !important;
}
.roster-pagination span{
  height:26px !important;
  min-width:96px !important;
  padding:0 10px !important;
  font-size:11px !important;
}
.roster-pagination button{
  width:26px !important;
  height:26px !important;
  padding:0 !important;
  font-size:14px !important;
  line-height:1 !important;
}

/* DUELIST SELECTION — remove only the extra/repeated text clutter. */
.duelist-main-panel .selection-grid-head > strong,
.duelist-main-panel .duelist-section-head,
.duelist-main-panel .duelist-tile-copy small,
.duelist-main-panel .arena-select-duelist em{
  display:none !important;
}

/* BATTLE — profile cards only. Keep every v91.10 Duelist/monster row in its
   original grid row and original size, then take only the profile cards out
   of the grid flow and pin them to the board corners. */
.enemy-layer{grid-row:2 !important;grid-column:1 !important}
.enemy-row{grid-row:3 !important;grid-column:1 !important}
.arena-seal{grid-row:4 !important;grid-column:1 !important}
.player-row{grid-row:5 !important;grid-column:1 !important}
.player-layer{grid-row:6 !important;grid-column:1 !important}

.profile-layer{
  position:absolute !important;
  z-index:90 !important;
  width:auto !important;
  height:auto !important;
  pointer-events:none !important;
}
.profile-layer .match-profile{pointer-events:auto !important}
.enemy-profile-layer{
  top:8px !important;
  right:8px !important;
  left:auto !important;
  bottom:auto !important;
}
.player-profile-layer{
  left:8px !important;
  bottom:8px !important;
  right:auto !important;
  top:auto !important;
}

/* ================================================================
   v91.21 ONLINE — additive UI only. Existing v91.21 cards/rows/tiles
   above remain untouched; all new surfaces reuse the same Egyptian skin.
   ================================================================ */
.arena-selection-content{
  grid-template-columns:178px 292px minmax(560px,1fr) 340px !important;
  grid-template-areas:"modes team roster info" !important;
}
.arena-mode-rail{grid-area:modes;align-self:start;min-width:0;padding:9px;display:grid;gap:7px;position:relative;border:3px solid #2d180d;outline:2px solid #aa7b35;box-shadow:inset 0 0 0 1px #efc96d,0 8px 24px #0008;background-image:linear-gradient(180deg,rgba(251,214,119,.05),rgba(26,16,11,.15) 22%,rgba(0,0,0,.28) 100%),repeating-linear-gradient(0deg,rgba(255,229,167,.03) 0 2px,transparent 2px 18px),radial-gradient(circle at 50% 0,rgba(255,208,97,.08),transparent 30%),linear-gradient(135deg,#684625f0,#261810f4 56%,#72502af0);color:#f0dfb2}
.arena-mode-rail::before{content:"";position:absolute;inset:6px;pointer-events:none;border:1px solid rgba(243,198,101,.35);clip-path:polygon(8px 0,calc(100% - 8px) 0,100% 8px,100% calc(100% - 8px),calc(100% - 8px) 100%,8px 100%,0 calc(100% - 8px),0 8px)}
.mode-rail-head{padding:5px 4px 8px;border-bottom:1px solid #926932;text-align:center}.mode-rail-head small{display:block;color:#c89c52;font:900 7px Tahoma;letter-spacing:1.7px}.mode-rail-head b{display:block;margin-top:3px;color:#f0da9d;font:900 10px Georgia}
.arena-mode-rail button,.ancient-primary,.ancient-secondary,.online-modal button,.history-id button,.admin-feedback-list button{width:100%;min-height:34px;padding:7px 8px;border:2px ridge #a27531;border-radius:0;background:linear-gradient(180deg,#2d1b11,#090605 60%,#402715);color:#f2d487;box-shadow:inset 0 0 0 1px rgba(233,198,108,.14),0 3px 8px #0006;font:900 9px Georgia;letter-spacing:.5px;text-transform:uppercase}
.arena-mode-rail button:hover,.ancient-primary:hover,.ancient-secondary:hover,.online-modal button:hover{filter:brightness(1.2)}
.arena-mode-rail [data-mode-ranked],.ancient-primary{background:linear-gradient(180deg,#9d6d2f,#57341a 48%,#21130b);color:#fff1be}.arena-mode-rail .admin-button{background:linear-gradient(180deg,#69401f,#2f1b10 60%,#7e5527);color:#ffe39b}.arena-mode-rail .logout-button{margin-top:2px;background:linear-gradient(180deg,#55231d,#1c0d0b 65%,#6b2a21);color:#eac9aa}.mode-rail-divider{height:1px;background:#926932;margin:1px 3px}
.lobby-account-card{grid-column:1/-1;min-width:0;padding:6px!important;display:grid!important;grid-template-columns:54px minmax(0,1fr)!important;gap:7px!important;text-align:left!important;align-items:center!important;background-image:linear-gradient(180deg,rgba(255,224,150,.06),rgba(0,0,0,0) 22%,rgba(0,0,0,.16) 100%),linear-gradient(145deg,#3b2618,#1c120d 68%,#4a311d)!important;border:2px ridge #94672d!important;color:#f0ddb0!important}.lobby-account-card img{width:52px;height:52px;object-fit:contain;background:#160e0a;border:1px solid #a47632}.lobby-account-card span{min-width:0;display:grid;grid-template-columns:1fr 1fr;gap:1px 7px}.lobby-account-card b,.lobby-account-card small{grid-column:1/-1;display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lobby-account-card b{font:900 11px Georgia;color:#f1d88f}.lobby-account-card small{font:8px Tahoma;color:#c7a768}.lobby-account-card em{font:normal 7px Tahoma;color:#dec895}

/* Account gate */
.auth-page{grid-template-rows:78px minmax(0,1fr)!important}.auth-header{grid-row:1}.auth-stage{position:relative;z-index:2;display:flex;align-items:center;justify-content:center;min-height:0;padding:18px}.auth-panel{width:min(480px,92vw);max-height:calc(100vh - 125px);overflow:auto;padding:18px;position:relative;border:3px solid #2d180d;outline:2px solid #aa7b35;box-shadow:inset 0 0 0 1px #efc96d,0 12px 35px #000b;background-image:linear-gradient(180deg,rgba(251,214,119,.06),rgba(0,0,0,.18)),linear-gradient(135deg,#684625f5,#261810fa 56%,#72502af5);color:#f0dfb2}.auth-panel-title{padding-bottom:9px;margin-bottom:11px;border-bottom:1px solid #a77c3b;text-align:center}.auth-panel-title small{color:#c89c52;font:900 7px Tahoma;letter-spacing:2px}.auth-panel-title h2{margin:4px 0 0;color:#f0da9d;font:900 19px/1.15 Georgia}.auth-welcome{width:min(650px,92vw);text-align:center}.auth-welcome p{font:12px Georgia;color:#e2c98f}.auth-gate-buttons{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:18px}.auth-panel label,.online-modal label{display:grid;gap:4px;margin:10px 0;color:#cfa95b;font:900 8px Tahoma;letter-spacing:1px}.auth-panel input,.online-modal input,.online-modal textarea,.online-modal select{width:100%;padding:9px;border:2px inset #8d632d;border-radius:0;background:#160f0c;color:#f4e4b8;font:11px Tahoma;outline:none}.auth-panel input:focus,.online-modal input:focus,.online-modal textarea:focus{border-color:#d1a34c}.auth-hint,.modal-hint{margin:2px 0 7px;color:#bda87a;font:8px/1.4 Tahoma}.auth-message{padding:8px;margin:8px 0;border:1px solid #a0523e;background:#3b1714;color:#f0c2a7;font:9px Tahoma}.auth-avatar-panel{width:min(980px,95vw)}.avatar-section>b{display:block;margin:10px 0 5px;color:#efc662;font:900 10px Georgia}.avatar-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:6px}.avatar-choice{min-height:105px!important;padding:4px!important;display:grid!important;grid-template-rows:78px auto;gap:3px}.avatar-choice img{width:100%;height:78px;object-fit:contain;background:#100a08;border:1px solid #79562f}.avatar-choice span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:7px Tahoma}

/* Queue, guide, reports, history and admin */
.online-overlay{position:fixed;inset:0;z-index:10000;display:flex;align-items:center;justify-content:center;padding:22px;background:#080403c7;backdrop-filter:blur(2px)}.online-modal{width:min(620px,92vw);max-height:88vh;overflow:auto;padding:14px;position:relative;border:3px solid #2d180d;outline:2px solid #aa7b35;box-shadow:inset 0 0 0 1px #efc96d,0 14px 42px #000c;background-image:linear-gradient(180deg,rgba(251,214,119,.06),rgba(0,0,0,.18)),linear-gradient(135deg,#684625fa,#261810fc 56%,#72502afa);color:#f0dfb2}.online-modal.small{width:min(430px,92vw);text-align:center}.online-modal-head{padding:5px 5px 9px;margin-bottom:10px;border-bottom:1px solid #a77c3b}.online-modal-head small{display:block;color:#c89c52;font:900 7px Tahoma;letter-spacing:2px}.online-modal-head b{display:block;margin-top:3px;color:#f0da9d;font:900 17px Georgia}.online-modal p{font:9px/1.5 Tahoma;color:#dfc997}.guide-modal{width:min(780px,94vw)}.guide-list{display:grid;gap:6px}.guide-list article{display:grid;grid-template-columns:26px 1fr;gap:7px;padding:7px;border:1px solid #79562f;background:#1c120dcc}.guide-list article>strong{color:#e7b655;font:900 14px Georgia}.guide-list b{font:900 10px Georgia;color:#eed58f}.guide-list p{margin:2px 0 0}.feedback-modal textarea{min-height:150px;resize:vertical}.modal-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.history-modal{width:min(760px,94vw)}.history-list{display:grid;gap:7px;margin-bottom:10px}.history-list article{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:8px;border:1px solid #79562f;background:#1b110ccc}.history-list article div:first-child{display:grid;gap:2px}.history-list b{color:#efd07a;font:900 10px Georgia}.history-list span,.history-list small{font:8px Tahoma;color:#cfba89}.history-list em{font:900 9px Tahoma;color:#e8bd5a}.history-id{display:grid;gap:4px}.history-id code{font:8px Consolas,monospace;color:#e5cf9c}.history-id button{min-height:26px;padding:4px 7px}.profile-large{display:grid;grid-template-columns:120px 1fr;gap:14px;align-items:center}.profile-large img{width:118px;height:118px;object-fit:contain;background:#130d0a;border:2px ridge #a27531}.profile-large p{margin:5px 0;font:10px Tahoma}.queue-search-modal{width:min(430px,92vw);text-align:center}.queue-spinner{margin:5px auto;color:#d7ad50;font:900 56px Georgia;animation:arena-spin 1.6s linear infinite}.queue-search-modal>strong{display:block;color:#f0d488;font:900 23px Georgia}@keyframes arena-spin{to{transform:rotate(360deg)}}
.admin-modal{width:min(900px,96vw)}.admin-search{display:grid;grid-template-columns:1fr 160px;gap:8px;align-items:end}.admin-search label{margin:0}.admin-match{margin:10px 0;padding:8px;display:grid;gap:4px;border:1px solid #9a6c2f;background:#120c09}.admin-match>b{color:#efcc70;font:900 11px Georgia}.admin-match span{font:8px Tahoma;color:#d6c18f}.admin-match pre{max-height:220px;overflow:auto;white-space:pre-wrap;padding:7px;background:#090605;color:#d8c9a3;font:8px/1.4 Consolas,monospace}.admin-feedback-list{display:grid;gap:7px}.admin-feedback-list article{padding:8px;border:1px solid #79562f;background:#1a110d}.admin-feedback-list header{display:flex;justify-content:space-between;gap:10px}.admin-feedback-list header b{color:#efc662;font:900 10px Georgia}.admin-feedback-list header span{font:7px Tahoma;color:#baa574}.admin-feedback-list p{margin:6px 0}.admin-feedback-list select{width:auto;float:right;padding:4px}.admin-feedback-list button{width:auto;min-height:25px;padding:4px 7px}
.online-surrender{background:linear-gradient(180deg,#69261e,#2d110e 65%,#7f3024)!important;color:#f0d2b1!important}

@media(max-width:1550px){.arena-selection-content{grid-template-columns:160px 270px minmax(540px,1fr) 310px!important}.arena-mode-rail{padding:7px}.arena-mode-rail button{font-size:8px;padding:6px 5px}.lobby-account-card{grid-template-columns:42px minmax(0,1fr)!important}.lobby-account-card img{width:40px;height:40px}.lobby-account-card em{font-size:6.5px}}
.duelist-avatar-choice img,.duelist-account-avatar{background-color:#17100b!important;background-image:url("https://i.pinimg.com/1200x/99/2b/28/992b28839ddfe4b67261d6b7f8988853.jpg")!important;background-size:cover!important;background-position:center!important;background-repeat:no-repeat!important}
.arena-selection-content{width:min(1900px,100%)!important}
.admin-user-search{margin-top:8px}.admin-account-list{display:grid;gap:6px;margin:8px 0 12px}.admin-account-list article{display:grid;grid-template-columns:42px minmax(0,1fr) auto 120px;gap:8px;align-items:center;padding:6px;border:1px solid #79562f;background:#17100bcc}.admin-account-list img{width:40px;height:40px;object-fit:contain;background:#100a08;border:1px solid #8c632d}.admin-account-list span{display:grid;gap:2px}.admin-account-list b{color:#efcf79;font:900 10px Georgia}.admin-account-list small,.admin-account-list em{color:#cbb788;font:8px Tahoma}.admin-account-list select{margin:0!important;padding:5px!important}

/* =====================================================================
   v91.21 ONLINE POLISH — mockup-inspired homepage + usability pass
   ===================================================================== */

/* Homepage shell: account at top-left, centered title, roster/modes/team/info
   laid out like the approved Egyptian mockup. */
.arena-selection-page:not(.auth-page){
  grid-template-rows:128px 38px minmax(0,1fr) !important;
  padding:8px 10px !important;
  gap:8px !important;
  background-image:
    linear-gradient(90deg,rgba(8,4,2,.62),transparent 18% 82%,rgba(8,4,2,.62)),
    linear-gradient(rgba(6,3,2,.18),rgba(6,3,2,.32)),
    url("../assets/reskin/lobby-backdrop.webp") !important;
  background-position:center !important;
  background-size:cover !important;
}
.arena-selection-page:not(.auth-page) .arena-selection-header{
  min-height:128px !important;
  display:grid !important;
  grid-template-columns:310px minmax(420px,1fr) 310px !important;
  align-items:center !important;
  padding:8px 16px !important;
  background:
    linear-gradient(rgba(18,10,5,.12),rgba(18,10,5,.28)),
    url("../assets/reskin/header-banner.webp") center/100% 100% no-repeat !important;
  clip-path:none !important;
}
.arena-selection-page:not(.auth-page) .selection-brand{
  grid-column:2 !important;
  justify-self:center !important;
  text-align:center !important;
  padding:0 !important;
}
.arena-selection-page:not(.auth-page) .selection-brand>span{
  color:#f0c96b !important;
  font:900 13px/1.1 Georgia,serif !important;
  letter-spacing:2.4px !important;
  text-transform:none !important;
  text-shadow:0 2px 3px #000 !important;
}
.arena-selection-page:not(.auth-page) .arena-selection-header h1{
  margin:3px 0 0 !important;
  color:#ffe7a4 !important;
  font-size:35px !important;
  line-height:1 !important;
  letter-spacing:3px !important;
  text-shadow:0 2px 4px #000,0 0 12px rgba(208,151,50,.28) !important;
}
.selection-header-spacer{grid-column:3}
.selection-header-ornament{display:none !important}

/* Large account card in the top-left. */
.lobby-account-panel{
  grid-column:1 !important;
  justify-self:start !important;
  align-self:center !important;
  width:292px !important;
  padding:7px !important;
  display:grid !important;
  grid-template-columns:minmax(0,1fr) 104px !important;
  gap:7px !important;
  border:3px solid #2d180d !important;
  outline:2px solid #aa7b35 !important;
  box-shadow:inset 0 0 0 1px #efc96d,0 8px 22px #0009 !important;
  background:
    linear-gradient(180deg,rgba(255,222,141,.05),rgba(0,0,0,.2)),
    url("../assets/reskin/panel-wide.webp") center/100% 100% no-repeat !important;
}
.lobby-account-card{
  width:100% !important;
  min-height:94px !important;
  grid-column:1/-1 !important;
  display:grid !important;
  grid-template-columns:88px minmax(0,1fr) !important;
  gap:10px !important;
  align-items:center !important;
  padding:7px 8px !important;
  border:1px solid rgba(235,192,92,.55) !important;
  outline:0 !important;
  background:rgba(13,8,5,.72) !important;
  box-shadow:inset 0 0 14px rgba(221,166,65,.08) !important;
}
.lobby-account-card img{
  width:86px !important;
  height:86px !important;
  object-fit:cover !important;
  object-position:center top !important;
  border:2px solid #b88636 !important;
  background:#120b08 !important;
  box-shadow:0 0 0 1px #3a2112,0 3px 8px #0009 !important;
}
.lobby-account-card span{display:grid !important;grid-template-columns:1fr !important;gap:4px !important}
.lobby-account-card b{
  color:#ffe29a !important;
  font:900 18px/1 Georgia,serif !important;
  letter-spacing:.3px !important;
  white-space:nowrap !important;
  overflow:hidden !important;
  text-overflow:ellipsis !important;
}
.lobby-account-card em{
  color:#ddc58f !important;
  font:normal 10px/1.2 Tahoma,sans-serif !important;
  white-space:nowrap !important;
}
.change-avatar-button{
  grid-column:1/-1 !important;
  min-height:31px !important;
  padding:5px 10px !important;
  border:2px ridge #b07d30 !important;
  background:linear-gradient(180deg,#173f66,#0e263d 58%,#1f5688) !important;
  color:#f7e7b4 !important;
  font:900 10px Georgia,serif !important;
  letter-spacing:.7px !important;
  text-transform:uppercase !important;
  box-shadow:inset 0 0 0 1px rgba(255,224,132,.18),0 3px 7px #0007 !important;
}
.change-avatar-button:hover{filter:brightness(1.16)}
.custom-account-avatar{object-fit:cover !important;object-position:center top !important;background-image:none !important}

/* Approved mockup-style content columns. */
.arena-selection-content{
  width:min(1900px,100%) !important;
  grid-template-columns:minmax(330px,.95fr) minmax(250px,.68fr) 255px minmax(350px,.92fr) !important;
  grid-template-areas:"roster modes team info" !important;
  gap:9px !important;
}
.arena-select-main{grid-area:roster !important}
.arena-mode-rail{grid-area:modes !important;align-self:stretch !important;padding:12px 11px !important;gap:9px !important}
.arena-select-team{grid-area:team !important}
.arena-select-info{grid-area:info !important}

/* Larger central mode controls, matching the mockup. */
.mode-rail-head{
  min-height:42px !important;
  display:grid !important;
  place-items:center !important;
  padding:5px 4px 9px !important;
  border-bottom:1px solid #a77832 !important;
}
.mode-rail-head small{display:none !important}
.mode-rail-head b{margin:0 !important;color:#ffe4a0 !important;font:900 18px Georgia,serif !important;letter-spacing:1px !important}
.arena-mode-rail button{
  min-height:42px !important;
  padding:8px 10px !important;
  font-size:11px !important;
  letter-spacing:.6px !important;
}
.arena-mode-rail [data-mode-quickplay]{
  background:linear-gradient(180deg,#275d90,#123554 58%,#3479ad) !important;
  color:#fff0bf !important;
}
.arena-mode-rail [data-mode-ranked]{
  background:linear-gradient(180deg,#8e2b2c,#481718 58%,#aa3b32) !important;
  color:#ffe4b3 !important;
}

/* Monster roster like the approved 3-column mockup. */
.monster-main-panel .selection-grid-head{min-height:40px !important;align-items:center !important}
.monster-main-panel .selection-grid-head span{font:900 18px Georgia,serif !important;color:#ffe3a0 !important;letter-spacing:.8px !important}
.monster-main-panel .selection-grid-head b{display:none !important}
.monster-main-panel .selection-grid-head>strong{font-size:11px !important;color:#efc76d !important}
.monster-main-panel .monster-grid{
  grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  grid-template-rows:repeat(4,minmax(0,1fr)) !important;
  grid-auto-rows:unset !important;
  height:calc(100% - 76px) !important;
  gap:7px !important;
  padding-top:6px !important;
}
.monster-main-panel .monster-tile b{font-size:10px !important}
.roster-pagination{margin-top:1px !important;min-height:29px !important;gap:7px !important}
.roster-pagination button{width:30px !important;height:28px !important}
.roster-pagination span{height:28px !important;line-height:28px !important;font-size:10px !important}

/* Team card: only label + 0/3, as requested. */
.team-panel-head{align-items:center !important;min-height:40px !important}
.team-panel-head span{font:900 17px Georgia,serif !important;color:#ffe3a0 !important;letter-spacing:.7px !important}
.team-panel-head b{display:none !important}
.team-panel-head>strong{font-size:21px !important}

/* Selection-side skill descriptions are intentionally much easier to read. */
.arena-select-info{padding:10px !important}
.info-panel-head span{font-size:9px !important}
.info-panel-head>b{font-size:15px !important}
.select-focus-skills,.select-duelist-abilities{gap:7px !important;margin-top:8px !important}
.select-focus-skill{
  grid-template-columns:58px 1fr !important;
  gap:9px !important;
  padding:7px !important;
}
.select-focus-skill img{width:56px !important;height:56px !important}
.select-focus-skill b{font-size:13px !important;line-height:1.15 !important}
.select-focus-skill small{margin-top:4px !important;font-size:11.5px !important;line-height:1.42 !important}

/* Queue search: fixed/static Egyptian panel, no scrollbar, smoother ankh. */
.queue-search-overlay{overflow:hidden !important}
.queue-search-modal{
  width:min(620px,92vw) !important;
  max-height:none !important;
  overflow:hidden !important;
  padding:36px 42px 34px !important;
  border:0 !important;
  outline:0 !important;
  box-shadow:0 18px 55px #000d !important;
  background:
    linear-gradient(rgba(20,11,5,.10),rgba(8,4,2,.24)),
    url("../assets/reskin/panel-wide.webp") center/100% 100% no-repeat !important;
}
.queue-search-modal::before,.queue-search-modal::after{display:none !important}
.queue-search-modal .online-modal-head{margin:0 18px 15px !important;padding:4px 0 10px !important;border-bottom:1px solid rgba(219,163,58,.7) !important}
.queue-search-modal .online-modal-head small{font-size:10px !important;color:#d8ac53 !important;letter-spacing:2.4px !important}
.queue-search-modal .online-modal-head b{font-size:24px !important;color:#ffe7a6 !important;text-shadow:0 2px 4px #000 !important}
.queue-spinner{
  width:118px !important;
  height:118px !important;
  margin:8px auto 12px !important;
  display:grid !important;
  place-items:center !important;
  border:2px solid rgba(225,174,67,.56) !important;
  border-radius:50% !important;
  color:#f0bd4b !important;
  font:900 78px/1 Georgia,serif !important;
  text-shadow:0 0 9px #c27b1f,0 0 22px #f3b83b !important;
  box-shadow:inset 0 0 18px rgba(238,179,59,.23),0 0 24px rgba(205,132,24,.22) !important;
  animation:arena-spin 1.05s linear infinite !important;
  will-change:transform !important;
  transform:translateZ(0);
}
.queue-search-modal>strong{font-size:31px !important;letter-spacing:2px !important;text-shadow:0 2px 3px #000 !important}
.queue-search-modal>p{margin:8px 0 !important;font-size:10px !important}
.queue-search-modal [data-cancel-queue]{margin-top:16px !important;min-height:43px !important;font-size:12px !important}
@keyframes arena-spin{from{transform:rotate(0deg) translateZ(0)}to{transform:rotate(360deg) translateZ(0)}}

/* Avatar editor. */
.avatar-change-modal{width:min(930px,95vw) !important;overflow:auto !important}
.avatar-change-tabs{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0 0 8px;padding:7px 9px;border:1px solid #79562f;background:#17100bcc}
.avatar-change-tabs b{color:#f0cf78;font:900 11px Georgia}.avatar-change-tabs span{color:#bda97b;font:9px Tahoma}
.compact-avatar-grid{max-height:260px;overflow:auto;padding-right:3px;grid-template-columns:repeat(auto-fill,minmax(72px,1fr)) !important}
.compact-avatar-grid .avatar-choice{min-height:90px !important;grid-template-rows:64px auto !important}
.compact-avatar-grid .avatar-choice img{height:64px !important}
.custom-avatar-editor{display:grid;grid-template-columns:145px 1fr;gap:15px;align-items:center;margin:12px 0;padding:12px;border:2px ridge #9b6d31;background:linear-gradient(145deg,#291a11,#130d09 68%,#382317)}
.custom-avatar-preview{display:grid;gap:6px;text-align:center}.custom-avatar-preview img{width:132px;height:132px;object-fit:cover;object-position:center top;border:2px solid #b78434;background:#100a08}.custom-avatar-preview span{font:900 8px Tahoma;color:#d6b768;letter-spacing:1px}
.custom-avatar-fields{display:grid;gap:7px}.custom-avatar-fields label{margin:0 !important}.imgur-upload-button{display:block;padding:8px 10px;text-align:center;text-decoration:none;border:2px ridge #507ba2;background:linear-gradient(#32658e,#153957);color:#f6e5b2;font:900 10px Georgia}.avatar-error{min-height:15px;margin:0 !important;color:#e7a28d !important;font-size:9px !important}

/* Battle player cards: substantially larger, always use the account avatar. */
.match-profile{min-width:255px !important;max-width:360px !important}
.match-profile-main{grid-template-columns:66px minmax(0,1fr) !important;gap:9px !important;padding:7px 10px !important;min-height:72px !important}
.match-profile.enemy .match-profile-main{grid-template-columns:minmax(0,1fr) 66px !important}
.match-profile-main img{width:64px !important;height:64px !important;object-fit:cover !important;object-position:center top !important}
.match-profile-main b{font-size:14px !important}.match-profile-main small{font-size:10px !important}
.match-profile-scroll{min-width:275px !important;font-size:10px !important}

/* Larger battle controls. */
.ready-button{min-width:190px !important;min-height:45px !important;padding:10px 16px !important;font-size:13px !important}
.right-controls button{min-height:35px !important;padding:8px 7px !important;font-size:10px !important;line-height:1.1 !important}

/* Majestic crisp Duelist bars using the approved Egyptian reskin asset. */
.duelist-back,
.duelist-back.player{
  background:
    linear-gradient(90deg,rgba(11,6,3,.32),rgba(11,6,3,.05) 30% 70%,rgba(11,6,3,.32)),
    url("../assets/reskin/header-banner.webp") center/100% 100% no-repeat !important;
  box-shadow:inset 0 0 0 1px rgba(255,221,126,.16),0 4px 12px rgba(0,0,0,.35) !important;
}

@media(max-width:1550px){
  .arena-selection-page:not(.auth-page){grid-template-rows:116px 36px minmax(0,1fr) !important}
  .arena-selection-page:not(.auth-page) .arena-selection-header{min-height:116px !important;grid-template-columns:270px minmax(390px,1fr) 270px !important}
  .lobby-account-panel{width:255px !important}.lobby-account-card{grid-template-columns:72px minmax(0,1fr) !important;min-height:80px !important}.lobby-account-card img{width:70px !important;height:70px !important}.lobby-account-card b{font-size:15px !important}.lobby-account-card em{font-size:8.5px !important}
  .arena-selection-content{grid-template-columns:minmax(300px,.95fr) minmax(220px,.62fr) 225px minmax(315px,.9fr) !important}
  .arena-mode-rail button{font-size:9px !important;min-height:36px !important}.mode-rail-head b{font-size:15px !important}
  .select-focus-skill small{font-size:10px !important}.select-focus-skill b{font-size:12px !important}
}
/* Final header sizing: leave full room for the enlarged account card. */
.arena-selection-page:not(.auth-page){grid-template-rows:150px 38px minmax(0,1fr) !important}
.arena-selection-page:not(.auth-page) .arena-selection-header{min-height:150px !important}
@media(max-width:1550px){
  .arena-selection-page:not(.auth-page){grid-template-rows:140px 36px minmax(0,1fr) !important}
  .arena-selection-page:not(.auth-page) .arena-selection-header{min-height:140px !important}
}


/* =====================================================================
   v91.21 ONLINE POLISH R2 — restore the established homepage layout.
   Keep the enlarged account card at top-left, but undo the mockup's
   roster/mode/team rearrangement. Battle Duelist rows get their own
   thicker temple-stone treatment (not the top timer/header artwork).
   ===================================================================== */

/* Homepage: original v91.21 online column layout, with room above for profile. */
.arena-selection-page:not(.auth-page){
  grid-template-rows:140px 32px minmax(0,1fr) !important;
  padding:7px 10px !important;
  gap:6px !important;
  background-color:#1b0f08 !important;
  background-image:linear-gradient(90deg,#160a0560 0 8%,transparent 26% 74%,#160a0560 92%),linear-gradient(#120a0518,#120a0518),url("../assets/background/duel-monsters-original.jpg") !important;
  background-position:center !important;
  background-size:cover !important;
}
.arena-selection-page:not(.auth-page) .arena-selection-header{
  min-height:140px !important;
  display:grid !important;
  grid-template-columns:310px minmax(330px,1fr) 310px !important;
  align-items:center !important;
  gap:14px !important;
  padding:8px 16px !important;
  background:linear-gradient(rgba(18,10,5,.10),rgba(18,10,5,.18)),url("../assets/reskin/header-banner.webp") center/100% 100% no-repeat !important;
  clip-path:none !important;
}
.arena-selection-page:not(.auth-page) .selection-brand{
  grid-column:2 !important;
  justify-self:center !important;
  text-align:center !important;
  padding:0 !important;
}
.arena-selection-page:not(.auth-page) .selection-brand>span{
  font:900 11px/1.1 Georgia,"Times New Roman",serif !important;
  letter-spacing:2px !important;
}
.arena-selection-page:not(.auth-page) .arena-selection-header h1{
  margin:2px 0 0 !important;
  font:900 31px/1.02 Copperplate,"Copperplate Gothic Bold",Georgia,serif !important;
  letter-spacing:2px !important;
}
.selection-header-spacer{grid-column:3 !important}

/* Keep the large profile treatment, but only as the top-left account card. */
.lobby-account-panel{
  grid-column:1 !important;
  justify-self:start !important;
  align-self:center !important;
  width:292px !important;
}

/* Restore established online homepage layout: modes | team | roster | info. */
.arena-selection-content{
  width:min(1900px,100%) !important;
  grid-template-columns:178px 292px minmax(560px,1fr) 340px !important;
  grid-template-areas:"modes team roster info" !important;
  gap:8px !important;
}
.arena-select-main{grid-area:roster !important}
.arena-mode-rail{grid-area:modes !important;align-self:start !important;padding:9px !important;gap:7px !important}
.arena-select-team{grid-area:team !important}
.arena-select-info{grid-area:info !important}
.mode-rail-head{min-height:0 !important;display:block !important;padding:5px 4px 8px !important;text-align:center !important}
.mode-rail-head b{font:900 10px Georgia !important;letter-spacing:0 !important}
.arena-mode-rail button{min-height:34px !important;padding:7px 8px !important;font-size:9px !important;letter-spacing:.5px !important}
.arena-mode-rail [data-mode-quickplay],.arena-mode-rail [data-mode-ranked]{color:#fff1be !important}

/* Restore six-column roster and original compact page controls. */
.monster-main-panel .monster-grid{
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  grid-template-rows:repeat(4,minmax(0,1fr)) !important;
  grid-auto-rows:auto !important;
  height:calc(100% - 68px) !important;
  gap:7px !important;
  padding-top:4px !important;
}
.monster-main-panel .monster-tile b{font-size:8px !important}
.roster-pagination{margin-top:1px !important;min-height:30px !important;gap:7px !important}
.roster-pagination button{width:26px !important;height:26px !important;font-size:14px !important}
.roster-pagination span{height:26px !important;min-width:96px !important;line-height:26px !important;font-size:11px !important}

/* Keep homepage skill copy larger/readable, without changing panel placement. */
.select-focus-skill{grid-template-columns:52px 1fr !important;gap:8px !important;padding:6px !important}
.select-focus-skill img{width:50px !important;height:50px !important}
.select-focus-skill b{font-size:12px !important;line-height:1.15 !important}
.select-focus-skill small{margin-top:3px !important;font-size:10.5px !important;line-height:1.38 !important}

/* Custom avatars deliberately zoom a little so source-image borders are cropped. */
.lobby-account-card,.match-profile-main,.custom-avatar-preview{overflow:hidden !important}
.lobby-account-card img.custom-account-avatar,.match-profile-main img.custom-account-avatar{object-fit:cover !important;object-position:center 18% !important;transform:scale(1.10) !important}

/* Duelist rows: thicker, roomy, and visually independent from the top timer bar. */
.battle-board{
  grid-template-rows:16px clamp(112px,12vh,132px) clamp(150px,20vh,195px) 46px clamp(150px,20vh,195px) clamp(112px,12vh,132px) 16px !important;
  gap:3px !important;
}
.duelist-back,.duelist-back.player{
  min-height:108px !important;
  padding:9px 14px !important;
  border:3px solid #6b431d !important;
  outline:1px solid #c28f3e !important;
  background:
    radial-gradient(ellipse at 50% 50%,rgba(44,92,113,.20),transparent 42%),
    linear-gradient(90deg,rgba(58,33,14,.34),rgba(8,6,5,.06) 28% 72%,rgba(58,33,14,.34)),
    url("../assets/reskin/stone-wide.webp") center/cover no-repeat !important;
  box-shadow:inset 0 0 0 1px rgba(245,215,137,.15),inset 0 0 34px rgba(0,0,0,.34),0 4px 12px rgba(0,0,0,.35) !important;
}
.duelist-back.enemy{flex-direction:row-reverse !important;text-align:right !important}
.duelist-avatar{width:142px !important;height:118px !important;max-height:118px !important;object-fit:contain !important}
.duelist-passives-row{gap:7px !important;align-items:center !important;flex-wrap:wrap !important}
.duelist-passive,.duelist-active-skill{
  min-width:102px !important;
  min-height:48px !important;
  grid-template-columns:38px minmax(0,1fr) !important;
  gap:6px !important;
  padding:5px 6px !important;
}
.duelist-passive img,.duelist-active-skill img{width:36px !important;height:36px !important}
.duelist-passive>span{font-size:9px !important}

/* Battle controls remain deliberately easier to hit/read. */
.ready-button{min-width:190px !important;min-height:46px !important;padding:10px 16px !important;font-size:13px !important}
.right-controls button{min-height:36px !important;padding:8px 7px !important;font-size:10px !important}

@media(max-width:1550px){
  .arena-selection-page:not(.auth-page){grid-template-rows:128px 30px minmax(0,1fr) !important}
  .arena-selection-page:not(.auth-page) .arena-selection-header{min-height:128px !important;grid-template-columns:270px minmax(330px,1fr) 270px !important}
  .lobby-account-panel{width:255px !important}
  .arena-selection-content{grid-template-columns:160px 270px minmax(540px,1fr) 310px !important}
  .arena-mode-rail button{font-size:8px !important;padding:6px 5px !important}
  .select-focus-skill small{font-size:9.5px !important}
}
@media(max-height:820px){
  .battle-board{grid-template-rows:10px 104px clamp(140px,19vh,170px) 36px clamp(140px,19vh,170px) 104px 10px !important}
  .duelist-avatar{height:100px !important;max-height:100px !important}
}
@media(max-height:700px){
  .battle-board{grid-template-rows:8px 78px clamp(120px,18vh,145px) 22px clamp(120px,18vh,145px) 78px 8px !important}
  .duelist-avatar{height:74px !important;max-height:74px !important;width:100px !important}
  .duelist-passive,.duelist-active-skill{min-height:38px !important;min-width:82px !important;padding:3px 4px !important}
  .duelist-passive img,.duelist-active-skill img{width:30px !important;height:30px !important}
}

/* =====================================================================
   v91.21 ONLINE POLISH R4 — exact homepage placement corrections
   ===================================================================== */

/* Move the account card to the true top-left of the lobby, outside the
   centered banner, without cropping or changing its current wrapper. */
.arena-selection-page:not(.auth-page){position:relative !important}
.arena-selection-page:not(.auth-page)>.lobby-account-panel{
  position:absolute !important;
  z-index:40 !important;
  left:14px !important;
  top:10px !important;
  width:292px !important;
  margin:0 !important;
  padding:7px !important;
  display:block !important;
}
.arena-selection-page:not(.auth-page)>.lobby-account-panel .lobby-account-card{
  width:100% !important;
  margin:0 !important;
}

/* Keep the banner in place but lift the title group to match the user's
   edited reference image. */
.arena-selection-page:not(.auth-page) .selection-brand{
  transform:translateY(-14px) !important;
}

/* Change Avatar belongs in the mode rail, immediately above Game Guide. */
.arena-mode-rail [data-change-avatar]{
  background:linear-gradient(180deg,#2d1b11,#090605 60%,#402715) !important;
  color:#f2d487 !important;
}

/* Quickplay and Ranked use the same brown/gold palette as the rest of the
   homepage buttons — no blue/red mode colors. */
.arena-mode-rail [data-mode-quickplay],
.arena-mode-rail [data-mode-ranked]{
  background:linear-gradient(180deg,#2d1b11,#090605 60%,#402715) !important;
  color:#f2d487 !important;
  border-color:#a27531 !important;
}

@media(max-width:1550px){
  .arena-selection-page:not(.auth-page)>.lobby-account-panel{left:10px !important;top:8px !important;width:255px !important}
  .arena-selection-page:not(.auth-page) .selection-brand{transform:translateY(-11px) !important}
}


/* =====================================================================
   v91.21 ONLINE POLISH R5 — VERIFIED homepage placement
   These are intentionally last and highly specific so earlier skin rules
   cannot override them.
   ===================================================================== */
body #app .arena-selection-page:not(.auth-page){position:relative !important}
body #app .arena-selection-page:not(.auth-page) > .lobby-account-panel{
  position:absolute !important;
  left:14px !important;
  top:10px !important;
  z-index:100 !important;
  width:292px !important;
  margin:0 !important;
  transform:none !important;
}
body #app .arena-selection-page:not(.auth-page) .arena-selection-header{
  position:relative !important;
}
body #app .arena-selection-page:not(.auth-page) .selection-brand{
  transform:translateY(-14px) !important;
}
body #app .arena-mode-rail button[data-change-avatar]{
  display:block !important;
  visibility:visible !important;
  opacity:1 !important;
  background:linear-gradient(180deg,#2d1b11,#090605 60%,#402715) !important;
  color:#f2d487 !important;
  border-color:#a27531 !important;
}
body #app .arena-mode-rail button[data-mode-quickplay],
body #app .arena-mode-rail button[data-mode-ranked]{
  background:linear-gradient(180deg,#2d1b11,#090605 60%,#402715) !important;
  color:#f2d487 !important;
  border-color:#a27531 !important;
  box-shadow:inset 0 0 0 1px rgba(233,198,108,.14),0 3px 8px #0006 !important;
}
@media(max-width:1550px){
  body #app .arena-selection-page:not(.auth-page) > .lobby-account-panel{
    left:10px !important;top:8px !important;width:255px !important;
  }
  body #app .arena-selection-page:not(.auth-page) .selection-brand{
    transform:translateY(-12px) !important;
  }
}


/* =====================================================================
   v91.21 ONLINE POLISH R6 — battle spacing / callouts / top controls
   ===================================================================== */

/* Remove the separate battle header strip entirely. The turn controls now
   sit directly on the battlefield art. */
body #app .arena-page{
  grid-template-rows:minmax(0,1fr) !important;
}
body #app .arena-page>.classic-top{display:none !important}
.battle-controls-overlay{
  position:absolute !important;
  z-index:180 !important;
  top:8px !important;
  left:50% !important;
  transform:translateX(-50%) !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  gap:8px !important;
  pointer-events:none !important;
}
.battle-controls-overlay .ready-button,
.battle-controls-overlay .timer{pointer-events:auto !important}
.battle-controls-overlay .ready-button{
  min-width:150px !important;
  min-height:36px !important;
  padding:7px 14px !important;
  background:linear-gradient(180deg,#4b2f1b,#160c08 68%,#5c391f) !important;
  border:2px ridge #a97a34 !important;
  color:#efd38c !important;
  box-shadow:0 3px 8px #0008,inset 0 0 0 1px rgba(255,220,125,.10) !important;
}
.battle-controls-overlay .timer{
  min-width:64px !important;
  padding:7px 9px !important;
  background:rgba(20,11,7,.86) !important;
  border:2px ridge #9b6d2f !important;
  color:#efcf68 !important;
  box-shadow:0 3px 8px #0008 !important;
}

/* Push the enemy formation toward the top and the player's formation toward
   the bottom, leaving a much larger clean arena in the middle. Profile cards
   keep their corner positions in the reserved top/bottom strips. */
body #app .battle-board{
  align-content:stretch !important;
  grid-template-rows:64px 88px clamp(142px,18vh,174px) minmax(150px,1fr) clamp(142px,18vh,174px) 88px 64px !important;
  gap:3px !important;
}
body #app .enemy-layer{grid-row:2 !important}
body #app .enemy-row{grid-row:3 !important}
body #app .arena-seal{grid-row:4 !important}
body #app .player-row{grid-row:5 !important}
body #app .player-layer{grid-row:6 !important}

/* Duelist bars stay compact enough to fit the full Duelist and all abilities. */
body #app .duelist-back,
body #app .duelist-back.player{
  min-height:84px !important;
  height:100% !important;
  padding:6px 10px !important;
}
body #app .duelist-avatar{
  width:112px !important;
  height:84px !important;
  max-height:84px !important;
}
body #app .duelist-passives-row{
  flex-wrap:nowrap !important;
  min-width:0 !important;
  gap:5px !important;
}
body #app .duelist-passive,
body #app .duelist-active-skill{
  min-width:0 !important;
  width:auto !important;
  flex:1 1 0 !important;
  min-height:42px !important;
  grid-template-columns:32px minmax(0,1fr) !important;
  padding:4px 5px !important;
}
body #app .duelist-passive img,
body #app .duelist-active-skill img{width:30px !important;height:30px !important}

/* Callouts live in dedicated outer space of the Duelist row instead of
   covering passive/skill buttons. When a callout exists, reserve its space. */
body #app .duelist-back.has-chat.player{padding-right:330px !important}
body #app .duelist-back.has-chat.enemy{padding-left:330px !important}
body #app .duelist-chat{
  top:50% !important;
  width:300px !important;
  min-width:260px !important;
  max-width:300px !important;
  min-height:54px !important;
  max-height:72px !important;
  padding:8px 12px 8px 16px !important;
  transform:translateY(-50%) !important;
}
body #app .duelist-chat.enemy{
  left:12px !important;
  right:auto !important;
}
body #app .duelist-chat.player{
  left:auto !important;
  right:12px !important;
}
body #app .duelist-chat b{font-size:7px !important}
body #app .duelist-chat span{font-size:10px !important;line-height:1.2 !important}

@media(max-width:1450px){
  body #app .battle-board{
    grid-template-rows:58px 82px clamp(132px,18vh,160px) minmax(125px,1fr) clamp(132px,18vh,160px) 82px 58px !important;
  }
  body #app .duelist-back.has-chat.player{padding-right:270px !important}
  body #app .duelist-back.has-chat.enemy{padding-left:270px !important}
  body #app .duelist-chat{width:244px !important;min-width:220px !important;max-width:244px !important}
}
@media(max-height:760px){
  body #app .battle-board{
    grid-template-rows:52px 72px clamp(118px,17vh,140px) minmax(90px,1fr) clamp(118px,17vh,140px) 72px 52px !important;
  }
  body #app .duelist-avatar{width:94px !important;height:70px !important;max-height:70px !important}
  body #app .duelist-back.has-chat.player{padding-right:245px !important}
  body #app .duelist-back.has-chat.enemy{padding-left:245px !important}
  body #app .duelist-chat{width:220px !important;min-width:200px !important;max-width:220px !important;min-height:48px !important}
}

/* =====================================================================
   R13 — surgical fixes on exact uploaded R6 base
   Only: approved homepage/admin/profile changes + two battle CSS fixes.
   ===================================================================== */

/* Approved homepage background: exact AI-generated Egyptian temple asset. */
body #app .arena-selection-page:not(.auth-page){
  background-color:#140b06 !important;
  background-image:url("../assets/reskin/lobby-backdrop.webp") !important;
  background-position:center center !important;
  background-size:cover !important;
  background-repeat:no-repeat !important;
}

/* Admin feedback organization/delete controls. */
.admin-feedback-actions{display:flex;justify-content:flex-end;align-items:center;gap:7px;margin-top:6px}
.admin-feedback-actions select{float:none !important;margin:0 !important}
.admin-feedback-actions .admin-delete-feedback{
  width:auto !important;min-height:26px !important;padding:4px 9px !important;
  border-color:#8f3c2f !important;background:linear-gradient(180deg,#6a2b22,#2a100d 70%,#7c3227) !important;color:#f1c1a7 !important;
}
.admin-feedback-section{margin:12px 0;padding:8px;border:1px solid #7d572b;background:rgba(19,12,8,.72)}
.admin-feedback-section>h3{display:flex;align-items:center;justify-content:space-between;margin:0 0 7px;padding-bottom:6px;border-bottom:1px solid #7d572b;color:#efcf79;font:900 12px Georgia;letter-spacing:.6px}
.admin-feedback-section>h3 span{min-width:25px;padding:2px 6px;text-align:center;border:1px solid #8f652f;background:#21140c;color:#f4d789;font:900 9px Tahoma}

/* BATTLE FIX 1: both account cards live fully in the reserved top strip,
   never inside either Duelist row. Keep them compact enough to fit there. */
body #app .enemy-profile-layer,
body #app .player-profile-layer{
  top:2px !important;
  bottom:auto !important;
  height:auto !important;
  align-items:flex-start !important;
}
body #app .enemy-profile-layer{right:8px !important;left:auto !important}
body #app .player-profile-layer{left:8px !important;right:auto !important}
body #app .match-profile{min-width:170px !important;max-width:240px !important}
body #app .match-profile-main{
  min-height:0 !important;
  grid-template-columns:36px minmax(0,1fr) !important;
  gap:6px !important;
  padding:2px 6px !important;
}
body #app .match-profile.enemy .match-profile-main{grid-template-columns:minmax(0,1fr) 36px !important}
body #app .match-profile-main img{width:34px !important;height:34px !important}
body #app .match-profile-main b{font-size:9px !important}
body #app .match-profile-main small{font-size:7px !important;margin-top:1px !important}

/* Both top-corner cards expand downward so details remain on-screen. */
body #app .player-profile-layer .match-profile-scroll,
body #app .enemy-profile-layer .match-profile-scroll{
  top:calc(100% + 4px) !important;
  bottom:auto !important;
}
body #app .player-profile-layer .match-profile-scroll{left:0 !important;right:auto !important;text-align:left !important}
body #app .enemy-profile-layer .match-profile-scroll{left:auto !important;right:0 !important;text-align:right !important}

/* BATTLE FIX 2: Duelist passive/skill tiles keep natural compact widths.
   R6 had flex:1, which forced every tile to stretch across the row. */
body #app .duelist-passives-row{
  width:auto !important;
  max-width:100% !important;
  flex:0 1 auto !important;
  justify-content:flex-start !important;
}
body #app .duelist-back.enemy .duelist-passives-row{justify-content:flex-end !important}
body #app .duelist-passive,
body #app .duelist-active-skill{
  flex:0 0 auto !important;
  width:auto !important;
  min-width:112px !important;
  max-width:190px !important;
}
