:root{
  --bg:#f5faff; --ink:#2b3a4a; --muted:#6b7c8d; --card:#ffffff; --line:#e3eef8;
  --brand:#4aa8ff; --brand-dark:#2f8ae6; --sun:#ffd166;
  /* Flächen und Formen: die Stile in styles.css überschreiben diese Werte */
  --page:linear-gradient(180deg,#e9f5ff 0,#fffaf0 55%,#fff0f5 100%);
  --panel:rgba(255,255,255,.95); --panel-solid:#ffffff;
  --side-bg:rgba(255,255,255,.92); --stage-bg:#ffffff; --icon-bg:#ffffff;
  --soft:#eaf5ff; --soft-2:#f1f8ff; --hover:#e6f3ff; --cell-hover:#d8ecff;
  --top-bg:rgba(255,255,255,.85); --overlay:rgba(255,255,255,.88);
  --chip-bg:rgba(255,255,255,.9); --chip-hover:#fff7d6;
  --input-bg:#ffffff; --input-border:#cfe5f8; --focus:#bfe0ff;
  --radius:22px; --radius-sm:12px; --radius-md:16px; --radius-lg:20px;
  --border-w:3px;
  --shadow:0 6px 16px rgba(60,110,160,.10);
  --shadow-hover:0 16px 30px rgba(60,110,160,.22);
  --shadow-soft:0 6px 16px rgba(60,110,160,.08);
  --font:"Nunito","Segoe UI",system-ui,-apple-system,Roboto,sans-serif;
  --title-filter:none;
}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; font-family:var(--font); color:var(--ink); line-height:1.5;
  background:var(--page) fixed; min-height:100vh;
  display:flex; flex-direction:column;
}
a{color:var(--brand-dark)}
.top{
  display:flex; flex-wrap:wrap; align-items:center; gap:.8rem 1.5rem; padding:.8rem 4.4rem .8rem 1.5rem;
  background:var(--top-bg); backdrop-filter:blur(6px); border-bottom:2px solid var(--line); position:sticky; top:0; z-index:10;
}
.logo{font-size:1.4rem; font-weight:800; text-decoration:none; color:var(--ink)}
nav{display:flex; gap:1rem; flex:1; align-items:center; min-width:0}
nav a{text-decoration:none; font-weight:700; color:var(--ink); padding:.3rem .8rem; border-radius:999px}
nav a:hover{background:var(--hover)}
.namebox{display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; min-width:0; flex:0 1 auto}
.namebox label{font-weight:700; white-space:nowrap}
.namebox input{width:9rem; flex:0 1 9rem}
input{font:inherit; padding:.45rem .8rem; border:2px solid var(--input-border); border-radius:var(--radius-sm); background:var(--input-bg); color:var(--ink); min-width:0}
input:focus{outline:3px solid var(--focus); border-color:var(--brand)}
button,.btn{
  font:inherit; font-weight:800; cursor:pointer; border:0; border-radius:var(--radius-sm); padding:.5rem 1.1rem;
  background:var(--brand); color:#fff; box-shadow:0 3px 0 var(--brand-dark); transition:transform .08s;
}
button:hover{filter:brightness(1.05)} button:active{transform:translateY(2px); box-shadow:0 1px 0 var(--brand-dark)}
/* ---------- Handy: Knöpfe sollen sich nicht markieren lassen ---------- */
/* Beim Tippen markiert der Browser sonst die Beschriftung und will sie kopieren –
   dann lässt sich der Knopf nicht mehr sauber drücken. */
