:root{
  --bg:#d9dde0;
  --steel:#f4f2ed;
  --ink:#162532;
  --navy:#10293d;
  --navy-2:#173d59;
  --blue:#0d74c9;
  --green:#3b9e43;
  --orange:#d97918;
  --red:#b72b2b;
  --gold:#f1b626;
  --line:#9ea8ae;
  --shadow:0 10px 30px rgba(20,35,45,.15);
  --radius:14px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;font-family:Inter,Segoe UI,Arial,sans-serif;color:var(--ink);background:linear-gradient(135deg,#c9ced2,#edf0f2)}
button,input{font:inherit}
button{cursor:pointer}
.app-shell{min-height:100vh;display:grid;grid-template-columns:172px 1fr}
.sidebar{position:sticky;top:0;height:100vh;background:linear-gradient(#122f45,#0c2334);color:white;padding:16px 10px;box-shadow:5px 0 18px rgba(0,0,0,.18);z-index:5;display:flex;flex-direction:column}
.brand{appearance:none;border:0;background:transparent;color:white;display:flex;align-items:center;gap:10px;width:100%;padding:8px;margin-bottom:14px;text-align:left}
.brand-bolt{width:48px;height:48px;border:2px solid #c9d1d6;border-radius:12px;display:grid;place-items:center;font-size:28px;background:linear-gradient(145deg,#4b5962,#1d2a31);box-shadow:inset 0 0 0 3px #18242b}
.brand b,.brand small{display:block;letter-spacing:.04em}.brand b{font-size:13px}.brand small{font-size:11px;opacity:.8;margin-top:2px}
.nav{display:grid;gap:6px}.nav-item{border:0;color:#dbe6ee;background:transparent;border-radius:9px;text-align:left;padding:12px 10px;font-weight:700;display:flex;gap:9px;align-items:center}.nav-item:hover{background:#1b435e}.nav-item.active{background:linear-gradient(180deg,#1688df,#0b6bb5);box-shadow:inset 0 0 0 1px rgba(255,255,255,.2)}
.sidebar-note{margin-top:auto;background:#f7d35e;color:#26323b;padding:14px 12px;border-radius:4px;transform:rotate(-2deg);box-shadow:var(--shadow);font-size:13px;display:grid;gap:5px}.sidebar-note small{font-size:11px}.build-label{font-size:10px;opacity:.55;margin:18px 4px 2px}
.workspace{min-width:0}.topbar{min-height:128px;background:linear-gradient(100deg,#ece7dc,#f8f7f3 55%,#e1e3e2);border-bottom:1px solid #9fa6a9;display:grid;grid-template-columns:minmax(440px,1.45fr) 230px minmax(300px,.8fr);align-items:center;gap:16px;padding:16px 24px;box-shadow:0 3px 14px rgba(0,0,0,.12)}
.title-wrap{display:flex;align-items:center;gap:16px}.party-screw{font-size:48px;position:relative;filter:drop-shadow(0 4px 2px rgba(0,0,0,.2))}.party-screw span{position:absolute;font-size:25px;left:-4px;top:-14px;transform:rotate(-18deg)}h1{margin:0;font-size:clamp(25px,2.2vw,42px);letter-spacing:-.03em;text-shadow:0 1px white}.title-wrap p{margin:4px 0 0;color:#2d4b6f;font-size:17px;font-weight:700}
.warning-plate{background:#f6cc45;border:2px solid #7b651e;box-shadow:inset 0 0 0 3px rgba(255,255,255,.35),0 3px 8px rgba(0,0,0,.15);border-radius:9px;padding:13px;text-align:center;transform:rotate(-1deg);font-size:13px}
.player-summary{background:linear-gradient(160deg,#183e59,#102a3e);color:white;border-radius:14px;padding:13px 16px;min-height:86px;display:grid;grid-template-columns:auto 1fr;gap:12px;align-items:center;box-shadow:var(--shadow)}.player-avatar{width:55px;height:55px;border-radius:50%;background:linear-gradient(#f7f7f4,#aeb8be);border:4px solid #73848d;display:grid;place-items:center;font-size:28px}.player-summary b{display:block}.player-summary small{opacity:.74}.xp-bar{height:8px;background:#071722;border-radius:9px;margin-top:7px;overflow:hidden}.xp-bar span{display:block;height:100%;background:linear-gradient(90deg,#f0b61e,#ffd961);border-radius:inherit}.summary-links{font-size:11px;margin-top:5px;opacity:.85}
.content-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;padding:18px}.main{min-width:0}.right-rail{display:grid;gap:14px;align-content:start}
.panel{background:rgba(249,249,247,.94);border:1px solid #aeb8bd;border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.panel-head{background:linear-gradient(#183e59,#10293d);color:white;padding:10px 14px;font-weight:800}.panel-body{padding:14px}.section-title{display:flex;align-items:end;justify-content:space-between;gap:12px;margin:4px 0 12px}.section-title h2{margin:0;font-size:22px}.section-title p{margin:0;color:#62727d;font-size:13px}
.difficulty-grid{display:grid;grid-template-columns:repeat(4,minmax(180px,1fr));gap:14px}.difficulty-card{border:2px solid currentColor;border-radius:14px;padding:14px;text-align:left;min-height:195px;position:relative;overflow:hidden;background:white;box-shadow:0 4px 10px rgba(0,0,0,.1);transition:.2s transform,.2s box-shadow}.difficulty-card:hover{transform:translateY(-3px);box-shadow:0 9px 20px rgba(0,0,0,.15)}.difficulty-card.green{color:#26752d;background:linear-gradient(145deg,#f8fff4,#e0f4db)}.difficulty-card.blue{color:#0b5d9f;background:linear-gradient(145deg,#fbfdff,#e3f2ff)}.difficulty-card.orange{color:#a75a0e;background:linear-gradient(145deg,#fffdfa,#fff0d9)}.difficulty-card.red{color:#9c2020;background:linear-gradient(145deg,#fffafa,#ffe3e3)}.difficulty-num{position:absolute;right:10px;top:8px;width:38px;height:38px;border-radius:50%;display:grid;place-items:center;color:white;background:currentColor;box-shadow:0 2px 6px rgba(0,0,0,.2)}.difficulty-card h3{font-size:23px;margin:4px 44px 0 0}.difficulty-card .subtitle{font-weight:800;color:#263640;margin-top:2px}.difficulty-size{display:inline-block;background:currentColor;color:white;border-radius:999px;padding:5px 10px;font-size:13px;font-weight:800;margin:13px 0}.difficulty-card p{color:#263640;margin:0;font-weight:650;line-height:1.35}.difficulty-screw{position:absolute;right:4px;bottom:-12px;font-size:74px;opacity:.13;transform:rotate(24deg)}
.hero-strip{margin-top:14px;display:grid;grid-template-columns:1fr auto;gap:15px;align-items:center;padding:14px 16px;background:linear-gradient(105deg,#112f45,#1b5273);color:white;border-radius:13px;box-shadow:var(--shadow)}.hero-strip b{font-size:18px}.hero-strip p{margin:3px 0 0;opacity:.82;font-size:13px}.primary-btn,.secondary-btn,.danger-btn{border:0;border-radius:9px;padding:10px 14px;font-weight:800}.primary-btn{background:linear-gradient(#1688df,#0b6bb5);color:white}.secondary-btn{background:#e8edef;color:#253743;border:1px solid #b6c0c5}.danger-btn{background:#b83232;color:white}.mini-btn{padding:7px 10px;font-size:12px}
.preview-grid{display:grid;grid-template-columns:repeat(8,minmax(90px,1fr));gap:8px}.preview-tile,.collection-card{background:#fbfaf6;border:1px solid #b9c0c3;border-radius:9px;padding:8px;text-align:center;min-width:0}.preview-tile .screw-art{height:90px}.preview-tile b{font-size:11px;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.preview-tile small{font-size:9px;color:#687781;display:block;margin-top:2px}
.screw-art svg{display:block;width:100%;height:100%}
.login-form{display:grid;gap:9px}.input-row{display:grid;gap:5px}.input-row label{font-size:12px;font-weight:800;color:#50616d}.input-row input{width:100%;border:1px solid #bcc5ca;background:#fff;border-radius:8px;padding:10px 11px}.local-warning{font-size:11px;color:#6b7479;background:#fff6d9;padding:8px;border-radius:7px;border:1px solid #e6d495}.login-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.profile-list{display:grid;gap:7px}.profile-chip{display:flex;justify-content:space-between;gap:10px;align-items:center;background:#edf2f4;border:1px solid #c7d0d5;border-radius:8px;padding:8px 10px;font-size:12px}.profile-chip button{border:0;background:#0d74c9;color:white;border-radius:7px;padding:5px 8px}
.achievement-mini-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.badge{display:grid;justify-items:center;text-align:center;gap:4px}.badge-icon{width:52px;height:52px;border-radius:15px;clip-path:polygon(50% 0,88% 14%,100% 52%,79% 90%,50% 100%,20% 90%,0 52%,12% 14%);background:linear-gradient(145deg,#f7c545,#a86f00);box-shadow:inset 0 0 0 4px rgba(255,255,255,.38),0 3px 8px rgba(0,0,0,.25);display:grid;place-items:center;font-size:24px}.badge.locked{filter:grayscale(1);opacity:.38}.badge b{font-size:10px;line-height:1.1}.badge small{font-size:9px;color:#6c7a82}
.game-toolbar{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-bottom:10px}.game-toolbar .stat-pill{background:#edf2f4;border:1px solid #c2ccd1;border-radius:999px;padding:7px 11px;font-size:12px;font-weight:800}.game-board-wrap{background:#213f52;border:1px solid #0e2c40;padding:10px;border-radius:14px;overflow:auto;box-shadow:inset 0 0 28px rgba(0,0,0,.25)}.memory-grid{display:grid;gap:6px;margin:auto;width:max-content}.memory-card{width:92px;height:116px;perspective:700px;border:0;padding:0;background:transparent}.memory-card.compact{width:62px;height:78px}.memory-card.tiny{width:49px;height:62px}.memory-card-inner{position:relative;width:100%;height:100%;transition:transform .32s;transform-style:preserve-3d}.memory-card.flipped .memory-card-inner,.memory-card.matched .memory-card-inner{transform:rotateY(180deg)}.card-face{position:absolute;inset:0;backface-visibility:hidden;border-radius:8px;overflow:hidden;border:1px solid #8e989d}.card-back{background:radial-gradient(circle at 30% 20%,#47657a,#17364d 55%,#0d2435);color:#dce6eb;display:grid;place-items:center;font-size:29px;box-shadow:inset 0 0 0 3px rgba(255,255,255,.08)}.card-back:before{content:'⚙';border:2px solid #8fa2ad;width:50%;aspect-ratio:1;border-radius:50%;display:grid;place-items:center}.card-front{transform:rotateY(180deg);background:linear-gradient(#fffefa,#ece9df);padding:4px;display:grid;grid-template-rows:1fr auto;align-items:center}.card-front .screw-art{min-height:0}.card-front span{font-size:8px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;color:#334650}.memory-card.compact .card-front span,.memory-card.tiny .card-front span{display:none}.memory-card.matched{opacity:.48}.memory-card.bonus .card-front{background:linear-gradient(145deg,#fff6b0,#e7ad18);font-size:26px}.memory-card.shake{animation:shake .25s linear 2}@keyframes shake{25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}
.game-result{display:grid;gap:10px;text-align:center;padding:10px 4px}.game-result .big{font-size:44px}.game-result h2{margin:0}.game-result p{margin:0;color:#5e6d75}
.collection-toolbar{display:flex;gap:8px;margin-bottom:10px;flex-wrap:wrap}.collection-toolbar input,.collection-toolbar select{border:1px solid #b6c1c6;border-radius:8px;padding:9px 10px}.collection-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(142px,1fr));gap:9px}.collection-card{position:relative}.collection-card.locked{filter:grayscale(1);opacity:.38}.collection-card .screw-art{height:115px}.collection-card b{font-size:11px;display:block}.collection-card small{font-size:9px;color:#667780}.collection-card .lock-mark{position:absolute;right:8px;top:7px;font-size:18px}
.achievement-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}.achievement-card{border:1px solid #bcc5ca;background:#faf9f5;border-radius:10px;padding:12px;display:grid;grid-template-columns:58px 1fr;gap:10px;align-items:center}.achievement-card.locked{opacity:.42;filter:grayscale(1)}.achievement-card h4{margin:0 0 4px;font-size:13px}.achievement-card p{margin:0;font-size:10px;color:#63727a}.achievement-card .badge-icon{width:58px;height:58px}
.stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}.stat-box{background:linear-gradient(#fff,#edf1f3);border:1px solid #bdc7cc;border-radius:10px;padding:14px;min-height:95px}.stat-box span{font-size:11px;color:#667780;display:block}.stat-box b{font-size:25px;display:block;margin-top:7px}.mode-table{width:100%;border-collapse:collapse;font-size:12px}.mode-table th,.mode-table td{padding:9px;border-bottom:1px solid #d5dadd;text-align:left}.mode-table th{background:#eef2f4}
.help-list{display:grid;gap:10px}.help-step{display:grid;grid-template-columns:40px 1fr;gap:12px;align-items:start}.help-num{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#0d74c9;color:white;font-weight:900}.help-step h3{margin:1px 0 4px;font-size:15px}.help-step p{margin:0;color:#5d6c74;font-size:12px}.tiny-source{font-size:10px;color:#6c777d;margin-top:10px}
.toast-region{position:fixed;right:20px;bottom:20px;z-index:50;display:grid;gap:8px}.toast{background:#10293d;color:white;border:1px solid #587085;border-radius:10px;box-shadow:var(--shadow);padding:11px 14px;max-width:350px;animation:toastin .2s ease}.toast strong{color:#ffd35b}@keyframes toastin{from{transform:translateY(8px);opacity:0}}
.modal-backdrop{position:fixed;inset:0;background:rgba(4,15,22,.65);z-index:40;display:grid;place-items:center;padding:20px}.modal{background:#f8f7f2;border-radius:16px;border:1px solid #9da9af;box-shadow:0 30px 80px rgba(0,0,0,.4);width:min(610px,100%);max-height:90vh;overflow:auto}.modal .panel-head{display:flex;justify-content:space-between;align-items:center}.modal-close{border:0;background:transparent;color:white;font-size:20px}.empty-state{text-align:center;color:#6f7c83;padding:30px 10px}
@media (max-width:1250px){.content-grid{grid-template-columns:1fr}.right-rail{grid-template-columns:repeat(2,1fr)}.topbar{grid-template-columns:1fr 190px}.player-summary{grid-column:1/-1}.difficulty-grid{grid-template-columns:repeat(2,1fr)}.preview-grid{grid-template-columns:repeat(6,1fr)}}
@media (max-width:800px){.app-shell{grid-template-columns:64px 1fr}.sidebar{padding:10px 6px}.brand span:last-child,.nav-item span,.sidebar-note,.build-label{display:none}.brand{justify-content:center}.brand-bolt{width:44px;height:44px}.nav-item{justify-content:center;font-size:19px}.topbar{grid-template-columns:1fr;padding:14px}.warning-plate{display:none}.title-wrap p{font-size:13px}.content-grid{padding:10px}.right-rail{grid-template-columns:1fr}.difficulty-grid{grid-template-columns:1fr}.preview-grid{grid-template-columns:repeat(3,1fr)}.stats-grid{grid-template-columns:repeat(2,1fr)}}


/* v0.2 – Spielbrett-Balancing, größere Karten, Lupe & Responsive-Modus */
.app-shell.game-active .content-grid{grid-template-columns:minmax(0,1fr);padding-right:18px}
.app-shell.game-active .right-rail{display:none}
.app-shell.game-active .topbar{grid-template-columns:minmax(420px,1.3fr) 210px minmax(270px,.7fr);min-height:112px;padding-top:12px;padding-bottom:12px}
.game-section-title{align-items:center}
.game-tools{display:flex;justify-content:space-between;align-items:center;gap:12px;background:linear-gradient(105deg,#edf3f5,#f9faf8);border:1px solid #b8c3c9;border-radius:11px;padding:9px 11px;margin-bottom:9px}
.game-tools>div:first-child{display:grid;gap:2px}.game-tools small{font-size:11px;color:#65757e}.zoom-controls{display:flex;align-items:center;gap:6px;white-space:nowrap}.zoom-controls #zoom-label{min-width:48px;text-align:center;font-size:11px;font-weight:900;color:#40545f}
.card-magnifier{min-height:132px;display:grid;grid-template-columns:112px minmax(0,1fr);align-items:center;gap:14px;background:linear-gradient(115deg,#102c40,#1d536f);color:white;border:1px solid #071d2b;border-radius:13px;padding:10px 14px;margin-bottom:10px;box-shadow:inset 0 0 25px rgba(0,0,0,.18),0 5px 14px rgba(20,35,45,.12)}
.card-magnifier.active{background:linear-gradient(115deg,#12354d,#246887)}.card-magnifier b{display:block;font-size:14px}.card-magnifier small{display:block;margin-top:4px;color:#c8d9e3;font-size:11px;line-height:1.35}.magnifier-icon{font-size:46px;text-align:center;opacity:.8}.magnifier-art{height:110px;width:100%;display:grid;place-items:center}.magnifier-art svg{height:100%;width:100%;filter:drop-shadow(0 4px 3px rgba(0,0,0,.3))}.magnifier-gold{font-size:66px;text-align:center;filter:drop-shadow(0 4px 3px rgba(0,0,0,.3))}
.game-board-wrap{padding:11px;max-height:calc(100vh - 305px);min-height:300px;scrollbar-gutter:stable both-edges}
.memory-grid{gap:var(--card-gap,7px);width:max-content;min-width:min-content;align-items:start;justify-items:start}
.memory-card,.memory-card.compact,.memory-card.tiny{width:var(--card-w,96px);height:var(--card-h,118px);transition:filter .15s ease,opacity .15s ease}
.memory-card:hover:not(:disabled){filter:brightness(1.08)}
.card-face{border-radius:9px;border-width:1.5px}.card-front{padding:3px;grid-template-rows:1fr}.card-front .screw-art{width:100%;height:100%;display:grid;place-items:center;overflow:hidden}.card-front .screw-art svg{filter:drop-shadow(0 2px 1px rgba(0,0,0,.16))}.card-front span{display:none!important}.card-back:before{width:55%;font-size:clamp(20px,2vw,34px)}
.golden-card{height:100%;display:grid;place-items:center;align-content:center;gap:2px}.golden-card>span{display:block!important;font-size:clamp(24px,3vw,42px)}.golden-card small{font-size:clamp(6px,.7vw,9px);font-weight:900;line-height:1.05;color:#6b4a00}
.game-board-wrap[data-mode="merten"] .memory-card{--local-scale:1}.game-board-wrap[data-mode="sidney"] .card-face{border-radius:7px}.game-board-wrap[data-mode="sidney"] .card-back{font-size:20px}
@media (max-width:1250px){.app-shell.game-active .topbar{grid-template-columns:1fr 190px}.app-shell.game-active .player-summary{grid-column:1/-1}.game-board-wrap{max-height:none}.card-magnifier{grid-template-columns:100px 1fr}.magnifier-art{height:100px}}
@media (max-width:800px){.app-shell.game-active .topbar{grid-template-columns:1fr;min-height:auto}.game-tools{align-items:flex-start;flex-direction:column}.zoom-controls{width:100%}.card-magnifier{grid-template-columns:82px 1fr;min-height:104px}.magnifier-art{height:82px}.game-board-wrap{padding:8px}.game-section-title{align-items:flex-start;flex-direction:column}.game-section-title .danger-btn{align-self:flex-end}}
\n\n/* v0.3.1 – kleiner visueller Refresh. WICHTIG: Kartenbrett, Memory-Karten und Flip-Rotation absichtlich unangetastet. */
body{background:
  radial-gradient(circle at 18% 10%,rgba(255,255,255,.65),transparent 30%),
  linear-gradient(135deg,#c6ccd0,#edf0f2 48%,#cbd0d3)}
.sidebar{background:
  linear-gradient(90deg,rgba(255,255,255,.035),transparent 25%),
  linear-gradient(#13364f,#0a2639 74%,#071d2b);border-right:1px solid #526673}
.brand{border-radius:12px;padding:10px 8px;background:rgba(0,0,0,.09);box-shadow:inset 0 0 0 1px rgba(255,255,255,.04)}
.brand-bolt{clip-path:polygon(25% 5%,75% 5%,96% 50%,75% 95%,25% 95%,4% 50%);border-radius:0;background:linear-gradient(145deg,#667781,#293840);box-shadow:inset 0 0 0 3px #18242b,0 4px 8px rgba(0,0,0,.28)}
.nav-item{border:1px solid transparent;transition:.16s ease;background:linear-gradient(90deg,rgba(255,255,255,.015),transparent)}
.nav-item:hover{border-color:rgba(255,255,255,.08);transform:translateX(2px)}
.nav-item.active{border-color:#5eb5ed;box-shadow:inset 0 0 0 1px rgba(255,255,255,.18),0 4px 10px rgba(0,0,0,.18)}
.sidebar-note{background:linear-gradient(145deg,#ffe16c,#efbf32);border:1px solid #a67a10;box-shadow:0 8px 18px rgba(0,0,0,.25);position:relative}
.sidebar-note:before{content:'';position:absolute;width:38px;height:13px;background:rgba(245,233,190,.75);top:-7px;left:41%;transform:rotate(3deg)}
.topbar{background:
  repeating-linear-gradient(90deg,rgba(20,30,35,.018) 0 1px,transparent 1px 5px),
  linear-gradient(100deg,#d9d3c7,#f7f5ee 52%,#dadcdc);box-shadow:0 5px 16px rgba(0,0,0,.14)}
.title-wrap h1{font-weight:900;color:#27343c;text-shadow:0 2px #fff,0 4px 10px rgba(0,0,0,.08)}
.party-screw{width:64px;height:64px;border-radius:50%;display:grid;place-items:center;background:linear-gradient(145deg,#f8f8f5,#9eabb3);border:4px solid #697b85;box-shadow:inset 0 0 0 3px #d9dfe2,0 5px 11px rgba(0,0,0,.2);font-size:37px}
.party-screw span{left:-5px;top:-13px}
.warning-plate{background:linear-gradient(145deg,#ffdc58,#efb91e);border:2px solid #87670d;box-shadow:inset 0 0 0 3px rgba(255,255,255,.28),0 5px 11px rgba(0,0,0,.16)}
.player-summary{border:1px solid #567388;box-shadow:inset 0 0 0 1px rgba(255,255,255,.06),0 8px 18px rgba(0,0,0,.15)}
.panel{border-color:#9ba8af;background:linear-gradient(180deg,rgba(253,252,248,.97),rgba(240,241,239,.97));box-shadow:0 8px 20px rgba(23,39,49,.13)}
.panel-head{position:relative;padding-left:20px;background:linear-gradient(#1b4967,#102f46);text-shadow:0 1px 2px rgba(0,0,0,.35);letter-spacing:.01em}
.panel-head:before,.panel-head:after{content:'';position:absolute;top:50%;width:5px;height:5px;border-radius:50%;background:#aebbc3;box-shadow:inset 0 1px 1px #fff,0 1px 2px #071722;transform:translateY(-50%)}
.panel-head:before{left:7px}.panel-head:after{right:8px}
.difficulty-card{min-height:205px;border-width:2px;box-shadow:0 7px 15px rgba(0,0,0,.12),inset 0 0 0 1px rgba(255,255,255,.55)}
.difficulty-card:before,.difficulty-card:after{content:'';position:absolute;width:6px;height:6px;border-radius:50%;background:#9aa6ad;box-shadow:inset 0 1px 1px white,0 1px 2px rgba(0,0,0,.35)}
.difficulty-card:before{left:8px;bottom:8px}.difficulty-card:after{right:8px;top:8px}
.difficulty-card h3{font-weight:900;letter-spacing:-.02em;text-shadow:0 1px #fff}
.difficulty-card .subtitle{font-size:13px}.difficulty-size{box-shadow:inset 0 -2px 0 rgba(0,0,0,.14),0 2px 4px rgba(0,0,0,.08)}
.difficulty-screw{opacity:.16;filter:drop-shadow(0 3px 2px rgba(0,0,0,.18))}
.hero-strip{border:1px solid #0a283c;background:linear-gradient(105deg,#102f45,#225d7e);box-shadow:inset 0 0 0 1px rgba(255,255,255,.05),0 8px 18px rgba(0,0,0,.13)}
.primary-btn{box-shadow:inset 0 -2px 0 rgba(0,0,0,.16),0 3px 7px rgba(0,0,0,.11)}
.primary-btn:hover,.secondary-btn:hover{filter:brightness(1.05)}
.preview-tile,.collection-card{background:
  linear-gradient(rgba(31,76,104,.04) 1px,transparent 1px),
  linear-gradient(90deg,rgba(31,76,104,.04) 1px,transparent 1px),
  linear-gradient(#fffefa,#efede7);background-size:14px 14px,14px 14px,auto;border-color:#aab5bb;box-shadow:0 4px 10px rgba(0,0,0,.08)}
.preview-tile:hover,.collection-card:hover{transform:translateY(-2px);box-shadow:0 7px 14px rgba(0,0,0,.12)}
.achievement-mini-grid{gap:12px}
.badge-icon{background:radial-gradient(circle at 35% 25%,#ffeaa3,#efb92f 40%,#a46500 78%);border:2px solid #7c5706;box-shadow:inset 0 0 0 3px rgba(255,255,255,.32),0 4px 8px rgba(0,0,0,.24);text-shadow:0 1px 1px rgba(255,255,255,.6)}
.achievement-grid{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.achievement-card{position:relative;overflow:hidden;border-color:#a9b5bb;background:linear-gradient(145deg,#fffefb,#ebece8);box-shadow:0 4px 10px rgba(0,0,0,.08);transition:.16s ease}
.achievement-card:not(.locked):hover{transform:translateY(-2px);box-shadow:0 8px 16px rgba(0,0,0,.13)}
.achievement-card:not(.locked):before{content:'✓';position:absolute;right:7px;top:5px;width:20px;height:20px;border-radius:50%;display:grid;place-items:center;background:#369b47;color:white;font-size:11px;font-weight:900;border:2px solid white;box-shadow:0 2px 5px rgba(0,0,0,.18)}
.achievement-card.locked{opacity:.34}
.achievement-card h4{font-size:13px;line-height:1.15;padding-right:15px}.achievement-card p{line-height:1.3}
.stats-grid{gap:12px}.stat-box{position:relative;overflow:hidden;background:linear-gradient(145deg,#fff,#e8edef);box-shadow:0 4px 10px rgba(0,0,0,.07)}
.stat-box:after{content:'🔩';position:absolute;right:-8px;bottom:-16px;font-size:58px;opacity:.055;transform:rotate(24deg)}
.local-warning{background:linear-gradient(#fff9df,#fff1bf);border-color:#dfc46a}


/* v0.3.2 – Hotfix: Difficulty-Badges wieder korrekt farbig */
.difficulty-card.green{--difficulty-accent:#26752d}
.difficulty-card.blue{--difficulty-accent:#0b5d9f}
.difficulty-card.orange{--difficulty-accent:#a75a0e}
.difficulty-card.red{--difficulty-accent:#9c2020}

.difficulty-num{
  color:#fff !important;
  background:var(--difficulty-accent) !important;
}

.difficulty-size{
  color:#fff !important;
  background:var(--difficulty-accent) !important;
  border:1px solid color-mix(in srgb,var(--difficulty-accent) 75%,#000 25%);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 2px 5px rgba(0,0,0,.10);
}


/* v0.3.3 – Schrauben-Orakel / Laufband; Spielfeldregeln unverändert */
.screw-oracle{
  min-height:42px;
  display:grid;
  grid-template-columns:auto minmax(0,1fr) 42px;
  align-items:center;
  overflow:hidden;
  margin:0;
  color:#f8fbfd;
  background:linear-gradient(180deg,#173d59,#102d43);
  border-top:1px solid rgba(255,255,255,.12);
  border-bottom:1px solid #071d2b;
  box-shadow:inset 0 1px rgba(255,255,255,.06),inset 0 -8px 18px rgba(0,0,0,.12),0 3px 8px rgba(0,0,0,.10);
  cursor:pointer;
  user-select:none;
}
.oracle-label{
  height:100%;
  padding:0 14px;
  display:flex;
  align-items:center;
  gap:7px;
  white-space:nowrap;
  color:#162532;
  background:linear-gradient(180deg,#ffd95d,#eab52c);
  border-right:1px solid #816216;
  text-transform:uppercase;
  letter-spacing:.055em;
  font-size:11px;
  box-shadow:inset -1px 0 rgba(255,255,255,.25);
}
.oracle-label span{font-size:17px;filter:drop-shadow(0 1px 0 rgba(255,255,255,.35))}
.oracle-track{position:relative;overflow:hidden;min-width:0;height:42px;display:flex;align-items:center;mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent);-webkit-mask-image:linear-gradient(90deg,transparent,#000 3%,#000 97%,transparent)}
.oracle-text{
  width:max-content;
  max-width:none;
  white-space:nowrap;
  padding-left:100%;
  font-size:13px;
  font-weight:800;
  letter-spacing:.012em;
  text-shadow:0 1px 1px rgba(0,0,0,.35);
  animation:oracle-scroll 24s linear infinite;
  will-change:transform;
}
.screw-oracle:hover .oracle-text{animation-play-state:paused}
.oracle-bolt{height:100%;display:grid;place-items:center;font-size:19px;color:#b9c9d2;border-left:1px solid rgba(255,255,255,.10);background:rgba(0,0,0,.08)}
.oracle-text.oracle-swap{animation:none;opacity:0;transform:translateX(12px);transition:opacity .18s ease,transform .18s ease}
@keyframes oracle-scroll{from{transform:translateX(0)}to{transform:translateX(calc(-100% - 100vw))}}
@media (prefers-reduced-motion:reduce){.oracle-text{animation:none;padding-left:18px;white-space:normal}.oracle-track{height:auto;min-height:42px}}
@media (max-width:800px){.screw-oracle{grid-template-columns:38px minmax(0,1fr) 30px}.oracle-label{padding:0;justify-content:center}.oracle-label b{display:none}.oracle-text{font-size:12px}.oracle-bolt{font-size:15px}}


/* v0.3.4 – Darkmode. Spielfeld-/Karten-Geometrie und Flip-Logik bleiben unverändert. */
.theme-toggle{
  margin:14px 2px 10px;
  width:calc(100% - 4px);
  min-height:40px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:9px;
  color:#e6f0f6;
  background:linear-gradient(180deg,#183e59,#102b40);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:800;
  font-size:12px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06),0 3px 8px rgba(0,0,0,.16);
}
.theme-toggle:hover{background:linear-gradient(180deg,#205272,#15384f);border-color:rgba(255,255,255,.28)}
.theme-icon{font-size:16px}.theme-label{white-space:nowrap}

html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{
  color:#dbe5eb;
  background:radial-gradient(circle at 18% 8%,rgba(55,82,99,.24),transparent 31%),linear-gradient(135deg,#111a20,#1b262d 48%,#0e171d);
}
html[data-theme="dark"] .workspace{background:linear-gradient(135deg,#111a20,#17232a 50%,#101a20)}
html[data-theme="dark"] .topbar{
  background:repeating-linear-gradient(90deg,rgba(255,255,255,.012) 0 1px,transparent 1px 5px),linear-gradient(100deg,#202a30,#111a20 52%,#1a252b);
  border-bottom-color:#3d4c55;
  box-shadow:0 5px 16px rgba(0,0,0,.34);
}
html[data-theme="dark"] .title-wrap h1{color:#eef4f7;text-shadow:0 2px #080d10,0 4px 10px rgba(0,0,0,.35)}
html[data-theme="dark"] .title-wrap p{color:#9ec7e0}
html[data-theme="dark"] .party-screw{background:linear-gradient(145deg,#6f7e87,#202c33);border-color:#84959e;box-shadow:inset 0 0 0 3px #33434c,0 5px 11px rgba(0,0,0,.36)}
html[data-theme="dark"] .content-grid{background:transparent}
html[data-theme="dark"] .section-title h2{color:#edf3f6}
html[data-theme="dark"] .section-title p{color:#93a5af}
html[data-theme="dark"] .panel{background:linear-gradient(180deg,rgba(30,43,51,.98),rgba(20,31,38,.98));border-color:#445660;box-shadow:0 8px 20px rgba(0,0,0,.28)}
html[data-theme="dark"] .panel-body{color:#d7e1e6}
html[data-theme="dark"] .panel-head{background:linear-gradient(#1c4b68,#0c293d);border-bottom-color:#071d2b}
html[data-theme="dark"] .difficulty-card.green{background:linear-gradient(145deg,#1d3424,#13271a);color:#68c872;border-color:#399448}
html[data-theme="dark"] .difficulty-card.blue{background:linear-gradient(145deg,#172d3d,#102535);color:#62b7ef;border-color:#2f8dc8}
html[data-theme="dark"] .difficulty-card.orange{background:linear-gradient(145deg,#382719,#2b1d11);color:#f1a653;border-color:#ce771d}
html[data-theme="dark"] .difficulty-card.red{background:linear-gradient(145deg,#3a1c20,#291317);color:#ef7373;border-color:#c43a3a}
html[data-theme="dark"] .difficulty-card h3{color:currentColor;text-shadow:0 1px rgba(0,0,0,.5)}
html[data-theme="dark"] .difficulty-card .subtitle,html[data-theme="dark"] .difficulty-card p{color:#dbe5e9}
html[data-theme="dark"] .difficulty-card:before,html[data-theme="dark"] .difficulty-card:after{background:#788891;box-shadow:inset 0 1px 1px #c8d2d7,0 1px 2px #000}
html[data-theme="dark"] .hero-strip{background:linear-gradient(105deg,#0b2638,#173f57);border-color:#31566b}
html[data-theme="dark"] .preview-tile,html[data-theme="dark"] .collection-card{
  color:#dce6eb;
  background:linear-gradient(rgba(121,166,190,.045) 1px,transparent 1px),linear-gradient(90deg,rgba(121,166,190,.045) 1px,transparent 1px),linear-gradient(#27353d,#1a272e);
  background-size:14px 14px,14px 14px,auto;
  border-color:#4b606b;
}
html[data-theme="dark"] .preview-tile small,html[data-theme="dark"] .collection-card small{color:#9fb0ba}
html[data-theme="dark"] .secondary-btn{background:#263740;color:#e0e8ec;border-color:#52636d}
html[data-theme="dark"] .input-row label{color:#b9c7ce}
html[data-theme="dark"] .input-row input,html[data-theme="dark"] .collection-toolbar input,html[data-theme="dark"] .collection-toolbar select{background:#111e25;color:#e5edf1;border-color:#52636d}
html[data-theme="dark"] .input-row input::placeholder,html[data-theme="dark"] .collection-toolbar input::placeholder{color:#798c97}
html[data-theme="dark"] .local-warning{color:#f0deb0;background:linear-gradient(#3b321d,#302714);border-color:#6c5b2e}
html[data-theme="dark"] .profile-chip{background:#1c2b33;border-color:#455963;color:#dce5ea}
html[data-theme="dark"] .achievement-card{border-color:#455963;background:linear-gradient(145deg,#26353d,#18252c);box-shadow:0 4px 10px rgba(0,0,0,.18)}
html[data-theme="dark"] .achievement-card h4{color:#e3ebef}
html[data-theme="dark"] .achievement-card p{color:#9babb4}
html[data-theme="dark"] .stat-box{background:linear-gradient(145deg,#26353d,#17242b);border-color:#455963;box-shadow:0 4px 10px rgba(0,0,0,.18)}
html[data-theme="dark"] .stat-box span{color:#9fb0ba}
html[data-theme="dark"] .stat-box b{color:#eef4f7}
html[data-theme="dark"] .mode-table th{background:#21313a;color:#dfe8ec}
html[data-theme="dark"] .mode-table th,html[data-theme="dark"] .mode-table td{border-bottom-color:#40515b}
html[data-theme="dark"] .help-step p,html[data-theme="dark"] .tiny-source{color:#9eafb8}
html[data-theme="dark"] .game-tools{background:linear-gradient(105deg,#1d2d35,#253740);border-color:#455963;color:#e1e9ed}
html[data-theme="dark"] .game-tools small{color:#9eb0ba}
html[data-theme="dark"] .zoom-controls #zoom-label{color:#bcd0da}
html[data-theme="dark"] .game-toolbar .stat-pill{background:#1d2c34;border-color:#455963;color:#dce6eb}
html[data-theme="dark"] .modal{background:#19262d;border-color:#52636d;color:#e0e9ed}
html[data-theme="dark"] .empty-state{color:#91a4ae}
/* Memory-Karten selbst bleiben bewusst hell und kontrastreich. */
html[data-theme="dark"] .card-front{color:#162532}
html[data-theme="dark"] .golden-card small{color:#6b4a00}

@media (max-width:800px){
  .theme-toggle{width:46px;min-height:42px;margin:12px auto 8px;padding:0;gap:0}
  .theme-label{display:none}
  .theme-icon{font-size:18px}
}

/* v0.4.0 – Online-Konten, MariaDB & Bestenliste. Spielfeld-Geometrie/Flip-Regeln unverändert. */
.hero-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.server-note{font-size:11px;line-height:1.4;color:#35586d;background:#e7f4fb;border:1px solid #a8cee3;border-radius:8px;padding:9px}
.online-status{margin-top:9px;font-size:11px;font-weight:800}.online-status.ok{color:#237b36}
.account-card{display:flex;gap:14px;align-items:center}.account-card h3{margin:0 0 3px}.account-card p{margin:0;color:#687983;font-size:12px}
.import-stats{grid-template-columns:repeat(4,1fr)}
.leaderboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:14px}
.leaderboard-panel.green .panel-head{background:linear-gradient(#3f984a,#26752d)}
.leaderboard-panel.blue .panel-head{background:linear-gradient(#1688df,#0b5d9f)}
.leaderboard-panel.orange .panel-head{background:linear-gradient(#e58b2c,#a75a0e)}
.leaderboard-panel.red .panel-head{background:linear-gradient(#d24a4a,#8f1f1f)}
.sidney-doom{display:grid;grid-template-columns:94px minmax(0,1fr);gap:18px;align-items:center;background:radial-gradient(circle at 8% 50%,rgba(196,47,47,.22),transparent 28%),linear-gradient(115deg,#2d1014,#4b171c 48%,#1c1114);color:#fff;border:1px solid #7e3037;border-radius:14px;padding:16px 18px;box-shadow:0 8px 22px rgba(42,8,12,.22),inset 0 0 28px rgba(0,0,0,.18)}
.sidney-doom h3{margin:0 0 5px;font-size:21px}.sidney-doom p{margin:0 0 9px;color:#f0d9dc;font-size:13px}.sidney-doom small{color:#d8bfc2}.doom-icon{font-size:54px;text-align:center;filter:drop-shadow(0 5px 4px rgba(0,0,0,.35))}.survival-bar{height:12px;border-radius:999px;background:#17080a;border:1px solid #713039;overflow:hidden;margin:7px 0}.survival-bar span{display:block;height:100%;background:linear-gradient(90deg,#54ae63,#a5d76d);border-radius:inherit;min-width:0}
.community-strip{display:flex;gap:10px;flex-wrap:wrap;margin-top:12px}.community-strip span{background:#edf2f4;border:1px solid #c2ccd1;border-radius:999px;padding:8px 11px;font-size:12px}
html[data-theme="dark"] .server-note{color:#b9ddeb;background:#17303d;border-color:#31586c}
html[data-theme="dark"] .online-status.ok{color:#6ed782}
html[data-theme="dark"] .account-card p{color:#9fb0ba}
html[data-theme="dark"] .community-strip span{background:#1d2c34;border-color:#455963;color:#dce6eb}
html[data-theme="dark"] .sidney-doom{background:radial-gradient(circle at 8% 50%,rgba(196,47,47,.18),transparent 28%),linear-gradient(115deg,#240d11,#3d1418 48%,#170d10)}
@media(max-width:1050px){.leaderboard-grid{grid-template-columns:1fr}}
@media(max-width:800px){.hero-actions{width:100%;justify-content:stretch}.hero-actions button{flex:1}.sidney-doom{grid-template-columns:1fr;text-align:center}.doom-icon{font-size:44px}.import-stats{grid-template-columns:repeat(2,1fr)}}
.sidney-mini{margin-top:12px;display:flex;align-items:center;gap:11px;background:linear-gradient(105deg,#40161b,#251115);color:#f7e6e8;border:1px solid #743039;border-radius:11px;padding:10px 13px;box-shadow:0 4px 12px rgba(40,8,12,.13)}
.sidney-mini-icon{font-size:28px}.sidney-mini b{display:block;font-size:13px}.sidney-mini small{display:block;margin-top:2px;color:#d8bdc0;font-size:11px}.link-button{border:0;background:transparent;color:#ffd36b;padding:0;font:inherit;font-weight:800;text-decoration:underline;cursor:pointer}
html[data-theme="dark"] .sidney-mini{background:linear-gradient(105deg,#351217,#1c0d10)}


/* v0.4.1 – optimierte Mobilansicht
   Desktop-Layout sowie Memory-Karten-Geometrie und Flip-/Rotationslogik bleiben unverändert. */
@media (max-width:720px){
  html{scroll-padding-bottom:78px}
  body{padding-bottom:72px;overflow-x:hidden}

  /* Die Desktop-Seitenleiste wird zur Touch-Navigation am unteren Rand. */
  .app-shell{display:block;min-height:100vh}
  .sidebar{
    position:fixed;
    left:0;right:0;bottom:0;top:auto;
    width:100%;height:68px;
    padding:5px 6px max(5px,env(safe-area-inset-bottom));
    display:flex;flex-direction:row;align-items:stretch;gap:5px;
    background:linear-gradient(180deg,#153b55,#0a2335);
    border-top:1px solid rgba(255,255,255,.13);
    box-shadow:0 -5px 18px rgba(0,0,0,.28);
    z-index:100;
  }
  .brand,.sidebar-note,.build-label{display:none!important}
  .nav{
    flex:1;min-width:0;
    display:flex;gap:4px;overflow-x:auto;overflow-y:hidden;
    scroll-snap-type:x proximity;
    scrollbar-width:none;
    -webkit-overflow-scrolling:touch;
  }
  .nav::-webkit-scrollbar{display:none}
  .nav-item{
    flex:0 0 62px;min-width:62px;height:56px;
    padding:5px 3px;border-radius:9px;
    display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;
    text-align:center;font-size:19px;line-height:1;
    scroll-snap-align:center;
  }
  .nav-item span{display:block!important;max-width:58px;font-size:8.5px;line-height:1.05;white-space:normal}
  .nav-item.active{box-shadow:inset 0 0 0 1px rgba(255,255,255,.22),0 2px 7px rgba(0,0,0,.16)}
  .theme-toggle{
    flex:0 0 52px;width:52px!important;height:56px;min-height:56px!important;
    margin:0!important;padding:0!important;border-radius:9px;
  }
  .theme-label{display:none!important}.theme-icon{font-size:20px!important}

  /* Vollbreite statt 64px verschenkter Seitenleiste. */
  .workspace{width:100%;min-width:0}
  .topbar{
    min-height:auto!important;
    grid-template-columns:minmax(0,1fr)!important;
    gap:9px;padding:11px 12px!important;
  }
  .warning-plate{display:none!important}
  .title-wrap{gap:10px;min-width:0}
  .party-screw{width:46px;height:46px;flex:0 0 46px;font-size:27px;border-width:3px}
  .party-screw span{font-size:18px;left:-3px;top:-10px}
  .title-wrap h1{font-size:clamp(20px,6vw,27px);line-height:1.02;white-space:normal}
  .title-wrap p{font-size:11px;margin-top:4px}
  .player-summary{min-height:62px;padding:8px 10px;gap:9px;border-radius:11px}
  .player-avatar{width:42px;height:42px;border-width:3px;font-size:21px}
  .player-summary b{font-size:13px}.player-summary small{font-size:10px}.summary-links{font-size:9px;margin-top:3px}.xp-bar{height:6px;margin-top:4px}

  .screw-oracle{min-height:36px;grid-template-columns:34px minmax(0,1fr) 28px}
  .oracle-track{height:36px}.oracle-label{padding:0;justify-content:center}.oracle-label b{display:none}.oracle-label span{font-size:15px}.oracle-text{font-size:11px}.oracle-bolt{font-size:14px}

  .content-grid{display:block!important;padding:9px 8px 13px!important}
  .right-rail{display:grid!important;grid-template-columns:1fr!important;gap:10px;margin-top:10px}
  .section-title{align-items:flex-start;margin:2px 0 9px}.section-title h2{font-size:19px}.section-title p{font-size:11px;line-height:1.3}
  .panel{border-radius:11px}.panel-head{padding:9px 13px 9px 18px;font-size:12px}.panel-body{padding:10px}

  /* Auswahl und Übersichten: weniger Scrollstrecke, aber gut bedienbar. */
  .difficulty-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px}
  .difficulty-card{min-width:0;min-height:164px;padding:10px;border-radius:11px}
  .difficulty-card h3{font-size:18px;margin:2px 32px 0 0}.difficulty-card .subtitle{font-size:10px}
  .difficulty-num{width:30px;height:30px;right:7px;top:7px;font-size:12px}
  .difficulty-size{font-size:9px;padding:4px 7px;margin:9px 0 7px;max-width:100%;white-space:normal}
  .difficulty-card p{font-size:10px;line-height:1.25}.difficulty-screw{font-size:56px;bottom:-10px}
  .hero-strip{grid-template-columns:1fr;gap:9px;padding:11px 12px}.hero-strip b{font-size:15px}.hero-strip p{font-size:10px}.hero-actions{justify-content:stretch}.hero-actions button{flex:1;min-height:42px}
  .preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px}.preview-tile .screw-art{height:96px}
  .collection-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.collection-card .screw-art{height:100px}
  .achievement-mini-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.badge-icon{width:46px;height:46px;font-size:21px}.badge b{font-size:8.5px}.badge small{font-size:8px}
  .achievement-grid{grid-template-columns:1fr;gap:8px}.achievement-card{padding:9px;grid-template-columns:50px 1fr}.achievement-card .badge-icon{width:50px;height:50px}.achievement-card h4{font-size:12px}
  .stats-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.stat-box{min-height:78px;padding:10px}.stat-box b{font-size:20px}.stat-box span{font-size:9px}
  .leaderboard-grid{grid-template-columns:1fr!important;gap:9px}.sidney-doom{grid-template-columns:58px 1fr;text-align:left;gap:10px;padding:12px}.doom-icon{font-size:36px}.sidney-doom h3{font-size:16px}.sidney-doom p{font-size:11px}.community-strip{gap:6px}.community-strip span{font-size:10px;padding:6px 8px}
  .mode-table{font-size:10px}.mode-table th,.mode-table td{padding:7px 5px}
  .collection-toolbar{display:grid;grid-template-columns:1fr 1fr;gap:6px}.collection-toolbar input{grid-column:1/-1}.collection-toolbar input,.collection-toolbar select{width:100%;min-width:0;min-height:42px}
  .input-row input{min-height:44px}.primary-btn,.secondary-btn,.danger-btn{min-height:42px;padding:8px 10px}.login-actions{gap:6px}
  .toast-region{left:8px;right:8px;bottom:78px}.toast{max-width:none;width:100%;font-size:12px}
  .modal-backdrop{padding:10px 8px 82px}.modal{width:100%;max-height:calc(100dvh - 100px);border-radius:12px}

  /* Spielansicht: maximale Breite für das Brett, wenig vertikal verlorener Platz. */
  .app-shell.game-active .screw-oracle{display:none}
  .app-shell.game-active .content-grid{padding:6px!important}
  .app-shell.game-active .topbar{display:flex!important;min-height:54px!important;padding:7px 9px!important}
  .app-shell.game-active .topbar .title-wrap{flex:1}
  .app-shell.game-active .topbar .party-screw{width:38px;height:38px;flex-basis:38px;font-size:22px}
  .app-shell.game-active .topbar h1{font-size:17px}.app-shell.game-active .topbar .title-wrap p{display:none}
  .app-shell.game-active .player-summary{display:none!important}
  .game-section-title{display:flex!important;flex-direction:row!important;align-items:center!important;gap:6px;margin-bottom:5px}
  .game-section-title>div{min-width:0;flex:1}.game-section-title h2{font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.game-section-title p{display:none}.game-section-title .danger-btn{align-self:center!important;min-height:36px;padding:6px 9px;font-size:10px;white-space:nowrap}
  .game-toolbar{
    flex-wrap:nowrap;overflow-x:auto;gap:5px;margin:0 0 6px;padding:1px 0 3px;
    scrollbar-width:none;-webkit-overflow-scrolling:touch;
  }
  .game-toolbar::-webkit-scrollbar{display:none}.game-toolbar .stat-pill{flex:0 0 auto;padding:6px 8px;font-size:10px}
  .game-tools{flex-direction:row!important;align-items:center!important;gap:6px;padding:6px 7px;margin-bottom:6px}
  .game-tools>div:first-child{min-width:0;flex:1}.game-tools>div:first-child b{font-size:11px}.game-tools>div:first-child small{display:none}
  .zoom-controls{width:auto!important;flex:0 0 auto;gap:4px}.zoom-controls .mini-btn{min-width:36px;min-height:34px;padding:4px 7px}.zoom-controls #zoom-label{min-width:38px;font-size:9px}
  .card-magnifier{grid-template-columns:64px minmax(0,1fr)!important;gap:8px;min-height:76px!important;padding:6px 8px;margin-bottom:6px;border-radius:10px}
  .card-magnifier b{font-size:11px}.card-magnifier small{font-size:9px;line-height:1.2}.magnifier-icon{font-size:31px}.magnifier-art{height:64px!important}.magnifier-gold{font-size:40px}
  .game-board-wrap{
    position:relative;
    padding:7px!important;
    min-height:280px!important;
    height:clamp(280px,calc(100dvh - 305px),720px);
    max-height:none!important;
    overflow:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    scrollbar-gutter:auto;
    border-radius:10px;
  }
  .game-board-wrap::before{
    content:'↔ Spielfeld mit dem Finger verschieben';
    position:sticky;left:6px;top:0;z-index:8;
    display:block;width:max-content;max-width:calc(100vw - 34px);
    margin:0 0 5px;padding:4px 7px;border-radius:7px;
    background:rgba(7,29,43,.82);color:#d8e7ef;
    font-size:9px;font-weight:800;letter-spacing:.01em;
    pointer-events:none;backdrop-filter:blur(3px);
  }
}

@media (max-width:430px){
  .difficulty-grid{grid-template-columns:1fr!important}
  .difficulty-card{min-height:135px}.difficulty-card p{max-width:82%}
  .preview-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .achievement-mini-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
  .title-wrap h1{font-size:20px}
}

/* Kleine Handy-Queransicht: Spielbrett priorisieren. */
@media (max-width:900px) and (max-height:520px) and (orientation:landscape){
  body{padding-bottom:58px}
  .sidebar{height:56px;padding-top:3px;padding-bottom:max(3px,env(safe-area-inset-bottom))}
  .nav-item,.theme-toggle{height:46px;min-height:46px!important}.nav-item{flex-basis:58px}.nav-item span{font-size:7.5px}
  .app-shell.game-active .topbar{display:none!important}
  .app-shell.game-active .content-grid{padding:4px 6px!important}
  .game-section-title{margin:0 0 3px}.game-section-title h2{font-size:14px}.game-section-title .danger-btn{min-height:30px;padding:3px 7px}
  .game-toolbar{margin-bottom:3px}.game-toolbar .stat-pill{padding:4px 7px;font-size:9px}
  .game-tools{padding:3px 6px;margin-bottom:3px}.game-tools>div:first-child{display:none}.zoom-controls{margin-left:auto}
  .card-magnifier{grid-template-columns:48px 1fr!important;min-height:54px!important;padding:3px 6px;margin-bottom:3px}.magnifier-art{height:48px!important}.magnifier-icon{font-size:25px}.card-magnifier small{display:none}
  .game-board-wrap{height:calc(100dvh - 160px);min-height:180px!important;padding:5px!important}
  .game-board-wrap::before{font-size:8px;margin-bottom:3px;padding:3px 6px}
}


/* v0.4.2 – Mobile Memory-Raster: vertikal statt riesigem horizontalen Brett
   Desktop bleibt vollständig unverändert. */
@media (max-width:800px){
  /* Das Brett wächst mit seinem Inhalt. Die Seite selbst scrollt vertikal. */
  .app-shell.game-active .game-board-wrap{
    width:100%;
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    overscroll-behavior:auto;
    scrollbar-gutter:auto;
    padding:7px!important;
  }

  /* Standard auf Smartphones: vier Karten pro Reihe. */
  .app-shell.game-active .memory-grid{
    grid-template-columns:repeat(4,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:6px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    margin:0 auto!important;
    align-items:start;
    justify-items:stretch;
  }

  /* Merten bleibt selbstverständlich 3 × 3. */
  .app-shell.game-active .game-board-wrap[data-mode="merten"] .memory-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }

  /* Karte füllt ihre Rasterzelle. Die bestehende Flip-Mechanik bleibt unangetastet. */
  .app-shell.game-active .memory-card,
  .app-shell.game-active .memory-card.compact,
  .app-shell.game-active .memory-card.tiny{
    width:100%!important;
    height:auto!important;
    aspect-ratio:1 / 1.22;
    min-width:0!important;
  }

  /* Die automatische Mobilanordnung ersetzt den manuellen Brett-Zoom. */
  .app-shell.game-active .zoom-controls{display:none!important}

  .app-shell.game-active .game-board-wrap::before{
    content:'↓ Karten untereinander – nach unten scrollen';
    position:static!important;
    display:block;
    width:max-content;
    max-width:100%;
    margin:0 auto 6px!important;
    padding:4px 8px;
    border-radius:7px;
    background:rgba(7,29,43,.82);
    color:#d8e7ef;
    font-size:9px;
    font-weight:800;
    letter-spacing:.01em;
    text-align:center;
    pointer-events:none;
    backdrop-filter:blur(3px);
  }
}

/* Handy im Querformat: sechs Karten pro Reihe, weiterhin vertikal scrollend. */
@media (max-width:900px) and (max-height:520px) and (orientation:landscape){
  .app-shell.game-active .game-board-wrap{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    padding:5px!important;
  }
  .app-shell.game-active .memory-grid{
    grid-template-columns:repeat(6,minmax(0,1fr))!important;
    grid-auto-flow:row!important;
    gap:5px!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
  }
  .app-shell.game-active .game-board-wrap[data-mode="merten"] .memory-grid{
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
  }
  .app-shell.game-active .memory-card,
  .app-shell.game-active .memory-card.compact,
  .app-shell.game-active .memory-card.tiny{
    width:100%!important;
    height:auto!important;
    aspect-ratio:1 / 1.22;
  }
  .app-shell.game-active .zoom-controls{display:none!important}
  .app-shell.game-active .game-board-wrap::before{
    content:'↓ Vertikal scrollen · 6 Karten pro Reihe';
    position:static!important;
    margin:0 auto 4px!important;
  }
}


/* v0.4.6 – optionaler Fokusmodus während einer laufenden Partie.
   Memory-Karten, Flip-Rotation und Rasterlogik bleiben unverändert. */
.game-view-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.focus-mode-btn{white-space:nowrap}

.app-shell.game-active.focus-mode{
  grid-template-columns:minmax(0,1fr)!important;
}
.app-shell.game-active.focus-mode .sidebar,
.app-shell.game-active.focus-mode .topbar,
.app-shell.game-active.focus-mode .screw-oracle,
.app-shell.game-active.focus-mode .right-rail{
  display:none!important;
}
.app-shell.game-active.focus-mode .workspace{
  width:100%;
  min-width:0;
}
.app-shell.game-active.focus-mode .content-grid{
  display:block!important;
  width:100%;
  max-width:none!important;
  padding:8px!important;
}
.app-shell.game-active.focus-mode .main{width:100%;max-width:none!important}
.app-shell.game-active.focus-mode .game-section-title{
  margin:0 0 7px;
  padding:0 2px;
}
.app-shell.game-active.focus-mode .game-board-wrap{
  max-height:calc(100vh - 255px);
}

@media (max-width:800px){
  .game-view-actions{gap:5px;flex:0 0 auto}
  .game-view-actions .secondary-btn,.game-view-actions .danger-btn{min-height:36px;padding:6px 8px;font-size:9.5px}
  .app-shell.game-active.focus-mode .content-grid{padding:4px 6px 70px!important}
  .app-shell.game-active.focus-mode .game-section-title{margin-bottom:4px}
  .app-shell.game-active.focus-mode .game-section-title h2{font-size:15px}
  /* In der Mobilansicht wächst das v0.4.2-Raster weiter normal nach unten. */
  .app-shell.game-active.focus-mode .game-board-wrap{max-height:none!important}
}

@media (max-width:430px){
  .game-view-actions{width:auto}
  .game-view-actions .focus-mode-btn{font-size:0;width:38px;padding:6px}
  .game-view-actions .focus-mode-btn::before{content:'⛶';font-size:17px}
  .app-shell.game-active.focus-mode .game-view-actions .focus-mode-btn::before{content:'↩'}
}


/* v0.4.7 – Sidney-Easter-Egg. Keine Änderung an Kartenmaßen oder Flip-Rotation. */
#sidney-cheat-title{user-select:none}
.memory-card.cheat-solved{animation:sidney-cheat-pop .28s ease both}
@keyframes sidney-cheat-pop{
  0%{filter:brightness(1)}
  55%{filter:brightness(1.5) drop-shadow(0 0 9px rgba(255,211,91,.65))}
  100%{filter:brightness(1)}
}
.sidney-cheat-result{
  padding:28px 14px!important;
  background:radial-gradient(circle at 50% 0,rgba(255,211,91,.16),transparent 46%);
}
.sidney-cheat-result .big{font-size:58px}
.sidney-cheat-result p{max-width:650px;margin-left:auto;margin-right:auto}

@media (prefers-reduced-motion:reduce){
  .memory-card.cheat-solved{animation:none}
}
