#minigame-dialog{--game-height:740px;--game-accent:#356b58;box-sizing:border-box;width:min(660px,calc(100vw - 20px));max-width:none;height:min(var(--game-height),calc(100dvh - 20px));max-height:calc(100dvh - 20px);padding:0;overflow:hidden;overscroll-behavior:contain;border:1px solid #e0d5bf;border-radius:18px}
#minigame-dialog[open]{display:flex;flex-direction:column}
#minigame-dialog[data-game=blocks]{--game-height:780px;width:min(540px,calc(100vw - 20px))}
#minigame-dialog[data-game=water]{--game-height:660px}#minigame-dialog[data-game=planets]{--game-height:660px;--game-accent:#67538c}#minigame-dialog[data-game=power]{--game-height:630px;--game-accent:#67538c}#minigame-dialog[data-game=shuttle]{--game-height:710px;--game-accent:#67538c}
#minigame-dialog .game-heading{position:relative;flex:none;min-height:60px;padding:12px 62px 10px 18px;background:#f8efd9;border-bottom:1px solid #d8d2c1}
#minigame-title{font:27px/1.25 Georgia,serif;margin:0}#minigame-dialog .close{right:8px;top:7px;width:44px;height:44px}
#minigame-dialog .game-body{display:flex;flex:1;min-height:0;flex-direction:column;gap:8px;padding:12px 18px 14px;overflow:hidden}
#minigame-intro{flex:none;font-size:13px;line-height:1.4;margin:0;color:#3d5149}
#minigame-area{display:flex;flex:1 1 0;min-height:0;align-items:center;flex-direction:column;gap:8px}
.game-stage{position:relative;flex:1 1 0;min-height:0;width:100%;overflow:hidden}
.game-stage>canvas,.game-stage>.water-grid,.game-stage>.planet-grid,.game-stage>.power-grid{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);box-sizing:border-box;max-width:none;max-height:none}
.game-canvas{display:block;border:3px solid #54766a;border-radius:12px;background:#19332f;box-shadow:0 4px 12px #182c2620}
.game-canvas.blocks{border-color:#8499af}.game-canvas.shuttle{border-color:#a8acc5}
.game-pad{flex:none;display:flex;justify-content:center;flex-wrap:wrap;gap:6px;width:100%}
.game-pad button{min-width:44px;min-height:44px;border:1px solid #acb6a9;border-radius:10px;background:#fffaf0;font-size:21px;padding:5px 12px;touch-action:manipulation;box-shadow:0 2px 0 #c8c7b9}
.game-pad button[aria-label="Stein ablegen"]{font-size:13px;font-weight:700}
.game-controls{flex:none;display:flex;justify-content:center;gap:8px;flex-wrap:wrap;margin:0}
.game-controls button{min-height:44px;padding:9px 18px;border:1px solid #abb6aa;border-radius:10px;background:#fffaf0;font-weight:700}
.game-controls #minigame-start{background:var(--gold);border-color:#d5ae3f}
#minigame-score{flex:none;display:block;align-self:center;text-align:center;margin:0;padding:5px 12px;background:#e9eddf;border:1px solid #c8d6c5;border-radius:20px;font-size:12px;line-height:1.25;font-weight:700}
#minigame-result{flex:none;text-align:center;font-size:13px;line-height:1.35;font-weight:700;color:#315f4b;margin:0;padding:4px 8px}
#minigame-result:empty{display:none}#minigame-dialog[data-state=won] #minigame-result{background:#dfedda;border-radius:8px}#minigame-dialog[data-state=edge] #minigame-result{background:#f5dfaa;color:#594113;border-radius:8px}
#minigame-dialog .game-body>.small{flex:none;margin:0;text-align:center;font-size:10px;line-height:1.3;color:#687368}
.water-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:7px;background:#d6c39d;padding:10px;border-radius:12px}
.channel{min-width:0;min-height:0;padding:0;border:2px solid #8a6b3d;border-radius:8px;background:#fff7df;touch-action:manipulation;overflow:hidden}.channel svg{display:block;width:100%;height:100%}.channel-bank{fill:none;stroke:#966c3e;stroke-width:32;stroke-linejoin:round}.channel-water{fill:none;stroke:#cfb185;stroke-width:18;stroke-linejoin:round}.channel.wet .channel-water{stroke:#177f9c}.channel:focus-visible{outline-offset:-4px}
.planet-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:7px}
.planet-card{min-width:0;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;border:2px solid #7a82a4;border-radius:11px;background:linear-gradient(145deg,#2f3856,#475371);color:#fff;font-size:28px;padding:0;touch-action:manipulation;overflow:hidden}
.planet-card svg{width:100%;height:calc(100% - 18px);min-height:0;flex:1}.planet-card.revealed{background:#ede5f1;color:#302d44}.planet-card.revealed span{flex:none;font-size:11px;line-height:16px;padding:0 2px 2px}.planet-card:disabled{opacity:.8;border-color:#397f70}
.power-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:10px;padding:12px;background:#303b57;border-radius:15px}
.power-cell{min-width:0;min-height:0;border:3px solid #8494ad;border-radius:12px;background:#46516a;color:#fff;font-size:22px;font-weight:700;touch-action:manipulation}.power-cell.charged{background:#f6d27b;color:#332f42;border-color:#fff0b9;box-shadow:inset 0 0 0 4px #d4ac53}.power-cell:disabled{opacity:1}
.planet-card:focus-visible,.power-cell:focus-visible{outline:3px solid #c4abed;outline-offset:-5px}
.game-list-heading{grid-column:1/-1;font:20px Georgia,serif;margin:14px 0 0}#results .game-list-entry{border-color:#b2c8b2;background:#edf1df}
@media(max-height:700px){#minigame-dialog .game-body>.small{display:none}#minigame-dialog .game-body{gap:6px;padding:9px 14px 11px}#minigame-intro{font-size:12px;line-height:1.35}#minigame-title{font-size:24px}.game-pad{gap:5px}}
@media(max-height:520px) and (min-width:560px){#minigame-dialog{width:min(850px,calc(100vw - 20px))}#minigame-dialog .game-heading{min-height:54px;padding:10px 62px 8px 16px}#minigame-dialog .game-body{display:grid;grid-template-columns:minmax(0,1fr) 215px;grid-template-rows:auto auto minmax(0,1fr) auto;gap:7px 16px}#minigame-area{grid-column:1;grid-row:1/5;height:100%}#minigame-intro{grid-column:2;grid-row:1}#minigame-score{grid-column:2;grid-row:2;justify-self:center}#minigame-result{grid-column:2;grid-row:3;align-self:center}.game-controls{grid-column:2;grid-row:4}.game-controls button{padding:8px 12px}}
#minigame-dialog[data-game=chess]{--game-height:790px;width:min(640px,calc(100vw - 20px));--game-accent:#654875}.chess-options{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;width:100%;font-size:12px}.chess-options select,.chess-options button,.chess-promotions button{font:inherit;border:1px solid #9eaa98;border-radius:8px;padding:8px;background:#fffaf0;min-height:38px}.chess-options label{display:flex;align-items:center;gap:6px}.chess-options select{max-width:240px}.chess-options button:disabled{opacity:.45}.game-stage>.chess-board{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}.chess-board{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));border:4px solid #29483b;border-radius:6px;overflow:hidden;box-shadow:0 3px 12px #14291f30}.chess-square{position:relative;display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;padding:0;border:0;border-radius:0;touch-action:manipulation}.chess-square.light{background:#f1dfb9}.chess-square.dark{background:#4b775e}.chess-square.last-move{background:#d8bd6b}.chess-square.dark.last-move{background:#7f954c}.chess-square[aria-selected=true]{box-shadow:inset 0 0 0 4px #a25aaa}.chess-square.can-move:after{content:'';position:absolute;width:24%;height:24%;border-radius:50%;background:#844895;opacity:.85}.chess-square:has(.chess-piece).can-move:after{background:transparent;border:4px solid #a25aaa;width:80%;height:80%}.chess-piece{width:88%;height:88%;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;z-index:1;pointer-events:none}.chess-piece.white{fill:#fff8e5;stroke:#27362c;color:#27362c}.chess-piece.black{fill:#26372e;stroke:#fff2cd;color:#fff2cd}.chess-file,.chess-rank{position:absolute;font-size:clamp(7px,1.8vmin,11px);line-height:1;color:#20382a;pointer-events:none}.dark .chess-file,.dark .chess-rank{color:#fdf7e3}.chess-file{right:3px;bottom:2px}.chess-rank{left:3px;top:2px}.chess-square:focus-visible{outline:3px solid #c278dc;outline-offset:-3px;z-index:2}.chess-promotions{display:flex;flex:none;justify-content:center;gap:6px}.chess-promotions[hidden]{display:none}
@media(max-width:420px){.chess-options{font-size:11px}.chess-options select{max-width:190px;padding:6px}.chess-options label{gap:3px}.chess-options button{padding:6px}.chess-options label{font-size:0}.chess-options label select{font-size:11px}}
@media(max-height:520px) and (min-width:560px){#minigame-dialog[data-game=chess]{width:min(850px,calc(100vw - 20px))}.chess-options{font-size:10px}.chess-options label{font-size:0}.chess-options select{font-size:10px;max-width:160px}.chess-options button{font-size:10px;padding:5px}.chess-promotions{gap:2px}.chess-promotions button{font-size:10px;padding:5px}}
