/* Custom Kulami editor, shared compact Pentago controls and 3D viewport. */
html body #compactSettings178>[hidden]{display:none!important}
html body dialog.kulami-designer179{width:min(640px,calc(100vw - 16px));max-width:none;max-height:95dvh;padding:16px;border:1px solid #61c7c4;border-radius:18px;background:#0b3044;color:#f5faff;overflow:auto;box-sizing:border-box}
html body dialog.kulami-designer179::backdrop{background:#001521c9}
html body .kulami-designer179 h2{font-size:22px;margin:0 0 8px}
html body .kulami-designer179 p{font-size:14px;line-height:1.4;margin:8px 0}
html body .kd-grid179{position:relative;width:100%;aspect-ratio:1;background:repeating-linear-gradient(0deg,transparent 0 calc(10% - 1px),#8dbab544 calc(10% - 1px) 10%),repeating-linear-gradient(90deg,#143d4b 0 calc(10% - 1px),#8dbab544 calc(10% - 1px) 10%);border:2px solid #5d9198;touch-action:none}
html body .kd-grid179 .kd-tile179{position:absolute;display:grid;gap:10%;min-height:0!important;min-width:0!important;margin:0!important;padding:5px!important;border:2px solid #503013!important;border-radius:6px!important;background:repeating-linear-gradient(8deg,#b78045 0px,#c28e54 2px,#a9713c 4px);box-shadow:inset 0 1px 3px #ffe2a5;touch-action:none}
html body .kd-grid179 .kd-tile179.selected{outline:3px solid #ffe17c;outline-offset:-3px;z-index:2}
html body .kd-tile179 i{display:block;align-self:center;justify-self:center;width:60%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 65% 70%,#a97640,#46200e);box-shadow:inset 0 2px 3px #241006}
html body .kd-buttons179{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;margin-top:10px}
html body .kd-buttons179 button{min-height:44px;padding:6px;font-size:16px}
html body .kd-buttons179 button:nth-last-child(-n+2){grid-column:span 2}
html body .kd-footer179{display:grid;grid-template-columns:1fr 1fr;gap:8px}
html body .kd-footer179 button{min-height:44px;font-size:16px;padding:8px}
html body[data-playgame="pentago"] #gameRoot .pen-layout179{display:flex!important;flex-direction:column!important;width:100%!important;gap:8px!important}
html body[data-playgame="pentago"] #gameRoot .pen-controls179{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%!important;padding:10px!important;border-radius:14px;background:#0a3044;box-sizing:border-box}
html body #gameRoot .pen-controls179 label{display:grid!important;gap:5px!important;min-width:0!important;margin:0!important;font-size:14px!important}
html body #gameRoot .pen-controls179 select{width:100%!important;min-width:0!important;min-height:44px!important;padding:8px 5px!important;font-size:16px!important;background:#163f50;color:white;border:1px solid #427789;border-radius:10px}
html body #gameRoot .pen-controls179>button{min-width:0!important;min-height:44px!important;margin:0!important;padding:8px!important;align-self:end;font-size:15px!important}
html body #gameRoot .pen-instruction179{display:flex;align-items:center;justify-content:center;min-width:0;font-size:14px;line-height:1.3;text-align:center}
html body[data-playgame="pentago"] #gameRoot .pen-scene{display:flex!important;flex-direction:column!important;gap:8px!important;width:100%!important;min-height:0!important;padding:8px!important;box-sizing:border-box!important;overflow:hidden!important}
html body #gameRoot .pen-hud179{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;gap:6px;flex:0 0 auto}
html body #gameRoot .pen-hud179>div{display:flex;align-items:center;flex-wrap:wrap;gap:5px;padding:7px;border:1px solid #417482;border-radius:10px;background:#082c3e;font-size:13px;line-height:1.3}
html body #gameRoot .pen-hud179 .active{border-color:#efcd79}
html body #gameRoot .pen-hud179 .pen-turn-dot{width:18px;height:18px;flex:0 0 18px}
html body #gameRoot .pen-hud179 b{font-size:21px;color:#fff0c7}
html body #gameRoot .pen-viewport179{position:relative;width:100%;height:clamp(320px,65vh,680px);min-height:320px;overflow:hidden;touch-action:none;border-radius:12px}
html body #gameRoot .pen-viewport179 canvas{display:block;width:100%!important;height:100%!important}
html body #gameRoot .pen-webgl179>.pen-board{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%)!important;pointer-events:none!important}
html body #gameRoot .pen-webgl179>.pen-board:focus-within{position:relative!important;width:min(90%,500px)!important;height:auto!important;clip-path:none!important;overflow:visible!important;pointer-events:auto!important}
html body[data-playgame="pentago"] #gameRoot .pen-viewport179 .pen-3d-directions179{position:absolute!important;inset:auto!important;left:var(--pen-x,50%)!important;top:var(--pen-y,50%)!important;transform:translate(-50%,-50%)!important;width:min(160px,38%)!important;max-width:none!important;z-index:8!important;display:flex!important;gap:5px!important;margin:0!important;padding:0!important;background:transparent!important}
html body[data-playgame="pentago"] #gameRoot .pen-3d-directions179 button{min-height:44px!important;min-width:0!important;font-size:18px!important;padding:10px 3px!important;background:rgba(255,201,60,.35)!important;pointer-events:auto;color:#08283a!important;text-shadow:0 0 4px white}
html body #gameRoot .pen-view-controls179{position:absolute;right:8px;bottom:8px;display:flex;gap:5px;z-index:9}
html body #gameRoot .pen-view-controls179 button{width:44px;min-height:44px;padding:4px;font-size:24px;background:#082b3acc;color:#fff;border:1px solid #78bac5;border-radius:10px}
html body #gameRoot .pen-layout179 .pen-rotor{background:repeating-linear-gradient(8deg,#a76d37 0,#ba854d 3px,#996134 6px)!important;border-color:#d4ae79!important;box-shadow:inset 2px 3px 4px #ffe3ad88,0 7px 0 #59351e,0 12px 10px #0008!important}
html body #gameRoot .pen-layout179 .pen-hole{background:radial-gradient(ellipse at 60% 70%,#bf8a4e,#603715 65%,#301608)!important;box-shadow:inset 2px 4px 6px #281105,0 1px 2px #f4c992!important}
