/* Voting Atlas - gemeinsame Gestaltung der Spiele (Quiz, Stimmenfall, Uebersicht /games), Stil "Atlas-Nacht"
   (Nutzerentscheidung 2026-11-20): dunkle Karte mit Rundung und Schatten der Seite, Farben des Atlas,
   Lesetexte in Sora/Nunito Sans, Pixelschrift und Pixel-Art nur fuer Spielelemente.
   Wurzel: class="arcade" (setzt die Farben); Karte: .arcard. */

/* ---------- Pixelschrift (SIL OFL, Lizenz static/fonts/OFL-press-start-2p.txt, aus
   @fontsource/press-start-2p@5.3.0; selbst gehostet, keine Anfrage an Dritte) ---------- */
@font-face {
  font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/press-start-2p-cyrillic-400-normal.woff2) format('woff2');
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/press-start-2p-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face {
  font-family: 'Press Start 2P'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/press-start-2p-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

/* ---------- Farben: Atlas bei Nacht ---------- */
.arcade {
  --px: 'Press Start 2P', ui-monospace, monospace;
  --night: #13233A;      /* Karte */
  --deep: #0E1B2E;       /* Felder, Textboxen */
  --edge: #2B4363;       /* Linien */
  --outline: #0B1626;    /* Umrisse der Pixel-Art */
  --sky: #9FC3E8; --un: #3C7FC0; --un-deep: #2B5F93;
  --soft: #C9D6E4; --dim: #8FA6BF; --white: #FFFFFF;
  --y: #A9D8C3; --yl: #D6EFE4; --yd: #6FAE93; --yi: #175C42;
  --a: #F3D9A4; --al: #FBEED2; --ad: #C9A866; --ai: #77560F;
  --n: #F2BFC6; --nl: #FBE2E6; --nd: #C98592; --ni: #8F3549;
  /* Pixelecke: die aeusseren Eckpixel fehlen */
  --notch: polygon(4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 4px), 0 calc(100% - 4px), 0 4px, 4px 4px);
}
.arcade .px-arrow { display: inline-block; width: 8px; height: 14px; vertical-align: -2px; margin-right: 8px; }
/* verpixelte Flagge (arcade.js PixelFlag) bzw. ISO-Code, wenn das System keine Flaggen-Emoji hat */
.arcade .vdpflag { flex: none; width: 32px; height: auto; image-rendering: pixelated; image-rendering: crisp-edges; outline: 2px solid var(--outline); }
.arcade .vdiso { flex: none; font: 8px/1 var(--px); color: var(--outline); background: var(--soft); padding: 6px 4px; }

/* ---------- Karte mit feinen Bildschirmzeilen ---------- */
.arcard {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--night); color: var(--white); font-family: var(--font-body);
  border-radius: var(--r-card, 16px);
  box-shadow: 0 2px 4px rgba(46,65,87,.08), 0 14px 34px rgba(19,35,58,.28);
}
.arcard + .arcard { margin-top: 18px; }
.arcard::after {
  content: ""; position: absolute; inset: 0; z-index: 40; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.14) 0 1px, transparent 1px 3px);
}
.arcard > * { position: relative; z-index: 1; }

.arstars { position: absolute !important; inset: 0; z-index: 0 !important; pointer-events: none; }
.arstars i { position: absolute; width: 2px; height: 2px; background: var(--sky); opacity: .55; animation: artwinkle 2.8s steps(1) infinite; }
.arstars i.big { width: 4px; height: 4px; background: var(--white); opacity: .7; }
@keyframes artwinkle { 50% { opacity: .1; } }
@keyframes arblink { 50% { opacity: 0; } }
.arblink { animation: arblink 1s steps(1) infinite; }

/* Textbox mit Pixelrahmen */
.arbox { background: var(--deep); border: 4px solid var(--un); clip-path: var(--notch); }
.arkicker { font: 8px/1.6 var(--px); color: var(--sky); text-transform: uppercase; letter-spacing: 2px; margin: 0 0 12px; }
.arhead { font: 800 12px/1.3 var(--font-body); letter-spacing: .07em; color: var(--sky); text-transform: uppercase; margin: 0 0 9px; }

