/* =========================================================
   kolOS 2.0 — Spiele-Explorer und Spiele
   ========================================================= */

/* ---------------------------------------------------------
   Spiele-Explorer
   --------------------------------------------------------- */
.gx { display: flex; flex-direction: column; height: 100%; background: #fff; }

.gx-tools {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 3px;
  padding: 5px 8px;
  background: linear-gradient(180deg, #f6fbff, #dceefc);
  border-bottom: 1px solid rgba(140,185,220,.6);
}
.gx-t {
  padding: 4px 9px;
  border: 1px solid transparent; border-radius: 3px;
  background: none; color: #17506f;
  font: 500 12px/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}
.gx-t:hover { background: rgba(255,255,255,.9); border-color: rgba(140,185,220,.8); }
.gx-t.open { background: #fff; border-color: #8dbfe0; box-shadow: inset 0 1px 3px rgba(40,90,130,.18); }
.gx-tools { position: relative; }
.gx-pop {
  position: absolute; top: 100%; z-index: 30;
  min-width: 194px;
  display: flex; flex-direction: column;
  padding: 3px;
  border: 1px solid #9dc4de; border-radius: 0 4px 4px 4px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(20,60,90,.3);
}
.gx-pop hr { border: 0; border-top: 1px solid #dbe9f2; margin: 3px 2px; width: 100%; }
.gx-grow { flex: 1 1 auto; }
.gx-find {
  width: 168px; height: 23px; padding: 0 8px;
  border: 1px solid rgba(120,170,210,.85); border-radius: 3px;
  background: #fff; color: #123;
  font: 400 12px/1 "Segoe UI", system-ui, sans-serif;
}
.gx-find:focus { outline: 2px solid rgba(120,195,250,.7); outline-offset: -1px; }

.gx-cols {
  flex: 0 0 auto;
  display: grid;
  background: linear-gradient(180deg, #fdfefe, #eef5fa);
  border-bottom: 1px solid #c7dcea;
  overflow: hidden;
}
.gx-col {
  padding: 5px 9px;
  font: 400 11.5px/1.2 "Segoe UI", system-ui, sans-serif;
  color: #3d6b8c;
  border-right: 1px solid #dceaf3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gx-col:last-child { border-right: 0; }

.gx-list { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px; }

/* Kachelansicht (Vorgabe) */
.gx-row.gx-tile {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 12px;
  border: 1px solid transparent; border-radius: 5px;
  background: none; text-align: left; cursor: default;
  font: inherit;
}
.gx-row.gx-tile .gx-big { font-size: 40px; line-height: 1; flex: 0 0 auto; filter: drop-shadow(0 2px 3px rgba(30,80,120,.25)); }
.gx-row.gx-tile .gx-tx b { display: block; font-size: 13.5px; color: #16374e; }
.gx-row.gx-tile .gx-tx small { display: block; font-size: 11.5px; color: #6c8ea6; }
.gx-row:hover { background: linear-gradient(180deg, #f2f9ff, #e2f0fd); border-color: #b6dbf3; }
.gx-row.sel { background: linear-gradient(180deg, #d8ecfd, #b9dcf8); border-color: #7fbde8; }
.gx-row:focus-visible { outline: 2px solid #4ea3e0; outline-offset: -2px; }

/* Detailansicht */
.gx.is-details .gx-list { padding: 0; }
.gx.is-details .gx-row {
  display: grid; align-items: center;
  width: 100%; padding: 0;
  border: 1px solid transparent; border-radius: 0;
  background: none; text-align: left; cursor: default; font: inherit;
}
.gx.is-details .gx-row:nth-child(even) { background: #f7fbfe; }
.gx-cell {
  padding: 5px 9px;
  font: 400 12px/1.3 "Segoe UI", system-ui, sans-serif;
  color: #2c4d63;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gx-cell.gx-name { display: flex; align-items: center; gap: 7px; color: #16374e; font-weight: 500; }
.gx-cell .gx-ico { font-style: normal; font-size: 16px; flex: 0 0 auto; }

.gx-none { padding: 22px; text-align: center; color: #6c8ea6; font-size: 12.5px; }

.gx-info {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  background: linear-gradient(180deg, #eef7ff, #dcecf9);
  border-top: 1px solid #bcd8ea;
  min-height: 54px;
}
.gx-info .gi-ico { font-size: 30px; line-height: 1; }
.gx-info .gi-tx b { display: block; font-size: 13px; color: #16374e; }
.gx-info .gi-tx small { display: block; font-size: 11.5px; color: #4e7b96; max-width: 60ch; white-space: normal; }
.gx-info .gi-grow { flex: 1 1 auto; }
.gi-play {
  padding: 6px 18px;
  border: 1px solid #6ba9d4; border-radius: 4px;
  background: linear-gradient(180deg, #fdfefe, #d6ecfd 48%, #b3dbf6);
  color: #114a70; font: 600 12.5px/1 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}
.gi-play:hover { background: linear-gradient(180deg, #fff, #c9e7ff 48%, #96cef2); }

/* ---------------------------------------------------------
   Gemeinsames Spielgeruest
   --------------------------------------------------------- */
.gm { display: flex; flex-direction: column; height: 100%; background: linear-gradient(180deg, #f4fbff, #e4f1fb); }

.gm-menu {
  flex: 0 0 auto;
  display: flex; gap: 1px;
  padding: 2px 4px;
  background: #eff6fb;
  border-bottom: 1px solid #c8dcea;
}
.gm-m { position: relative; }
.gm-mb {
  padding: 4px 10px;
  border: 1px solid transparent; border-radius: 3px;
  background: none; color: #1d4a68;
  font: 400 12px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer;
}
.gm-mb:hover { background: #d6e8f8; border-color: #a9cde8; }
.gm-pop {
  position: absolute; left: 0; top: 100%; z-index: 20;
  min-width: 172px;
  display: flex; flex-direction: column;
  padding: 3px;
  border: 1px solid #9dc4de; border-radius: 0 4px 4px 4px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(20,60,90,.28);
}
.gm-pop[hidden] { display: none !important; }
.gm-pop hr { border: 0; border-top: 1px solid #dbe9f2; margin: 3px 2px; }
.gm-mi {
  padding: 5px 12px;
  border: 0; border-radius: 3px;
  background: none; color: #1d4a68;
  font: 400 12px/1.3 "Segoe UI", system-ui, sans-serif;
  text-align: left; cursor: pointer; white-space: nowrap;
}
.gm-mi:hover { background: linear-gradient(180deg, #e6f4ff, #c9e5fb); }
.gm-mi.on { font-weight: 600; }

.gm-area { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; display: flex; }
.gm-status {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px;
  height: 23px; padding: 0 10px;
  background: linear-gradient(180deg, #f2f9ff, #dceefc);
  border-top: 1px solid #bcd8ea;
  font: 400 11.5px/1 "Segoe UI", system-ui, sans-serif; color: #3d6b8c;
}
.gm-status .gs-mid { flex: 1 1 auto; text-align: center; }
.gm-status .gs-right { min-width: 56px; text-align: right; }
.gm-oops { margin: auto; padding: 20px; text-align: center; color: #8a3a3a; }
.gm-oops b { display: block; font-size: 14px; margin-bottom: 6px; }
.gm-oops small { font: 400 11px/1.5 Consolas, monospace; color: #a06060; }

/* ---------------------------------------------------------
   Minesweeper
   --------------------------------------------------------- */
.ms { margin: auto; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ms-head {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 12px;
  border: 1px solid #a9c9de; border-radius: 5px;
  background: linear-gradient(180deg, #ffffff, #e8f4fd);
  box-shadow: inset 0 1px 0 #fff;
  font: 700 15px/1 "Segoe UI", system-ui, sans-serif; color: #16374e;
}
.ms-face {
  width: 34px; height: 34px; padding: 0;
  border: 1px solid #8fb9d6; border-radius: 5px;
  background: linear-gradient(180deg, #fff, #d9edfb);
  font-size: 19px; line-height: 1; cursor: pointer;
}
.ms-face:hover { background: linear-gradient(180deg, #fff, #c1e2fa); }
.ms-mines, .ms-time { font-variant-numeric: tabular-nums; min-width: 74px; }
.ms-time { text-align: right; }

.ms-board {
  --cell: 26px; --cols: 9;
  display: grid;
  grid-template-columns: repeat(var(--cols), var(--cell));
  gap: 1px;
  padding: 4px;
  border: 1px solid #7ba7c6; border-radius: 4px;
  background: #9fc3da;
}
.ms-c {
  width: var(--cell); height: var(--cell);
  padding: 0; border: 0; border-radius: 2px;
  background: linear-gradient(180deg, #f2fbff, #cfe6f6);
  box-shadow: inset 1px 1px 0 rgba(255,255,255,.95), inset -1px -1px 0 rgba(90,140,175,.5);
  font: 700 calc(var(--cell) * .62)/1 "Segoe UI", system-ui, sans-serif;
  color: #16374e;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  user-select: none;
  -webkit-touch-callout: none;
}
.ms-c:hover:not(.open) { background: linear-gradient(180deg, #fff, #e6f5ff); }
.ms-c.open {
  background: #eaf3f9;
  box-shadow: inset 0 0 0 1px rgba(140,180,205,.45);
  cursor: default;
}
.ms-c.flag { color: #c0392b; }
.ms-c.mine { background: #f7dede; }
.ms-c.boom { background: #e74c3c; }
.ms-c.wrong { color: #c0392b; background: #f4e6e6; }
/* Die Ziffernfarben aus dem Original. */
.ms-c.n1 { color: #1f6fd0; } .ms-c.n2 { color: #2e8b3d; } .ms-c.n3 { color: #d03a2e; }
.ms-c.n4 { color: #23307a; } .ms-c.n5 { color: #8b2020; } .ms-c.n6 { color: #158a8a; }
.ms-c.n7 { color: #222; }    .ms-c.n8 { color: #777; }

/* ---------------------------------------------------------
   Purble Pairs
   --------------------------------------------------------- */
.pp {
  /* Eigene Breite ist Pflicht: .pp ist ein Flex-Element, und ohne sie
     bezieht sich das min(100%,...) des Brettes auf einen Elternteil, der
     selbst erst vom Brett abhaengt -- das Ergebnis waren 11-px-Karten. */
  margin: auto; padding: 14px;
  flex: 0 0 auto;
  width: min(100%, 470px);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.pp-head { font: 500 12.5px/1 "Segoe UI", system-ui, sans-serif; color: #2c5c7c; }
.pp-board {
  --cols: 6;
  display: grid;
  grid-template-columns: repeat(var(--cols), 1fr);
  gap: 9px;
  width: 100%;
}
.pp-c {
  position: relative;
  aspect-ratio: 3 / 4;
  padding: 0; border: 0; background: none;
  cursor: pointer;
  perspective: 600px;
}
.pp-c > span {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  backface-visibility: hidden;
  transition: transform .28s ease;
}
.pp-back {
  background: linear-gradient(150deg, #79c6f2, #2f7fc0 60%, #1b5e97);
  border: 1px solid rgba(255,255,255,.6);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 3px 8px rgba(20,70,110,.3);
  color: rgba(255,255,255,.85); font-size: 22px; font-weight: 700;
}
.pp-face {
  background: linear-gradient(180deg, #fff, #eaf6ff);
  border: 1px solid #9fc9e4;
  box-shadow: 0 3px 8px rgba(20,70,110,.22);
  font-size: 30px;
  transform: rotateY(180deg);
}
.pp-c.up .pp-back, .pp-c.done .pp-back { transform: rotateY(180deg); }
.pp-c.up .pp-face, .pp-c.done .pp-face { transform: rotateY(360deg); }
.pp-c.done { cursor: default; }
.pp-c.done .pp-face { border-color: #6fc06f; box-shadow: 0 0 0 2px rgba(110,200,110,.55); }
@media (prefers-reduced-motion: reduce) { .pp-c > span { transition: none; }}

/* ---------------------------------------------------------
   Mahjong Titans
   --------------------------------------------------------- */
.mj { flex: 1 1 auto; display: flex; }
.mj-board {
  /* --u ist eine HALBE Steinbreite. Ein Stein ist 2u breit und 2.6u hoch;
     die Reihen stehen genau 2.6u auseinander, sonst ueberlappen sie sich
     zur Haelfte und der Schildkroetenaufbau ist nicht mehr zu erkennen. */
  --u: 22px;
  position: relative;
  margin: auto;
  width: calc(var(--u) * 33);
  height: calc(var(--u) * 23);
}
.mj-t {
  position: absolute;
  left: calc(var(--gx) * var(--u) + var(--l) * var(--u) * .30);
  top: calc(var(--gy) * var(--u) * 2.6 - var(--l) * var(--u) * .38);
  width: calc(var(--u) * 2);
  height: calc(var(--u) * 2.6);
  padding: 0;
  border: 1px solid #b49a68;
  border-radius: calc(var(--u) * .18);
  background: linear-gradient(170deg, #fffdf4 0%, #f6efdc 55%, #e6dcc0 100%);
  box-shadow:
    calc(var(--u) * .12) calc(var(--u) * .12) 0 rgba(120,100,60,.45),
    inset 0 1px 0 #fff;
  font-size: calc(var(--u) * 1.25);
  line-height: 1;
  color: #1d3f5c;
  display: flex; align-items: center; justify-content: center;
  cursor: default;
  transition: filter .12s ease;
}
.mj-t.free { cursor: pointer; }
.mj-t:not(.free) { filter: brightness(.86) saturate(.7); }
.mj-t.free:hover { filter: brightness(1.06); }
.mj-t.sel {
  background: linear-gradient(170deg, #fffde8, #ffe9a8 60%, #f2d585);
  border-color: #d8a93a;
  box-shadow: calc(var(--u) * .12) calc(var(--u) * .12) 0 rgba(120,100,60,.45), 0 0 0 2px #f0bf4a;
}
.mj-t.hint {
  animation: mjhint .5s ease-in-out 3;
}
@keyframes mjhint {
  50% { background: linear-gradient(170deg, #e8ffe8, #b8f0b8); border-color: #4fae4f; }}
@media (prefers-reduced-motion: reduce) { .mj-t.hint { animation: none; box-shadow: 0 0 0 3px #4fae4f; }}

/* ---------------------------------------------------------
   Schmale Schirme
   --------------------------------------------------------- */
@media (max-width: 819px) {
  /* Die Kachelzeilen duerfen auf dem Handy nicht die halbe Hoehe fressen. */
  .gx-row.gx-tile { padding: 7px 10px; gap: 10px; }
  .gx-row.gx-tile .gx-big { font-size: 30px; }
  .gx-row.gx-tile .gx-tx b { font-size: 13px; }
  .gx.is-details .gx-cols, .gx.is-details .gx-cell:not(.gx-name):not(.gx-played) { display: none; }
  .gx.is-details .gx-row { grid-template-columns: 1.6fr 1.1fr !important; }
  .gx-cols { display: none; }
  .gx-find { width: 108px; }
  .gx-t[data-t="tools"], .gx-t[data-t="opts"] { display: none; }
  .gx-info .gi-tx small { display: none; }
  .ms-board { --cell: 22px; }
  .pp-board { width: 100%; gap: 6px; }
}

/* ---------------------------------------------------------
   Kartenspiele: Tisch, Stapel, Karten
   Alles in Kartenbreiten (--cw) gerechnet -- so passt sich der
   ganze Tisch in einem Rutsch an die Fenstergroesse an.
   --------------------------------------------------------- */
.tbl {
  --cw: 74px; --cols: 8; --rows: 5;
  position: relative;
  margin: auto;
  width: calc(var(--cols) * var(--cw));
  height: calc(var(--rows) * var(--cw) * 1.4);
  flex: 0 0 auto;
}
.gm-area:has(.tbl) { background: linear-gradient(170deg, #2f8f4e 0%, #1f7a41 55%, #17663a 100%); }
/* Fallback fuer Browser ohne :has() -- Filz gibt es dann ueber die Klasse. */
.gm.felt .gm-area { background: linear-gradient(170deg, #2f8f4e 0%, #1f7a41 55%, #17663a 100%); }

.pile {
  position: absolute;
  left: calc(var(--px) * var(--cw));
  top: calc(var(--py) * var(--cw) * 1.4);
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  border: 2px dashed rgba(255,255,255,.30);
  border-radius: calc(var(--cw) * .09);
  box-sizing: border-box;
}
.pile::after {
  content: attr(data-mark);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--cw) * .5);
  color: rgba(255,255,255,.22);
  pointer-events: none;
}
.pile-stock { border-style: solid; border-color: rgba(255,255,255,.42); cursor: pointer; }
.pile.over { border-color: #ffe479; box-shadow: 0 0 0 3px rgba(255,228,121,.5), 0 0 22px rgba(255,228,121,.5); }

.pcard {
  position: absolute;
  left: calc(var(--cx) * var(--cw));
  top: calc(var(--cy) * var(--cw) * 1.4);
  width: var(--cw);
  height: calc(var(--cw) * 1.4);
  box-sizing: border-box;
  border: 1px solid #9aa7b0;
  border-radius: calc(var(--cw) * .09);
  background: linear-gradient(170deg, #ffffff 0%, #fbfdff 60%, #eef4f8 100%);
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  color: #14243a;
  font-family: "Segoe UI", system-ui, sans-serif;
  user-select: none;
  cursor: pointer;
  will-change: transform;
}
.pcard.red { color: #c0202c; }
.pcard .c-tl, .pcard .c-br {
  position: absolute;
  display: flex; flex-direction: column; align-items: center;
  line-height: .96;
  font-weight: 700;
  font-size: calc(var(--cw) * .26);
}
.pcard .c-tl { left: calc(var(--cw) * .07); top: calc(var(--cw) * .06); }
.pcard .c-br { right: calc(var(--cw) * .07); bottom: calc(var(--cw) * .06); transform: rotate(180deg); }
.pcard .c-tl i, .pcard .c-br i { font-style: normal; font-size: calc(var(--cw) * .22); }
.pcard .c-mid {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--cw) * .62);
  opacity: .92;
}
.pcard .c-back { display: none; }
.pcard.down {
  color: transparent;
  border-color: #2b5f92;
  background: #1f5a90;
}
.pcard.down .c-tl, .pcard.down .c-br, .pcard.down .c-mid { visibility: hidden; }
.pcard.down .c-back {
  display: block;
  position: absolute; inset: calc(var(--cw) * .05);
  border-radius: calc(var(--cw) * .05);
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.16) 0 3px, rgba(255,255,255,0) 3px 7px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.16) 0 3px, rgba(255,255,255,0) 3px 7px),
    linear-gradient(160deg, #63b6ee, #2a72b4 55%, #174f86);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.45);
}
.pcard.drag { box-shadow: 0 10px 26px rgba(0,0,0,.5); cursor: grabbing; }
/* Karten im Ablagestapel, die von der naechsten verdeckt werden. */
.pcard.stack .c-tl, .pcard.stack .c-mid, .pcard.stack .c-br { opacity: .0; }
.pcard.fly { position: absolute; transition: none; }

@media (max-width: 819px) {
  .pcard .c-tl, .pcard .c-br { font-size: calc(var(--cw) * .3); }}

/* ---------------------------------------------------------
   Chess Titans
   Kein 3D: ein Glasbrett von oben. Die Figuren sind Unicode --
   in jeder Groesse scharf und ohne eine einzige Bilddatei.
   --------------------------------------------------------- */
.ch { flex: 1 1 auto; display: flex; gap: 12px; padding: 8px; min-height: 0; }
.ch-main { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-width: 0; }
.ch-board {
  --sq: 62px;
  display: grid;
  grid-template-columns: repeat(8, var(--sq));
  grid-template-rows: repeat(8, var(--sq));
  border: 3px solid #6f5334;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(20,50,80,.4), inset 0 0 0 1px rgba(255,255,255,.4);
  overflow: hidden;
}
.ch-sq {
  position: relative;
  width: var(--sq); height: var(--sq);
  padding: 0; border: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.ch-sq.light { background: linear-gradient(150deg, #f6ecd5, #e8dbbd); }
.ch-sq.dark  { background: linear-gradient(150deg, #9a7b53, #7d6140); }
.ch-sq.last  { box-shadow: inset 0 0 0 3px rgba(255,220,110,.75); }
.ch-sq.sel   { box-shadow: inset 0 0 0 3px #4fc3f7, inset 0 0 22px rgba(80,200,255,.55); }
.ch-sq.check { box-shadow: inset 0 0 0 3px #e05252, inset 0 0 26px rgba(230,70,70,.6); }
.ch-p {
  font-size: calc(var(--sq) * .78);
  line-height: 1;
  user-select: none;
  pointer-events: none;
}
/* Weisse Figuren: helles Glas mit dunklem Rand. Schwarze: poliertes
   Anthrazit. Beide aus denselben gefuellten Zeichen -- die hohlen
   Zeichen verschwinden auf hellen Feldern. */
.ch-p.w { color: #fdfdfb; text-shadow: 0 0 1px #33475c, 0 1px 0 #6d8296, 0 2px 3px rgba(0,0,0,.45), 0 -1px 0 #fff; }
.ch-p.b { color: #2b3440; text-shadow: 0 1px 0 #59636f, 0 -1px 1px rgba(255,255,255,.35), 0 2px 4px rgba(0,0,0,.5); }
.ch-dot {
  position: absolute; left: 50%; top: 50%;
  width: calc(var(--sq) * .26); height: calc(var(--sq) * .26);
  margin: calc(var(--sq) * -.13) 0 0 calc(var(--sq) * -.13);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, rgba(255,255,255,.9), rgba(90,190,255,.85));
  box-shadow: 0 0 10px rgba(80,200,255,.9);
  pointer-events: none;
}
.ch-sq.take .ch-dot {
  width: calc(var(--sq) * .82); height: calc(var(--sq) * .82);
  margin: calc(var(--sq) * -.41) 0 0 calc(var(--sq) * -.41);
  background: none;
  border: 3px solid rgba(255,120,90,.9);
  box-shadow: 0 0 12px rgba(255,120,90,.7);
}
.ch-rank, .ch-file {
  position: absolute; font-style: normal;
  font: 600 9.5px/1 "Segoe UI", system-ui, sans-serif;
  color: rgba(40,30,15,.5);
}
.ch-rank { left: 2px; top: 2px; }
.ch-file { right: 3px; bottom: 2px; }
.ch-sq.dark .ch-rank, .ch-sq.dark .ch-file { color: rgba(255,245,225,.6); }

.ch-side {
  flex: 0 0 168px;
  display: flex; flex-direction: column; gap: 6px;
  min-height: 0;
}
.ch.narrow .ch-side { display: none; }
.ch-who {
  padding: 5px 8px; border-radius: 5px;
  background: rgba(255,255,255,.7); border: 1px solid #b8d6e8;
  font: 600 11.5px/1.3 "Segoe UI", system-ui, sans-serif; color: #16374e;
  text-align: center;
}
.ch-taken {
  min-height: 26px; padding: 3px 5px;
  border-radius: 5px; background: rgba(255,255,255,.45);
  font-size: 17px; line-height: 1.25; color: #43536a;
  word-break: break-all;
}
.ch-moves {
  flex: 1 1 auto; min-height: 60px; overflow: auto;
  margin: 0; padding: 4px 4px 4px 30px;
  border: 1px solid #bcd8ea; border-radius: 5px;
  background: rgba(255,255,255,.75);
  font: 400 11.5px/1.7 Consolas, "Lucida Console", monospace;
  color: #1d4a68;
}
.ch-moves li { padding-right: 4px; }
.ch-moves li b, .ch-moves li span { display: inline-block; min-width: 52px; font-weight: 400; }
.ch-moves li b { font-weight: 600; }

.ch-promo { display: flex; gap: 8px; justify-content: center; margin-top: 6px; }
.ch-promo button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 12px;
  border: 1px solid #8fbede; border-radius: 6px;
  background: linear-gradient(180deg, #fff, #dcefff);
  cursor: pointer; color: #16374e;
}
.ch-promo button:hover { background: linear-gradient(180deg, #fff, #b9e0fb); }
.ch-promo b { font-size: 26px; line-height: 1; }
.ch-promo small { font-size: 10.5px; }

/* ---------------------------------------------------------
   InkBall
   --------------------------------------------------------- */
.ib { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.ib-hud {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #f4fbff, #dceefc);
  border-bottom: 1px solid #bcd8ea;
  font: 600 12px/1 "Segoe UI", system-ui, sans-serif; color: #16374e;
}
.ib-inkbar {
  margin-left: auto;
  width: 110px; height: 11px;
  border: 1px solid #7fa8c4; border-radius: 6px;
  background: #fff; overflow: hidden;
}
.ib-inkbar b {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, #4a7fb5, #16324f);
  transition: width .12s linear;
}
.ib-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.ib-cv { border-radius: 6px; box-shadow: 0 8px 26px rgba(20,60,95,.35); touch-action: none; cursor: crosshair; }

/* ---------------------------------------------------------
   Kniffel
   --------------------------------------------------------- */
.kn { flex: 1 1 auto; display: flex; gap: 14px; padding: 10px; min-height: 0; }
.kn-play { flex: 0 0 208px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.kn-dice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.kn-d {
  width: 58px; height: 58px; padding: 7px;
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  border: 1px solid #b9c6cf; border-radius: 11px;
  background: linear-gradient(160deg, #ffffff, #eef4f8 60%, #dbe6ee);
  box-shadow: 0 3px 7px rgba(20,50,80,.28), inset 0 1px 0 #fff;
  cursor: pointer;
}
.kn-d i { border-radius: 50%; background: none; }
.kn-d i.on { background: radial-gradient(circle at 34% 30%, #5b6b7a, #1d2a36); box-shadow: inset 0 -1px 1px rgba(255,255,255,.3); }
.kn-d.held {
  border-color: #4aa3dd;
  background: linear-gradient(160deg, #eaf7ff, #c9e6fa 60%, #a8d5f2);
  box-shadow: 0 0 0 2px rgba(80,180,240,.5), inset 0 1px 0 #fff;
}
.kn-d.rolling { animation: kn-shake .12s linear infinite; }
@keyframes kn-shake { 50% { transform: translateY(-3px) rotate(-4deg); }}
.kn-actions { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.kn-roll { min-width: 148px; }
.kn-roll:disabled { opacity: .45; cursor: default; }
.kn-rolls { font: 500 11.5px/1 "Segoe UI", system-ui, sans-serif; color: #4e7b96; }
.kn-hint { margin: 0; text-align: center; font-size: 11.5px; color: #4e7b96; line-height: 1.4; }

.kn-sheet { flex: 1 1 auto; min-width: 0; overflow: auto; }
.kn-sheet table {
  width: 100%; border-collapse: collapse;
  font: 400 12px/1.3 "Segoe UI", system-ui, sans-serif; color: #1d4a68;
}
.kn-sheet th {
  position: sticky; top: 0; z-index: 1;
  padding: 6px 8px; text-align: right;
  background: linear-gradient(180deg, #f2f9ff, #dceefc);
  border-bottom: 1px solid #a9cde4;
  font-weight: 600;
}
.kn-sheet th:first-child { text-align: left; }
.kn-sheet td { padding: 3px 8px; border-bottom: 1px solid #e3eef6; text-align: right; }
.kn-name { text-align: left !important; }
.kn-cell.empty { color: #a9bccb; }
.kn-cell.set { font-weight: 600; color: #16374e; }
.kn-pick {
  min-width: 40px; padding: 2px 8px;
  border: 1px solid #7fc08a; border-radius: 4px;
  background: linear-gradient(180deg, #f2fff4, #cdefd4);
  color: #1c5c2c; font: 600 12px/1.3 "Segoe UI", system-ui, sans-serif;
  cursor: pointer;
}
.kn-pick:hover { background: linear-gradient(180deg, #fff, #a9e5b6); }
.kn-pick.zero { border-color: #d9a9a9; background: linear-gradient(180deg, #fff5f5, #f2d8d8); color: #8a3a3a; }
.kn-pick.zero:hover { background: linear-gradient(180deg, #fff, #eec4c4); }
.kn-sub td {
  padding-top: 9px;
  font: 600 10.5px/1 "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: .06em;
  color: #6d92aa; text-align: left; border-bottom: 0;
}
.kn-sum td { background: #f2f9ff; font-weight: 600; }
.kn-total td { background: linear-gradient(180deg, #e2f2ff, #cbe6fa); font-size: 13px; color: #0f3d5c; }

/* ---------------------------------------------------------
   Der Raum fuers Online-Spiel
   --------------------------------------------------------- */
.mp { display: block; margin-top: 4px; }
.mp-row { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; flex-wrap: wrap; }
.mp-row label { font-size: 12px; color: #4e7b96; min-width: 58px; }
.mp input {
  flex: 1 1 120px; min-width: 90px; height: 27px; padding: 0 9px;
  border: 1px solid #9dc4de; border-radius: 4px; background: #fff;
  font: 400 13px/1 "Segoe UI", system-ui, sans-serif; color: #16374e;
}
.mp input.code { font: 700 17px/1 Consolas, monospace; letter-spacing: .22em; text-transform: uppercase; text-align: center; }
.mp-code {
  display: block; margin: 10px 0;
  padding: 12px; border-radius: 8px;
  border: 1px solid #9dc4de;
  background: linear-gradient(180deg, #f2fbff, #d9eefc);
  font: 700 30px/1.1 Consolas, monospace; letter-spacing: .3em;
  text-align: center; color: #0f4a72;
}
.mp-share {
  display: block; margin: 6px 0 10px;
  padding: 7px 9px; border-radius: 5px;
  border: 1px solid #cfe2ee; background: #f7fcff;
  font: 400 11px/1.4 Consolas, monospace; color: #3d6b8c;
  word-break: break-all;
}
.mp-note { display: block; font-size: 11.5px; color: #6d92aa; line-height: 1.5; }
.mp-wait { display: flex; align-items: center; gap: 9px; margin: 8px 0; font-size: 12.5px; color: #2c5c7c; }
.mp-wait i {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid #b8d9ef; border-top-color: #2f8fce;
  animation: mp-spin .9s linear infinite;
}
@keyframes mp-spin { to { transform: rotate(360deg); }}
@media (prefers-reduced-motion: reduce) { .mp-wait i { animation: none; }}

@media (max-width: 819px) {
  .ch { flex-direction: column; padding: 4px; }
  .ch-side { display: none; }
  .kn { flex-direction: column; padding: 6px; }
  .kn-play { flex: 0 0 auto; }
  .kn-d { width: 46px; height: 46px; padding: 5px; }
  .ib-hud { font-size: 11px; gap: 8px; padding: 5px 8px; }
  .ib-inkbar { width: 74px; }
  .mp-code { font-size: 24px; }}

/* =========================================================
   Malen + Gemälde-Museum
   ========================================================= */
.pnt { display: flex; flex-direction: column; height: 100%; background: #f4faff; }
.pnt-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: linear-gradient(180deg, #f6fbff, #dceefc); border-bottom: 1px solid rgba(140,185,220,.6); }
.pnt-tools { display: flex; gap: 5px; }
.pnt-t { width: 34px; height: 34px; border-radius: 7px; border: 1px solid transparent; background: none; font-size: 18px; cursor: pointer; display: grid; place-items: center; }
.pnt-t.on, .pnt-t:hover { background: #fff; border-color: #9bc2da; box-shadow: inset 0 0 0 1px rgba(150,200,230,.5); }
.pnt-sizes { display: flex; gap: 6px; align-items: center; }
.pnt-s { border-radius: 50%; border: 1px solid #9bc2da; background: #123; box-shadow: inset 0 1px 0 rgba(255,255,255,.4); cursor: pointer; }
.pnt-s.on { outline: 2px solid #1a8fd0; outline-offset: 1px; }
.pnt-colors { display: flex; gap: 4px; flex-wrap: wrap; max-width: 220px; }
.pnt-c { width: 20px; height: 20px; border-radius: 4px; border: 1px solid rgba(0,0,0,.18); cursor: pointer; padding: 0; }
.pnt-c.on { outline: 2px solid #0a4a70; outline-offset: 1px; }
.pnt-grow { flex: 1 1 auto; }
.pnt-stage { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 12px; display: flex; align-items: flex-start; justify-content: center; background: repeating-conic-gradient(#eef4f8 0 25%, #f7fbfd 0 50%) 50%/20px 20px; }
.pnt-cv { background: #fff; box-shadow: 0 6px 20px rgba(0,50,90,.25); border: 1px solid #b6d2e4; max-width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.pnt-foot { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-top: 1px solid rgba(140,185,220,.6); background: #eef6fc; }
.pnt-foot .aero-btn { margin: 0; }

/* Museum */
.mus { display: flex; flex-direction: column; height: 100%; background: linear-gradient(180deg, #2e4a3a, #466f4f 60%, #2c4634); color: #eaf3ee; }
.mus-head { padding: 12px 18px; border-bottom: 1px solid rgba(255,255,255,.15); }
.mus-head h2 { margin: 0; font-size: 19px; font-weight: 300; color: #f2f7f4; }
.mus-head p { margin: 2px 0 0; font-size: 12.5px; opacity: .75; }
.mus-wall { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 18px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 18px; align-content: start; }
.mus-empty { grid-column: 1/-1; text-align: center; font-size: 14px; opacity: .8; margin: 40px 0; }
.mus-item { margin: 0; padding: 10px 10px 8px; background: linear-gradient(180deg, #f5e8c9, #e4cf9e); border: 6px solid #6b4a10; border-radius: 4px; box-shadow: 0 8px 20px rgba(0,0,0,.35); }
.mus-item img { width: 100%; display: block; aspect-ratio: 4/3; object-fit: contain; background: #fff; border: 1px solid rgba(0,0,0,.12); }
.mus-item figcaption { display: flex; justify-content: space-between; gap: 6px; padding-top: 7px; font-size: 12px; color: #5b4517; }
.mus-item figcaption small { opacity: .7; }
.mus-foot { flex: 0 0 auto; padding: 10px 16px; text-align: right; background: rgba(0,0,0,.18); }
.mus-foot .aero-btn { margin: 0; }

/* Spielkram in der Seitenleiste */
.side-toys { display: flex; flex-direction: column; gap: 6px; text-align: left; max-width: 100%; overflow: hidden; }
.st-grid { display: grid; grid-template-columns: 1fr; gap: 6px; min-width: 0; }
.st-toy { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 6px 8px; border: 1px solid rgba(255,255,255,.8); border-radius: 9px; background: linear-gradient(180deg, rgba(255,255,255,.85), rgba(190,228,250,.5)); color: #0a4a70; font-size: 11.5px; font-weight: 600; cursor: pointer; text-align: left; }
.st-toy:hover { filter: brightness(1.08); }
.st-ico { font-size: 15px; flex: 0 0 auto; }
.st-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* =========================================================
   Dunkle Fassung: Spiele-Explorer + Spielrahmen + Musik + Malen
   ---------------------------------------------------------
   Chrome (Werkzeugleisten, Menüs, Status, Liste) wird dunkel;
   die eigentlichen Spielbretter (Karten, Schach, Minesweeper)
   bleiben hell -- sie sind "Inhalt", wie ein Dokument, und auf
   ihrem eigenen hellen Grund weiterhin gut lesbar.
   ========================================================= */
body.dark .gx, body.dark .gm { background: #142430; color: #d7e6f2; }
body.dark .gm-area { background: #12212c; }
body.dark .gx-tools, body.dark .pnt-bar, body.dark .pnt-foot {
  background: linear-gradient(180deg, #1b3040, #14242f); border-color: rgba(120,170,210,.25);
}
body.dark .gx-t { color: #cfe4f2; }
body.dark .gx-t:hover, body.dark .gx-t.open { background: rgba(70,110,140,.3); border-color: rgba(120,180,220,.4); }
body.dark .gx-pop, body.dark .gm-pop {
  background: #1b3040; border-color: rgba(120,180,220,.35);
  box-shadow: 0 10px 26px rgba(0,0,0,.5);
}
body.dark .gx-pop hr, body.dark .gm-pop hr { border-top-color: rgba(120,180,220,.2); }
body.dark .gx-find {
  background: rgba(8,20,30,.7); border-color: rgba(120,180,220,.3); color: #e8f4fb;
}
body.dark .gx-cols { background: linear-gradient(180deg, #1a2e3e, #162833); border-bottom-color: rgba(120,180,220,.25); }
body.dark .gx-col { color: #9dbccd; border-right-color: rgba(120,180,220,.16); }
body.dark .gx-row.gx-tile .gx-tx b, body.dark .gx-cell, body.dark .gx-cell.gx-name,
body.dark .gx-info .gi-tx b { color: #d7e8f4; }
body.dark .gx-row.gx-tile .gx-tx small, body.dark .gx-info .gi-tx small,
body.dark .gx-none { color: #8fb0c4; }
body.dark .gx-row:hover { background: linear-gradient(180deg, #1e3444, #182a38); border-color: rgba(120,180,220,.3); }
body.dark .gx-row.sel { background: linear-gradient(180deg, #25435c, #1b3345); border-color: rgba(120,190,235,.5); }
body.dark .gx.is-details .gx-row:nth-child(even) { background: #182b38; }
body.dark .gx-info { background: linear-gradient(180deg, #1a3040, #14242f); border-top-color: rgba(120,180,220,.22); }
body.dark .gi-play { background: linear-gradient(180deg, #2a4a60, #17324a 48%, #122a3e); border-color: rgba(120,180,220,.4); color: #cfe4f2; }

body.dark .gm-menu { background: #162833; border-bottom-color: rgba(120,180,220,.25); }
body.dark .gm-mb, body.dark .gm-mi { color: #cfe4f2; }
body.dark .gm-mb:hover, body.dark .gm-mi:hover { background: rgba(70,110,140,.32); }
body.dark .gm-status { background: linear-gradient(180deg, #1a2e3e, #14242f); border-top-color: rgba(120,180,220,.22); color: #9dbccd; }

body.dark .pnt { background: #142430; color: #d7e6f2; }

body.dark .pnt-stage { background: repeating-conic-gradient(#101c24 0 25%, #162630 0 50%) 50%/20px 20px; }
body.dark .pnt-cv { box-shadow: 0 6px 20px rgba(0,0,0,.5); border-color: #2b3d4a; }
body.dark .pnt-t.on, body.dark .pnt-t:hover { background: #22384a; border-color: rgba(120,180,220,.5); }
body.dark .st-toy { background: linear-gradient(180deg, rgba(30,56,72,.75), rgba(16,36,48,.6)); border-color: rgba(120,180,220,.3); color: #cfe4f2; }

@media (max-width: 819px) {
  .pnt-colors { max-width: 120px; }
}
/* ---------------------------------------------------------
   Snake
   --------------------------------------------------------- */
.sn { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
.sn-hud {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 14px;
  padding: 6px 12px;
  background: linear-gradient(180deg, #f4fbff, #dceefc);
  border-bottom: 1px solid #bcd8ea;
  font: 600 12px/1 "Segoe UI", system-ui, sans-serif; color: #16374e;
  font-variant-numeric: tabular-nums;
}
.sn-score { min-width: 76px; }
.sn-best { min-width: 84px; opacity: .72; }
.sn-len { margin-left: auto; opacity: .8; }
.sn-lvl { opacity: .8; }
.sn-stage {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 8px;
  background: radial-gradient(circle at 50% 40%, #f2f8fc, #dbe9f4);
}
.sn-fit { position: relative; flex: 0 0 auto; }
.sn-cv {
  display: block;
  border-radius: 6px;
  box-shadow: 0 8px 26px rgba(20,60,95,.35);
  /* touch-action:none ist Pflicht -- sonst scrollt die Seite statt zu wischen. */
  touch-action: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.sn-over {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 6px;
  border-radius: 6px;
  background: rgba(6,18,12,.72); color: #eaf7ee;
  text-align: center; padding: 12px;
  cursor: pointer;
}
.sn-over[hidden] { display: none; }
.sn-over b { font: 700 20px/1.2 "Segoe UI", system-ui, sans-serif; }
.sn-over small { font-size: 12px; opacity: .85; }

body.dark .sn-hud {
  background: linear-gradient(180deg, #1a2e3e, #14242f);
  border-bottom-color: rgba(120,180,220,.22);
  color: #9dbccd;
}
body.dark .sn-stage { background: radial-gradient(circle at 50% 40%, #16232c, #0d161d); }
body.dark .sn-cv { box-shadow: 0 8px 26px rgba(0,0,0,.55); }


/* --- Steuerkreuz fuer den Finger ---
   Ein 3x3-Raster: oben, links, runter, rechts liegen auf ihren
   Kreuzpositionen. So trifft der Daumen ohne hinzusehen. */
.sn-pad {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 6px;
  width: 174px;
  height: 174px;
  margin: 4px auto 12px;
  padding: 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255,255,255,.7), rgba(220,238,252,.7));
  border: 1px solid rgba(140,185,220,.6);
}
.sn-pad[hidden] { display: none; }
.sn-dir {
  border: 1px solid rgba(120,170,205,.75);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #d9ecf9);
  color: #16405c;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 1px 2px rgba(20,60,95,.18);
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.sn-dir:active, .sn-dir.on {
  background: linear-gradient(180deg, #9fd4f0, #6fb6dd);
  color: #06263a;
  box-shadow: inset 0 2px 4px rgba(10,50,80,.35);
}
.sn-dir.up    { grid-area: 1 / 2; }
.sn-dir.left  { grid-area: 2 / 1; }
.sn-dir.down  { grid-area: 3 / 2; }
.sn-dir.right { grid-area: 2 / 3; }

body.dark .sn-pad {
  background: linear-gradient(180deg, #1a2e3e, #14242f);
  border-color: rgba(120,180,220,.28);
}
body.dark .sn-dir {
  background: linear-gradient(180deg, #27424f, #172c38);
  border-color: rgba(120,180,220,.4);
  color: #cfe4f2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
body.dark .sn-dir:active, body.dark .sn-dir.on {
  background: linear-gradient(180deg, #3d7fa0, #2a5d78);
  color: #eaf7ee;
}

@media (max-width: 640px) {
  .sn-hud { font-size: 11px; gap: 8px; padding: 5px 8px; }
  .sn-score { min-width: 66px; }
}