button,.btn,.pad,.gametools,.sizebar,.sizebar button{
  user-select:none; -webkit-user-select:none;
  -webkit-touch-callout:none;                /* kein Textmenü beim langen Drücken */
  touch-action:manipulation;                 /* kein Doppel-Tipp-Zoom, keine Verzögerung */
  -webkit-tap-highlight-color:transparent;   /* kein blauer Blitz beim Tippen */
}
#namemsg{font-size:.9rem; color:#2a9d5c; font-weight:700}
#namemsg.bad{color:#d6455d}
main{max-width:1100px; width:100%; margin:0 auto; padding:1.5rem 1rem 3rem; flex:1}
.hero{text-align:center; margin-bottom:1.5rem}
.hero h1{margin:.2rem 0; font-size:2.2rem}
.hero p{color:var(--muted); margin:.2rem 0}
.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:1.1rem}
.grid.small{grid-template-columns:repeat(auto-fill,minmax(230px,1fr))}
.gcard{
  display:block; text-decoration:none; color:var(--ink); background:var(--card); border-radius:var(--radius); padding:0; overflow:hidden;
  border:var(--border-w) solid var(--c,#8ec5ff); box-shadow:var(--shadow);
  transition:transform .2s, box-shadow .2s; animation:pop-in .5s both; animation-delay:calc(var(--i,0) * 45ms);
}
a.gcard:hover{transform:translateY(-6px) rotate(-.6deg) scale(1.02); box-shadow:var(--shadow-hover)}
.gcard.static{padding:0 0 .9rem}
.gcard.static h3,.gcard.static p,.gcard.static ol{margin-left:1rem; margin-right:1rem}
.cardtext{display:block; padding:.5rem 1.1rem 1.1rem}
.banner{display:block; position:relative; aspect-ratio:2/1; overflow:hidden; background:var(--c,#8ec5ff)}
.banner.small{aspect-ratio:3/1}
.banner img{width:100%; height:100%; object-fit:cover; display:block; transition:transform .5s; filter:var(--title-filter)}
a.gcard:hover .banner img{transform:scale(1.12) rotate(1.5deg)}
.gcard .icon{
  position:absolute; right:.6rem; bottom:.4rem; font-size:2.2rem; width:3.4rem; height:3.4rem; display:flex; align-items:center; justify-content:center;
  background:var(--icon-bg); border-radius:50%; box-shadow:0 4px 10px rgba(0,0,0,.15); transition:transform .3s;
}
a.gcard:hover .icon{animation:wiggle .6s}
.playbtn{display:inline-block; margin-top:.6rem; font-weight:800; color:#fff; background:var(--c,#4aa8ff); background-image:linear-gradient(rgba(0,0,0,.18),rgba(0,0,0,.18)); border-radius:999px; padding:.25rem .9rem; transform:scale(.92); transition:transform .2s}
a.gcard:hover .playbtn{transform:scale(1.06)}
.medals{list-style:none; padding-left:0 !important}
.medals li:nth-child(1)::before{content:"🥇 "} .medals li:nth-child(2)::before{content:"🥈 "} .medals li:nth-child(3)::before{content:"🥉 "}
.gcard h2,.gcard h3{margin:.3rem 0 .2rem; font-size:1.2rem}
.gcard p{margin:0; color:var(--muted); font-size:.95rem}
.gcard ol{margin:.2rem 0 0; padding-left:1.3rem}
.muted{color:var(--muted)}
.error{background:#ffe9ec; color:#b3263f; padding:.8rem 1rem; border-radius:12px}
.table{border-collapse:collapse; width:100%; max-width:640px; background:var(--panel-solid); border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow-soft)}
.table th,.table td{padding:.55rem .9rem; text-align:left; border-bottom:1px solid var(--line)}
.table th{background:var(--soft)}
.gamepage{display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:1.5rem; align-items:start}
.gamepage h1{margin:.2rem 0}
.stage{
  position:relative; margin:.8rem 0; background:var(--stage-bg); border-radius:var(--radius-lg); border:var(--border-w) solid var(--c,#8ec5ff);
  box-shadow:0 8px 24px rgba(60,110,160,.12); overflow:hidden; width:100%; user-select:none; -webkit-user-select:none; outline:none;
  -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent;
}
.stage canvas{display:block; width:100%; height:auto; touch-action:none}
.hud{display:flex; justify-content:space-between; padding:.4rem .9rem; background:var(--soft-2); font-weight:800; border-bottom:2px solid var(--line); flex-wrap:wrap; row-gap:.3rem}
/* Knopf „Speichern und beenden“ in der Kopfzeile des Spielfelds (v1.6.11) */
.hud .hudinfo{margin-left:auto}
.hud .savebtn{font-size:.85rem; padding:.25rem .75rem; margin-left:.5rem; white-space:nowrap}
.overlay{
  position:absolute; inset:0; background:var(--overlay); display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:.6rem; text-align:center; padding:1rem; z-index:5;
}
.overlay h2{margin:0; font-size:1.8rem}
.overlay p{margin:0; max-width:90%}
.overlay button{font-size:1.2rem; padding:.7rem 1.6rem}
.overlay .big{font-size:2.4rem; font-weight:800; color:var(--brand-dark)}
.record{color:#e08a00; font-weight:800}
.side{background:var(--panel-solid); border:2px solid var(--line); border-radius:var(--radius-lg); padding:1rem 1.2rem; box-shadow:var(--shadow-soft)}
.side h2{margin:.1rem 0 .5rem; font-size:1.2rem}
.toplist{padding-left:1.4rem; margin:0 0 1rem}
.toplist li{padding:.15rem 0}
.controls{color:var(--muted); font-size:.95rem}
/* ---------- Anleitung unter dem Spiel ---------- */
.gamehelp{margin:1rem 0 0; background:var(--panel-solid); border:2px solid var(--line); border-radius:var(--radius-lg); padding:1rem 1.2rem; box-shadow:var(--shadow-soft)}
.gamehelp h2{margin:.1rem 0 .5rem; font-size:1.2rem}
.gamehelp h3{margin:1.1rem 0 .3rem; font-size:1rem}
.gamehelp p{margin:.2rem 0}
.gamehelp .muted{color:var(--muted); font-size:.93rem}
.helpsteps{margin:.2rem 0; padding-left:1.3rem}
.helpsteps li{margin:.3rem 0}
.helpspecials{list-style:none; display:grid; grid-template-columns:repeat(auto-fit,minmax(265px,1fr)); gap:.6rem; margin:.5rem 0 0; padding:0}
.helpspecials li{display:flex; gap:.6rem; align-items:flex-start; background:var(--soft); border:2px solid var(--line); border-radius:var(--radius-md); padding:.55rem .7rem}
.helpspecials b{display:block; margin-bottom:.1rem}
.helpspecials span span{color:var(--muted); font-size:.9rem; line-height:1.35}
.helpsvg{flex:none; width:38px; height:38px}
.helpcombos{margin:.3rem 0 0; padding-left:1.2rem}
.helpcombos li{margin:.25rem 0}
.helpjewels{list-style:none; display:flex; flex-wrap:wrap; gap:.4rem 1.1rem; margin:.4rem 0 0; padding:0}
.helpjewels li{display:flex; align-items:center; gap:.35rem; font-size:.92rem}
.helpjew{flex:none; width:26px; height:26px}
.pad{display:flex; justify-content:space-between; gap:1rem; margin:.5rem 0}
.pad[hidden]{display:none}
.pad .dp{display:grid; grid-template-columns:repeat(3,64px); grid-template-rows:repeat(2,64px); gap:6px}
.pad button{font-size:1.5rem; padding:0; touch-action:none}
.pad .act{width:96px; height:96px; border-radius:50%; align-self:center; font-size:1.2rem; background:#ff9aa2; box-shadow:0 3px 0 #e07c85}
.foot{text-align:center; padding:1rem; color:var(--muted)}
/* Impressum-Link unten auf der Website (Adresse wird im Admin-Bereich eingestellt) */
.foot{display:flex; flex-direction:column; align-items:center; gap:.35rem}
.foot .impressum{font-weight:800; color:var(--brand-dark); text-decoration:none; border-bottom:2px solid transparent}
.foot .impressum:hover{border-bottom-color:currentColor}
/* DOM-Spiele */
.board{display:grid; gap:6px; padding:12px; margin:0 auto; touch-action:manipulation}
.cell{
  background:var(--soft); border-radius:var(--radius-sm); display:flex; align-items:center; justify-content:center; font-weight:800; cursor:pointer;
  aspect-ratio:1; font-size:1.6rem; border:0; box-shadow:none; color:var(--ink); padding:0;
}
.cell:hover{background:var(--cell-hover)}
.msgline{text-align:center; padding:.4rem; font-weight:800; min-height:2.2rem}
/* Survivor.io: Auswahl des Bonus beim Levelaufstieg */
.surv-levelup{
  position:absolute; inset:0; z-index:6; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:.5rem; text-align:center; padding:1rem; background:var(--overlay); overflow:auto;
}
.surv-levelup h3{margin:0; font-size:1.7rem; color:var(--brand-dark)}
.surv-levelup p{margin:0}
.surv-choices{display:flex; flex-wrap:wrap; gap:.6rem; justify-content:center; margin-top:.3rem}
.surv-pick{
  display:flex; flex-direction:column; align-items:center; gap:.2rem; width:11rem; padding:.7rem .5rem; cursor:pointer;
  border:2px solid var(--line); border-radius:var(--radius-md); background:var(--panel-solid); color:var(--ink);
  box-shadow:var(--shadow-soft); font:inherit; text-align:center;
}
.surv-pick b{font-size:1rem}
.surv-pick span{font-size:.82rem; color:var(--muted)}
.surv-pick i{font-size:.75rem; font-style:normal; color:var(--brand-dark); font-weight:800}
.surv-pick:hover{border-color:var(--brand); transform:translateY(-2px); filter:none}
@media (max-width:600px){
  .surv-levelup{padding:.4rem; gap:.25rem}
  .surv-levelup h3{font-size:1.15rem}
  .surv-levelup p{font-size:.8rem}
  .surv-choices{gap:.35rem; margin-top:.1rem}
  .surv-pick{width:8.6rem; padding:.35rem .25rem; gap:.1rem}
  .surv-pick b{font-size:.82rem}
  .surv-pick span{font-size:.68rem}
  .surv-pick i{font-size:.62rem}
}
@media (max-width:820px){
  .gamepage{grid-template-columns:1fr}
  nav{order:3; flex-basis:100%}
}

/* ---------- Lebendiger Hintergrund ---------- */
.sky{position:fixed; inset:0; z-index:-1; overflow:hidden; pointer-events:none}
.sun{position:absolute; top:70px; right:6%; width:90px; height:90px; border-radius:50%; background:radial-gradient(circle,#fff6c2 0 45%,#ffe27a 46% 100%);
  box-shadow:0 0 0 14px rgba(255,226,122,.35),0 0 0 32px rgba(255,226,122,.2),0 0 60px 30px rgba(255,226,122,.35); animation:sunpulse 6s ease-in-out infinite}
.cloud{position:absolute; left:-220px; width:170px; height:52px; background:#fff; border-radius:60px; opacity:.85; animation:drift 70s linear infinite}
.cloud::before,.cloud::after{content:""; position:absolute; background:#fff; border-radius:50%}
.cloud::before{width:70px; height:70px; left:24px; top:-34px}
.cloud::after{width:90px; height:90px; left:70px; top:-48px}
.c1{top:12%; animation-duration:80s} .c2{top:32%; transform:scale(.7); animation-duration:105s; animation-delay:-40s}
.c3{top:58%; transform:scale(1.2); animation-duration:130s; animation-delay:-90s; opacity:.6} .c4{top:80%; transform:scale(.8); animation-duration:95s; animation-delay:-20s; opacity:.7}
.bub{position:absolute; bottom:-60px; border-radius:50%; background:radial-gradient(circle at 30% 30%,#fff,var(--b,#bfe3ff) 70%); opacity:.55; animation:rise 18s linear infinite}
.b1{left:5%; width:26px; height:26px; --b:#bfe3ff} .b2{left:14%; width:44px; height:44px; --b:#ffd6e0; animation-duration:24s; animation-delay:-6s}
.b3{left:26%; width:20px; height:20px; --b:#d4f5d4; animation-duration:16s; animation-delay:-3s} .b4{left:38%; width:36px; height:36px; --b:#fff0b3; animation-duration:22s; animation-delay:-12s}
.b5{left:52%; width:24px; height:24px; --b:#e6d4ff; animation-duration:19s; animation-delay:-9s} .b6{left:63%; width:48px; height:48px; --b:#bfe3ff; animation-duration:27s; animation-delay:-15s}
.b7{left:74%; width:22px; height:22px; --b:#ffd6e0; animation-duration:17s; animation-delay:-1s} .b8{left:83%; width:38px; height:38px; --b:#d4f5d4; animation-duration:23s; animation-delay:-18s}
.b9{left:91%; width:28px; height:28px; --b:#fff0b3; animation-duration:20s; animation-delay:-7s} .b10{left:45%; width:16px; height:16px; --b:#e6d4ff; animation-duration:15s; animation-delay:-11s}
body.gamebody{background:linear-gradient(180deg,color-mix(in srgb,var(--gc,#8ec5ff) 35%,#fff) 0,#fffaf0 60%,#fff 100%) fixed}
main,.top,.foot{position:relative; z-index:1}
.top{z-index:10}
.rainbow{background:linear-gradient(90deg,#ff7a8a,#ffb347,#f5c400,#4cbf7a,#4aa8ff,#9b7dff); -webkit-background-clip:text; background-clip:text; color:transparent; background-size:200% 100%; animation:shine 6s linear infinite}
.hero{padding:.5rem 0 .3rem}
.hero-icons{font-size:2.4rem; display:flex; justify-content:center; gap:1.2rem}
.hero-icons span{display:inline-block; animation:hop 1.6s ease-in-out infinite}
.hero-icons span:nth-child(2){animation-delay:.2s} .hero-icons span:nth-child(3){animation-delay:.4s} .hero-icons span:nth-child(4){animation-delay:.6s} .hero-icons span:nth-child(5){animation-delay:.8s}
.big-btn{font-size:1.2rem; padding:.7rem 1.6rem; border-radius:999px; background:linear-gradient(135deg,#ff9aa2,#ffb347); box-shadow:0 4px 0 #e0805f; animation:pulse 2.4s ease-in-out infinite}
.recent{margin:0 0 1.4rem; text-align:center}
.recent h2{font-size:1.1rem; margin:.2rem 0 .5rem}
.ticker{display:flex; flex-wrap:wrap; justify-content:center; gap:.5rem}
.chip{background:var(--chip-bg); border:2px solid var(--line); border-radius:999px; padding:.2rem .8rem; font-weight:700; font-size:.92rem; text-decoration:none; color:var(--ink); animation:pop-in .5s both}
.chip:hover{background:var(--chip-hover)}
.gamehead{position:relative}
.gamehead img{display:block; width:100%; height:200px; object-fit:cover; object-position:50% 68%; border-radius:var(--radius); border:var(--border-w) solid var(--c,#8ec5ff); box-shadow:0 8px 20px rgba(60,110,160,.14); filter:var(--title-filter)}
.gametitle{padding:.5rem .3rem 0}
.gametitle h1{margin:0; font-size:1.7rem} .gametitle p{margin:0; color:var(--muted)}
.bounce{display:inline-block; animation:hop 1.8s ease-in-out infinite}
.stage{box-shadow:0 8px 24px rgba(60,110,160,.12),0 0 0 6px color-mix(in srgb,var(--c,#8ec5ff) 25%,transparent)}
.hud span:first-child.pop{animation:scorepop .3s}
.side{background:var(--side-bg,var(--panel-solid))}
.table tr:nth-child(2) td{background:#fff9db} .table tr:nth-child(3) td{background:#f4f6f8} .table tr:nth-child(4) td{background:#fff1e6}
.foot{color:#5c6f82}
#confetti{position:fixed; inset:0; width:100%; height:100%; pointer-events:none; z-index:100}
@keyframes drift{from{translate:0 0} to{translate:calc(100vw + 500px) 0}}
@keyframes rise{from{translate:0 0; opacity:0} 10%{opacity:.55} to{translate:40px -115vh; opacity:0}}
@keyframes sunpulse{50%{transform:scale(1.08)}}
@keyframes shine{to{background-position:200% 0}}
@keyframes hop{0%,100%{transform:translateY(0)} 40%{transform:translateY(-12px) rotate(-6deg)}}
@keyframes pulse{50%{transform:scale(1.06)}}
@keyframes wiggle{25%{transform:rotate(-14deg) scale(1.15)} 75%{transform:rotate(14deg) scale(1.15)}}
@keyframes pop-in{from{opacity:0; transform:translateY(16px) scale(.94)} to{opacity:1; transform:none}}
@keyframes slowzoom{to{transform:scale(1.12)}}
@keyframes scorepop{50%{transform:scale(1.35); color:#e08a00}}
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation:none !important; transition:none !important}
}

button.secondary{background:var(--input-bg); color:var(--brand-dark); box-shadow:0 3px 0 var(--input-border); border:2px solid var(--input-border)}
button[hidden],input[hidden]{display:none}
.notice{background:#fff3c4; color:#6b5200; text-align:center; padding:.5rem 1rem; font-weight:700; border-bottom:2px solid #ffe08a; position:relative; z-index:2}

.loginpage{max-width:520px; margin:0 auto}
.loginpage .panel,.panel{background:var(--panel); border:2px solid var(--line); border-radius:var(--radius-lg); padding:1rem 1.3rem; margin:0 0 1.2rem; box-shadow:var(--shadow-soft)}
.loginpage .field{display:flex; flex-direction:column; gap:.2rem; margin-bottom:.9rem}
.loginpage .field label{font-weight:700}
.loginpage .field input{width:100%}
.loginpage .big-btn{width:100%; animation:none}
.loginmsg{min-height:1.4rem; font-weight:700; margin:.6rem 0 0; color:#2a9d5c}
.loginmsg.bad{color:#d6455d}
.okbox{background:#e1f7e8; color:#1d7a43; border-radius:12px; padding:.7rem 1rem; font-weight:700}
.notice.inpage{max-width:520px; margin:0 auto 1rem; border-radius:12px; border:2px solid #ffe08a}

.tabs{display:flex; gap:.4rem; margin:0 0 1rem; border-bottom:2px solid var(--line)}
.tab{background:transparent; color:var(--ink); box-shadow:none; border-radius:12px 12px 0 0; padding:.5rem 1rem; border:2px solid transparent; border-bottom:0}
.tab.active{background:var(--hover); color:var(--brand-dark); border-color:var(--line)}
.tab:hover{filter:none; background:var(--soft-2)}
.hint{color:var(--muted); font-size:.88rem}
.hint.bad{color:#d6455d; font-weight:700}
.hint.good{color:#2a9d5c; font-weight:700}
form[hidden]{display:none}

/* ---------- Spielgröße S / M / L / XL ---------- */
.stagewrap{margin:.8rem 0}
.stagewrap .stage{margin:0}
.gamebar{display:flex; flex-wrap:wrap; align-items:flex-end; justify-content:space-between; gap:.4rem 1rem}
.sizebar{display:flex; align-items:center; gap:0; margin-top:.5rem; background:var(--chip-bg); border:2px solid var(--line); border-radius:999px; padding:.15rem; box-shadow:0 3px 8px rgba(60,110,160,.08)}
.sizelabel{font-weight:800; font-size:.85rem; color:var(--muted); padding:0 .6rem 0 .7rem}
.sizebar button{background:transparent; color:var(--ink); box-shadow:none; border-radius:999px; padding:.25rem .8rem; min-width:2.6rem; font-weight:800}
.sizebar button:hover{background:#eef6ff; filter:none}
.sizebar button.active{background:var(--c,#4aa8ff); background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2)); color:#fff}
body.gamebody.sz-l main{max-width:1300px}
body.gamebody.sz-xl main{max-width:1700px}
body.gamebody.sz-xl .gamepage{grid-template-columns:1fr}
@media (max-width:820px){ .sizelabel{display:none} }
.stagewrap{scroll-margin-top:78px}
body.gamebody.sz-l .gamehead img{height:130px}
body.gamebody.sz-xl .gamehead img{height:90px}
body.gamebody.sz-xl .stagewrap{margin-left:auto; margin-right:auto}

/* ---------- Handy: nichts darf seitlich überlaufen ---------- */
nav{flex-wrap:wrap; gap:.2rem .6rem}
@media (max-width:600px){
  nav a{padding:.25rem .6rem; font-size:.95rem}
  .table th,.table td{padding:.4rem .45rem; font-size:.9rem}
  .table td{overflow-wrap:anywhere}
  .hero h1{font-size:1.7rem}
}

/* ---------- Multiplayer ---------- */
.gametools{display:flex; flex-wrap:wrap; align-items:center; gap:.5rem .8rem; margin-top:.5rem}
.gametools .sizebar{margin-top:0}
.mpbar{display:flex; align-items:center; gap:.3rem; background:var(--chip-bg); border:2px solid var(--line); border-radius:999px; padding:.15rem .3rem .15rem .15rem; box-shadow:0 3px 8px rgba(60,110,160,.08)}
.mp-btn{background:linear-gradient(135deg,#9b7dff,#4aa8ff); box-shadow:0 3px 0 #6a58c9; border-radius:999px; padding:.3rem .9rem}
.vs-btn{text-decoration:none; display:inline-block; background:linear-gradient(135deg,#ff9aa2,#ffa06b); box-shadow:0 3px 0 #c9718a}
.mpbar select{border:0; background:transparent; font-weight:700; padding:.2rem .3rem; color:var(--ink)}
.mp-panel{background:var(--panel); border:3px solid #cbbdff; border-radius:var(--radius-lg); padding:.9rem 1.2rem; margin:.8rem 0; box-shadow:0 8px 24px rgba(110,90,200,.15)}
.mp-head{display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap}
.mp-head h2{margin:.1rem 0; font-size:1.3rem}
.mp-code{background:#f1ecff; border-radius:12px; padding:.2rem .8rem; font-size:1.3rem; letter-spacing:.15em; color:#5b45c4}
.mp-codelabel{font-size:.7rem; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-right:.5rem}
.mp-msg{margin:.5rem 0; color:var(--ink)} .mp-msg.bad{color:#d6455d; font-weight:700} .mp-msg.ok{color:#1d7a43; font-weight:700}
.mp-hint{color:var(--muted); font-size:.92rem; margin:.4rem 0}
.mp-link{width:100%; font-size:.9rem; margin:.2rem 0 .5rem}
.mp-name{display:flex; flex-wrap:wrap; gap:.5rem; margin:.5rem 0}
.mp-players{list-style:none; margin:.6rem 0; padding:0; display:grid; gap:.4rem}
.mp-player{display:flex; justify-content:space-between; align-items:center; gap:.8rem; background:#f6f9ff; border:2px solid var(--line); border-radius:14px; padding:.45rem .9rem}
.mp-player.me{background:#f1ecff; border-color:#cbbdff}
.mp-pname{font-weight:800} .mp-medal{display:inline-block; min-width:1.8rem}
.mp-pscore{display:flex; align-items:center; gap:.6rem; color:var(--muted); flex-wrap:wrap; justify-content:flex-end}
.mp-pscore strong{font-size:1.2rem; color:var(--ink)}
.mp-tag{font-size:.85rem}
.mp-diff{font-weight:800; font-size:.9rem; border-radius:999px; padding:.05rem .6rem; background:#eef2f6}
.mp-diff.up{background:#ffe1e5; color:#c0344d} .mp-diff.down{background:#dff6e6; color:#1d7a43}
.mp-count{font-size:3.4rem; font-weight:800; text-align:center; color:#6a58c9; animation:pulse 1s ease-in-out infinite; margin:.2rem 0}
.mp-result{font-size:1.5rem; font-weight:800; text-align:center; margin:.6rem 0; color:#6a58c9}
.mp-btns{display:flex; flex-wrap:wrap; gap:.6rem; margin:.7rem 0 .2rem}
.mp-rooms{margin:0 0 1.4rem; background:var(--panel); border:3px solid #cbbdff; border-radius:var(--radius-lg); padding:.8rem 1.2rem}
.mp-rooms h2{margin:.1rem 0 .2rem; font-size:1.2rem}
.mp-roomlist{display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:.6rem; margin-top:.5rem}
.mp-room{display:flex; flex-direction:column; gap:.1rem; text-decoration:none; color:var(--ink); background:#f6f2ff; border:2px solid #d8ccff; border-radius:14px; padding:.55rem .9rem; transition:transform .15s}
.mp-room:hover{transform:translateY(-3px); box-shadow:0 8px 18px rgba(110,90,200,.2)}
.mp-room-title{font-weight:800} .mp-room-host{color:var(--muted); font-size:.9rem} .mp-room-join{font-weight:800; color:#6a58c9}
body.mp-on #againbtn{display:none}
.mp-rooms[hidden]{display:none}
/* Echtzeit-Duell: Lobby, Spielerliste und Spielfeld */
.vspage{max-width:960px; margin:0 auto}
.vshead h1{margin:.2rem 0 .3rem}
.vshead p{color:var(--muted); margin:.2rem 0 1rem}
.vs-panel{background:var(--panel); border:3px solid #cbbdff; border-radius:var(--radius-lg); padding:.9rem 1.2rem; margin:.8rem 0; box-shadow:0 8px 24px rgba(110,90,200,.15)}
.vs-panel h2{margin:.1rem 0 .3rem; font-size:1.3rem}
.vs-panel h3{margin:.9rem 0 .2rem; font-size:1.05rem}
.vs-msg{margin:.4rem 0; color:var(--ink)} .vs-msg.bad{color:#d6455d; font-weight:700}
.vs-btns{display:flex; flex-wrap:wrap; gap:.6rem; margin:.7rem 0 .2rem}
.vs-name, .vs-join{display:flex; flex-wrap:wrap; gap:.5rem; margin:.6rem 0}
.vs-name input, .vs-join input{flex:1 1 12rem}
.vs-rooms{margin:.4rem 0 .2rem; display:grid; gap:.5rem}
.vs-room{display:flex; align-items:center; gap:.8rem; background:#f6f9ff; border:2px solid var(--line); border-radius:14px; padding:.45rem .9rem}
.vs-roomcode{font-weight:800; letter-spacing:.15em; color:#5b45c4}
.vs-roomhost{flex:1 1 auto; color:var(--muted); font-size:.92rem}
.vs-head{display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap}
.vs-head h2{margin:.1rem 0; font-size:1.3rem}
.vs-code{background:#f1ecff; border-radius:12px; padding:.2rem .8rem; font-size:1.3rem; letter-spacing:.15em; color:#5b45c4}
.vs-codelabel{font-size:.7rem; letter-spacing:.05em; text-transform:uppercase; color:var(--muted); margin-right:.5rem}
.vs-spieler{list-style:none; margin:.6rem 0; padding:0; display:grid; gap:.4rem}
.vs-spielerzeile{display:flex; justify-content:space-between; align-items:center; gap:.8rem; background:#f6f9ff; border:2px solid var(--line); border-radius:14px; padding:.45rem .9rem}
.vs-spielerzeile.me{background:#f1ecff; border-color:#cbbdff}
.vs-spielername{font-weight:800}
.vs-spielerpunkte{font-size:1.2rem; font-weight:800}
.vs-status{margin:.5rem 0; font-weight:700; color:#6a58c9}
.vs-link{width:100%; font-size:.9rem; margin:.2rem 0 .5rem}
.vs-stage{margin:.6rem 0; display:flex; justify-content:center}
.vs-stage canvas{width:100%; max-width:600px; height:auto; border-radius:18px; border:3px solid #cbbdff; box-shadow:0 8px 22px rgba(110,90,200,.18); touch-action:none}
/* Größe des Spielfelds im Echtzeit-Duell: wie im Einzelspiel S / M / L / XL */
.vs-sizebar{margin:.2rem 0 .5rem; justify-content:center}
body.gamebody.sz-l .vspage{max-width:1300px}
body.gamebody.sz-xl .vspage{max-width:1700px}
.vs-back{margin:1rem 0 2rem}
/* Menü: Links nicht umbrechen; wird es eng, rutscht lieber das Namensfeld in die nächste Zeile */
nav{flex:1 1 auto}
nav a{white-space:nowrap}
.mp-round{font-size:.8rem; letter-spacing:.04em; color:var(--muted); margin-right:.7rem; font-weight:800}
.mp-wins{font-size:.9rem; color:#c98a00; font-weight:800}

/* ---------- Dunkelmodus: Sonne wird zum Mond ---------- */
/* Der Knopf oben rechts: Sonne anklicken, sie wird zum Mond und die Seite dunkel. */
.themebtn{
  position:absolute; top:.8rem; right:1.5rem; width:2.7rem; height:2.7rem; padding:0; border-radius:50%;
  border:2px solid var(--line); background:var(--card); color:#f5a623;
  box-shadow:0 2px 8px rgba(60,110,160,.18); display:inline-flex; align-items:center; justify-content:center;
  transition:transform .2s, background .35s, color .35s, border-color .35s, box-shadow .35s;
}
.themebtn:hover{filter:none; transform:rotate(22deg) scale(1.07)}
.themebtn:active{transform:scale(.94); box-shadow:0 1px 3px rgba(60,110,160,.2)}
.themebtn:focus-visible{outline:3px solid var(--brand); outline-offset:2px}
.themebtn .ico{position:absolute; width:1.55rem; height:1.55rem; transition:opacity .35s, transform .35s}
.themebtn .ico-sun{opacity:1; transform:rotate(0) scale(1)}
.themebtn .ico-moon{opacity:0; transform:rotate(-75deg) scale(.35)}
html[data-theme="dark"] .themebtn{color:#ffe6a3; background:#1d2942; border-color:#3b4d6d; box-shadow:0 2px 10px rgba(0,0,0,.45)}
html[data-theme="dark"] .themebtn .ico-sun{opacity:0; transform:rotate(75deg) scale(.35)}
html[data-theme="dark"] .themebtn .ico-moon{opacity:1; transform:rotate(0) scale(1)}

/* Grundfarben im dunklen Modus */
html[data-theme="dark"]{
  --bg:#0e1626; --ink:#e9eff8; --muted:#9aabc2; --card:#182133; --line:#2b3a52;
  --brand:#4aa8ff; --brand-dark:#74b9ff; --sun:#ffd166;
  --page:linear-gradient(180deg,#0b1220 0,#111c2f 55%,#0c1524 100%);
  --panel:rgba(24,33,51,.96); --panel-solid:#182133; --side-bg:#182133; --stage-bg:#10192a;
  --soft:#1e2c44; --soft-2:#1b2740; --hover:#1f2d45; --cell-hover:#2a3c5a;
  --top-bg:rgba(16,24,40,.86); --overlay:rgba(12,18,30,.94);
  --chip-bg:rgba(24,33,51,.92); --chip-hover:#2c3a54;
  --input-bg:#131c2c; --input-border:#33465f; --focus:#3d5f8a;
  --icon-bg:#222e44;
  --shadow:0 6px 18px rgba(0,0,0,.4);
  --shadow-hover:0 16px 32px rgba(0,0,0,.55);
  --shadow-soft:0 6px 18px rgba(0,0,0,.35);
  color-scheme:dark;
}
html[data-theme="dark"] body{transition:background .35s}
html[data-theme="dark"] .top{border-bottom-color:#2b3a52}
html[data-theme="dark"] .gcard .icon{box-shadow:0 4px 10px rgba(0,0,0,.45)}
html[data-theme="dark"] .error{background:#3a1f27; color:#ff9aa6}
html[data-theme="dark"] .table tr:nth-child(2) td{background:#33301a}
html[data-theme="dark"] .table tr:nth-child(3) td{background:#1b2434}
html[data-theme="dark"] .table tr:nth-child(4) td{background:#33241a}
html[data-theme="dark"] .stage{box-shadow:0 8px 24px rgba(0,0,0,.45)}
html[data-theme="dark"] .notice{background:#3d3413; color:#ffe08a; border-bottom-color:#6b5a20}
html[data-theme="dark"] .notice.inpage{border-color:#6b5a20}
html[data-theme="dark"] .okbox{background:#14331f; color:#6ee7a0}
html[data-theme="dark"] .tab.active{background:#1e2c44; color:var(--brand-dark); border-color:#2b3a52}
html[data-theme="dark"] .tab:hover{background:#243350}
html[data-theme="dark"] button.secondary{background:#1b2537; color:var(--brand-dark); border-color:#33465f; box-shadow:0 3px 0 #33465f}
html[data-theme="dark"] #namemsg{color:#57d38a}
html[data-theme="dark"] #namemsg.bad{color:#ff9aa6}
html[data-theme="dark"] .hint.bad{color:#ff9aa6}
html[data-theme="dark"] .hint.good{color:#57d38a}
html[data-theme="dark"] .loginmsg{color:#57d38a}
html[data-theme="dark"] .loginmsg.bad{color:#ff9aa6}
html[data-theme="dark"] .foot{color:#93a4ba}
html[data-theme="dark"] .sizebar{background:rgba(24,33,51,.92)}
html[data-theme="dark"] .sizebar button:hover{background:#243350}
html[data-theme="dark"] .mp-panel{border-color:#4b3f8a; box-shadow:0 8px 24px rgba(0,0,0,.4)}
html[data-theme="dark"] .mp-code{background:#241d47; color:#b9a6ff}
html[data-theme="dark"] .mp-player{background:#1a2436}
html[data-theme="dark"] .mp-player.me{background:#241d47; border-color:#4b3f8a}
html[data-theme="dark"] .mp-rooms{border-color:#4b3f8a}
html[data-theme="dark"] .mp-room{background:#1e1938; border-color:#4b3f8a}
html[data-theme="dark"] .mp-diff{background:#24314a}
html[data-theme="dark"] .mp-diff.up{background:#3d1f27; color:#ff9aa6}
html[data-theme="dark"] .mp-diff.down{background:#14331f; color:#6ee7a0}
html[data-theme="dark"] .mp-count,html[data-theme="dark"] .mp-result{color:#b9a6ff}
html[data-theme="dark"] .mp-msg.ok{color:#6ee7a0}
html[data-theme="dark"] .mp-msg.bad{color:#ff9aa6}
html[data-theme="dark"] .mp-wins{color:#ffd166}
html[data-theme="dark"] .vs-panel{border-color:#4b3f8a; box-shadow:0 8px 24px rgba(0,0,0,.4)}
html[data-theme="dark"] .vs-code{background:#241d47; color:#b9a6ff}
html[data-theme="dark"] .vs-spielerzeile{background:#1a2436}
html[data-theme="dark"] .vs-spielerzeile.me{background:#241d47; border-color:#4b3f8a}
html[data-theme="dark"] .vs-room{background:#1a2436}
html[data-theme="dark"] .vs-status{color:#b9a6ff}
html[data-theme="dark"] .vs-stage canvas{border-color:#4b3f8a; box-shadow:0 8px 22px rgba(0,0,0,.45)}
html[data-theme="dark"] .gamehead img{box-shadow:0 8px 22px rgba(0,0,0,.45)}
/* Titelbild passt unten ans Karten-Rot an (das SVG verläuft in dieselbe Farbe) */
html[data-theme="dark"] .banner{background:#121b2d}
html[data-theme="dark"] body.gamebody{
  background:linear-gradient(180deg,color-mix(in srgb,var(--gc,#8ec5ff) 14%,#0b1220) 0,#111c2f 60%,#0c1524 100%) fixed;
}

/* Nachtsternenhimmel: die Sonne im Hintergrund wird zum Mond */
html[data-theme="dark"] .sky .sun{
  background:
    radial-gradient(circle at 32% 30%,rgba(150,162,192,.55) 0 9%,transparent 10%),
    radial-gradient(circle at 66% 58%,rgba(150,162,192,.45) 0 12%,transparent 13%),
    radial-gradient(circle at 44% 74%,rgba(150,162,192,.32) 0 7%,transparent 8%),
    radial-gradient(circle,#f4f7ff 0 46%,#c3cde3 47% 100%);
  box-shadow:0 0 0 14px rgba(160,180,225,.10),0 0 0 32px rgba(160,180,225,.06),0 0 60px 30px rgba(150,170,220,.14);
}
html[data-theme="dark"] .sky .cloud{background:#3b4a66; opacity:.55}
html[data-theme="dark"] .sky .cloud::before,html[data-theme="dark"] .sky .cloud::after{background:#3b4a66}
html[data-theme="dark"] .sky .bub{opacity:.22}
.st{display:none}
html[data-theme="dark"] .st{
  display:block; position:absolute; left:var(--x); top:var(--y); width:2px; height:2px; border-radius:50%;
  background:#fff; box-shadow:0 0 4px rgba(255,255,255,.8); animation:twinkle 3.2s ease-in-out infinite;
  animation-delay:var(--d,0s);
}
@keyframes twinkle{0%,100%{opacity:.25} 50%{opacity:.95}}

/* ---------- DOM-Spiele im dunklen Modus ---------- */
html[data-theme="dark"] .dg-board{background:#1a1526 !important}
html[data-theme="dark"] .dg-cell{background:#4b3f8a !important; color:#fff !important}
html[data-theme="dark"] .dg-cell:hover{background:#5d4fa5 !important}
html[data-theme="dark"] .dg-board.dg-mine{background:#14243c !important}
html[data-theme="dark"] .dg-mine{background:#2b4470 !important}
/* Aufgedeckte Felder werden hell, damit man sieht, was schon aufgedeckt ist.
   Die Zahlenfarben kommen aus dem Spiel (dunkel auf hell). */
html[data-theme="dark"] .dg-mine.offen{background:#eef4ff !important}
html[data-theme="dark"] .dg-mine.offen.minen{background:#ffb5b5 !important}
html[data-theme="dark"] .dg-mine.offen.boom{background:#ff7b7b !important; color:#fff !important}
html[data-theme="dark"] .dg-mine:hover{background:#37609c !important}
html[data-theme="dark"] .dg-mine.offen:hover{background:#dbe7ff !important}
html[data-theme="dark"] .dg-board.dg-ttt{background:#2a1c1c !important}
html[data-theme="dark"] .dg-ttt{background:#1a2436 !important; color:#e9eff8 !important}
html[data-theme="dark"] .dg-ttt:hover{background:#26344c !important}
html[data-theme="dark"] .dg-input{background:#131c2c !important; color:#e9eff8 !important; border-color:#33465f !important}
html[data-theme="dark"] .dg-bar{background:#4a6d9c !important}
/* Texte und aufgedeckte Felder der DOM-Spiele */
html[data-theme="dark"] .dg-msg{color:#e9eff8 !important}
html[data-theme="dark"] .dg-cell-open{background:#e9eff8 !important; color:#1a2436 !important}
html[data-theme="dark"] .dg-cell-done{background:#14331f !important; color:#a7f3c8 !important}
html[data-theme="dark"] .dg-win{background:#14331f !important}
html[data-theme="dark"] .dg-lose{background:#3a1f27 !important}
html[data-theme="dark"] .dg-word{color:#9ecbff !important}
html[data-theme="dark"] .dg-prev{color:#9aabc2 !important}

/* ---------- Hintergrundmusik ---------- */
/* Kleiner runder Knopf unten rechts; das Panel öffnet sich darüber.
   Alles bleibt im Fenster, damit auf dem Handy nichts seitlich überläuft. */
.musicbox{position:fixed; right:.7rem; bottom:.7rem; z-index:60}
#mgaudio{position:absolute; width:1px; height:1px; opacity:0; pointer-events:none}
.musicbtn{
  width:2.7rem; height:2.7rem; padding:0; border-radius:50%; border:2px solid var(--line);
  background:var(--card); color:var(--brand-dark); font-size:1.1rem; line-height:1;
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer;
  box-shadow:0 4px 14px rgba(60,110,160,.25); transition:transform .2s, box-shadow .3s;
}
.musicbtn:hover{filter:none; transform:scale(1.07)}
.musicbtn:active{transform:scale(.94)}
.musicbtn:focus-visible{outline:3px solid var(--brand); outline-offset:2px}
.musicbtn.mg-want{border-color:var(--brand); animation:mgpulse 1.4s ease-in-out infinite}
@keyframes mgpulse{
  0%,100%{box-shadow:0 4px 14px rgba(60,110,160,.25)}
  50%{box-shadow:0 0 0 9px rgba(74,168,255,.28)}
}
.musicpanel{
  position:absolute; right:0; bottom:3.3rem; width:15rem; max-width:calc(100vw - 1.4rem);
  background:var(--panel); border:2px solid var(--line); border-radius:var(--radius-md);
  padding:.7rem .9rem; box-shadow:var(--shadow-hover);
  display:flex; flex-direction:column; gap:.45rem; text-align:left;
}
.musicpanel[hidden]{display:none}
.musicpanel h2{margin:0; font-size:1rem}
.musicplay{width:100%; padding:.4rem .6rem; font-weight:800}
.musicrow{display:flex; justify-content:space-between; align-items:center; gap:.5rem; font-size:.88rem; font-weight:700}
.musiccheck{display:flex; align-items:center; gap:.45rem; font-size:.86rem; font-weight:700; cursor:pointer}
.musichint{margin:0; font-size:.78rem; line-height:1.35; color:var(--muted)}
.musicnow{margin:.25rem 0 .1rem; font-size:.82rem; font-weight:700; color:var(--brand-dark)}
#musicvol{width:100%; padding:0; border:0; background:transparent; accent-color:var(--brand); height:1.5rem}
html[data-theme="dark"] .musicbtn{background:#1d2942; border-color:#3b4d6d; color:#ffe6a3}
html[data-theme="dark"] .musicpanel{background:rgba(24,33,51,.96); border-color:#2b3a52}