/* Knoepfe und Links */
.arbtn {
  font: 16px/1 var(--px); text-transform: uppercase; color: var(--white); background: var(--deep);
  border: 4px solid var(--sky); padding: 12px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  clip-path: var(--notch); text-decoration: none;
}
.arbtn.primary { color: var(--outline); background: var(--a); border-color: var(--al); }
.arbtn:hover, .arbtn:focus-visible { background: var(--white); color: var(--outline); border-color: var(--white); outline: none; }
.arbtn:disabled { opacity: .6; cursor: default; }
.arbtn.small { font-size: 8px; padding: 10px 12px; }
.arlink { font: 700 14px/1.4 var(--font-body); color: var(--sky); text-decoration: none; border-bottom: 2px solid var(--un); }
.arlink:hover { color: var(--white); border-bottom-color: var(--white); }

/* ---------- Leiste ueber der Karte: Untermenue der Spiele links, Vollbild rechts ---------- */
.gamebar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.gamebar:not(:has(.gamesnav)):not(:has(.fsbtn)) { display: none; }
.gametools { margin-left: auto; }
.gamesnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gamesnav a {
  font: 800 13px/1 var(--font-body); color: var(--muted); text-decoration: none;
  padding: 9px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface);
}
.gamesnav a:hover { color: var(--un-deep); border-color: var(--un-soft); }
.gamesnav a[aria-current="page"] { background: #13233A; border-color: #13233A; color: #FFFFFF; }
.gamesnav .all { border: 0; background: none; padding-left: 4px; color: var(--faint); }

/* Vollbild-Knopf (nur am Rechner, arcade.js Fullscreen) */
.fsbtn {
  display: inline-flex; align-items: center; gap: 8px; font: 800 13px/1 var(--font-body); color: var(--muted);
  padding: 8px 13px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.fsbtn:hover, .fsbtn:focus-visible { color: var(--un-deep); border-color: var(--un-soft); outline: none; }
.fsbtn .px-fs { width: 14px; height: 14px; }

/* ---------- Vollbild: das Spiel fuellt den Bildschirm, Inhalte mittig ---------- */
.arcade:fullscreen {
  margin: 0; padding: 22px 32px 32px; box-sizing: border-box; overflow-y: auto;
  background: #0B1626 radial-gradient(ellipse at 50% 0%, #1A3150 0%, #0B1626 70%);
}
.arcade:fullscreen > * { max-width: 1120px; margin-left: auto; margin-right: auto; }
.arcade:fullscreen .gamesnav { display: none; }
.arcade:fullscreen .fsbtn { background: #13233A; border-color: #2B4363; color: #C9D6E4; }
.arcade:fullscreen .fsbtn:hover { color: #FFFFFF; border-color: #9FC3E8; }
.arcade:fullscreen .arcard { box-shadow: 0 0 0 1px #2B4363, 0 18px 50px rgba(0,0,0,.45); }
.arcade::backdrop { background: #0B1626; }

/* Handy: das Spiel fuellt per CSS den Bildschirm (html.gamefull, arcade.js Fullscreen); "Beenden" oben rechts */
html.gamefull, html.gamefull body { overflow: hidden; }
html.gamefull main.arcade {
  position: fixed; inset: 0; z-index: 1000; margin: 0 !important; padding: 0 8px 16px; box-sizing: border-box;   /* #votedrop/#quiz haben sonst margin-top */
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  background: #0B1626 radial-gradient(ellipse at 50% 0%, #1A3150 0%, #0B1626 70%);
}
html.gamefull main.arcade .gamesnav, .arcade:fullscreen .gamesnav { display: none; }
html.gamefull .gamebar, .arcade:fullscreen .gamebar {
  position: sticky; top: 0; z-index: 60; justify-content: flex-end; margin: 0 0 6px; padding: 8px 0 6px;
  background: linear-gradient(#0B1626 70%, rgba(11,22,38,0));
}
/* Am Rechner ist die Leiste so breit wie die Karte: mittig wie sie (die margin-Regel oben hebt sonst das auto auf),
   ohne eigenes Band, das sich vom Verlauf des Hintergrunds abheben wuerde */
.arcade:fullscreen .gamebar { margin-left: auto; margin-right: auto; background: none; }
html.gamefull .fsbtn { background: #13233A; border-color: #2B4363; color: #C9D6E4; padding: 9px 13px; }
html.gamefull .fsbtn:active { color: #FFFFFF; border-color: #9FC3E8; }
html.gamefull .arcard { box-shadow: 0 0 0 1px #2B4363; }

/* ---------- Uebersicht /games ---------- */
.gameshub { margin-top: 16px; padding: 40px 32px 34px; }   /* Abstand zur Menuelinie wie Rangliste */
.gameshub .lede { font: 17px/1.55 var(--font-body); color: var(--soft); max-width: 620px; margin: 0 0 26px; }
.gameshub h2 { font: 32px/1.2 var(--px); text-transform: uppercase; margin: 0 0 16px; color: var(--white); text-shadow: 4px 4px 0 var(--un), 8px 8px 0 var(--un-deep); }
.gamegrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.gametile { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 20px; text-decoration: none; color: var(--white); border-color: var(--edge); transition: border-color .1s steps(1); }
.gametile:hover, .gametile:focus-visible { border-color: var(--sky); outline: none; }
.gametile h3 { font: 600 21px/1.3 var(--font-display); margin: 0; color: var(--white); }
.gametile p { font: 15px/1.55 var(--font-body); color: var(--soft); margin: 0; flex: 1; }
.gametile .arbtn { align-self: flex-start; font-size: 8px; padding: 10px 12px; }
.gameart { height: 120px; display: flex; align-items: center; justify-content: center; background: var(--night); border-bottom: 2px dashed var(--edge); margin: -18px -20px 4px; }
.gameart img { max-width: 86%; max-height: 104px; }
/* kleine Vorfuehrung Stimmenfall: drei Urnen, fallender Block (symbolisch) */
.minidrop { position: relative; width: 220px; height: 100px; }
.minidrop .u { position: absolute; bottom: 4px; width: 52px; height: 38px; }
.minidrop .u::before, .minidrop .u::after { content: ""; position: absolute; }
.minidrop .u::before { left: 0; right: 0; top: 0; height: 12px; border: 3px solid var(--outline); }
.minidrop .u::after { left: 3px; right: 3px; top: 12px; bottom: 0; border: 3px solid var(--outline); border-top: 0; }
.minidrop .u-y { left: 0; } .minidrop .u-y::before { background: var(--yl); } .minidrop .u-y::after { background: var(--y); }
.minidrop .u-a { left: 84px; } .minidrop .u-a::before { background: var(--al); } .minidrop .u-a::after { background: var(--a); }
.minidrop .u-n { left: 168px; } .minidrop .u-n::before { background: var(--nl); } .minidrop .u-n::after { background: var(--n); }
.minidrop i {
  position: absolute; top: 0; left: 92px; width: 32px; height: 18px; background: var(--un-deep);
  border: 3px solid var(--sky); animation: minidrop 2.2s steps(9) infinite;
}
@keyframes minidrop { 0% { transform: translateY(-20px); opacity: 0; } 10% { opacity: 1; } 70%, 100% { transform: translateY(40px); opacity: 0; } }

@media (max-width: 640px) {
  .gameshub { margin-top: 12px; padding: 28px 16px 22px; }
  .gameshub h2 { font-size: 24px; text-shadow: 3px 3px 0 var(--un), 6px 6px 0 var(--un-deep); }
  .gamegrid { grid-template-columns: 1fr; }
  .arbtn { font-size: 8px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .arblink, .arstars i, .minidrop i { animation: none !important; }
}
