@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');
:root{--ink:#17263c;--muted:#718198;--line:#dfe7ef;--blue:#39d6ff;--deep:#182b52;--violet:#725cf2;--paper:#f7f9fc;--green:#49d3a0;--orange:#ffb353}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:'DM Sans',Arial,sans-serif}button{font:inherit;cursor:pointer;border:0}.topbar{height:76px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 clamp(22px,5vw,78px)}.brand{display:flex;align-items:center;gap:13px}.brand img{width:45px;height:45px;object-fit:contain}.brand strong{display:block;font:700 15px 'Space Grotesk';letter-spacing:.09em}.brand span{color:var(--muted);font-size:11px;letter-spacing:.04em}.top-actions{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px}.live-dot{width:7px;height:7px;background:var(--green);border-radius:50%;box-shadow:0 0 0 4px #e4faf2}.top-actions button{margin-left:18px;background:var(--deep);color:#fff;border-radius:8px;padding:10px 15px;font-size:12px}.shell{max-width:1440px;margin:auto;padding:36px clamp(22px,5vw,78px) 20px}.intro{display:flex;justify-content:space-between;align-items:flex-end;margin-bottom:27px}.eyebrow,.view-label{color:#7990aa;font-size:10px;font-weight:700;letter-spacing:.15em;margin:0 0 8px}.intro h1{font:700 clamp(27px,3vw,42px) 'Space Grotesk';letter-spacing:-.04em;margin:0 0 8px}.intro p:not(.eyebrow){color:var(--muted);max-width:645px;line-height:1.6;margin:0;font-size:14px}.timer-card{border-left:1px solid var(--line);padding-left:32px;min-width:155px}.timer-card span{font-size:10px;letter-spacing:.15em;color:#91a1b3}.timer-card strong{display:block;font:700 28px 'Space Grotesk';margin-top:4px}.workspace{display:grid;grid-template-columns:1fr 1fr;gap:18px}.panel,.control-card{background:#fff;border:1px solid var(--line);border-radius:15px;box-shadow:0 8px 28px #182b5208}.panel{padding:21px}.panel-heading,.card-title{display:flex;justify-content:space-between;align-items:flex-start}.panel h2,.control-card h2{margin:0;font:600 17px 'Space Grotesk'}.truth-badge,.world-badge,.mood,.step{font-size:9px;letter-spacing:.12em;padding:7px 9px;border-radius:5px;background:#e9fbf7;color:#21a881;font-weight:700}.world-badge{background:#f0edff;color:var(--violet)}.board-2d{aspect-ratio:1;max-width:520px;margin:19px auto 12px;display:grid;grid-template-columns:repeat(4,1fr);gap:10px;padding:14px;background:#edf2f7;border-radius:13px;box-shadow:inset 0 0 0 1px #dbe4ed}.board-cell{position:relative;background:linear-gradient(145deg,#fff,#e7edf4);border:1px solid #d5dee8;border-radius:11px;min-width:0;display:flex;align-items:center;justify-content:center;font:700 clamp(18px,2.6vw,29px) 'Space Grotesk';color:#314864;box-shadow:0 7px 0 #c5d0dd,0 11px 14px #36516a15;transition:.2s}.board-cell:after{content:'';position:absolute;width:30%;height:30%;border:2px solid #c7d3df;border-radius:50%;opacity:.45}.board-cell:hover{transform:translateY(-3px)}.board-cell.selected{color:#fff;background:linear-gradient(145deg,#4fe2ff,#37afd8);border-color:#19a5d4;box-shadow:0 7px 0 #168ab3,0 0 0 4px #39d6ff44,0 12px 25px #39d6ff55}.board-cell.placed{color:#fff;background:linear-gradient(145deg,#54dcb0,#25b983);box-shadow:0 7px 0 #159368}.owner-mark{position:absolute;z-index:1;top:6px;right:7px;font-size:10px;color:#fff}.board-legend,.world-controls{display:flex;justify-content:space-between;color:var(--muted);font-size:11px}.board-legend span{display:flex;align-items:center;gap:5px}.legend-dot{width:8px;height:8px;border-radius:50%;background:var(--blue)}.placed-dot{background:var(--green)}.world-3d{height:410px;margin-top:17px;border-radius:12px;position:relative;overflow:hidden;background:radial-gradient(circle at 50% 15%,#ffe9b8 0,#9d91ef 43%,#263b70 100%);perspective:900px}.sky-glow{position:absolute;width:240px;height:240px;background:#fff1b966;filter:blur(22px);border-radius:50%;left:50%;top:10px;transform:translateX(-50%)}.king-stage{position:absolute;z-index:3;left:50%;top:16px;transform:translateX(-50%);text-align:center}.king{width:118px;height:144px;object-fit:contain;filter:drop-shadow(0 15px 12px #182b5250);animation:float 3.5s ease-in-out infinite}.king-shadow{height:13px;width:90px;margin:-13px auto 0;background:#182b5240;border-radius:50%;filter:blur(5px)}.speech{position:absolute;z-index:4;white-space:nowrap;right:92px;top:17px;background:#fff;color:var(--ink);padding:11px 15px;border-radius:14px 14px 3px 14px;box-shadow:0 8px 20px #182b5222;font-size:11px}.speech:after{content:'';position:absolute;right:-8px;bottom:4px;border-width:7px 0 0 10px;border-style:solid;border-color:transparent transparent transparent #fff}.pyramid{position:absolute;z-index:2;bottom:51px;left:50%;width:380px;height:190px;transform:translateX(-50%) rotateX(57deg) rotateZ(45deg);transform-style:preserve-3d}.pyramid:before,.pyramid:after{content:'';position:absolute;inset:0;border-radius:18px;background:linear-gradient(135deg,#70e3fa,#258bc8);box-shadow:inset 0 0 0 2px #ffffff55,0 15px 0 #185b91,0 22px 29px #061a4240}.pyramid:after{transform:translateZ(33px) scale(.82);background:linear-gradient(135deg,#8becf5,#40b6dc);box-shadow:inset 0 0 0 2px #ffffff66,0 13px 0 #1682ae}.world-floor{position:absolute;bottom:0;left:-10%;width:120%;height:100px;background:linear-gradient(#182b5200,#182b5266);transform:skewY(-4deg)}@keyframes float{50%{transform:translateY(-7px) rotate(1deg)}}.world-controls{padding-top:12px}.hint{color:var(--violet)}.control-grid{display:grid;grid-template-columns:1.35fr 1fr .78fr;gap:18px;margin-top:18px}.control-card{padding:21px;min-height:235px}.step{background:#f2f5fa;color:#7b8ba0}.step b{color:var(--ink)}.equation{display:flex;align-items:center;justify-content:center;gap:9px;margin:25px 0 11px;font:700 28px 'Space Grotesk'}.op-select,.result-tile{background:#ece9ff;color:var(--violet);border-radius:7px;min-width:38px;height:38px;font-size:22px}.result-tile{background:#fff5e1;color:#d99827;border:1px dashed #e7b85c}.operation-menu{display:none;gap:5px;justify-content:center;margin-bottom:12px}.operation-menu.show{display:flex}.operation-menu button{width:32px;height:30px;background:#f0edff;color:var(--violet);border-radius:5px}.hand{display:flex;gap:7px;justify-content:center}.hand-tile{padding:8px 11px;background:#fff;border:1px solid #dbe4ed;border-radius:7px;box-shadow:0 3px 0 #dce5ec;color:#314864;font-weight:700}.hand-tile.active{background:#fff2d7;border-color:#f4bf59;color:#b47813;box-shadow:0 3px 0 #e7b24e}.feedback{margin:16px 0;color:var(--muted);font-size:11px;min-height:17px}.primary,.secondary{width:100%;padding:12px;border-radius:7px;font-weight:700;font-size:12px}.primary{background:var(--deep);color:#fff}.primary span,.secondary span{float:right;font-size:17px;line-height:12px}.secondary{background:#edfaff;color:#148aaa;margin-top:18px}.king-card p{color:var(--muted);font-size:12px;line-height:1.6;max-width:270px}.hint-levels{display:flex;gap:5px;flex-wrap:wrap;margin-top:15px}.hint-levels span{border-radius:5px;background:#f2f5f9;padding:6px 7px;color:#9aa8b7;font-size:10px}.hint-levels .active{background:#e5f9ff;color:#128eae}.calculator-card{padding:0;overflow:hidden}.drag-handle{height:43px;padding:13px 16px;border-bottom:1px solid var(--line);font-size:10px;color:var(--muted);letter-spacing:.1em}.drag-handle>span:first-child{color:var(--violet);font-size:15px;margin-right:6px}.drag-handle .calc-title{color:var(--muted);font-size:10px;margin-right:0}.drag-handle button{float:right;background:none;color:#9aa8b7;font-size:18px;line-height:12px}.calc-display{margin:15px 16px 10px;padding:11px;background:#f4f7fb;border-radius:6px;text-align:right;font:600 21px 'Space Grotesk';min-height:45px;overflow:hidden}.calc-keys{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:0 16px 16px}.calc-keys button{height:30px;background:#f2f5f9;border-radius:5px;color:#51677f;font-size:12px}.calc-keys button:nth-child(3n+3),.calc-keys button:last-child{background:#eeeaff;color:var(--violet)}.calc-keys .wide{grid-column:span 2}footer{display:flex;justify-content:space-between;color:#96a4b3;font-size:10px;padding:20px 2px 0}footer b{color:var(--violet)}
@media(max-width:950px){.workspace,.control-grid{grid-template-columns:1fr}.intro{align-items:flex-start;gap:20px}.timer-card{padding-left:15px}.world-3d{height:350px}}@media(max-width:560px){.shell{padding:25px 14px}.topbar{padding:0 14px}.brand strong{font-size:12px}.top-actions>span:not(.live-dot){display:none}.intro{display:block}.timer-card{border:0;padding:15px 0 0}.equation{gap:5px;font-size:23px}.pyramid{width:260px;height:135px}.speech{right:45px;top:5px;font-size:9px}.board-2d{gap:6px;padding:8px}}
.player-name{display:inline-flex;align-items:center;gap:9px;margin-top:14px;color:#7990aa;font-size:10px;font-weight:700;letter-spacing:.12em}.player-name input{border:1px solid var(--line);border-radius:6px;padding:8px 10px;color:var(--ink);font:600 12px 'DM Sans';letter-spacing:0}.board-3d{position:absolute;z-index:1;bottom:39px;left:50%;width:min(70%,330px);aspect-ratio:1;display:grid;grid-template-columns:repeat(4,1fr);gap:5px;padding:9px;transform:translateX(-50%) rotateX(58deg) rotateZ(0deg);transform-style:preserve-3d;background:#1e3f72aa;border-radius:10px;box-shadow:0 13px 0 #142b56,0 20px 30px #07173866}.tile-3d{position:relative;border:1px solid #ffffff66;border-radius:7px;background:linear-gradient(145deg,#fff9e9,#c8e1ef);color:#2e5372;font:700 13px 'Space Grotesk';box-shadow:0 4px 0 #adc5d3;transform:translateZ(3px);transition:.2s}.tile-3d:hover,.tile-3d.selected{transform:translateZ(14px);background:linear-gradient(145deg,#61e4fa,#2fa8d2);color:#fff;box-shadow:0 5px 0 #187da5,0 0 0 3px #39d6ff66}.tile-3d.placed{background:linear-gradient(145deg,#62e2b8,#23ad82);color:#fff}.board-3d .owner-mark{top:2px;right:3px;font-size:8px}.world-3d .pyramid{opacity:.9;pointer-events:none}.world-3d .king-stage{pointer-events:none}
.board-cell,.tile-3d{clip-path:polygon(0 14%,14% 14%,14% 0,86% 0,86% 14%,100% 14%,100% 86%,86% 86%,86% 100%,14% 100%,14% 86%,0 86%);border-radius:0}.board-cell:after{box-shadow:0 0 0 4px #e8eef4}.tile-3d:after{content:'';position:absolute;width:28%;height:28%;left:36%;top:36%;border:1px solid #8baabd;border-radius:50%;box-shadow:0 0 0 3px #ffffff99}
.board-cell,.tile-3d,.pyramid-tile{-webkit-mask-image:url('assets/tile-form.svg');mask-image:url('assets/tile-form.svg');-webkit-mask-size:100% 100%;mask-size:100% 100%;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;clip-path:none}
.board-cell,.tile-3d,.pyramid-tile{-webkit-mask-image:none;mask-image:none;clip-path:polygon(0 14%,14% 14%,14% 0,86% 0,86% 14%,100% 14%,100% 86%,86% 86%,86% 100%,14% 100%,14% 86%,0 86%)}
.board-cell,.tile-3d,.pyramid-tile{clip-path:polygon(0 18%,0 14%,1% 9%,4% 4%,9% 1%,14% 0,86% 0,91% 1%,96% 4%,99% 9%,100% 14%,100% 86%,99% 91%,96% 96%,91% 99%,86% 100%,14% 100%,9% 99%,4% 96%,1% 91%,0 86%)}
.world-3d .pyramid{inset:auto 0 27px 0;width:100%;height:235px;transform:none;display:block;opacity:1;pointer-events:none}.world-3d .pyramid:before,.world-3d .pyramid:after{display:none}.pyramid-layer{position:absolute;left:50%;bottom:calc(var(--layer-index) * 38px);width:calc(var(--layer-width) * 68px);height:calc(var(--layer-width) * 34px);display:grid;grid-template-columns:repeat(var(--layer-width),1fr);gap:3px;padding:4px;transform:translateX(-50%) rotateX(53deg);transform-origin:center bottom;transform-style:preserve-3d;background:linear-gradient(145deg,#6bdcf0,#2589bc);border:1px solid #ffffff66;border-radius:5px;box-shadow:0 8px 0 #185b91,0 13px 20px #061a4240}.pyramid-layer.layer-1{background:linear-gradient(145deg,#7ce9f3,#35a7cc);z-index:2}.pyramid-layer.layer-2{background:linear-gradient(145deg,#91eff0,#4bb8cf);z-index:3}.pyramid-layer.layer-3{background:linear-gradient(145deg,#ffdc79,#ef9e2a);z-index:4;box-shadow:0 7px 0 #b46a18,0 13px 20px #061a4240}.pyramid-tile{min-width:0;background:#b7e7edaa;border:1px solid #ffffffaa;clip-path:polygon(0 20%,20% 20%,20% 0,80% 0,80% 20%,100% 20%,100% 80%,80% 80%,80% 100%,20% 100%,20% 80%,0 80%);color:#24556c;font:700 9px 'Space Grotesk';display:flex;align-items:center;justify-content:center;box-shadow:0 2px 0 #1d7899}.pyramid-tile.filled{background:linear-gradient(145deg,#53e0bc,#1ca77f);color:#fff}.pyramid-tile.top-tile{font-size:14px;background:linear-gradient(145deg,#ffe9a0,#efaa35);color:#704611}.world-controls{position:relative;z-index:5}
.board-3d{width:min(78%,380px);gap:7px;padding:12px;bottom:34px;box-shadow:0 18px 0 #142b56,0 26px 34px #07173877}.tile-3d{min-height:52px;border-width:2px;background:linear-gradient(145deg,#fffdf4 0%,#d8edf1 72%,#a8cbd4 100%);box-shadow:0 10px 0 #7faab9,0 12px 12px #07173833;transform:translateZ(9px);font-size:14px}.tile-3d:after{width:34%;height:34%;left:33%;top:33%;border-width:2px;box-shadow:0 0 0 4px #ffffffbb}.tile-3d:hover,.tile-3d.selected{transform:translateZ(20px);box-shadow:0 13px 0 #187da5,0 18px 18px #07173855,0 0 0 3px #39d6ff66}.tile-3d.placed{box-shadow:0 10px 0 #087856,0 12px 12px #07173833}.pyramid-layer{bottom:calc(var(--layer-index) * 43px);box-shadow:0 13px 0 #185b91,0 19px 25px #061a424d}.pyramid-layer.layer-3{box-shadow:0 11px 0 #b46a18,0 17px 22px #061a424d}.pyramid-tile{min-height:27px;box-shadow:0 5px 0 #1d7899}.pyramid-tile.filled{box-shadow:0 5px 0 #087856}.pyramid-tile.top-tile{box-shadow:0 6px 0 #b46a18}
.board-3d{width:min(84%,400px);padding:14px;gap:8px;bottom:31px;box-shadow:0 24px 0 #142b56,0 32px 38px #07173888}.tile-3d{min-height:66px;border-width:2px;box-shadow:0 16px 0 #789fac,0 20px 16px #07173844;transform:translateZ(12px);font-size:15px}.tile-3d:hover,.tile-3d.selected{transform:translateZ(25px);box-shadow:0 19px 0 #187da5,0 25px 22px #07173866,0 0 0 3px #39d6ff66}.tile-3d.placed{box-shadow:0 16px 0 #087856,0 20px 16px #07173844}.pyramid-layer{bottom:calc(var(--layer-index) * 50px);box-shadow:0 17px 0 #185b91,0 24px 28px #061a4255}.pyramid-layer.layer-3{box-shadow:0 14px 0 #b46a18,0 20px 25px #061a4255}.pyramid-tile{min-height:31px;box-shadow:0 8px 0 #1d7899}.pyramid-tile.filled{box-shadow:0 8px 0 #087856}.pyramid-tile.top-tile{box-shadow:0 9px 0 #b46a18}
.player-name{display:inline-flex;align-items:center;gap:9px;margin-top:14px;color:#7990aa;font-size:10px;font-weight:700;letter-spacing:.12em}.player-name input{border:1px solid var(--line);border-radius:6px;padding:8px 10px;color:var(--ink);font:600 12px 'DM Sans';letter-spacing:0}.board-3d{position:absolute;z-index:1;bottom:39px;left:50%;width:min(70%,330px);aspect-ratio:1;display:grid;grid-template-columns:repeat(4,1fr);gap:5px;padding:9px;transform:translateX(-50%) rotateX(58deg) rotateZ(0deg);transform-style:preserve-3d;background:#1e3f72aa;border-radius:10px;box-shadow:0 13px 0 #142b56,0 20px 30px #07173866}.tile-3d{position:relative;border:1px solid #ffffff66;border-radius:7px;background:linear-gradient(145deg,#fff9e9,#c8e1ef);color:#2e5372;font:700 13px 'Space Grotesk';box-shadow:0 4px 0 #adc5d3;transform:translateZ(3px);transition:.2s}.tile-3d:hover,.tile-3d.selected{transform:translateZ(14px);background:linear-gradient(145deg,#61e4fa,#2fa8d2);color:#fff;box-shadow:0 5px 0 #187da5,0 0 0 3px #39d6ff66}.tile-3d.placed{background:linear-gradient(145deg,#62e2b8,#23ad82);color:#fff}.board-3d .owner-mark{top:2px;right:3px;font-size:8px}.world-3d .pyramid{opacity:.9;pointer-events:none}.world-3d .king-stage{pointer-events:none}
.board-cell.context,.tile-3d.context{outline:3px solid rgba(255,211,91,.9);box-shadow:0 0 0 5px rgba(255,211,91,.18),0 10px 22px rgba(255,180,40,.18)}
.dice-button{border:2px solid #d9a928;background:linear-gradient(145deg,#164fc3,#082b83);color:#fff;border-radius:999px;padding:.45rem .75rem;font-weight:700;cursor:pointer;box-shadow:0 3px 0 #9b7212,0 6px 12px #082b8338}.dice-button:hover{background:linear-gradient(145deg,#2869e0,#0b399e);transform:translateY(-1px)}
.dice-button:disabled{cursor:default;opacity:.92;transform:none}
.dice-button.crown-mode img{width:28px;height:20px;object-fit:contain;vertical-align:middle;margin-right:4px;mix-blend-mode:screen;filter:saturate(1.15) drop-shadow(0 1px 2px #f5c54288)}
.dice-button.dice-roll{animation:diceRoll .8s cubic-bezier(.2,.8,.3,1)}@keyframes diceRoll{0%{transform:perspective(220px) rotateX(0) rotateY(0) scale(1)}35%{transform:perspective(220px) rotateX(180deg) rotateY(120deg) scale(1.12)}70%{transform:perspective(220px) rotateX(330deg) rotateY(285deg) scale(1.08)}100%{transform:perspective(220px) rotateX(360deg) rotateY(360deg) scale(1)}}@media (prefers-reduced-motion:reduce){.dice-button.dice-roll{animation:none}}
.dice-choice{display:inline-flex;gap:3px;margin-left:4px}.dice-choice button{min-width:24px;padding:4px 7px;border:1px solid #d9a928;border-radius:6px;background:#fff;color:#111827;font-weight:800}.dice-choice button:hover,.dice-choice button:focus-visible{background:#fff4bf;outline:2px solid #d9a928;outline-offset:1px}
.hand-tile.used{opacity:.42;cursor:not-allowed;text-decoration:line-through}.hand-tile:disabled{pointer-events:none}
.pyramid-layer{gap:0}.pyramid-tile{margin:0}
.pyramid-tile{border-color:#cbd5e1!important;box-shadow:0 2px 0 #b8c2ce, inset 0 0 0 1px #eef2f7}
.result-tile,.center-result,.pyramid-tile.top-tile{background:linear-gradient(145deg,#ffffff,#eef2f7)!important;color:#111827!important;border-color:#cbd5e1!important;box-shadow:0 5px 0 #b8c2ce,0 8px 12px #64748b33!important}
.board-cell:not(.selected):not(.placed),.tile-3d:not(.selected):not(.placed),.hand-tile:not(.active):not(.used){background:linear-gradient(145deg,#ffffff 0%,#ffffff 38%,#eef2f7 100%);box-shadow:inset 2px 2px 0 #ffffff, inset -2px -3px 0 #e2e8f0,0 5px 8px #64748b22}
.hand-tile{cursor:grab}.hand-tile:active{cursor:grabbing}.board-2d.drop-ready,.board-3d.drop-ready{outline:4px dashed rgba(255,211,91,.9);outline-offset:6px}
.pyramid-tile{font-size:0}
.tile-3d,.board-cell,.hand-tile,.center-result,.pyramid-tile{text-shadow:0 1px 0 #ffffff,0 -1px 0 #64748b;color:#111827}
.world-3d .pyramid{display:none}
.world-3d{touch-action:none}.world-orbit{position:absolute;inset:0;transform-origin:50% 58%;transform-style:preserve-3d;will-change:transform;cursor:grab}.world-orbit:active{cursor:grabbing}
.stl-piece-view{display:none!important}
.board-3d .center-result{display:none}
.board-2d .persistent-result,.board-3d .persistent-result{pointer-events:auto;cursor:pointer}
.board-2d{position:relative}.center-result{position:absolute;z-index:6;transform:translate(-50%,-50%);width:calc((100% - 58px) / 4);aspect-ratio:1;border-radius:11px;background:linear-gradient(145deg,#ffdf83,#e99c2c);border:3px solid #fff;color:#704611;display:flex;align-items:center;justify-content:center;font:700 clamp(18px,2.6vw,29px) 'Space Grotesk';box-shadow:0 10px 0 #b56b18,0 0 0 5px #ffca5544;pointer-events:none}.board-3d .center-result{width:calc((100% - 56px) / 4);font-size:15px;transform:translate(-50%,-50%) rotateX(-58deg) translateZ(30px);box-shadow:0 10px 0 #b56b18,0 0 0 3px #ffca5544}
.center-result{border-radius:0;clip-path:polygon(0 18%,0 14%,1% 9%,4% 4%,9% 1%,14% 0,86% 0,91% 1%,96% 4%,99% 9%,100% 14%,100% 86%,99% 91%,96% 96%,91% 99%,86% 100%,14% 100%,9% 99%,4% 96%,1% 91%,0 86%);background:linear-gradient(145deg,#ffe9a2 0%,#ffc34f 62%,#e89a26 100%);border:0;box-shadow:0 10px 0 #b56b18,0 0 0 5px #ffca5544}
.center-result::after{content:'';position:absolute;width:42%;height:42%;left:29%;top:29%;border-radius:50%;border:3px solid rgba(255,255,255,.85);box-shadow:0 0 0 5px rgba(255,255,255,.24),inset 0 3px 5px rgba(137,79,8,.22);z-index:-1}
.board-cell.hint-highlight,.tile-3d.hint-highlight{background:linear-gradient(145deg,#ffffff,#f8fafc)!important;border-color:#dbe4ed!important;color:#111827!important;box-shadow:inset 0 0 0 3px var(--hint-shadow),0 7px 0 #b8c2ce,0 11px 18px var(--hint-shadow-soft)!important}.board-cell.hint-shade-0,.tile-3d.hint-shade-0{--hint-shadow:#f3b6d1;--hint-shadow-soft:#f3b6d144}.board-cell.hint-shade-1,.tile-3d.hint-shade-1{--hint-shadow:#c9bdf2;--hint-shadow-soft:#c9bdf244}.board-cell.hint-shade-2,.tile-3d.hint-shade-2{--hint-shadow:#f1d58a;--hint-shadow-soft:#f1d58a44}.board-cell.hint-shade-3,.tile-3d.hint-shade-3{--hint-shadow:#afd7ee;--hint-shadow-soft:#afd7ee44}.board-cell.hint-revealed,.hand-tile.hint-revealed{outline:3px solid #ffca55;outline-offset:2px}
.board-cell.hint-active,.tile-3d.hint-active{background:linear-gradient(145deg,#56dffb,#2fafd8)!important;border-color:#148db6!important;color:#fff!important;box-shadow:inset 0 0 0 3px #0e7fa8,0 8px 0 #176e94,0 12px 20px #0b4c7066!important}
.equation.hint-target{padding:10px 12px;border-radius:12px;background:linear-gradient(145deg,#ffffff,#f8fafc);box-shadow:inset 0 0 0 3px var(--hint-shadow),0 8px 18px var(--hint-shadow-soft);color:#111827}.equation.hint-target.hint-shade-0{--hint-shadow:#f3b6d1;--hint-shadow-soft:#f3b6d144}.equation.hint-target.hint-shade-1{--hint-shadow:#c9bdf2;--hint-shadow-soft:#c9bdf244}.equation.hint-target.hint-shade-2{--hint-shadow:#f1d58a;--hint-shadow-soft:#f1d58a44}.equation.hint-target.hint-shade-3{--hint-shadow:#afd7ee;--hint-shadow-soft:#afd7ee44}.equation.hint-target .op-select,.equation.hint-target .result-tile{background:#fff;border-color:var(--hint-shadow);color:#111827}
.board-cell,.tile-3d,.hand-tile{color:#111827}.board-cell.selected,.board-cell.placed,.tile-3d.selected,.tile-3d.placed{color:#fff}.hand-tile.active{color:#111827}
.calculator-card[hidden]{display:none!important}
.crown-drop{animation:crownDrop .75s cubic-bezier(.2,.8,.3,1)}@keyframes crownDrop{0%{translate:0 -24px;scale:1.08;opacity:.3}65%{translate:0 3px;scale:.98;opacity:1}100%{translate:0 0;scale:1;opacity:1}}@media(prefers-reduced-motion:reduce){.crown-drop{animation:none}}
.result-drop{animation:crownDrop .75s cubic-bezier(.2,.8,.3,1)}
.crown-drop{animation:crownDrop .75s cubic-bezier(.2,.8,.3,1)}
.wave-tile{--wave-delay:0ms;animation:resultWave .58s cubic-bezier(.2,.8,.3,1) var(--wave-delay) both;box-shadow:0 0 0 3px #ffffffaa,0 9px 15px #64748b55!important}
.tile-form{isolation:isolate;overflow:visible}.tile-form:before{content:'';position:absolute;z-index:0;width:43%;height:43%;left:28.5%;top:28.5%;border-radius:50%;background:linear-gradient(145deg,#ffffff,#f5f7fa 58%,#d6dee8);box-shadow:inset 2px 2px 3px #fff,0 4px 0 #b7c2cf,0 5px 8px #64748b33}.tile-form:after{z-index:1}.tile-number{position:relative;z-index:2;display:block;text-shadow:0 1px 0 #fff}
.tile-3d.tile-form:before{background:linear-gradient(145deg,#ffffff,#daeaf0 60%,#a9c7d2);box-shadow:inset 2px 2px 3px #fff,0 5px 0 #7faab9,0 6px 9px #07173833}
.wave-index-0{--wave-delay:0ms}.wave-index-1{--wave-delay:420ms}.wave-index-2{--wave-delay:840ms}.wave-index-3{--wave-delay:1260ms}
.center-result.result-drop,.pyramid-tile.result-drop{animation:resultWave .58s cubic-bezier(.2,.8,.3,1) 1680ms both}
@keyframes resultWave{0%{translate:0 -18px;scale:1.06;opacity:1}55%{translate:0 3px;scale:.98;opacity:1}100%{translate:0 0;scale:1;opacity:1}}
@keyframes resultFlash{0%{box-shadow:0 0 0 0 #fff,0 5px 0 #b8c2ce,0 8px 12px #64748b33!important}35%{box-shadow:0 0 0 9px #ffffffee,0 5px 0 #b8c2ce,0 8px 12px #64748b33!important}100%{box-shadow:0 5px 0 #b8c2ce,0 8px 12px #64748b33!important}}
@media(prefers-reduced-motion:reduce){.wave-tile,.center-result.result-drop,.pyramid-tile.result-drop{animation:none}}
.hint-suggestions{display:flex;flex-wrap:wrap;gap:6px;margin:-2px 0 10px}.hint-suggestion{flex:1 1 45%;min-width:145px;padding:8px 10px;border:1px solid var(--hint-shadow);border-radius:8px;background:#fff;color:#111827;text-align:left;font:600 12px 'Space Grotesk';box-shadow:0 4px 10px var(--hint-shadow-soft)}.hint-suggestion:hover,.hint-suggestion:focus-visible{outline:2px solid var(--hint-shadow);outline-offset:1px}.hint-result{flex:1 1 100%;padding:8px 10px;border-radius:8px;background:#fff8e8;border:1px solid #f1d58a;color:#5b4210;font:600 12px 'Space Grotesk'}

/* The king reveals help on the configured clock; there is no player tip control. */
#hint[hidden]{display:none!important}
.king-card .hint-levels{opacity:.78}

/* Keep a selected 2×2 visually stable while the player fills it. */
.board-cell.selected,.tile-3d.selected{background:linear-gradient(145deg,#ffffff 0%,#ffffff 42%,#eef2f7 100%)!important;border-color:#1da7d0!important;color:#111827!important;box-shadow:inset 0 0 0 3px #39d6ff,0 7px 0 #b8c2ce,0 11px 18px #39d6ff2e!important}
.board-cell.selected.hint-active,.tile-3d.selected.hint-active{background:linear-gradient(145deg,#ffffff 0%,#ffffff 42%,#eef2f7 100%)!important;color:#111827!important}

/* The result hand belongs beside the board so the player can see board and hand together. */
.hand-board-label{margin:13px auto 6px;max-width:520px;color:#7990aa;font-size:10px;font-weight:700;letter-spacing:.12em;text-transform:uppercase}
.hand-by-board{max-width:520px;margin:0 auto 4px;justify-content:flex-start;flex-wrap:wrap;padding:9px 10px;border:1px solid #dfe7ef;border-radius:10px;background:#f7f9fc;box-shadow:inset 0 1px 0 #fff}
.hand-by-board .hand-tile{min-width:48px;text-align:center}

/* A calmer camera and upright labels make the 3D board readable. */
.board-3d{transform:translateX(-50%) rotateX(34deg)!important;perspective:1200px;width:min(62%,var(--board-max-width,300px))}
.board-3d{bottom:calc(42px - 5%)}
.tile-3d{transform:translateZ(8px)!important}
.tile-3d .tile-number{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transform:rotateX(-34deg);transform-origin:center;color:#111827;font-size:15px;line-height:1;text-shadow:0 1px 0 #fff}
.tile-3d:hover .tile-number,.tile-3d.selected .tile-number{transform:rotateX(-34deg) translateZ(1px)}
.board-3d .center-result{transform:translate(-50%,-50%) rotateX(-34deg) translateZ(30px)!important}

/* King patrols the board; his soft shadow follows the path. */
.king-stage{animation:kingPatrol 14s ease-in-out infinite;will-change:transform}
.king-shadow{transform-origin:center;animation:kingShadowPatrol 14s ease-in-out infinite}
@keyframes kingPatrol{0%,100%{transform:translateX(-50%) translate3d(0,0,0)}25%{transform:translateX(-50%) translate3d(105px,58px,0)}50%{transform:translateX(-50%) translate3d(0,108px,0)}75%{transform:translateX(-50%) translate3d(-105px,58px,0)}}
@keyframes kingShadowPatrol{0%,100%{transform:scale(.72);opacity:.28}25%,75%{transform:scale(.92);opacity:.42}50%{transform:scale(1.08);opacity:.52}}
.speech{left:106px;right:auto;top:0;width:158px;min-height:78px;white-space:normal;display:flex;align-items:center;justify-content:center;text-align:center;padding:17px 20px;border-radius:50%;font-size:11px;line-height:1.35}
.speech:after{right:auto;left:-10px;bottom:16px;border-width:8px 12px 8px 0;border-color:transparent #fff transparent transparent}

@media(max-width:560px){.speech{left:83px;top:2px;width:137px;min-height:67px;padding:14px 16px;font-size:9px}.board-3d{transform:translateX(-50%) rotateX(30deg)!important}.tile-3d .tile-number{transform:rotateX(-30deg);font-size:13px}.tile-3d:hover .tile-number,.tile-3d.selected .tile-number{transform:rotateX(-30deg) translateZ(1px)}}
@media(prefers-reduced-motion:reduce){.king-stage,.king-shadow{animation:none}}
.hint-suggestion.hint-shade-0{--hint-shadow:#f3b6d1;--hint-shadow-soft:#f3b6d144}.hint-suggestion.hint-shade-1{--hint-shadow:#c9bdf2;--hint-shadow-soft:#c9bdf244}.hint-suggestion.hint-shade-2{--hint-shadow:#f1d58a;--hint-shadow-soft:#f1d58a44}.hint-suggestion.hint-shade-3{--hint-shadow:#afd7ee;--hint-shadow-soft:#afd7ee44}
.board-cell.hint-highlight,.tile-3d.hint-highlight{box-shadow:inset 0 0 0 3px var(--hint-shadow),inset 0 0 0 6px var(--hint-extra-shadow,transparent),0 7px 0 #b8c2ce,0 11px 18px var(--hint-shadow-soft)!important}
.board-cell.hint-highlight,.tile-3d.hint-highlight{box-shadow:inset 0 0 0 3px var(--hint-shadow),inset 0 0 0 6px var(--hint-extra-shadow,transparent),inset 0 0 0 9px var(--hint-extra-shadow-2,transparent),inset 0 0 0 12px var(--hint-extra-shadow-3,transparent),0 7px 0 #b8c2ce,0 11px 18px var(--hint-shadow-soft)!important}.board-cell.hint-active,.tile-3d.hint-active{box-shadow:inset 0 0 0 3px #0e7fa8,inset 0 0 0 6px var(--hint-extra-shadow,transparent),inset 0 0 0 9px var(--hint-extra-shadow-2,transparent),inset 0 0 0 12px var(--hint-extra-shadow-3,transparent),0 8px 0 #176e94,0 12px 20px #0b4c7066!important}

/* Final stable selection and readable 3D label overrides. */
.board-cell.selected,.tile-3d.selected{background:linear-gradient(145deg,#ffffff 0%,#ffffff 42%,#eef2f7 100%)!important;border-color:#1da7d0!important;color:#111827!important;box-shadow:inset 0 0 0 3px #39d6ff,0 7px 0 #b8c2ce,0 11px 18px #39d6ff2e!important}
.board-cell.selected.hint-active,.tile-3d.selected.hint-active{background:linear-gradient(145deg,#ffffff 0%,#ffffff 42%,#eef2f7 100%)!important;color:#111827!important;box-shadow:inset 0 0 0 3px #39d6ff,0 7px 0 #b8c2ce,0 11px 18px #39d6ff2e!important}

/* Keep the king parked in the upper-left so the speech never covers the board. */
.king-stage{left:8px!important;top:2px!important;transform:none!important;animation:none!important;text-align:left}
.king{width:72px;height:84px}
.king-shadow{width:58px;height:9px;margin:-6px 0 0 8px;transform:scale(.86);animation:none!important}
.speech{left:88px;right:auto;top:-24px;width:148px;min-height:68px}
@media(max-width:560px){.king-stage{left:6px!important;top:2px!important}.king{width:64px;height:75px}.king-shadow{width:50px;margin-left:7px}.speech{left:74px;top:-18px;width:128px;min-height:58px;padding:12px 14px;font-size:9px}}

/* Clear, stable feedback for the exact number and operator slot being edited. */
.board-cell.selected,.tile-3d.selected{background:linear-gradient(145deg,#dff9ff 0%,#b9eaf4 100%)!important;border-color:#159fc6!important;color:#102a43!important;box-shadow:inset 0 0 0 3px #39d6ff,0 7px 0 #83c2d0,0 11px 18px #39d6ff44!important}
.op-select.operator-active{background:linear-gradient(145deg,#e2f8ff,#bdeaf4)!important;color:#0d6f8f!important;box-shadow:inset 0 0 0 2px #39d6ff,0 4px 10px #39d6ff66!important}
.equation>span[id^="operand"]{display:inline-flex;align-items:center;justify-content:center;min-width:32px;min-height:32px;border-radius:7px;transition:background .15s,box-shadow .15s,color .15s}
.equation>span[id^="operand"].operand-active{background:linear-gradient(145deg,#fff4c9,#ffe19a);color:#815d12;box-shadow:inset 0 0 0 2px #f1c75b,0 4px 10px #e0aa3b55}
.pyramid-tile.result-tile-placed{background:linear-gradient(145deg,#ffffff,#eef2f7)!important;color:#111827!important;box-shadow:0 8px 0 #b8c2ce,0 10px 14px #64748b33!important}

/* Each 2×2 has a quiet center hit area. It becomes visible on hover or selection. */
.board-2d,.board-3d{isolation:isolate}
.square-selectors{position:absolute;inset:14px;z-index:5;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(4,minmax(0,1fr));gap:10px;pointer-events:none}
.square-outline{width:100%;height:100%;align-self:stretch;justify-self:stretch;border:2px solid transparent;border-radius:14px;pointer-events:none;transition:border-color .15s,box-shadow .15s}
.square-outline.selected{border-color:#b9dfe8;box-shadow:inset 0 0 0 1px #ffffffaa,0 0 0 3px #dff5fa}
.square-hit{width:18%;height:18%;align-self:center;justify-self:center;padding:0;border:2px solid transparent;border-radius:50%;background:transparent;color:transparent;opacity:0;box-shadow:none;pointer-events:auto;cursor:pointer;transition:opacity .15s,background .15s,border-color .15s,box-shadow .15s}
.square-hit:hover,.square-hit:focus-visible,.square-hit.selected{opacity:0;background:transparent;border-color:transparent;box-shadow:none;outline:none}
.board-3d .square-selectors{inset:9px;gap:5px;transform:translateZ(18px)}
.board-3d .square-hit{border-radius:50%}

/* The die is a visible blue-and-gold face, while the button remains the roll control. */
.dice-button{display:inline-flex;align-items:center;gap:9px;min-height:48px;padding:6px 12px}
.dice-face{width:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;background:linear-gradient(145deg,#fff,#dbe8f4);color:#0b399e;border:2px solid #e4b52f;box-shadow:inset 2px 2px 3px #fff,0 4px 0 #9b7212;font:800 19px 'Space Grotesk';text-shadow:none}
.dice-label{white-space:nowrap;font-size:11px;line-height:1.15;text-align:left}
.dice-crown-icon{font-size:24px;line-height:1;color:#ffe28a;text-shadow:0 1px 0 #8b5d00}

/* The selected 2×2 is one light frame; individual cells keep calm borders. */
.board-cell.context:not(.hint-highlight),.tile-3d.context:not(.hint-highlight){outline:1px solid #d6e5eb;outline-offset:-1px;box-shadow:inset 0 0 0 1px #eef6f8,0 7px 0 #b8c2ce,0 11px 18px #64748b22}
.minute-celebration{position:fixed;z-index:30;left:50%;top:22%;transform:translate(-50%,14px) scale(.86);padding:18px 28px;border-radius:16px;background:linear-gradient(145deg,#fff6c9,#f5c542);border:3px solid #b47b00;box-shadow:0 12px 30px #7b560066;color:#5c3b00;font:800 28px 'Space Grotesk',Arial,sans-serif;pointer-events:none;opacity:0}.minute-celebration.show{animation:minuteCelebration 2.2s cubic-bezier(.2,.8,.3,1) forwards}@keyframes minuteCelebration{0%{opacity:0;transform:translate(-50%,14px) scale(.86)}18%,78%{opacity:1;transform:translate(-50%,0) scale(1)}100%{opacity:0;transform:translate(-50%,-16px) scale(1.04)}}.hand-tile.crown-picked{outline:3px solid #d9a928;outline-offset:3px;box-shadow:0 0 0 6px #f5c54255,0 5px 0 #b47b00}.dice-button.crown-mode{border-color:#f5c542}
.dice-button.ds-mode{background:repeating-linear-gradient(135deg,#164fc3 0 8px,#2f75df 8px 14px,#0a2f86 14px 20px);border-color:#f5c542}.dice-button.ds-mode .dice-face-5{background:repeating-linear-gradient(135deg,#164fc3 0 4px,#f5c542 4px 8px);color:#fff;text-shadow:0 1px 2px #082b83}
/* Placerede og valgte grundbrikker bevarer den hvide neutrale brikfarve. */
.board-cell.selected,.tile-3d.selected,.board-cell.hint-active,.tile-3d.hint-active{background:linear-gradient(145deg,#ffffff 0%,#ffffff 38%,#eef2f7 100%)!important;color:#111827!important;border-color:#cbd5e1!important;box-shadow:inset 0 0 0 3px #dbe4ed,0 5px 0 #b8c2ce,0 8px 12px #64748b33!important}
.board-cell.placed,.tile-3d.placed{background:linear-gradient(145deg,#ffffff 0%,#ffffff 38%,#eef2f7 100%)!important;color:#111827!important;border-color:#cbd5e1!important;box-shadow:inset 2px 2px 0 #ffffff,inset -2px -3px 0 #e2e8f0,0 5px 0 #b8c2ce,0 8px 12px #64748b22!important}
.board-3d .center-result{display:flex!important}

/* Keep the complete header inside the viewport on smaller screens. */
@media(max-width:1100px){
  .topbar{height:auto;min-height:76px;flex-wrap:wrap;gap:8px;padding-top:10px;padding-bottom:10px}
  .top-actions{flex:1 1 620px;min-width:0;justify-content:flex-end;flex-wrap:wrap;gap:5px}
  .top-actions button{margin-left:0;padding:8px 10px;font-size:10px}
  .language-control{margin-left:0}
}
@media(min-width:761px) and (max-width:1100px){
  .workspace{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .panel{padding:14px}
  .board-2d{gap:6px;padding:8px}
  .world-3d{height:350px}
}
/* The floating calculator must sit above board helper text while it is dragged. */
.calculator-card{z-index:20}
body{zoom:var(--view-zoom,1)}
.view-zoom{position:fixed;z-index:40;right:12px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:center;gap:6px;width:48px;padding:9px 7px;border:1px solid #dbe4ed;border-radius:14px;background:#ffffffed;box-shadow:0 8px 22px #182b5226;color:#718198;font-size:8px;letter-spacing:.1em}
.view-zoom button{width:30px;height:25px;border-radius:6px;background:#f2f5f9;color:#182b52;font-weight:700;font-size:15px;line-height:1}
.view-zoom button:hover,.view-zoom button:focus-visible{background:#e5f7fc;outline:2px solid #39d6ff;outline-offset:1px}
.view-zoom output{font-size:9px;letter-spacing:0;color:#182b52;font-weight:700}
.view-zoom input[type=range]{width:132px;height:24px;margin:4px -52px;transform:rotate(-90deg);accent-color:#39bfe4;cursor:ns-resize}
.window-controls{position:absolute;top:10px;right:12px;display:flex;gap:4px;z-index:45}
.window-controls button{width:28px;height:24px;padding:0;border-radius:5px;background:#edf2f7;color:#182b52;font-size:15px;line-height:1}
.window-controls button:hover,.window-controls button:focus-visible{background:#dff5fa;outline:2px solid #39d6ff;outline-offset:1px}
.topbar{position:relative;padding-right:82px}
.app-minimized main,.app-minimized footer{display:none!important}
.app-minimized .topbar{position:fixed;inset:0 0 auto 0;z-index:50}
@media(max-width:760px){.topbar{padding-right:78px}.view-zoom{right:6px}.window-controls{right:7px}}

/* Fluid layout rules for changing screen and window sizes. */
html,body{width:100%;max-width:100%;overflow-x:hidden}
.workspace,.control-grid,.panel,.control-card{min-width:0}
.board-2d{width:100%;max-width:520px}
.world-3d{width:100%;height:clamp(300px,42vw,410px)}
.board-3d{max-width:calc(100% - 24px)}
@media(min-width:951px){
  .control-grid{grid-template-columns:minmax(0,1.35fr) minmax(0,1fr) minmax(180px,.78fr)}
}
@media(min-width:761px) and (max-width:950px){
  .control-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  .calculator-card{grid-column:1 / -1;width:min(100%,380px);justify-self:end}
}
@media(max-width:760px){
  .topbar{align-items:flex-start}
  .top-actions{width:100%;flex:1 1 100%;justify-content:flex-start}
  .workspace,.control-grid{grid-template-columns:1fr}
  .calculator-card{grid-column:auto;width:100%;justify-self:stretch}
  .panel{padding:14px}
  .world-3d{height:clamp(280px,82vw,350px)}
  .board-3d{width:min(60%,var(--board-mobile-width,220px));bottom:calc(42px - 5%)}
}
@media(max-height:700px) and (min-width:761px){
  .shell{padding-top:20px}
  .world-3d{height:clamp(280px,48vh,350px)}
  .panel{padding:14px}
}

/* The calculator can be resized from any window edge, like a desktop window. */
.calculator-card.calculator-resizable{position:relative;min-width:230px;min-height:250px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:auto}
.calculator-resize-handle{position:absolute;z-index:4;display:block;background:transparent;touch-action:none;user-select:none}
.calculator-resize-handle.resize-n,.calculator-resize-handle.resize-s{left:12px;right:12px;height:12px;cursor:ns-resize}
.calculator-resize-handle.resize-e,.calculator-resize-handle.resize-w{top:12px;bottom:12px;width:12px;cursor:ew-resize}
.calculator-resize-handle.resize-n{top:-5px}.calculator-resize-handle.resize-s{bottom:-5px}.calculator-resize-handle.resize-e{right:-5px}.calculator-resize-handle.resize-w{left:-5px}
.calculator-resize-handle.resize-ne,.calculator-resize-handle.resize-nw,.calculator-resize-handle.resize-se,.calculator-resize-handle.resize-sw{width:18px;height:18px}
.calculator-resize-handle.resize-ne{top:-5px;right:-5px;cursor:nesw-resize}.calculator-resize-handle.resize-nw{top:-5px;left:-5px;cursor:nwse-resize}.calculator-resize-handle.resize-se{right:-5px;bottom:-5px;cursor:nwse-resize}.calculator-resize-handle.resize-sw{left:-5px;bottom:-5px;cursor:nesw-resize}
.calculator-resize-handle.resize-se::after{content:'';position:absolute;right:4px;bottom:4px;width:8px;height:8px;border-right:2px solid #9aa8b7;border-bottom:2px solid #9aa8b7;opacity:.75}
@media(max-width:760px){.calculator-card.calculator-resizable{max-width:calc(100vw - 16px)}}

/* Let the calculator fit its content and viewport automatically; no internal scrollbars. */
.calculator-card.calculator-resizable{width:auto!important;height:auto!important;max-width:100%;max-height:none;overflow:hidden}
.calculator-resize-handle{display:none!important}
.calculator-card{max-width:100%;overflow:hidden}

/* The calculator can be dragged by its title bar. */
.drag-handle{cursor:grab}
.drag-handle:active{cursor:grabbing}
.drag-handle{touch-action:none;user-select:none}


/* Preserve the indented KOM tile silhouette at every zoom level. */
.board-cell,.tile-3d,.pyramid-tile{border-radius:0!important}

/* Resizable calculator window */
.calculator-card.calculator-resizable{position:relative;min-width:230px;min-height:280px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);overflow:hidden}
.calculator-resize-handle{position:absolute;z-index:30;display:block!important;background:transparent;touch-action:none;user-select:none}
.calculator-resize-handle.resize-n,.calculator-resize-handle.resize-s{left:12px;right:12px;height:14px;cursor:ns-resize}
.calculator-resize-handle.resize-e,.calculator-resize-handle.resize-w{top:12px;bottom:12px;width:14px;cursor:ew-resize}
.calculator-resize-handle.resize-n{top:-7px}.calculator-resize-handle.resize-s{bottom:-7px}.calculator-resize-handle.resize-e{right:-7px}.calculator-resize-handle.resize-w{left:-7px}
.calculator-resize-handle.resize-ne,.calculator-resize-handle.resize-nw,.calculator-resize-handle.resize-se,.calculator-resize-handle.resize-sw{width:20px;height:20px}
.calculator-resize-handle.resize-ne{top:-7px;right:-7px;cursor:nesw-resize}.calculator-resize-handle.resize-nw{top:-7px;left:-7px;cursor:nwse-resize}.calculator-resize-handle.resize-se{right:-7px;bottom:-7px;cursor:nwse-resize}.calculator-resize-handle.resize-sw{left:-7px;bottom:-7px;cursor:nesw-resize}
.calculator-resize-handle.resize-se::after{content:'';position:absolute;right:4px;bottom:4px;width:9px;height:9px;border-right:2px solid #8998aa;border-bottom:2px solid #8998aa;opacity:.9}/* Resize hit areas stay inside the card so overflow remains hidden and no scrollbars appear. */
.calculator-resize-handle.resize-n{top:0}.calculator-resize-handle.resize-s{bottom:0}.calculator-resize-handle.resize-e{right:0}.calculator-resize-handle.resize-w{left:0}
.calculator-resize-handle.resize-ne{top:0;right:0}.calculator-resize-handle.resize-nw{top:0;left:0}.calculator-resize-handle.resize-se{right:0;bottom:0}.calculator-resize-handle.resize-sw{left:0;bottom:0}
/* Let the unresized calculator include every key; an inline height takes over while resizing. */
.calculator-card.calculator-resizable{height:max-content;align-self:start}

/* Do not clip the calculator at short viewport heights; it remains movable. */
.calculator-card.calculator-resizable{max-height:none!important}

/* Keep each KOM tile a true 45×45-style square at every responsive board size. */
.board-2d .board-cell,.board-3d .tile-3d{min-height:0!important;height:auto;aspect-ratio:1 / 1}
/* The 3D board keeps the 45×45-style tile proportion on small screens too. */
.board-3d{width:min(72%,var(--board-max-width,300px))}
@media(max-width:760px){.board-3d{width:min(72%,var(--board-mobile-width,220px))}}
/* The 1·2·3 choice is available only after the special 1·2·3 die face. */
.dice-choice[hidden]{display:none!important}
/* The 3D viewing window can be resized independently of the 2D board. */
.world-3d{min-width:260px;min-height:260px}
.world-resize-handle{position:absolute;z-index:12;right:0;bottom:0;width:24px;height:24px;cursor:nwse-resize;touch-action:none;user-select:none;background:transparent}
.world-resize-handle::after{content:'';position:absolute;right:5px;bottom:5px;width:10px;height:10px;border-right:3px solid #dbe8f2;border-bottom:3px solid #dbe8f2;filter:drop-shadow(0 1px 1px #182b5266)}
.world-resize-handle:hover::after{border-color:#39d6ff}
.world-controls{flex-wrap:wrap;gap:8px}
/* Keep the 3D board centered inside its viewing window at every size. */
.world-3d .board-3d{top:50%;left:50%;bottom:auto!important;transform:translate(-50%,-50%) rotateX(34deg)!important}
@media(max-width:560px){.world-3d .board-3d{transform:translate(-50%,-50%) rotateX(30deg)!important}}
/* D/S uses the agreed patterned logo face; keep the action free of a second text label. */
.dice-button.ds-mode{background:linear-gradient(145deg,#fffdf4,#f6e8b1)!important;color:#5c4300;border-color:#c08a16;box-shadow:0 3px 0 #a8750d,0 6px 12px #8b650033}
.dice-button.ds-mode:hover{background:linear-gradient(145deg,#fffef8,#f2df91)!important}
.dice-button.ds-mode .dice-face-5{position:relative;font-size:0;background:repeating-linear-gradient(135deg,#fff9d9 0 5px,#f2bd2f 5px 8px,#fff9d9 8px 13px)!important;color:#5b4100;border-color:#b47b00;text-shadow:none}
.dice-button.ds-mode .dice-face-5::before{content:'↻';font-size:22px;font-weight:800;line-height:1;color:#5b4100;text-shadow:0 1px 0 #fff}
.dice-button.ds-mode .dice-label{color:#5c4300}
.calculator-resize-handle.resize-ne::after,.calculator-resize-handle.resize-nw::after,.calculator-resize-handle.resize-se::after,.calculator-resize-handle.resize-sw::after{content:'';position:absolute;width:8px;height:8px;border-color:#8998aa;border-style:solid;opacity:.7}
.calculator-resize-handle.resize-ne::after{right:3px;top:3px;border-width:2px 2px 0 0}.calculator-resize-handle.resize-nw::after{left:3px;top:3px;border-width:2px 0 0 2px}.calculator-resize-handle.resize-sw::after{left:3px;bottom:3px;border-width:0 0 2px 2px}
/* D/S uses the supplied gold-and-blue pattern on the same blue die button. */
.dice-button.ds-mode{background:linear-gradient(145deg,#164fc3,#082b83)!important;color:#fff;border-color:#f5c542;box-shadow:0 3px 0 #9b7212,0 6px 12px #082b8338}
.dice-button.ds-mode:hover{background:linear-gradient(145deg,#2869e0,#0b399e)!important}
.dice-button.ds-mode .ds-die-icon{width:32px;height:32px;display:block;object-fit:contain;border:2px solid #e4b52f;border-radius:8px;background:#164fc3;box-shadow:inset 2px 2px 3px #fff8,0 4px 0 #9b7212}
.dice-button.ds-mode .dice-label{color:#fff}
/* The 2D board has the same player-controlled size adjustment as the 3D view. */
.board-2d-shell{position:relative;width:100%;max-width:520px;aspect-ratio:1;margin:19px auto 12px}
.board-2d-shell .board-2d{width:100%;height:100%;max-width:none;margin:0}
.board-resize-handle{position:absolute;z-index:12;right:0;bottom:0;width:24px;height:24px;cursor:nwse-resize;touch-action:none;user-select:none;background:transparent}
.board-resize-handle::after{content:'';position:absolute;right:5px;bottom:5px;width:10px;height:10px;border-right:3px solid #b7c8d8;border-bottom:3px solid #b7c8d8;filter:drop-shadow(0 1px 1px #182b5266)}
.board-resize-handle:hover::after{border-color:#39d6ff}
/* Number slots in the equation match the operation buttons. */
.equation>span[id^="operand"]{display:inline-flex;align-items:center;justify-content:center;width:38px;min-width:38px;height:38px;padding:0;border:0;border-radius:7px;background:#ece9ff;color:var(--violet);font:700 22px/1 'Space Grotesk';}
.equation.hint-target>span[id^="operand"]{background:#fff;color:#111827;border:0;}
/* A 3D result tile uses the same chamfered body and embossed number as every 3D tile. */
.board-3d .center-result{display:flex!important;align-items:center;justify-content:center;width:calc((100% - 56px) / 4);aspect-ratio:1;border:1px solid #ffffff66!important;border-radius:0!important;clip-path:polygon(0 14%,14% 14%,14% 0,86% 0,86% 14%,100% 14%,100% 86%,86% 86%,86% 100%,14% 100%,14% 86%,0 86%);background:linear-gradient(145deg,#fff9e9,#c8e1ef)!important;color:#111827!important;font:700 13px/1 'Space Grotesk';text-shadow:0 1px 0 #fff,0 -1px 0 #64748b;box-shadow:0 4px 0 #adc5d3,0 6px 9px #07173833!important;transform:translate(-50%,-50%) rotateX(-34deg) translateZ(8px)!important;isolation:isolate;}
.board-3d .center-result::after{content:'';position:absolute;width:42%;height:42%;left:29%;top:29%;border:1px solid #8baabd;border-radius:50%;background:linear-gradient(145deg,#ffffff,#daeaf0 60%,#a9c7d2);box-shadow:inset 2px 2px 3px #fff,0 5px 0 #7faab9,0 6px 9px #07173833;z-index:-1;}
.center-result.tile-form{position:absolute;display:flex;align-items:center;justify-content:center;overflow:visible;}
.center-result.tile-form .tile-number{position:relative;z-index:2;display:block;color:#111827;font:700 1em/1 'Space Grotesk';text-shadow:0 1px 0 #fff,0 -1px 0 #64748b;}

/* The calculator window keeps a generous desktop-style resize grip. */
.calculator-card.calculator-resizable{max-width:calc(100vw - 16px)!important;max-height:calc(100vh - 16px)!important}
.calculator-resize-handle.resize-se{width:30px!important;height:30px!important;right:0!important;bottom:0!important;z-index:100!important}
.calculator-resize-handle.resize-se::after{width:13px;height:13px;right:5px;bottom:5px;border-right-width:3px;border-bottom-width:3px;opacity:.95}

/* Early stop and saved-time scoreboard. */
.timer-card{position:relative;min-width:205px}
.stop-timer{display:block;width:100%;margin-top:10px;padding:9px 12px;border-radius:8px;background:linear-gradient(145deg,#e5394f,#a91731);color:#fff;font:700 11px 'Space Grotesk';box-shadow:0 3px 0 #7f1025,0 7px 14px #a917312e;transition:.18s}
.stop-timer:hover:not(:disabled){transform:translateY(-1px);background:linear-gradient(145deg,#f04b5f,#bd1d3a)}
.stop-timer:disabled{cursor:not-allowed;opacity:.48;box-shadow:none}
#stop-timer-status{display:block;margin-top:6px;color:#9aa8b7;font-size:10px;line-height:1.3;text-align:center}
#timer.timer-stopped{color:#a91731}
.time-scoreboard{margin-top:12px;padding:10px;border:1px solid #e1e7ef;border-radius:10px;background:#f7f9fc;box-shadow:inset 0 1px 0 #fff;text-align:left}
.scoreboard-title{display:flex;justify-content:space-between;align-items:center;padding-bottom:6px;border-bottom:1px solid #e1e7ef;color:#7990aa;font-size:9px;font-weight:700;letter-spacing:.1em}
.scoreboard-title b{color:#a91731;font-size:9px;letter-spacing:0}
.scoreboard-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:7px;padding:7px 2px;color:#51677f;font-size:10px}
.scoreboard-row.active{background:#fff;border-radius:6px;padding-left:5px;padding-right:5px;box-shadow:0 2px 7px #182b520d}
.scoreboard-row span{display:flex;align-items:center;gap:5px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scoreboard-row i{width:7px;height:7px;flex:none;border-radius:50%;box-shadow:0 0 0 2px #fff,0 0 0 3px #dbe4ed}
.scoreboard-row strong{font:700 11px 'Space Grotesk';color:var(--ink)}
.scoreboard-row em{font-style:normal;color:#a91731;font-size:9px;white-space:nowrap}
.time-scoreboard>small{display:block;padding-top:6px;border-top:1px solid #e1e7ef;color:#8998aa;font-size:9px;line-height:1.35}
.scoreboard-empty{padding:8px 2px;color:#9aa8b7;font-size:10px}
@media(max-width:950px){.timer-card{min-width:180px}}

/* Børnevisning: gem tekniske forklaringer og vinduesværktøjer fra spillefladen. */
.view-zoom,.window-controls,.view-label,.truth-badge,.world-badge,.world-controls,
.board-legend,footer,.live-dot,.top-actions>span,.intro>div:first-child>.eyebrow,
.intro>div:first-child>p:not(.eyebrow),.king-card>p,.hint-levels{display:none!important}
.brand span,#stop-timer-status{display:none!important}

/* Tidskontoen får nyt scorebord efter den godkendte reference; behold data i state imens. */
#time-scoreboard{display:none!important}

/* Kongens automatiske hjælpekort vises ikke i den forenklede børnevisning. */
.king-card{display:none!important}
.control-grid{grid-template-columns:minmax(0,1.35fr) minmax(230px,.78fr)}
@media(max-width:950px){.control-grid{grid-template-columns:1fr}}

/* Ingen overskrift over selve spillebrætterne i børnevisningen. */
.panel-2d>.panel-heading,.panel-3d>.panel-heading{display:none!important}

/* Vis kun spiller-navnene; den aktive spiller fremhæves tydeligt. */
.player-name{display:none!important}
.players-panel{display:flex;align-items:center;justify-content:flex-end;min-height:52px;margin-left:clamp(12px,3vw,42px)}
.players-display{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.player-name-display{display:inline-flex;align-items:center;min-height:38px;padding:8px 14px;border-radius:10px;background:#edf2f7;color:#53677f;font:600 16px 'Space Grotesk';box-shadow:0 3px 0 #dbe4ed;transition:transform .18s,box-shadow .18s,background .18s,color .18s}
.player-name-display.active{background:#fff5d8;color:#17263c;transform:scale(1.12);box-shadow:0 4px 0 #e4b13f,0 0 0 3px #ffcf5b66,0 8px 18px #d69a2438}
@media(max-width:560px){.players-panel{justify-content:flex-start;margin-left:0}}

/* Scoretavlen følger den leverede KOM-reference og står direkte ved 2D-brættet. */
#time-scoreboard{display:block!important;margin-top:14px;padding:0;border:0;background:transparent;box-shadow:none;text-align:left}
.board-score-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(270px,.92fr);gap:16px;align-items:start}
.board-area{min-width:0}
.board-area .board-legend{display:flex!important;flex-wrap:wrap;align-items:center;gap:8px;margin-top:4px}
.board-area .board-legend>span{display:none!important}
.scoreboard-card{min-width:0;padding:16px;border:1px solid #335e91;border-radius:14px;background:linear-gradient(155deg,#112b53,#071a36);color:#f5f8ff;box-shadow:0 12px 26px #0717383d}
.scoreboard-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.scoreboard-brand small{display:block;color:#b9cce7;font-size:8px;font-weight:700;letter-spacing:.14em}
.scoreboard-brand strong{display:block;margin-top:5px;color:#fff;font:700 19px 'Space Grotesk';letter-spacing:.04em}
.scoreboard-timer{flex:none;padding:7px 10px;border:2px solid #ffcf5b;border-radius:11px;background:#ffca4f;color:#0b2142;text-align:right;box-shadow:0 3px 0 #bc7f1f}
.scoreboard-timer span{display:block;font-size:8px;font-weight:700;letter-spacing:.12em}
.scoreboard-timer strong{display:block;margin-top:1px;font:700 22px 'Space Grotesk';line-height:1}
.scoreboard-card .stop-timer{margin-top:12px;background:linear-gradient(145deg,#e5394f,#a91731);box-shadow:0 3px 0 #650f20,0 6px 12px #0004}
.scoreboard-card .stop-timer:disabled{opacity:.55}
.scoreboard-section-title{display:flex;justify-content:space-between;align-items:center;margin-bottom:7px;color:#fff}
.scoreboard-section-title strong{font:700 17px 'Space Grotesk';letter-spacing:.04em}
.scoreboard-section-title span{padding:5px 8px;border:1px solid #4a78ac;border-radius:999px;color:#b9cce7;font-size:8px;font-weight:700;letter-spacing:.1em}
.scoreboard-columns,.scoreboard-help-columns{display:grid;grid-template-columns:34px minmax(0,1fr) 68px 42px;gap:6px;padding:0 9px 5px;color:#a9bfdd;font-size:8px;font-weight:700;letter-spacing:.1em}
.scoreboard-player-row{display:grid;grid-template-columns:34px minmax(0,1fr) 68px 42px;gap:6px;align-items:center;margin-top:7px;padding:8px 9px;border:1px solid #3b6a9f;border-radius:10px;background:#1c4779;color:#fff}
.scoreboard-player-row.active{border-color:#6b91bd;box-shadow:inset 5px 0 0 #ffca4f}
.scoreboard-rank{display:grid;place-items:center;width:25px;height:25px;border:1px solid #78a4d3;border-radius:50%;background:var(--player-color,#3caad5);color:#082142;font:700 13px 'Space Grotesk'}
.scoreboard-player-name{min-width:0;font:700 12px 'Space Grotesk';overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scoreboard-player-name small{display:block;margin-top:2px;color:#b9cce7;font:500 9px 'DM Sans'}
.scoreboard-player-row>strong{font:700 14px 'Space Grotesk';text-align:center}
.scoreboard-player-row>b{display:grid;place-items:center;min-height:28px;border-radius:9px;background:#ffca4f;color:#11294c;font:700 14px 'Space Grotesk'}
.scoreboard-player-row:not(.active)>b{background:#1f578e;color:#ffca4f;border:1px solid #4e83b8}
.scoreboard-footnote,.scoreboard-help-note{display:block;margin-top:12px;color:#a9bfdd;font-size:9px;line-height:1.35}
.scoreboard-help{margin-top:18px}
.scoreboard-help h3{margin:0 0 9px;color:#fff;font:700 16px 'Space Grotesk';letter-spacing:.03em}
.scoreboard-rule{display:flex;flex-direction:column;gap:3px;padding:10px 11px;border:1px solid #4d7eb4;border-radius:10px;background:#183d6a;color:#b9cce7;font-size:10px}
.scoreboard-rule strong{color:#ffca4f;font:700 14px 'Space Grotesk'}
.scoreboard-rule small{font-size:9px}
.scoreboard-help-columns{grid-template-columns:minmax(0,1fr) 85px 55px;margin-top:14px;padding-left:11px;padding-right:11px}
.scoreboard-help-row{display:grid;grid-template-columns:minmax(0,1fr) 85px 55px;gap:6px;align-items:center;margin-top:7px;padding:8px 11px;border-radius:9px;background:#1c4779;color:#fff;font-size:11px;font-weight:700}
.scoreboard-help-row strong{text-align:center;font:700 13px 'Space Grotesk'}
@media(max-width:1050px){.board-score-layout{grid-template-columns:minmax(0,1fr) minmax(250px,.85fr)}}
@media(max-width:950px){.board-score-layout{grid-template-columns:1fr}.scoreboard-card{order:2}}

/* Lokal login og profilmenu. */
.account-button{background:#ffca4f!important;color:#10294c!important;border:1px solid #d69a24!important;font-weight:700}
.account-panel{position:fixed;z-index:70;top:72px;right:22px;width:min(380px,calc(100vw - 32px));max-height:calc(100vh - 90px);overflow:auto;padding:20px;border:1px solid #d6e0eb;border-radius:15px;background:#fff;color:var(--ink);box-shadow:0 18px 55px #182b5240;font:13px 'DM Sans',Arial,sans-serif}
.account-panel::before{content:'';position:absolute;top:-7px;right:32px;width:13px;height:13px;border-left:1px solid #d6e0eb;border-top:1px solid #d6e0eb;background:#fff;transform:rotate(45deg)}
.account-panel-head{position:relative;display:flex;justify-content:space-between;align-items:flex-start;padding-bottom:12px;border-bottom:1px solid var(--line)}
.account-panel-head small{color:#7990aa;font-size:9px;font-weight:700;letter-spacing:.14em}
.account-panel-head h2{margin:5px 0 0;font:700 21px 'Space Grotesk'}
.account-panel-head>button{background:transparent;color:#8998aa;font-size:22px;line-height:1}
.account-copy,.account-local-note{display:block;color:var(--muted);font-size:11px;line-height:1.45}
.account-panel label{display:flex;flex-direction:column;gap:5px;margin-top:12px;color:#51677f;font-size:11px;font-weight:600}
.identity-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
.consent-box{margin:14px 0 0;padding:10px 12px;border:1px solid #dbe4ed;border-radius:9px;background:#f7f9fc}
.consent-box legend{padding:0 5px;color:#51677f;font-size:11px;font-weight:700}
.consent-box p{margin:0;color:var(--muted);font-size:11px;line-height:1.4}
.consent-box .consent-check{display:flex;flex-direction:row;align-items:flex-start;gap:7px;color:#51677f;font-size:11px;font-weight:500}
.consent-box .consent-check input{margin-top:1px;accent-color:#1e77af}
.form-error{margin:10px 0 0;color:#a8334d;font-size:11px;line-height:1.4}
.account-panel input:not([type=checkbox]):not([type=range]),.account-panel select{width:100%;padding:9px 10px;border:1px solid #dbe4ed;border-radius:7px;background:#f7f9fc;color:var(--ink);font:600 12px 'DM Sans'}
.profile-tabs{display:flex;gap:7px;margin:12px 0 6px}.profile-tabs span{padding:5px 8px;border-radius:6px;background:#f2f5f9;color:#8998aa;font-size:10px}.profile-tabs .active{background:#e5f9ff;color:#128eae;font-weight:700}
.profile-settings{display:grid;grid-template-columns:1fr 1fr;gap:0 14px}.profile-settings label:has(input[type=checkbox]){display:flex;flex-direction:row;align-items:center;gap:7px}.profile-settings input[type=checkbox]{accent-color:#1e77af}.profile-settings input[type=range]{width:100%;accent-color:#1e77af}
.profile-activity{margin:16px 0;padding:13px;border:1px solid #e1e8f0;border-radius:11px;background:#f8fafd}.profile-activity h3{margin:0 0 10px;font:700 14px 'Space Grotesk'}.profile-activity h4{margin:14px 0 6px;color:#7890a8;font-size:9px;letter-spacing:.12em;text-transform:uppercase}.profile-stat-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.profile-stat-grid>div{display:flex;flex-direction:column;gap:3px}.profile-stat-grid strong{font-size:15px;color:var(--ink)}.profile-stat-grid span{color:#71879e;font-size:9px;line-height:1.2}.profile-activity-log{display:grid;gap:5px;margin:0;padding:0;list-style:none}.profile-activity-log li{display:flex;justify-content:space-between;gap:8px;color:#51677f;font-size:10px}.profile-activity-log li span{display:flex;flex-direction:column;gap:2px}.profile-activity-log li small{color:#8b9caf;font-size:9px}.profile-activity-log time{color:#8b9caf;text-align:right}
.account-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:17px}.account-actions button{width:auto!important;padding:9px 13px;border-radius:7px}.account-actions .secondary{margin-top:0;background:#eef3f8;color:#51677f}
@media(max-width:560px){.account-panel{top:58px;right:10px;width:calc(100vw - 20px)}.identity-grid{grid-template-columns:1fr}.profile-settings{grid-template-columns:1fr}}

/* KOM-lommeregneren følger den godkendte mørkeblå/guld reference. */
.calculator-card .drag-handle{background:linear-gradient(155deg,#183661,#0d2144);color:#a9bee0;border-bottom-color:#315785}
.calculator-card .drag-handle span{color:#ffe59a}
.calculator-card .calc-display{margin:15px 16px 12px;min-height:64px;padding:13px 15px;border:1px solid #315785;background:linear-gradient(145deg,#08152e,#112d58);color:#f7fbff;font-size:clamp(22px,2vw,30px);box-shadow:inset 0 1px 0 #ffffff14}
.calculator-card .calc-keys{grid-template-columns:repeat(4,minmax(0,1fr));gap:7px;padding:0 16px 16px}
.calculator-card .calc-key{min-height:48px;padding:4px;border:1px solid #315785;border-radius:10px;background:linear-gradient(145deg,#214b7e,#163960);color:#f7fbff;font-size:clamp(14px,1.35vw,20px);font-weight:800;box-shadow:0 4px 0 #0b2445;transition:transform .12s ease,box-shadow .12s ease,background .12s ease}
.calculator-card .calc-key:hover{background:linear-gradient(145deg,#2b6099,#1b4775)}
.calculator-card .calc-key:active{transform:translateY(3px);box-shadow:0 1px 0 #0b2445}
.calculator-card .calc-key.utility{color:#ffe59a;background:linear-gradient(145deg,#274d7a,#1b3c65)}
.calculator-card .calc-key.operator{color:#10223f;background:linear-gradient(145deg,#ffe59a,#f3bd4e);border-color:#f3bd4e;box-shadow:0 4px 0 #a46a1e}
.calculator-card .calc-key.equals{color:#10223f;background:linear-gradient(145deg,#8dd9e6,#5bb9cc);border-color:#5bb9cc;box-shadow:0 4px 0 #2e8296}
@media(max-width:560px){.calculator-card .calc-key{min-height:48px}.calculator-card .calc-keys{gap:6px;padding-left:12px;padding-right:12px}}

/* Reference calculator palette and geometry from KOM_CALCULATOR_PROTOTYPE.html. */
.calculator-card{border:1px solid rgba(126,169,217,.42)!important;border-radius:24px!important;background:linear-gradient(155deg,rgba(24,54,97,.96),rgba(13,33,67,.96))!important;box-shadow:0 22px 50px rgba(0,0,0,.27)!important;color:#f7fbff!important}
.calculator-card .drag-handle{height:43px;padding:13px 16px;border-bottom:1px solid rgba(126,169,217,.42);background:transparent;color:#a9bee0;font-size:10px;letter-spacing:.1em}
.calculator-card .drag-handle span{color:#ffe59a;font-size:15px;margin-right:6px}
.calculator-card .drag-handle button{color:#a9bee0}
.calculator-card .calc-size-controls{float:right;display:inline-flex;gap:3px;margin:-4px 7px 0 8px}
.calculator-card .calc-size-controls button{width:22px;height:22px;padding:0;border:1px solid rgba(126,169,217,.52);border-radius:5px;background:#214b7e;color:#ffe59a;font-size:16px;line-height:18px;font-weight:800}
.calculator-card .calc-size-controls button:hover{background:#2b6099}
.calculator-card .calc-display{min-height:126px;margin:15px 16px 18px;padding:14px 22px;border:2px solid rgba(126,169,217,.56);border-radius:20px;background:linear-gradient(145deg,#08152e,#112d58);color:#f7fbff;box-shadow:inset 0 1px 0 rgba(255,255,255,.08);font:900 clamp(2rem,3.25rem,4.6rem)/.98 'Space Grotesk',Arial,sans-serif;letter-spacing:-.055em;text-align:right}
.calculator-card .calc-keys{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;padding:0 16px 20px}
.calculator-card .calc-key{min-width:0;min-height:66px;padding:.25rem;border:1px solid rgba(126,169,217,.42);border-radius:16px;color:#f7fbff;background:linear-gradient(145deg,#214b7e,#163960);box-shadow:0 6px 0 #0b2445,0 10px 18px rgba(0,0,0,.16);cursor:pointer;font-size:clamp(1.05rem,1.42rem,2.1rem);font-weight:850;transition:transform .12s ease,box-shadow .12s ease,background .12s ease;user-select:none}
.calculator-card .calc-key:hover{background:linear-gradient(145deg,#2b6099,#1b4775)}
.calculator-card .calc-key:active{transform:translateY(4px);box-shadow:0 2px 0 #0b2445,0 5px 10px rgba(0,0,0,.16)}
.calculator-card .calc-key.utility{color:#ffe59a;background:linear-gradient(145deg,#274d7a,#1b3c65)}
.calculator-card .calc-key.operator{color:#10223f;background:linear-gradient(145deg,#ffe59a,#f3bd4e);border-color:#f3bd4e;box-shadow:0 6px 0 #a46a1e,0 10px 18px rgba(0,0,0,.16)}
.calculator-card .calc-key.operator:hover{background:linear-gradient(145deg,#fff0b6,#f6c965)}
.calculator-card .calc-key.equals{color:#10223f;background:linear-gradient(145deg,#8dd9e6,#5bb9cc);border-color:#5bb9cc;box-shadow:0 6px 0 #2e8296,0 10px 18px rgba(0,0,0,.16)}
.calculator-card .calc-key.wide{grid-column:span 2}
@media(max-width:560px){.calculator-card{border-radius:18px!important}.calculator-card .calc-display{min-height:132px;padding:14px}.calculator-card .calc-keys{gap:7px;padding:0 12px 16px}.calculator-card .calc-key{min-height:54px;border-radius:13px}}
/* The reference keypad has five complete rows; never collapse the window below them. */
.calculator-card.calculator-resizable{min-height:420px!important;display:flex;flex-direction:column}
.calculator-card.calculator-resizable .calc-keys{flex:1 1 auto;grid-template-rows:repeat(5,minmax(0,1fr));min-height:0}
.calculator-card.calculator-resizable .calc-key{min-height:0;height:100%}
/* Override the legacy nth-child lavender rule: only utility, operator and result keys are tinted. */
.calculator-card .calc-keys button.calc-key{color:#f7fbff;background:linear-gradient(145deg,#214b7e,#163960);box-shadow:0 6px 0 #0b2445,0 10px 18px rgba(0,0,0,.16)}
.calculator-card .calc-keys button.calc-key.utility{color:#ffe59a;background:linear-gradient(145deg,#274d7a,#1b3c65)}
.calculator-card .calc-keys button.calc-key.operator{color:#10223f;background:linear-gradient(145deg,#ffe59a,#f3bd4e);border-color:#f3bd4e;box-shadow:0 6px 0 #a46a1e,0 10px 18px rgba(0,0,0,.16)}
.calculator-card .calc-keys button.calc-key.equals{color:#10223f;background:linear-gradient(145deg,#8dd9e6,#5bb9cc);border-color:#5bb9cc;box-shadow:0 6px 0 #2e8296,0 10px 18px rgba(0,0,0,.16)}
.calculator-resize-handle.resize-se{width:max(20px,calc(32px / var(--view-zoom,1)));height:max(20px,calc(32px / var(--view-zoom,1)));right:0;bottom:0}
.calculator-resize-handle.resize-se::after{width:12px;height:12px;right:6px;bottom:6px;border-right:3px solid #dbe8f2;border-bottom:3px solid #dbe8f2}
/* Use the browser's native vertical resize grip as the reliable height control. */
.calculator-card.calculator-resizable{resize:none;overflow:hidden;scrollbar-width:none}
.calculator-card.calculator-resizable::-webkit-scrollbar{display:none}
.calculator-card.calculator-resizable .calculator-resize-handle{pointer-events:auto!important}
.calculator-card.calculator-resizable::after{content:'';position:absolute;right:7px;bottom:7px;width:15px;height:15px;border-right:3px solid #dbe8f2;border-bottom:3px solid #dbe8f2;border-radius:0 0 3px 0;pointer-events:none;filter:drop-shadow(0 1px 1px #061a4266)}

/* New compact upper navigation: the KOM logo is the visual anchor and the
   game controls share one consistent navy/gold menu surface. */
.topbar{min-height:82px;height:auto;padding:10px clamp(16px,4vw,64px);background:linear-gradient(135deg,#0d2346 0%,#163d6c 58%,#225681 100%);border-bottom:2px solid #f3bd4e;box-shadow:0 8px 24px rgba(7,24,52,.22);color:#f7fbff}
.brand{gap:12px;min-width:220px}.brand img{width:62px;height:62px;padding:3px;border-radius:15px;background:rgba(255,255,255,.08);filter:drop-shadow(0 4px 8px rgba(0,0,0,.28))}.brand strong{color:#fff;font-size:17px;letter-spacing:.08em}.brand span{color:#bfd3ed;font-size:10px}
.top-actions{gap:7px;color:#d8e6f5}.top-actions>span:not(.live-dot){display:none}.live-dot{background:#63e1bb;box-shadow:0 0 0 4px rgba(99,225,187,.17)}
.top-actions button{margin-left:0;padding:9px 11px;border:1px solid rgba(169,210,244,.35);border-radius:9px;background:rgba(33,75,126,.86);color:#f7fbff;box-shadow:0 3px 0 rgba(5,25,53,.34);font-size:11px;font-weight:700;transition:background .15s ease,transform .15s ease}.top-actions button:hover{background:#2b6099;transform:translateY(-1px)}
.top-actions .account-button{background:linear-gradient(145deg,#ffe59a,#f3bd4e)!important;border-color:#f3bd4e!important;color:#10223f!important}.top-actions .account-button:hover{background:linear-gradient(145deg,#fff0b6,#f6c965)!important}
.language-control{color:#d8e6f5!important;font-size:10px!important}.language-control select{border:1px solid rgba(169,210,244,.35)!important;border-radius:8px!important;background:#214b7e!important;color:#fff!important;padding:7px 9px!important}
@media(max-width:760px){.topbar{padding:8px 12px}.brand{min-width:0}.brand img{width:48px;height:48px}.brand strong{font-size:13px}.brand span{display:none}.top-actions{width:auto;flex:0 1 auto;justify-content:flex-end}.top-actions button{padding:7px 8px;font-size:10px}.language-control{display:flex!important;align-items:center;gap:5px}}

/* Header reference layout: white rounded bar, larger logo, two simple menu groups. */
.topbar{min-height:146px;height:auto;margin:14px clamp(10px,2vw,30px) 0;padding:16px clamp(16px,3vw,38px);border:1px solid #dbe4ed;border-bottom:3px solid #dfe8f1;border-radius:24px;background:#fff;box-shadow:0 10px 28px rgba(24,43,82,.08);color:#172f56;align-items:center;gap:24px}
.brand{min-width:350px;gap:14px;align-items:center}.brand img{width:116px;height:116px;padding:0;border-radius:0;background:transparent;filter:none}.brand strong{color:#183461;font-size:28px;line-height:.98;letter-spacing:.17em}.brand span{display:block;margin-top:9px;color:#60789e;font-size:12px;font-weight:800;letter-spacing:.1em}
.top-actions{display:flex;flex:0 1 auto;align-items:center;justify-content:center;gap:28px;color:#183461;background:transparent;box-shadow:none}
.top-actions>#voice,.top-actions>#music,.top-actions>button:not(#save):not(#restore):not(#reset):not(#king-toggle):not(#account-login):not(#account-button):not(#info-help){display:none!important}
.header-group{display:flex;flex-direction:column;gap:9px}.header-group-label{color:#637b9f;font-size:12px;font-weight:900;letter-spacing:.13em}.header-group-actions{display:flex;gap:11px;white-space:nowrap}.header-group-actions button{margin:0!important;min-width:112px;padding:13px 18px;border:1px solid #cbdced;border-radius:14px;background:#f7faff;color:#183461;box-shadow:none;font-size:16px;font-weight:500}.header-group-actions button:hover{transform:translateY(-1px);background:#eef5fd}.header-play #restore,.header-play #reset{border-color:#183461;background:#183461;color:#fff}.header-account #account-login{border-color:#e3ab2d;background:linear-gradient(145deg,#ffe59a,#f3bd4e);color:#183461}.header-account #account-button{border-color:#183461!important;background:#183461!important;color:#fff!important}.header-account #info-help{min-width:148px;border-color:#c8c4ef;background:#eeecff;color:#183461}.header-divider{width:1px;height:78px;background:#d7e1ed}.header-note{flex:1;min-width:250px;padding:18px 24px;border:1px solid #e3b43f;border-radius:17px;background:#fffaf0;color:#183461;font-size:16px;line-height:1.25}.header-note span,.header-note small{display:block}.header-note small{margin-top:8px;color:#637b9f;font-size:12px;font-weight:800;letter-spacing:.08em}.window-controls{top:6px;right:8px}.window-controls button{background:#f2f5f9}
.header-group-label{margin:0;padding:0;border:0;background:transparent;color:#637b9f;cursor:pointer;font:inherit;text-align:left}.header-group-label:hover{color:#183461}.header-play:not(.menu-open) .header-group-actions,.header-account:not(.menu-open) .header-group-actions{display:none!important}.header-play.menu-open .header-group-actions,.header-account.menu-open .header-group-actions{display:flex!important}
.info-panel-section{margin-top:14px;padding:12px 14px;border-radius:10px;background:#f7f9fc;color:#183461}.info-panel-section strong{font-size:13px}.info-panel-section p{margin:5px 0 0;color:#718198;font-size:12px;line-height:1.5}
@media(max-width:1150px){.topbar{gap:14px;padding:12px 18px}.brand{min-width:265px}.brand img{width:82px;height:82px}.brand strong{font-size:20px}.header-group-actions{gap:6px}.header-group-actions button{min-width:84px;padding:10px 11px;font-size:12px}.header-note{min-width:190px;padding:12px 15px;font-size:12px}.header-note small{font-size:9px}.header-divider{height:64px}}
@media(max-width:760px){.topbar{min-height:82px;margin:8px 8px 0;padding:8px 10px;border-radius:16px;gap:8px}.brand{min-width:0}.brand img{width:52px;height:52px}.brand strong{font-size:13px;letter-spacing:.1em}.brand span{margin-top:4px;font-size:8px}.top-actions{gap:5px}.header-group-label{display:block!important;font-size:10px}.header-divider,.header-note{display:none}.header-group-actions{gap:4px}.header-group-actions button{min-width:auto;padding:8px 7px;border-radius:8px;font-size:10px}.header-account #info-help{min-width:auto}}

/* King visibility is a direct game control beside New game. */
.header-play #king-toggle{border-color:#cfd9e6;background:#edf2f7;color:#183461}
.header-play #king-toggle:hover{background:#e1eaf4}
.header-play #king-toggle.king-off{border-color:#49d3a0;background:#e5f9f1;color:#087856}
.world-3d.king-disabled .king-stage{display:none!important}
.game-closed .shell{display:none!important}
@media(max-width:1150px){.header-play #king-toggle{min-width:84px}}

/* Regnestykket vises trin for trin med mellemresultatet båret videre til næste linje. */
.equation.equation-steps-layout{display:block}
.equation-steps{display:flex;flex-direction:column;gap:8px;width:min(100%,460px);margin:0 auto}
.equation-step{display:grid;grid-template-columns:52px minmax(0,1fr);align-items:center;gap:8px;padding:7px 9px;border:1px solid #dbe4ed;border-radius:10px;background:#f7f9fc;box-shadow:0 3px 8px #182b5210}
.equation-step-label{color:#718198;font:700 10px 'DM Sans';letter-spacing:.08em;text-transform:uppercase}
.equation-step-line{display:grid;grid-template-columns:minmax(32px,1fr) 36px minmax(32px,1fr) 22px minmax(48px,1fr);align-items:center;gap:6px;min-width:0}
.equation-slot,.step-result{display:inline-flex;align-items:center;justify-content:center;min-width:32px;height:34px;padding:0 7px;border-radius:7px;background:#ece9ff;color:#17263c;font:700 20px/1 'Space Grotesk';white-space:nowrap}
.equation-slot.empty{color:#9aa8b7;background:#fff;border:1px dashed #cbd7e3}
.equation-slot.carry-slot{background:#e5f9f1;color:#087856;border:1px solid #9edfc6;box-shadow:inset 0 0 0 1px #fff}
.equation-step .op-select{width:36px;min-width:36px;height:34px;padding:0;border-radius:7px;background:#ece9ff;color:var(--violet);font-size:19px}
.equation-step .op-select.operator-active{background:#fff0bd;color:#815d12;box-shadow:inset 0 0 0 2px #f1c75b}
.equals-sign{color:#718198;font:700 20px 'Space Grotesk';text-align:center}
.step-result{background:#e5f9f1;color:#087856;border:1px solid #9edfc6}
.step-result:not(.calculated){background:#fff;color:#9aa8b7;border:1px dashed #cbd7e3}
.intermediate-result.calculated{cursor:grab;box-shadow:0 3px 0 #75cba9}
.intermediate-result.calculated:active{cursor:grabbing}
.equation-step .result-tile{width:100%;min-width:48px;height:34px;padding:0 7px;background:#fff5e1;color:#b47813;border:1px dashed #e7b85c;font-size:19px}
@media(max-width:560px){.equation-step{grid-template-columns:40px minmax(0,1fr);gap:5px;padding:6px}.equation-step-label{font-size:8px}.equation-step-line{grid-template-columns:minmax(27px,1fr) 29px minmax(27px,1fr) 17px minmax(40px,1fr);gap:3px}.equation-slot,.step-result,.equation-step .op-select{min-width:27px;height:31px;font-size:16px}.equation-step .op-select{width:29px}.equals-sign{font-size:16px}}

.intermediate-result{appearance:none;border:1px solid #9edfc6;font:700 20px/1 'Space Grotesk';}
.intermediate-result:disabled{opacity:1;cursor:default;}
.equation-slot.carry-slot.carry-drop-ready{outline:3px solid #39d6ff;outline-offset:2px;background:#e5f9ff;}
.equation-slot.carry-slot.carry-placed{animation:carryPlaced .9s ease-out;}
@keyframes carryPlaced{0%{transform:scale(1.08);box-shadow:0 0 0 4px #39d6ff88}100%{transform:scale(1);}}

.equation-choice-pending{padding:13px 16px;border:1px dashed #f1c75b;border-radius:10px;background:#fffaf0;color:#815d12;font:600 13px 'DM Sans';text-align:center}

/* 1·2·3-menuen skal være synlig, når terningen giver spillerens frie valg. */
.board-area .board-legend>#dice-choice:not([hidden]){display:flex!important;align-items:center;gap:5px;}
.board-area .board-legend>#dice-choice:not([hidden]) button{display:inline-flex!important;align-items:center;justify-content:center;width:32px;height:30px;padding:0;border:1px solid #e3ab2d;border-radius:7px;background:#fff;color:#815d12;font:700 13px 'Space Grotesk';}
.board-area .board-legend>#dice-choice:not([hidden]) button:hover{background:#fff5d8;transform:translateY(-1px);}

.board-area .board-legend{justify-content:flex-start!important;}
.board-area .board-legend>#dice-choice:not([hidden]){margin-left:8px;}

/* Startknappen står stabilt og viser kun handlingen før første kast. */
.board-area .board-legend>#dice{position:relative;flex:none;min-width:148px;justify-content:center;}
.dice-start-label{font:800 12px 'Space Grotesk';letter-spacing:.12em;text-transform:uppercase;}

/* Automatisk hjælp samles som fem vedvarende trin i stedet for at overskrive det forrige. */
.hint-history-item{display:flex;gap:8px;align-items:flex-start;margin:5px 0;padding:7px 9px;border-left:3px solid #39d6ff;border-radius:6px;background:#f4fbff;color:#51677f;font-size:10px;line-height:1.35;text-align:left}
.hint-history-item strong{flex:none;color:#128eae;font:700 10px 'Space Grotesk'}
.hint-history-item span{white-space:normal}
.ds-choice-card{width:min(460px,calc(100vw - 32px));padding:24px;border:1px solid #dbe5f0;border-radius:18px;background:#fff;color:#17263c;box-shadow:0 20px 70px #182b5266;font:14px DM Sans,Arial,sans-serif}
.ds-choice-kicker{color:#1c63d5;font-size:11px;font-weight:800;letter-spacing:.16em}
.ds-choice-card h2{margin:7px 0 8px;font-size:21px}.ds-choice-card p{margin:0 0 18px;color:#61728a;line-height:1.45}
.ds-choice-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}.ds-choice-actions button{border:0;border-radius:10px;padding:13px 12px;background:#182b52;color:#fff;font-weight:800;cursor:pointer}.ds-choice-actions button:first-child{background:#2c6de8}
.ds-tile-group{margin-top:16px}.ds-tile-group>strong{display:block;margin-bottom:8px;font-size:12px;color:#526985;text-transform:uppercase;letter-spacing:.08em}.ds-tile-grid{display:flex;flex-wrap:wrap;gap:8px}.ds-tile{min-width:48px;padding:10px 12px;border:1px solid #d7e2ee;border-radius:9px;background:#f5f8fc;color:#17263c;font-size:16px;font-weight:800;cursor:pointer}.ds-tile.selected{border-color:#e6aa18;background:#fff2c6;box-shadow:0 0 0 2px #f5ca50}.ds-tile:disabled{opacity:.45;cursor:not-allowed}
.ds-box-tile{width:58px;height:58px;padding:6px;background:linear-gradient(145deg,#182b52,#28539a);border-color:#d9aa28;display:grid;place-items:center}.ds-box-tile img{width:100%;height:100%;object-fit:contain;border-radius:5px}.ds-box-tile:disabled{opacity:.55}
.ds-result-card{text-align:center}.ds-result-card h2{font-size:24px}.ds-result-close{margin-top:18px;border:0;border-radius:10px;padding:12px 20px;background:#182b52;color:#fff;font-weight:800;cursor:pointer}
.crown-hand-tile{display:inline-grid;place-items:center;padding:5px;background:linear-gradient(145deg,#fff7cf,#f5c542);border-color:#d9a928}.crown-visual{position:relative;display:grid;place-items:center;width:28px;height:28px}.crown-tile-icon{width:100%;height:100%;object-fit:contain;display:block}.crown-glyph{position:absolute;inset:0;display:grid;place-items:center;color:#123b7a;font:900 15px/1 Arial,sans-serif;text-shadow:0 1px 0 #fff;pointer-events:none}.board-cell .crown-visual,.tile-3d .crown-visual{width:70%;height:70%;min-width:16px;min-height:16px}.board-cell .crown-glyph,.tile-3d .crown-glyph{font-size:clamp(12px,2.5vw,20px)}
[data-ds-choice-panel]{position:fixed;z-index:40;inset:0;display:grid;place-items:center;padding:16px;background:#17263c66}


.top-actions #setup{display:block!important}


.top-actions #next-turn,.top-actions #computer-turn,.top-actions #redeem-invite{display:block!important}

