/* Live UI aligned with the accepted 1024×1536 art direction. */
html,body{min-height:100%;background:#091823}body{background:linear-gradient(#091823aa,#091823c9),url('battle-background.png') center/cover fixed}#match-pk{flex-direction:column;align-items:center;padding:12px 0;gap:8px}#match-pk .pk-phone{position:relative;width:440px;max-width:100%;aspect-ratio:2/3;background:#10252d url('reference-skin.png') center/100% 100% no-repeat;border:0;border-radius:0;box-shadow:0 16px 40px #0007;overflow:hidden}#match-pk .pk-heading{position:absolute;top:3.5%;left:24%;width:52%;height:6.8%;min-height:0;padding:0;margin:0;display:flex;justify-content:flex-start;background:none;border:0;box-shadow:none;border-radius:0;gap:0;color:#f8dfac}#match-pk .pk-heading span:first-child{font:bold clamp(15px,4.5vw,24px) Georgia,serif;letter-spacing:.3px;white-space:nowrap;text-align:center;text-shadow:0 2px 3px #000,0 0 6px #b7853540}#match-pk .pk-heading span:last-child{font:bold clamp(11px,3vw,16px) Georgia,serif;letter-spacing:1px;position:absolute;top:76%;color:#eee5c5}#match-pk .pk-crest{display:none}#match-pk .pk-turn{position:absolute;left:32%;top:10.8%;width:36%;height:2.9%;margin:0;padding:0;background:none;border:0;display:flex;justify-content:center;align-items:center}#match-pk .pk-turn span:first-child{font:bold clamp(10px,2.9vw,15px) Georgia,serif;color:#e2ffff;white-space:nowrap;text-shadow:0 1px 3px #07131d}#match-pk .pk-turn [data-ui="boss-name"]{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}#match-pk .pk-board-frame{position:absolute;left:9.5%;top:14.5%;width:81%;height:47.4%;margin:0;padding:0;border:0;border-radius:0;background:#071c20;box-shadow:none}#match-pk .pk-board{width:100%;height:100%;display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));gap:3px;padding:0;border-radius:0;background:#061317}#match-pk .pk-tile{aspect-ratio:auto;min-height:0;border-radius:5px;background:linear-gradient(135deg,#2b5752,#153a3c 60%,#0a262d)!important;box-shadow:inset 0 1px 1px #c3eadb66,inset 1px 0 #6d9c9866,inset 0 -2px 3px #0008}#match-pk .pk-item-art{width:100%;height:100%}#match-pk .pk-versus{position:absolute;left:0;top:63%;width:100%;height:17%;display:block;padding:0;margin:0;background:none;border:0;box-shadow:none;border-radius:0}#match-pk .pk-fighter{position:absolute;left:0;top:0;width:50%;height:100%;display:block}#match-pk .pk-fighter.boss{left:50%}#match-pk .pk-portrait{position:absolute;left:0;top:0;width:47%;height:100%;border:0;border-radius:0;background:none!important;box-shadow:none}#match-pk .boss .pk-portrait{left:auto;right:0}#match-pk .pk-bars{position:absolute;left:47%;top:40%;width:51%;height:55%;text-align:center}#match-pk .boss .pk-bars{left:2%;text-align:center}#match-pk .pk-fighter-name{position:absolute;top:0;left:0;width:100%;font:bold clamp(11px,3vw,16px) Georgia,serif;color:#fff6dc;white-space:nowrap;text-shadow:0 2px 3px #000}#match-pk .pk-hp-track{position:absolute;left:2%;top:34%;width:96%;height:18%;border-radius:12px;background:#220e16;box-shadow:none}#match-pk .pk-hp-track>div{background:linear-gradient(#f8797d,#d4223d 60%,#b60f2d);height:100%;border-radius:12px}#match-pk [data-ui="hero-hp"],#match-pk [data-ui="boss-hp"]{position:absolute;top:33%;left:0;width:100%;margin:0;font:bold clamp(9px,2.6vw,13px) Georgia,serif;color:#fff5e4;text-align:center;text-shadow:0 1px 3px #580f1d}#match-pk .pk-mana-track{position:absolute;left:6%;top:75%;width:87%;height:13%;border-radius:10px;background:#04202b;box-shadow:none}#match-pk .pk-mana-track>div{background:linear-gradient(#a8fff4,#24cbd5 65%,#11949d);border-radius:10px}#match-pk [data-ui="hero-energy"],#match-pk [data-ui="boss-energy"]{position:absolute;top:92%;left:0;width:100%;margin:0;font:clamp(9px,2.2vw,11px) system-ui;color:#cce5df;text-align:center;text-shadow:0 1px 2px #000}#match-pk .pk-vs{display:none}#match-pk .pk-log{position:absolute;left:25%;top:63.1%;width:50%;height:5.5%;min-height:0;padding:3px 4px;margin:0;background:#0a1d298a;border-radius:4px;font:clamp(9px,2.3vw,11px)/1.35 system-ui;text-align:center;color:#e5ead5;overflow:hidden}#match-pk .pk-controls{position:absolute;left:9%;top:81.7%;width:82%;height:6.8%;padding:0;gap:2%;grid-template-columns:1fr 1fr}#match-pk .pk-controls button,#match-pk .pk-controls .pk-skill{position:relative;width:100%;height:100%;min-height:0;border:0;border-radius:22px;background:transparent;box-shadow:none;padding:0 3px 0 22%;font:bold clamp(12px,3.4vw,18px) Georgia,serif;color:#fff5d1;text-shadow:0 2px 3px #36281e;white-space:nowrap;overflow:hidden}#match-pk .pk-controls button span{font:clamp(8px,2vw,10px) system-ui;opacity:.9;margin-top:2px;color:#fff5d1}#match-pk .pk-controls button:disabled{opacity:1;color:#d8c297}#match-pk .pk-controls button:disabled:before{content:'';position:absolute;inset:0;background:#05131b45;border-radius:22px;pointer-events:none}#match-pk .pk-controls button:focus-visible{outline:2px solid #d9fff7;outline-offset:-3px}#match-pk .pk-resources{position:absolute;left:0;top:93.7%;width:100%;height:4.4%;margin:0;padding:0;background:transparent;border:0;display:block;font:bold clamp(9px,2.5vw,13px) Georgia,serif;color:#f9d792;text-shadow:0 1px 3px #000}#match-pk .pk-resources span{position:absolute;top:0;white-space:nowrap}#match-pk [data-ui="gold"]{left:17.5%}#match-pk [data-ui="food"]{left:44%}#match-pk [data-ui="xp"]{left:76%;max-width:23%;font-size:clamp(8px,2.2vw,11px)}#match-pk .pk-extras{width:440px;max-width:100%;background:#0a1d29;color:#c7ddd9;border-top:1px solid #7d6a44}#match-pk .pk-sound{display:block;margin:2px auto;padding:3px;min-height:32px;background:transparent;border:0;color:#bfd5d7}#match-pk .pk-legend{background:transparent;border:0;padding:8px 12px}#match-pk .pk-result-box{background:linear-gradient(#244351,#0d2736);border:2px solid #d1ac67}#match-pk .pk-effects{z-index:5}@media(max-width:350px){#match-pk .pk-board{gap:2px}#match-pk .pk-heading span:first-child{font-size:15px}#match-pk .pk-portrait{width:47%;height:100%}#match-pk .pk-versus{padding:0}}
/* Gameplay occupies the complete Android viewport. */
html,body{height:100%;min-height:0;overflow:hidden}#match-pk{height:100vh;height:100dvh;padding:0!important;display:block;position:relative;overflow:hidden}#match-pk .pk-phone{width:100%;max-width:none;height:100%;aspect-ratio:auto;box-shadow:none}#match-pk .pk-extras{position:absolute;right:8px;bottom:42px;width:min(300px,calc(100% - 16px));max-width:none;z-index:8;background:#102936f5;border:1px solid #bb9c62;border-radius:12px;box-shadow:0 8px 30px #0008;display:none}#match-pk .pk-extras.is-open{display:block}#match-pk .pk-settings{position:absolute;bottom:5px;right:8px;width:32px;height:32px;padding:0;border:1px solid #a58750;border-radius:50%;background:#102936d9;color:#efd49a;font:20px system-ui;z-index:9}#match-pk [data-ui="food"]{left:48%}
#match-pk .pk-item-art{width:100%;height:auto;aspect-ratio:1;max-height:100%;flex:none}
/* Preserve artwork scale; only scenery fills the changing screen ratio. */
#match-pk .pk-phone{display:flex;flex-direction:column;justify-content:space-between;align-items:center;background:linear-gradient(#081b2733,#081b2755),url('battle-background.png') center/cover no-repeat;gap:0}#match-pk .pk-header-art{position:relative;width:100%;aspect-ratio:1024/210;flex:none;background:url('reference-skin.png') center top/100% auto no-repeat}#match-pk .pk-heading{top:25%;height:50%}#match-pk .pk-heading span:last-child{top:76%}#match-pk .pk-turn{top:77%;height:20%}#match-pk .pk-board-frame{position:relative;top:auto;left:auto;width:90%;height:auto;aspect-ratio:1;flex:none;padding:3%;background:url('reference-skin.png') 50.4% 26.38%/113.65% 198.45% no-repeat}#match-pk .pk-board{aspect-ratio:1;height:100%;width:100%;grid-template-rows:repeat(8,minmax(0,1fr));gap:3px}#match-pk .pk-tile{aspect-ratio:1}#match-pk .pk-item-art{width:100%;height:100%;aspect-ratio:1}#match-pk .pk-lower-art{position:relative;flex:none;width:100%;aspect-ratio:1024/591;background:url('reference-skin.png') center bottom/100% auto no-repeat}#match-pk .pk-versus{top:0;height:100%}#match-pk .pk-portrait{top:0;width:47%;height:70%}#match-pk .pk-bars{top:25%;height:21%}#match-pk .pk-log{top:1%;height:10%;left:27%;width:46%}#match-pk .pk-controls{top:52.8%;height:18.5%}#match-pk .pk-resources{top:84%;height:12%}#match-pk .pk-settings{bottom:6px;width:28px;height:28px;font-size:18px}@media(max-width:350px){#match-pk .pk-board{gap:2px}#match-pk .pk-portrait{width:47%;height:70%}}
#match-pk .pk-board-frame{aspect-ratio:auto}#match-pk .pk-board{aspect-ratio:auto}#match-pk .pk-tile{aspect-ratio:auto}
/* Crop the ornamental border before the portrait region; do not repeat faces. */
#match-pk .pk-board-frame{background-position:50.4% 25.54%;background-size:113.65% 203.984%;box-shadow:inset 0 -3px #ae8a50}
#match-pk .pk-board{touch-action:none;user-select:none;-webkit-user-select:none;overflow:hidden}#match-pk .pk-tile{touch-action:none;user-select:none;-webkit-user-select:none}#match-pk .pk-tile.dragging{z-index:2}#match-pk .pk-tile.drag-target{outline:2px solid #87f0dd;outline-offset:-2px}#match-pk .pk-tile.clearing{transition:transform .065s,opacity .065s}#match-pk .pk-item-art{backface-visibility:hidden;pointer-events:none}
#match-pk .pk-item-art{filter:none;backface-visibility:visible}#match-pk .pk-board{contain:layout paint}
#match-pk .pk-match-flash{position:absolute;border-radius:6px;background:radial-gradient(circle,#fffde5bb,var(--burst) 48%,transparent 75%);pointer-events:none;will-change:transform,opacity}#match-pk .pk-match-particle{position:absolute;width:7px;height:7px;border-radius:1px;pointer-events:none;will-change:transform,opacity}#match-pk .pk-match-badge{position:absolute;background:#123441eb;border:1px solid #e5c274;color:#fff0b4;border-radius:6px;padding:4px 7px;font:700 11px system-ui;white-space:nowrap;text-shadow:0 1px 2px #000;pointer-events:none;z-index:6;will-change:transform,opacity}
/* Independent alpha sprites preserve their proportions during recoil. */
#match-pk .pk-lower-art{background-image:url('reference-skin-no-characters.png')}#match-pk .pk-portrait{width:60%;height:70%;background:url('recoil-characters.png') left bottom/auto 100% no-repeat!important;transform-origin:50% 85%;z-index:1;pointer-events:none}#match-pk .boss .pk-portrait{background-position:right bottom!important}#match-pk .pk-bars,#match-pk .pk-log{z-index:2}#match-pk .pk-controls{z-index:3}@media(max-width:350px){#match-pk .pk-portrait{width:60%;height:70%}}
#match-pk .pk-about{padding:8px 12px;border-bottom:1px solid #345361;color:#d8e8df;font:12px system-ui}#match-pk .pk-about summary{min-height:30px;display:list-item;align-content:center;color:#eed49e}#match-pk .pk-about p{margin:8px 0;line-height:1.5}
/* Center the stage in its plaque; reserve a readable status frame between board and HUD. */
#match-pk .pk-heading [data-ui="stage"]{top:60%;left:0;width:100%;height:40%;display:flex;align-items:center;justify-content:center;line-height:1;margin:0;padding:0}
#match-pk .pk-log{position:relative;top:auto;left:auto;flex:none;width:90%;height:36px;min-height:36px;max-height:36px;margin:0;padding:2px 6px;display:flex;align-items:center;justify-content:center;background:#102c3de8;border:1px solid #b59a65;border-radius:5px;font:500 clamp(12px,3.2vw,14px)/1.15 system-ui,sans-serif;color:#fff2ce;text-shadow:0 1px 2px #07131d;text-align:center;overflow:hidden}
/* Stage uses the artwork plaque coordinates, independent of title layout. */
#match-pk .pk-header-art>.pk-stage-label{position:absolute;left:42%;top:54%;width:16%;height:20%;display:flex;align-items:center;justify-content:center;margin:0;padding:0;font:bold clamp(11px,3vw,16px)/1 Georgia,serif;letter-spacing:1px;color:#eee5c5;text-align:center;white-space:nowrap;text-shadow:0 1px 2px #07131d}
#match-pk .pk-heading span:first-child{position:static;top:auto;left:auto;width:100%;height:auto;display:block;font:bold clamp(15px,4.5vw,24px) Georgia,serif;letter-spacing:.3px;color:#f8dfac}
/* Large, readable weapon silhouette and a trailing light streak. */
#match-pk .pk-projectile{width:64px;height:64px;z-index:7;filter:drop-shadow(0 0 3px #fff4ca) drop-shadow(0 0 9px #ffcd69);will-change:transform,opacity}#match-pk .pk-projectile::before{content:'';position:absolute;left:49%;top:30%;width:72px;height:9px;border-radius:50%;background:linear-gradient(90deg,#fff6cee6,#ffcb6877,transparent);transform:rotate(-45deg);transform-origin:left center;z-index:-1}#match-pk .pk-hit{width:88px;height:88px;background:radial-gradient(circle,#fffbea,#ffd383b0 25%,#f3b55b44 50%,transparent 72%)}
#match-pk .pk-settings-backdrop{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;background:transparent;border:0;border-radius:0;z-index:7}#match-pk .pk-settings-backdrop[hidden]{display:none}
#match-pk .pk-settings{display:flex;align-items:center;justify-content:center}#match-pk .pk-settings svg{display:block;flex:none;pointer-events:none}
/* Align labels to the actual bar boxes rather than font baselines. */
#match-pk .pk-fighter-name{top:0;left:0;width:100%;height:28%;margin:0;padding:0;display:flex;align-items:center;justify-content:center;line-height:1}
#match-pk [data-ui="hero-hp"],#match-pk [data-ui="boss-hp"]{top:34%;left:2%;width:96%;height:18%;margin:0;padding:0;display:flex;align-items:center;justify-content:center;font:bold clamp(9px,2.6vw,13px)/1 Georgia,serif;white-space:nowrap}
#match-pk [data-ui="hero-energy"],#match-pk [data-ui="boss-energy"]{top:75%;left:6%;width:87%;height:13%;margin:0;padding:0;display:flex;align-items:center;justify-content:center;font:clamp(8px,2.2vw,11px)/1 system-ui;white-space:nowrap}
#match-pk [data-ui="hero-hp"],#match-pk [data-ui="boss-hp"]{transform:translateY(-2px)}
#match-pk [data-ui="hero-energy"],#match-pk [data-ui="boss-energy"]{transform:translateY(-5px)}
#match-pk .pk-mana-track{top:62%}
#match-pk [data-ui="hero-energy"],#match-pk [data-ui="boss-energy"]{top:62%;transform:none}
#match-pk .pk-fighter-name{transform:translateY(-2px)}
#match-pk [data-ui="hero-hp"],#match-pk [data-ui="boss-hp"]{transform:translateY(-3px)}
#match-pk [data-ui="hero-energy"],#match-pk [data-ui="boss-energy"]{transform:translateY(-2px)}
#match-pk [data-ui="hero-energy"],#match-pk [data-ui="boss-energy"]{color:#fff;font-weight:700;text-shadow:-1px 0 #06232e,1px 0 #06232e,0 -1px #06232e,0 1px #06232e,0 1px 2px #000}
#match-pk [data-ui="xp"]{left:75%;top:-2px;width:19%;max-width:19%;height:38%;display:flex;align-items:center;justify-content:center;line-height:1;text-align:center}
#match-pk [data-ui="xp"]{top:-8px}
#match-pk .pk-special svg{display:block;width:12px;height:12px;fill:none;stroke:#ffe9a8;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
#match-pk .pk-resources [data-ui="xp"]{top:-8px}
/* Fixed game viewport: gestures move tiles, never scale the interface. */
html,body,#match-pk{touch-action:none}
/* The active fighter has a readable speech label above their portrait. */
#match-pk .pk-turn-label{position:absolute;top:0;left:3%;max-width:43%;transform:translateY(-75%);z-index:4;padding:5px 7px;border:1px solid #f1ce7a;border-radius:7px;background:#123844f5;color:#fff3cb;font:700 clamp(10px,2.6vw,13px)/1.2 system-ui,sans-serif;text-align:center;white-space:nowrap;box-shadow:0 2px 7px #0008;pointer-events:none}
#match-pk .pk-turn-label::after{content:'';position:absolute;bottom:-5px;left:50%;width:7px;height:7px;background:#123844;border-right:1px solid #f1ce7a;border-bottom:1px solid #f1ce7a;transform:translateX(-50%) rotate(45deg)}
#match-pk .boss .pk-turn-label{left:auto;right:3%;max-width:62%}
#match-pk .pk-turn-label[hidden]{display:none}
/* Match history and fighter turn labels share the same typography. */
#match-pk .pk-log{font:700 clamp(10px,2.6vw,13px)/1.2 system-ui,sans-serif;color:#fff3cb}
html,body,#match-pk{touch-action:pan-y}
#match-pk .pk-extras{max-height:calc(100% - 64px);overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain}
#match-pk .pk-legend p{line-height:1.5}
#match-pk .pk-language{border-top:1px solid #345361;padding:8px 12px;font:12px system-ui;color:#eed49e}
#match-pk .pk-language summary{min-height:30px;align-content:center}
#match-pk .pk-language-options{display:flex;gap:8px;padding:8px 0}
#match-pk .pk-language-options button{flex:1;min-height:36px;border:1px solid #658a8c;border-radius:6px;background:#163743;color:#fff3cb;font:600 12px system-ui}
#match-pk .pk-language-options button[aria-pressed="true"]{border-color:#f1ce7a;background:#345554}
html[lang="en"] #match-pk .pk-controls button{font-size:clamp(10px,2.8vw,15px)}
/* Prominent active-turn callout above the fighter. */
#match-pk .pk-turn-label{font:800 clamp(13px,3.5vw,17px)/1.2 system-ui,sans-serif;max-width:none;padding:8px 10px;background:linear-gradient(#ffe8a3,#edba55);color:#251705;border:2px solid #fff3c9;border-radius:9px;box-shadow:0 3px 10px #000b,0 0 13px #ffd66b66;text-shadow:none;transform:translateY(-85%)}
#match-pk .boss .pk-turn-label{max-width:none;background:linear-gradient(#ffc6a5,#ef906b);color:#371207;border-color:#ffe4c7;box-shadow:0 3px 10px #000b,0 0 13px #ff986666}
#match-pk .pk-turn-label::after{background:#edba55;border-color:#fff3c9;width:9px;height:9px;bottom:-7px;border-width:2px}
#match-pk .boss .pk-turn-label::after{background:#ef906b;border-color:#ffe4c7}
#match-pk .pk-about summary,#match-pk .pk-legend summary,#match-pk .pk-language summary{font:400 12px/1.4 system-ui,sans-serif;color:#eed49e;min-height:30px;display:list-item;align-content:center}
/* Reserve a separate turn-label lane between history and portraits. */
#match-pk .pk-log{height:48px;min-height:48px;max-height:48px;white-space:normal;overflow-wrap:anywhere;padding:4px 8px}
#match-pk .pk-lower-art{margin-top:42px}
#match-pk .pk-turn-label{transform:translateY(-100%)}
#match-pk .boss .pk-portrait{width:54%;height:auto;aspect-ratio:2/3;left:auto;right:0}
#match-pk .pk-about{font:11px system-ui,sans-serif;color:#bad0d5}
#match-pk .pk-about p{line-height:1.5}
/* Keep history close to the turn callout; spare height belongs above the board. */
#match-pk .pk-phone{justify-content:flex-start}
#match-pk .pk-board-frame{margin-top:auto}
/* One shared body style for both settings sections. */
#match-pk .pk-about,#match-pk .pk-legend{font:400 12px/1.5 system-ui,sans-serif;color:#bad0d5}
#match-pk .pk-about p,#match-pk .pk-legend p,#match-pk .pk-legend-grid span{font:400 12px/1.5 system-ui,sans-serif;color:#bad0d5;text-shadow:none}
#match-pk .pk-about p,#match-pk .pk-legend p{margin:8px 0}
#match-pk .pk-about strong,#match-pk .pk-legend strong{font-weight:700;color:inherit}

/* Readable button captions and a deliberate confirmation before spending HP. */
#match-pk .pk-controls button span{font:700 clamp(10px,2.8vw,13px)/1.15 system-ui,sans-serif;color:#fff;opacity:1;text-shadow:0 1px 2px #000,0 0 4px #000;}
#match-pk .pk-hint-confirm{position:absolute;inset:0;z-index:30;background:#0009;display:flex;align-items:center;justify-content:center;padding:20px;}
#match-pk .pk-hint-confirm-panel{width:100%;max-width:330px;padding:18px;border:2px solid #d7b268;border-radius:14px;background:#102b37;color:#fff3cf;box-shadow:0 8px 30px #0009;font:600 15px/1.5 system-ui,sans-serif;}
#match-pk .pk-hint-confirm-panel p{margin:0 0 18px;}
#match-pk .pk-hint-confirm-panel>div{display:flex;gap:12px;}
#match-pk .pk-hint-confirm-panel button{flex:1;min-height:44px;border:1px solid #d7b268;border-radius:8px;background:#204756;color:#fff3cf;font:700 15px system-ui;}
#match-pk .pk-hint-confirm-panel button:last-child{background:#8b501a;}

/* Only help content scrolls; language choices stay in the panel footer. */
#match-pk .pk-extras{overflow:hidden;flex-direction:column;}
#match-pk .pk-extras.is-open{display:flex;}
#match-pk .pk-settings-scroll{min-height:0;overflow-y:auto;touch-action:pan-y;overscroll-behavior:contain;}
#match-pk .pk-language,#match-pk .pk-sound{flex-shrink:0;}
#match-pk .pk-language{background:#102936;border-radius:0 0 12px 12px;}

#match-pk .pk-lives{position:absolute;left:5%;top:58%;display:flex;gap:3px;padding:3px 5px;border:1px solid #bc985a;border-radius:8px;background:#071e2bd9;z-index:2;}
#match-pk .pk-lives svg{width:clamp(13px,4vw,19px);height:clamp(13px,4vw,19px);fill:#ffce45;stroke:#9c641b;stroke-width:1;filter:drop-shadow(0 1px 2px #000);}
#match-pk .pk-lives svg.lost{fill:#31414a;stroke:#6f7880;opacity:.6;}

#match-pk .pk-legend-grid{display:grid;grid-template-columns:1fr;gap:7px;}
#match-pk .pk-guide-item{display:flex;align-items:center;gap:9px;}
#match-pk .pk-guide-icon{display:block;flex:0 0 42px;width:42px;height:42px;border-radius:7px;background-image:url('items-3d.png');background-size:300% 200%;background-repeat:no-repeat;background-color:#163c3d;box-shadow:inset 0 1px 2px #8abaae55;}

#match-pk .pk-guide-bullet{position:relative;padding-left:12px;}
#match-pk .pk-guide-bullet::before{content:'-';position:absolute;left:0;top:0;color:#eed49e;}

/* Cap the board at nine square rows; extra height becomes scenery above the game. */
#match-pk .pk-header-art{margin-top:auto;}
#match-pk .pk-board-frame{margin-top:0;}

#match-pk .pk-quick-sound{position:absolute;top:8px;right:8px;width:34px;height:34px;display:flex;align-items:center;justify-content:center;padding:6px;border:1px solid #bd985b;border-radius:50%;background:#102936e8;color:#ffda86;z-index:6;box-shadow:0 2px 5px #0007;}
#match-pk .pk-quick-sound svg{width:22px;height:22px;}
#match-pk .pk-quick-sound[aria-pressed="false"]{color:#b8c5cb;}

/* Mirror the hearts across the header center, on the same horizontal line. */
#match-pk .pk-quick-sound{top:58%;right:5%;height:calc(clamp(13px,4vw,19px) + 8px);width:calc(clamp(13px,4vw,19px) + 12px);padding:3px 5px;border-radius:8px;z-index:2;}
#match-pk .pk-quick-sound svg{width:clamp(13px,4vw,19px);height:clamp(13px,4vw,19px);}

#match-pk .pk-quick-sound{width:34px;height:34px;padding:6px;border-radius:50%;transform:translateY(calc((clamp(13px,4vw,19px) + 8px - 34px)/2));}
#match-pk .pk-quick-sound svg{width:22px;height:22px;}

/* Pair equal-sized speaker and settings controls in the header. */
#match-pk .pk-quick-sound{right:calc(5% + 40px);}
#match-pk .pk-settings{top:58%;bottom:auto;right:5%;width:34px;height:34px;padding:6px;display:flex;align-items:center;justify-content:center;border-radius:50%;transform:translateY(calc((clamp(13px,4vw,19px) + 8px - 34px)/2));background:#102936e8;color:#ffda86;border:1px solid #bd985b;}
#match-pk .pk-settings svg{width:22px;height:22px;flex-shrink:0;}

#match-pk .pk-extras{bottom:auto;right:5%;}

#match-pk .pk-resource-particle{position:absolute;pointer-events:none;font:bold 20px/1 system-ui;z-index:6;will-change:transform,opacity;}
#match-pk .pk-resource-particle.health{color:#9cffb2;text-shadow:0 0 5px #1bd675,0 0 12px #66ffa6;}
#match-pk .pk-resource-particle.energy{color:#d4bdff;text-shadow:0 0 5px #8363ff,0 0 14px #a487ff;}

#match-pk .pk-skill-orb{position:absolute;width:56px;height:56px;border-radius:50%;background:radial-gradient(circle,#fffce7 0 15%,#fff198 25%,#ffad25 45%,#ee5a09aa 65%,transparent 72%);box-shadow:0 0 18px #ffc53b,0 0 35px #ff8b28;pointer-events:none;}
#match-pk .pk-skill-orb::before{content:'';position:absolute;right:28px;top:15px;width:76px;height:26px;border-radius:50%;background:linear-gradient(90deg,transparent,#ff8b2388,#fff1a1);transform-origin:right center;transform:rotate(var(--shot-angle));filter:blur(3px);}
#match-pk .pk-skill-burst{position:absolute;width:76px;height:76px;border-radius:50%;border:3px solid #fff2a9;background:radial-gradient(circle,#fff9d8aa,#ffb52b77,transparent 70%);box-shadow:0 0 20px #ffbf36;pointer-events:none;}

#match-pk .pk-skill-orb{background:radial-gradient(circle,#fff 0 12%,#fff9cf 19%,#ffda55 35%,#ff9119bb 52%,transparent 70%);box-shadow:0 0 15px #fff0aa,0 0 30px #ffab27;}
#match-pk .pk-skill-orb::before{width:110px;height:22px;top:17px;background:linear-gradient(90deg,transparent,#fa652944,#ffb632bb,#fff8d4);filter:blur(2px);}
#match-pk .pk-charged-ring{position:absolute;inset:4px;border:2px solid #fff5b8;border-left-color:transparent;border-bottom-color:#ffac25;border-radius:50%;transform:rotate(-25deg);box-shadow:0 0 8px #fff3ab;}
#match-pk .pk-charged-core{position:absolute;inset:17px;background:#fff;border-radius:50%;box-shadow:0 0 10px 4px #fff5b9;}
#match-pk .pk-skill-spark{position:absolute;width:6px;height:6px;border-radius:50%;background:#fff3a9;box-shadow:0 0 7px #ffc146,0 0 12px #ff891a;pointer-events:none;}
#match-pk .pk-skill-burst{border:2px solid #fff1b7;box-shadow:0 0 18px #ffcf6b,inset 0 0 18px #ffd174;background:radial-gradient(circle,#fff4cfcc,transparent 65%);}
#match-pk .pk-skill-burst i{position:absolute;inset:10px;border:2px solid #ffb73e;border-radius:50%;}

#match-pk .pk-portrait{isolation:isolate;backface-visibility:hidden;}
#match-pk .pk-skill-flame{position:absolute;width:18px;height:32px;border-radius:70% 20% 65% 35%;background:radial-gradient(ellipse at 50% 80%,#fff9cc 0 16%,#ffda57 32%,#ff7e13 57%,#d62c0b88 72%,transparent 80%);box-shadow:0 0 10px #ff7d2577;pointer-events:none;}
#match-pk .pk-flame-tail{position:absolute;right:24px;top:5px;width:108px;height:46px;transform-origin:right center;transform:rotate(var(--shot-angle));clip-path:polygon(100% 12%,100% 88%,67% 69%,36% 96%,49% 64%,0 72%,30% 47%,6% 15%,54% 33%,41% 0,75% 27%);background:linear-gradient(90deg,transparent,#e7430cbb 28%,#ff8a1c 60%,#fff4aa);filter:drop-shadow(0 0 5px #ff8f1f);}

/* Fine fractures in the jade stone remain behind the item silhouettes. */
#match-pk .pk-tile::before{content:'';position:absolute;inset:1px;border-radius:inherit;background:url('tile-cracks.svg') center/100% 100% no-repeat;opacity:.65;pointer-events:none;z-index:0;}
#match-pk .pk-tile:nth-child(3n)::before{transform:rotate(90deg);opacity:.5;}
#match-pk .pk-tile:nth-child(5n)::before{transform:rotate(180deg);}
#match-pk .pk-tile .pk-item-art{position:relative;z-index:1;}

#match-pk .pk-tile::before{background-image:var(--pk-stone-cracks,url('tile-cracks.svg'));opacity:.75;transform:none;}
#match-pk .pk-tile:nth-child(3n)::before,#match-pk .pk-tile:nth-child(5n)::before{transform:none;opacity:.75;}

#match-pk .pk-tile::before,#match-pk .pk-tile:nth-child(3n)::before,#match-pk .pk-tile:nth-child(5n)::before{opacity:.9;}

#match-pk .pk-tile[data-art^="0:"] .pk-item-art,#match-pk .pk-projectile,#match-pk .pk-guide-item:first-child .pk-guide-icon{background-image:url('sword-viet-v2.png');background-size:contain!important;background-position:center!important;background-repeat:no-repeat;}

#match-pk .pk-tile::before,#match-pk .pk-tile:nth-child(3n)::before,#match-pk .pk-tile:nth-child(5n)::before{background-image:var(--pk-stone-cracks),url('stone-moss-atlas.png');background-size:100% 100%,300% 300%;background-position:center,var(--pk-stone-position);background-repeat:no-repeat;opacity:1;}

/* Keep the aged material quiet so colored items remain the visual focus. */
#match-pk .pk-tile::before,#match-pk .pk-tile:nth-child(3n)::before,#match-pk .pk-tile:nth-child(5n)::before{background-image:linear-gradient(#06172066,#06172099),var(--pk-stone-cracks),url('stone-moss-atlas.png');background-size:100% 100%,100% 100%,300% 300%;background-position:center,center,var(--pk-stone-position);filter:saturate(.35);opacity:1;}

#match-pk .pk-punch{position:absolute;width:58px;height:46px;pointer-events:none;filter:drop-shadow(0 0 5px #ffd581);}
#match-pk .pk-punch svg{width:100%;height:100%;transform:scaleX(var(--punch-direction));}
#match-pk .pk-punch-impact{position:absolute;width:66px;height:66px;border:2px solid #ffe5a4;border-radius:50%;background:radial-gradient(circle,#fff9dccc,#ffbb3d55 40%,transparent 65%);box-shadow:0 0 14px #ffb834;pointer-events:none;}

/* Character bubbles carry dialogue; the centered history header carries the turn. */
#match-pk .pk-turn-label,#match-pk .boss .pk-turn-label{max-width:94%;white-space:normal;}
#match-pk .pk-log{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;}
#match-pk .pk-history-turn,#match-pk .pk-history-detail{width:100%;text-align:center;font:inherit;color:inherit;}
#match-pk .pk-history-detail{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;}

/* Prominent turn-only panel and quieter dialogue styled like the jade/bronze HUD. */
#match-pk .pk-log{font:700 clamp(20px,5.5vw,26px)/1.15 system-ui,sans-serif;color:#fff3cb;text-shadow:0 1px 3px #0008;}
#match-pk .pk-turn-label,#match-pk .boss .pk-turn-label{font:700 clamp(12px,3.2vw,15px)/1.2 system-ui,sans-serif;padding:6px 8px;background:linear-gradient(145deg,#204650,#102b38);color:#fff0c7;border:1px solid #c6a567;border-radius:8px;box-shadow:0 2px 7px #0008,inset 0 1px #d2bc8522;text-shadow:0 1px 2px #0008;}
#match-pk .pk-turn-label::after,#match-pk .boss .pk-turn-label::after{width:8px;height:8px;bottom:-5px;background:#102b38;border-color:#c6a567;border-width:1px;}

#match-pk .pk-log{font-size:clamp(18px,4.8vw,23px);}
#match-pk .pk-log.showing-history{font:700 clamp(10px,2.6vw,13px)/1.2 system-ui,sans-serif;}
#match-pk .pk-history-detail{display:block;-webkit-line-clamp:unset;overflow:hidden;}
#match-pk .pk-history-turn[hidden],#match-pk .pk-history-detail[hidden]{display:none;}

/* An ornate jade victory card leaves the battle scenery at full brightness. */
#match-pk .pk-result{background:transparent;z-index:10;padding:22px;}
#match-pk .pk-result-box{position:relative;max-width:370px;overflow:hidden;padding:22px 22px 24px;border:2px solid #dbb66e;border-radius:18px;background:radial-gradient(ellipse at 50% 0,#3a6a68aa,transparent 65%),repeating-linear-gradient(135deg,#cfbd8410 0 1px,transparent 1px 16px),linear-gradient(150deg,#173e4b,#0c2534 65%,#163c47);box-shadow:0 10px 22px #0006,inset 0 0 0 4px #0a2330,inset 0 0 28px #ddad4214;color:#ffe6a5;}
#match-pk .pk-result-box::before{content:'';position:absolute;inset:7px;border:1px solid #bb965c80;border-radius:11px;pointer-events:none;}
#match-pk .pk-result-box::after{content:'';position:absolute;top:-60px;left:50%;width:240px;height:240px;border:1px solid #ddbb6933;border-radius:50%;transform:translateX(-50%);box-shadow:0 0 0 14px #ddbb6908,0 0 0 30px #ddbb6905;pointer-events:none;}
#match-pk .pk-result-box>*{position:relative;z-index:1;}
#match-pk .pk-result-emblem{display:block;width:104px;height:78px;margin:0 auto 12px;filter:drop-shadow(0 2px 4px #0008);}
#match-pk .pk-result-box>[data-ui="result-title"]{display:block;font:700 clamp(23px,6vw,30px)/1.15 Georgia,serif;letter-spacing:1px;color:#ffe3a0;text-shadow:0 2px 2px #0008,0 0 13px #e6ba4833;}
#match-pk .pk-result-box p{margin:14px 0;font:400 13px/1.65 system-ui,sans-serif;color:#e6e0c9;}
#match-pk .pk-result button{min-height:48px;margin-top:8px;border:1px solid #f4cf7f;border-radius:11px;background:linear-gradient(115deg,#85511e,#d1a34f 48%,#8d5924);color:#fff6dc;font:700 16px/1.2 system-ui,sans-serif;text-shadow:0 1px 2px #5b3519;box-shadow:inset 0 1px #fff5c477,0 3px 7px #0004;}
#match-pk .pk-result button:active{transform:translateY(1px);filter:brightness(1.1);}
#match-pk .pk-result[data-victory="false"] .pk-result-emblem{filter:grayscale(.7) drop-shadow(0 2px 4px #0008);}

#match-pk .pk-resource-particle.gold{width:17px;height:17px;display:flex;align-items:center;justify-content:center;border:2px solid #f8d97b;border-radius:50%;background:radial-gradient(circle at 30% 25%,#ffe891,#d79222);color:#975f12;font-size:12px;box-shadow:0 0 8px #ffd55c88;}
#match-pk .pk-resource-particle.rice{width:27px;height:27px;background:url('items-3d.png') 50% 100%/300% 200% no-repeat;filter:drop-shadow(0 0 4px #ffdb7188);}

/* Floating arcade result lettering over the live board, without a modal card. */
#match-pk .pk-result{background:transparent;padding:0;}
#match-pk .pk-result-box{position:absolute;left:5%;top:var(--pk-result-top,30%);width:90%;max-width:none;padding:0;overflow:visible;border:0;border-radius:0;background:none;box-shadow:none;}
#match-pk .pk-result-box::before,#match-pk .pk-result-box::after{display:none;}
#match-pk .pk-result-box>[data-ui="result-title"]{font:900 clamp(52px,17vw,78px)/1.2 system-ui,sans-serif;letter-spacing:2px;color:#ec3520;-webkit-text-stroke:3px #ffdb73;paint-order:stroke fill;text-shadow:0 3px 0 #8b3016,0 0 4px #fff2b0,0 0 9px #ffcf37,0 0 18px #ff8c16;transform:rotate(-8deg);animation:pk-result-pop .8s cubic-bezier(.22,.61,.36,1);}
#match-pk .pk-result[data-victory="false"] [data-ui="result-title"]{color:#e53938;}
#match-pk .pk-result-box p{max-width:290px;margin:24px auto 12px;padding:9px 12px;border:1px solid #b3925966;border-radius:9px;background:#102b38e8;color:#fff0ce;font:500 12px/1.5 system-ui,sans-serif;box-shadow:0 2px 6px #0004;}
#match-pk .pk-result button{display:block;width:min(240px,80%);margin:0 auto;}
@keyframes pk-result-pop{from{transform:translateY(12px) rotate(-8deg) scale(.88);opacity:0}75%{transform:translateY(0) rotate(-8deg) scale(1.02);opacity:1}to{transform:translateY(0) rotate(-8deg) scale(1);opacity:1}}
@media(prefers-reduced-motion:reduce){#match-pk .pk-result-box>[data-ui="result-title"]{animation:none;}}

#match-pk .pk-resource-particle.herbs{width:27px;height:27px;background:url('items-3d.png') 50% 0%/300% 200% no-repeat;filter:drop-shadow(0 0 4px #74db8888);}
#match-pk .pk-log:not(.showing-history){font-size:clamp(16px,4.2vw,21px);}
#match-pk .pk-controls [data-ui="hint"]{padding:0 8px;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center;}
#match-pk .pk-lower-art{background-image:url('reference-skin-no-bulb.png');}

#match-pk .pk-match-flash{background:radial-gradient(circle,#fff9d299,var(--burst) 45%,transparent 80%);border:1px solid #fff5b9;box-shadow:0 0 10px var(--burst);}

#match-pk .pk-resource-particle.scroll{width:27px;height:27px;background:url('items-3d.png') 100% 100%/300% 200% no-repeat;filter:drop-shadow(0 0 4px #b9e7cf88);}
#match-pk .pk-controls [data-ui="hint"]{align-items:flex-start;text-align:left;padding-left:14px;padding-right:6px;}
#match-pk .pk-controls [data-ui="hint"]{align-items:center;text-align:center;padding-left:10px;padding-right:24px;}
#match-pk .pk-controls [data-ui="hint"]{padding-left:8px;padding-right:34px;}

#match-pk .pk-countdown{flex:none;height:20px;line-height:20px;margin-top:4px;width:100%;text-align:center;font:700 17px/20px system-ui,sans-serif;font-variant-numeric:tabular-nums;color:#ffe3a1;text-shadow:0 1px 3px #000;}
#match-pk .pk-countdown.urgent{color:#ffad8e;}
#match-pk .pk-countdown[hidden]{display:none;}

/* Time remaining shares the history panel rather than taking a separate row. */
#match-pk .pk-log{gap:2px;}
#match-pk .pk-log .pk-countdown{width:100%;height:auto;margin:0;font:700 13px/1.1 system-ui,sans-serif;color:#eed49e;}
#match-pk .pk-log .pk-countdown.urgent{color:#ffad8e;}
#match-pk .pk-history-detail{max-height:24px;}
#match-pk .pk-controls [data-ui="hint"]{padding-left:6px;padding-right:46px;}
#match-pk .pk-log{height:54px;min-height:54px;max-height:54px;}
#match-pk .pk-history-detail{max-height:27px;}

#match-pk .pk-start-actions{display:flex;align-items:center;justify-content:center;gap:12px;width:100%;}
#match-pk .pk-start-actions[hidden]{display:none;}
#match-pk .pk-start-actions button{border:1px solid #d5b36c;border-radius:9px;padding:8px 14px;background:linear-gradient(#c7a15b,#775024);color:#fff7de;font:700 15px/1.15 system-ui,sans-serif;text-shadow:0 1px 2px #39280f;}
#match-pk .pk-start-actions button:last-child{background:#123747;color:#eed49e;font-size:12px;padding:8px;}

#match-pk .pk-quick-sound{right:calc(5% + 80px);}
#match-pk .pk-quick-guide{position:absolute;top:58%;right:calc(5% + 40px);width:34px;height:34px;padding:6px;display:flex;align-items:center;justify-content:center;border:1px solid #bd985b;border-radius:50%;background:#102936e8;color:#ffda86;z-index:9;box-shadow:0 2px 5px #0007;transform:translateY(calc((clamp(13px,4vw,19px) + 8px - 34px)/2));}
#match-pk .pk-quick-guide svg{width:22px;height:22px;pointer-events:none;}

#match-pk .pk-extras{right:auto;box-sizing:border-box;border-radius:10px;background:#102936fa;}
#match-pk .pk-settings-scroll{flex:1;}

#match-pk .pk-session-actions{flex-shrink:0;display:flex;gap:8px;padding:10px 12px 2px;background:#102936;border-top:1px solid #345361;}
#match-pk .pk-session-actions button{flex:1;min-height:36px;border:1px solid #c5a165;border-radius:6px;background:linear-gradient(#6c542d,#3b3526);color:#fff3cb;font:600 12px system-ui;}
#match-pk .pk-session-actions button:last-child{background:#163743;border-color:#658a8c;}
#match-pk .pk-session-actions button:disabled{opacity:.5;}
#match-pk .pk-extras[data-mode="guide"] .pk-session-actions{display:none;}

#match-pk .pk-intro-section{position:relative;background:#102936;}
#match-pk .pk-extras[data-mode="settings"] .pk-intro-section{position:sticky;top:0;z-index:1;}
#match-pk .pk-intro-section .pk-session-actions{position:absolute;top:10px;right:10px;padding:0;gap:6px;border:0;z-index:2;}
#match-pk .pk-intro-section .pk-session-actions button{flex:none;min-height:26px;padding:4px 8px;font:600 11px/1.2 system-ui;}
#match-pk .pk-extras[data-mode="settings"] .pk-intro-section summary{padding-right:155px;}

#match-pk .pk-turn-notice{position:absolute;left:3%;width:94%;z-index:6;pointer-events:none;text-align:center;font:900 clamp(24px,7.3vw,36px)/1.3 system-ui,sans-serif;color:#ec3520;-webkit-text-stroke:1.5px #ffdb73;paint-order:stroke fill;text-shadow:0 2px 0 #8b3016,0 0 4px #fff2b0,0 0 9px #ffcf37,0 0 18px #ff8c16;transform:rotate(-6deg);}
#match-pk .pk-turn-notice[hidden]{display:none;}

#match-pk .pk-turn-notice small{display:block;margin-top:8px;font:700 clamp(13px,3.6vw,17px)/1.25 system-ui,sans-serif;color:#fff3cb;-webkit-text-stroke:0;text-shadow:0 2px 3px #000,0 0 7px #bf7823;}

#match-pk .pk-log:not(.showing-history){font-size:clamp(13px,3.5vw,17px);}
#match-pk .pk-log .pk-countdown{font-size:15px;line-height:1.2;}
#match-pk .pk-log .pk-countdown.urgent{color:#ff5353;animation:pk-clock-alert .65s ease-in-out infinite;text-shadow:0 0 5px #b81818;}
@keyframes pk-clock-alert{0%,100%{opacity:1}50%{opacity:.4}}
@media(prefers-reduced-motion:reduce){#match-pk .pk-log .pk-countdown.urgent{animation:none;}}
#match-pk .pk-log:not(.showing-history){font-size:clamp(10px,2.6vw,13px);}

#match-pk .pk-board-frame::after{content:'';position:absolute;inset:0;pointer-events:none;z-index:6;opacity:0;background:radial-gradient(ellipse at center,#e51b2420 25%,#e51b2480 100%);box-shadow:inset 0 0 35px 8px #ff2525a0;}
#match-pk .pk-phone.pk-time-warning .pk-board-frame::after{animation:pk-screen-clock-alert .9s ease-in-out infinite;}
@keyframes pk-screen-clock-alert{0%,100%{opacity:.12}50%{opacity:.75}}
@media(prefers-reduced-motion:reduce){#match-pk .pk-phone.pk-time-warning .pk-board-frame::after{animation:none;opacity:.3;}}
#match-pk .pk-damage.heal{color:#ff6262;text-shadow:0 1px 3px #450a10,0 0 6px #ff303070;}
#match-pk .pk-damage,#match-pk .pk-damage.heal{color:#ff4545;font-weight:900;font-size:clamp(19px,5vw,24px);-webkit-text-stroke:1px #fff0cf;paint-order:stroke fill;text-shadow:0 2px 2px #34040b,0 0 4px #34040b,0 0 9px #ff545480;}

#match-pk .pk-skill-lightning{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;filter:drop-shadow(0 0 4px #65cfff) drop-shadow(0 0 8px #1b85e6);}
#match-pk .pk-skill-lightning path{fill:none;stroke:#d6f7ff;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;}
#match-pk .pk-skill-lightning path.strike{stroke:#fff8d7;stroke-width:2.5;}

#match-pk .pk-damage.energy{color:#3ce88a;-webkit-text-stroke:1px #e1fff0;text-shadow:0 2px 2px #05251b,0 0 4px #05251b,0 0 9px #32de8b70;}
#match-pk .pk-damage,#match-pk .pk-damage.heal{font-size:clamp(17px,4.5vw,21px);-webkit-text-stroke:1px #fff4dc;paint-order:stroke fill;text-shadow:0 2px 2px #251018,0 0 4px #251018;}
#match-pk .pk-damage.energy{color:#429dff;-webkit-text-stroke:1px #e6f4ff;text-shadow:0 2px 2px #041c3a,0 0 4px #041c3a,0 0 7px #247fff55;}

#match-pk .pk-skill-lightning path{stroke-width:3;}
#match-pk .pk-skill-lightning path.strike{stroke-width:3.5;}
/* Lift item highlights and shadows while retaining the original cracked stone. */
#match-pk .pk-tile .pk-item-art{filter:brightness(1.14) contrast(1.08) drop-shadow(0 2px 2px #000b) drop-shadow(0 -1px 1px #fff3);}

#match-pk .pk-tile .pk-special{position:absolute;z-index:3;pointer-events:none;filter:drop-shadow(0 1px 2px #000);}

#match-pk .pk-tile[data-art$=":3"]{box-shadow:inset 0 0 0 2px #f1c55e,inset 0 0 9px #e9ab3560,0 0 3px #ffc95780;}
#match-pk .pk-special:empty{display:none;}
#match-pk .pk-tile .pk-special,#match-pk .pk-special-preview .pk-special{right:1px;bottom:1px;width:18px;height:18px;padding:2px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;border:1px solid #ffec9c;border-radius:50%;background:linear-gradient(145deg,#ffe190,#b7771f);box-shadow:0 1px 3px #000b,0 0 4px #ffd76c90;}
#match-pk .pk-special svg{width:13px;height:13px;fill:#fff4b5;stroke:#78461a;stroke-width:1.5;}
#match-pk .pk-special-preview{position:relative;background-position:100% 0%;box-shadow:inset 0 0 0 2px #f1c55e,0 0 5px #e9ab3560;}
#match-pk .pk-tile .pk-special:empty{display:none;}
#match-pk .pk-tile::before,#match-pk .pk-tile:nth-child(3n)::before,#match-pk .pk-tile:nth-child(5n)::before{inset:0;background-image:linear-gradient(#06172022,#06172044),url('stone-moss-atlas-v2.png');background-size:100% 100%,300% 300%;background-position:center,var(--pk-stone-position);filter:none;opacity:1;}
#match-pk .pk-tile.selected{z-index:4;outline:2px solid #fff1a2;outline-offset:-2px;box-shadow:inset 0 0 0 3px #e9b83f,inset 0 0 13px #ffc83d80,0 0 9px #ffd04db0;}
#match-pk .pk-tile.selected .pk-item-art{filter:brightness(1.35) contrast(1.08) drop-shadow(0 0 3px #ffdd7a90);}

#match-pk .pk-tile.selected{outline:3px solid #ffd02b;outline-offset:-3px;box-shadow:inset 0 0 0 4px #b97909,inset 0 0 0 6px #ffe67c,0 0 8px #ffd02ba0;}
#match-pk .pk-tile.selected{outline:3px solid #ffd028;outline-offset:-3px;box-shadow:none;animation:none;}
#match-pk .pk-tile.selected .pk-item-art{filter:brightness(1.14) contrast(1.08) drop-shadow(0 2px 2px #000b) drop-shadow(0 -1px 1px #fff3);}
#match-pk .pk-tile.selected::after{content:'';position:absolute;inset:0;z-index:5;border:3px solid #ffd028;border-radius:inherit;box-sizing:border-box;pointer-events:none;background:transparent;}

#match-pk .pk-skill-lightning path.strike{stroke-width:7;filter:drop-shadow(0 0 5px #fff3b0) drop-shadow(0 0 10px #57baff);}

#match-pk .pk-tile::after{content:'';position:absolute;inset:0;z-index:5;border:3px solid #ffd028;border-radius:inherit;box-sizing:border-box;pointer-events:none;background:transparent;box-shadow:inset 0 0 5px #ffd34d70,0 0 5px #ffd34d60;opacity:0;transition:opacity .16s ease-out;}
#match-pk .pk-tile.selected{outline:none;box-shadow:none;}
#match-pk .pk-tile.selected::after{opacity:1;}
#match-pk .pk-tile::after,#match-pk .pk-tile.selected::after{border-width:2px;border-color:#e7c86b;box-shadow:inset 0 0 4px #e7c86b40,0 0 4px #e7c86b40;}
#match-pk .pk-tile.selected::after{opacity:.85;}

#match-pk .pk-tile::after{transition:none;}

#match-pk .pk-tile.double-sword .pk-item-art{filter:brightness(1.2) drop-shadow(0 0 3px #f5b836);}
#match-pk .pk-tile.double-sword .pk-item-art::after{content:'×2';position:absolute;left:1px;top:1px;padding:1px 3px;border:1px solid #ffe294;border-radius:4px;background:#492613;color:#fff0b0;font:900 10px/1.15 system-ui;text-shadow:0 1px #000;}

#match-pk .pk-tile.double-sword .pk-item-art{background-image:none!important;}
#match-pk .pk-tile.double-sword .pk-item-art::before{content:'';position:absolute;inset:0;background:url('sword-special.png') center/contain no-repeat;transform:rotate(180deg);}
/* Open board trial: floating items over a muted jade surface. */
#match-pk .pk-board{background:linear-gradient(145deg,#35565b,#28454d 60%,#304f54);border-radius:7px;}
#match-pk .pk-tile{background:transparent!important;border:0;box-shadow:none;}
#match-pk .pk-tile::before,#match-pk .pk-tile:nth-child(3n)::before,#match-pk .pk-tile:nth-child(5n)::before{display:none;}
#match-pk .pk-tile[data-art$=":3"]{box-shadow:inset 0 0 0 1px #e7bd65,inset 0 0 8px #e9ab3525;}
#match-pk .pk-resource-particle.energy{font-size:28px;font-weight:900;color:#e7e0ff;text-shadow:0 0 3px #b6a2ff,0 0 8px #9871ff,0 0 15px #7052ee;}
#match-pk .pk-board{background:linear-gradient(145deg,#2b484d,#213b43 60%,#28464b);}

#match-pk .pk-tile.double-sword .pk-item-art::after{display:none;}
#match-pk .pk-double-sword-guide{position:relative;background-image:none;}
#match-pk .pk-double-sword-guide::before{content:'';position:absolute;inset:0;background:url('sword-special.png') center/contain no-repeat;transform:rotate(180deg);}

#match-pk .pk-tile[data-art^="1:"] .pk-item-art,#match-pk .pk-heal-guide{background-image:url('banh-chung.png');background-size:contain!important;background-position:center!important;background-repeat:no-repeat;}
#match-pk .pk-tile[data-art^="1:"] .pk-item-art,#match-pk .pk-heal-guide{background-size:80% 80%!important;}

#match-pk .pk-turn-notice small{display:table;margin:10px auto 0;padding:6px 10px;border:1px solid #d7b36e88;border-radius:7px;background:#102b3be8;font:800 clamp(15px,4vw,19px)/1.3 system-ui;color:#ffe39b;text-shadow:0 1px 2px #000;}

#match-pk .pk-map-button{position:absolute;top:5px;left:5%;width:34px;height:34px;padding:6px;display:flex;align-items:center;justify-content:center;border:1px solid #bd985b;border-radius:50%;background:#102936e8;color:#ffda86;z-index:6;box-shadow:0 2px 5px #0007;}
#match-pk .pk-map-button svg{width:22px;height:22px;}

#match-pk .pk-map-button{position:absolute;top:4px;left:5%;width:clamp(57px,calc(12vw + 18px),75px);height:22px;min-height:0;margin:0;padding:3px 6px;border-radius:5px;font:600 10px/1.2 system-ui;box-shadow:none;background:#102936b8;white-space:nowrap;}

#match-pk .pk-intro-section .pk-session-actions{gap:4px;right:8px;}
#match-pk .pk-intro-section .pk-session-actions button{font-size:10px;padding:4px 6px;}
#match-pk .pk-extras[data-mode="settings"] .pk-intro-section summary{padding-right:190px;}

/* Lower the board/history slightly and keep a clear gap before dialogue. */
#match-pk .pk-board-frame,#match-pk .pk-log{transform:translateY(6px);}
#match-pk .pk-turn-label,#match-pk .boss .pk-turn-label{top:-28px;transform:none;}
#match-pk .pk-lives,#match-pk .pk-quick-sound,#match-pk .pk-quick-guide,#match-pk .pk-settings{top:calc(58% + 6px);}
#match-pk .pk-map-button{top:10px;}

#match-pk .pk-tile.pk-sword-charged .pk-item-art{filter:brightness(1.65) drop-shadow(0 0 4px #e4faff) drop-shadow(0 0 9px #65cfff);transition:filter .18s ease-out;}
#match-pk .pk-tile.double-sword.pk-sword-charged .pk-item-art{filter:brightness(1.65) drop-shadow(0 0 4px #fff6c4) drop-shadow(0 0 9px #ffd363);}
#match-pk .pk-energy-ring{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:3;--ring-color:#b7fbff;filter:drop-shadow(0 0 3px #30dfff);}
#match-pk .pk-energy-ring[hidden]{display:none;}
#match-pk .pk-energy-ready-gold .pk-energy-ring{--ring-color:#fff3bc;filter:drop-shadow(0 0 4px #ffc94a);}
#match-pk .pk-energy-ring rect{fill:none;stroke:var(--ring-color);vector-effect:non-scaling-stroke;stroke-width:2;}
#match-pk .pk-energy-ring-base{opacity:.25;}
#match-pk .pk-energy-ring-runner{stroke-dasharray:18 82;stroke-linecap:round;animation:pk-energy-orbit 1.8s linear infinite;}
@keyframes pk-energy-orbit{from{stroke-dashoffset:100}to{stroke-dashoffset:0}}
@media(prefers-reduced-motion:reduce){#match-pk .pk-energy-ring-runner{animation:none;stroke-dasharray:none;}}
/* Full-energy highlights should remain visible beyond the HUD edges. */
#match-pk .pk-energy-ring{filter:drop-shadow(0 0 4px #a6faff) drop-shadow(0 0 8px #26dfff);}
#match-pk .pk-energy-ready-gold .pk-energy-ring{filter:drop-shadow(0 0 4px #fff2ba) drop-shadow(0 0 9px #ffbf31);}
#match-pk .pk-energy-ring rect{stroke-width:3.5;}
#match-pk .pk-energy-ring-runner{stroke-dasharray:25 75;}
#match-pk .pk-energy-ready{overflow:visible;}
/* Single-player notices share the readable LAN typography and palette. */
#match-pk .pk-turn-notice{font:900 clamp(28px,8vw,38px)/1.3 system-ui,sans-serif;color:#ff432c;-webkit-text-stroke:1.5px #fff0bd;paint-order:stroke fill;text-shadow:0 2px 2px #4a1704,0 0 4px #4a1704,0 0 14px #f3b144;filter:drop-shadow(0 2px 4px #061923);}
#match-pk .pk-turn-notice small{display:block;width:fit-content;max-width:94%;box-sizing:border-box;margin:8px auto 0;padding:6px 10px;border:1px solid #dbb76c;border-radius:8px;background:#092734f2;color:#ffe5a1;font:800 clamp(14px,3.8vw,17px)/1.4 system-ui,sans-serif;-webkit-text-stroke:0;text-shadow:0 1px 2px #000;box-shadow:0 2px 7px #0008;}
