/* Game surface and game-specific controls only. */
:root{--orb-size:clamp(34px,10vw,44px);}
[role=button]{-webkit-tap-highlight-color:transparent}
.tube:focus-visible{outline:3px solid #fff1b8;outline-offset:2px}
.premium-stage{position:relative;isolation:isolate;min-height:500px;overflow:hidden;border:1px solid #7b622f;border-radius:25px;padding:7px 5px 16px;background:linear-gradient(180deg,#111827dd,#06090fef),radial-gradient(circle at 50% 20%,#7891bd55,transparent 48%);box-shadow:inset 0 1px #fff3,inset 0 -40px 80px #0008,0 22px 60px #000b}
.premium-stage:before{content:"";position:absolute;z-index:-1;inset:0;background:repeating-linear-gradient(105deg,transparent 0 84px,#ffffff05 86px 87px,transparent 89px 170px),linear-gradient(90deg,#0007,transparent 13% 87%,#0007)}
.premium-stage:after{content:"";position:absolute;z-index:-1;right:8%;bottom:5px;left:8%;height:24px;border-radius:50%;background:#dcbf7244;filter:blur(16px)}
.stage-glow{position:absolute;z-index:-1;width:210px;height:210px;border-radius:50%;filter:blur(60px);opacity:.28}
.stage-glow-left{top:18%;left:-100px;background:#00d9ff}
.stage-glow-right{right:-110px;bottom:10%;background:#a84fff}
.board{position:relative;z-index:2;display:grid;grid-template-columns:repeat(var(--columns),minmax(0,1fr));align-content:center;gap:18px 2px;min-height:469px;padding:5px 1px 2px;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.board.is-locked{pointer-events:none}
.tube-shelf{position:absolute;z-index:0;top:calc(var(--shelf-position) * 100% - 14px);right:.75%;left:.75%;height:20px;background:linear-gradient(180deg,transparent 0,#17120a12 18%,#39281738 62%,#120d087d 100%);clip-path:polygon(4% 0,96% 0,100% 100%,0 100%);pointer-events:none}
.tube-shelf:after{content:"";position:absolute;right:0;bottom:0;left:0;height:1px;background:linear-gradient(90deg,transparent,#8c6b37 10%,#e0bc6d 50%,#8c6b37 90%,transparent);box-shadow:0 2px 5px #000b,0 0 5px #d0a5572e}
.tube{position:relative;z-index:1;display:flex;width:100%;height:198px;min-width:0;align-items:flex-end;justify-content:center;border:0;padding:0;background:none;cursor:pointer;filter:drop-shadow(0 10px 10px #0009);transition:transform .2s}
.tube:before{content:"";position:absolute;z-index:0;bottom:1px;width:82%;height:14px;border:1px solid #82652f;border-radius:50%;background:linear-gradient(180deg,#9a7432 0,#453018 38%,#170f09 76%,#050403 100%);box-shadow:inset 0 2px #f5dc8c88,0 5px 0 #070503,0 10px 13px #000c}
.tube-art{position:absolute;z-index:3;inset:0;width:100%;height:100%;object-fit:contain;pointer-events:none;user-select:none;transition:filter .2s,transform .25s cubic-bezier(.2,.8,.2,1)}
.balls{position:absolute;z-index:2;right:20%;bottom:19px;left:20%;display:flex;height:calc(var(--capacity) * (var(--orb-size) - 3px));flex-direction:column-reverse;align-items:center;justify-content:flex-start;pointer-events:none}
.orb{position:relative;display:block;width:var(--orb-size);height:var(--orb-size);flex:0 0 var(--orb-size);margin-top:-3px;filter:drop-shadow(0 5px 4px #0008);transition:transform .23s cubic-bezier(.18,.82,.2,1.25),filter .2s,opacity .12s}
.orb img{display:block;width:100%;height:100%;object-fit:contain;filter:var(--colour-filter);user-select:none}
.orb:after{content:"";position:absolute;right:16%;bottom:7%;left:16%;height:12%;border-radius:50%;background:#001a;filter:blur(4px)}
.colour-0{--colour-filter:grayscale(1) sepia(1) saturate(6) hue-rotate(310deg) brightness(.95)}
.colour-1{--colour-filter:grayscale(1) sepia(1) saturate(5) hue-rotate(350deg) brightness(1.08)}
.colour-2{--colour-filter:grayscale(1) sepia(1) saturate(5.5) hue-rotate(24deg) brightness(1.14)}
.colour-3{--colour-filter:grayscale(1) sepia(1) saturate(5) hue-rotate(78deg) brightness(.96)}
.colour-4{--colour-filter:grayscale(1) sepia(1) saturate(5) hue-rotate(138deg) brightness(1.02)}
.colour-5{--colour-filter:grayscale(1) sepia(1) saturate(6) hue-rotate(184deg) brightness(.86)}
.colour-6{--colour-filter:grayscale(1) sepia(1) saturate(5.5) hue-rotate(232deg) brightness(.96)}
.colour-7{--colour-filter:grayscale(1) sepia(1) saturate(5) hue-rotate(282deg) brightness(1.06)}
.tube.is-selected .orb:last-child{z-index:2;transform:translateY(-15px) scale(1.05);filter:drop-shadow(0 0 12px #ffe18f)}
.tube.is-selected:after,.tube.can-receive:after{content:"";position:absolute;z-index:4;top:8px;width:42%;height:9px;border-radius:50%;border:2px solid #9df4ff;box-shadow:0 0 12px #39dbff,inset 0 0 8px #39dbff;animation:target-pulse 1.15s ease-in-out infinite}
.tube-number{position:absolute;z-index:5;bottom:-9px;display:grid;width:23px;height:23px;place-items:center;border:1px solid #80662f;border-radius:50%;background:#090c12;color:#d8c488;font:700 10px Arial,sans-serif;box-shadow:0 3px 8px #000}
.arrival-orb{transform-origin:center;transition:none!important;will-change:transform,opacity}
.move-sheen{position:absolute;z-index:0;right:4%;bottom:15px;left:4%;height:1px;background:linear-gradient(90deg,transparent,#efcf78aa,transparent);box-shadow:0 0 22px #efcf78}
.result-orbit{position:relative;display:grid;width:88px;height:88px;margin:6px auto 12px;place-items:center}
.result-orbit:before{content:"";position:absolute;inset:5px;border:1px solid #ffe29c;border-radius:50%;box-shadow:0 0 22px #ffd65d;animation:orbit 2.2s linear infinite}
.result-orbit img{width:70px;height:70px}
@keyframes target-pulse{50%{opacity:.5;transform:scale(.88)}}
@keyframes orbit{to{transform:rotate(360deg)}}
@media(min-width:700px){:root{--orb-size:48px;}
.premium-stage{min-height:540px}
.board{min-height:504px;gap:20px 8px;padding:10px 16px}
.tube{height:225px}
.balls{bottom:22px}
.tube-number{bottom:-7px}}
@media(min-width:900px) and (orientation:landscape){.premium-stage{min-height:430px}
.board{grid-template-columns:repeat(var(--tube-count),minmax(70px,1fr));min-height:399px;gap:8px}
.tube-shelf{display:none}
.tube{height:275px}
.balls{bottom:26px}}
@media(max-width:370px){:root{--orb-size:36px;}
.premium-stage{min-height:465px}
.board{gap:12px 0;min-height:439px}
.tube{height:181px}
.balls{bottom:17px}}
@media(orientation:landscape) and (max-height:700px){.premium-stage{min-height:330px}
.board{grid-template-columns:repeat(var(--tube-count),1fr);min-height:324px}
.tube{height:230px}}
.solution-stop{position:absolute;z-index:10;top:9px;right:9px;width:36px;height:36px;background:#080b11e8;box-shadow:inset 0 1px #fff2,0 5px 18px #000c}
.cube-stage{height:calc(100svh - 250px);min-height:200px;max-height:850px;position:relative;background:radial-gradient(ellipse at 20% 12%,#32615844,transparent 60%),radial-gradient(ellipse at 90% 90%,#30535144,transparent 65%);border-radius:22px}
.cube-stage canvas{display:block;width:100%;height:calc(100% - 100px);touch-action:none}
.cube-controls{height:100px;display:grid;grid-template-columns:minmax(0,1fr) 78px minmax(0,1fr);align-items:center;gap:0}
.cube-controls #joystick{grid-column:2;justify-self:center}
.cube-controls #center{grid-column:3;justify-self:end;max-width:100%;overflow-wrap:anywhere}
.cube-controls .secondary-button{min-width:0;padding:10px 14px}
.joystick-base{width:78px;height:78px;position:relative;touch-action:none;border:1px solid #a38749;border-radius:50%;background:radial-gradient(circle,#242e37,#090d14);box-shadow:inset 0 3px 14px #000,0 0 16px #dfc17611}
.joystick-knob{position:absolute;left:50%;top:50%;width:34px;height:34px;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(circle at 30% 20%,#fff1bd,#b59448 50%,#4b3c21);box-shadow:0 3px 9px #000}
.start-row{position:absolute;top:0;left:20%;right:20%;z-index:2}
.start-row .primary-button{margin:4px 0}
.keyboard-pieces{display:flex;position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.keyboard-pieces:focus-within{display:flex;width:auto;height:auto;clip-path:none;flex-wrap:wrap;position:absolute;inset:0;z-index:10;background:#0b1017;overflow:auto;gap:5px;padding:10px}
.keyboard-pieces button{border:1px solid #b99b52;color:white;background:#151c22;padding:8px}
.keyboard-pieces button:not(:focus){opacity:.8}
.cube-stage{height:calc(100svh - 250px - env(safe-area-inset-bottom))}
.burst-bit{position:absolute;width:12px;height:12px;pointer-events:none;z-index:5;background:linear-gradient(135deg,#fff9d0,#edb741,#7a521c);border-radius:3px;animation:burst .7s ease-out forwards}
@keyframes burst{from{transform:translate(0,0) rotate(0);opacity:1}to{transform:translate(var(--dx),var(--dy)) rotate(240deg);opacity:0}}
@media(orientation:landscape){.cube-stage{height:calc(100svh - 250px);min-height:200px}
.cube-controls{height:82px}
.cube-stage canvas{height:calc(100% - 82px)}}
@media(prefers-reduced-motion:reduce){.burst-bit{display:none}}
:root{--anchor-inset:env(safe-area-inset-bottom,0px);}
@media(orientation:landscape) and (max-height:520px){.cube-controls{height:82px}
.cube-stage canvas{height:calc(100% - 82px)}}
#difficulty-option{max-width:50%;border:1px solid #796439;border-radius:9px;padding:10px;background:#080b11;color:var(--ivory);font:inherit}
#difficulty-note{font-size:13px;line-height:1.45;color:#c4b9a3;margin:0 0 14px}
.rotation-pad{grid-column:1;grid-row:1;justify-self:start;display:grid;grid-template-columns:repeat(3,36px);grid-template-rows:repeat(2,36px);gap:2px}
.cube-controls .rotation-pad button{width:36px;height:36px;min-height:0;padding:0;font:24px/1 Arial,sans-serif;touch-action:manipulation}
#rotate-up{grid-column:2;grid-row:1}
#rotate-left{grid-column:1;grid-row:2}
#rotate-down{grid-column:2;grid-row:2}
#rotate-right{grid-column:3;grid-row:2}
.cube-controls #joystick,.cube-controls #center{grid-row:1}
.highlow-shell,.play-area,.card-table{
  overscroll-behavior:none;
  touch-action:manipulation;
}
.card,.number-card{
  touch-action:manipulation;
}
img,canvas,.joystick-knob{
  -webkit-user-drag:none;
}
textarea,[contenteditable="true"]{
  -webkit-user-select:text;
  user-select:text;
  -webkit-touch-callout:default;
}
