/* games.kolja-mailahn.de · Rätselheft
 *
 * Schwarze Linien, harte Kästen, Gelb zum Markieren, Rot für Neues und
 * Fehler. Eine Schriftfamilie. Bauregel gegen die Unruhe dieses Stils:
 * je Ansicht EINE Sache im Mittelpunkt, Gelb höchstens einmal.
 *
 * Nachtausgabe: folgt dem Handy (prefers-color-scheme), lässt sich mit
 * data-modus="hell" | "nacht" am <html> festnageln. In der Bar leuchten zehn
 * weiße Handys sonst wie Taschenlampen auf dem Tisch.
 */

:root {
  --papier: #FBFAF5;
  --tinte: #111111;
  --gelb: #FFD83D;
  --auf-gelb: #111111;
  --rot: #D7262B;
  --grau: #6B6B66;
  --linie-zart: #CFCDC4;
  --strich: 1.5px;
  --schrift: "Helvetica Neue", Helvetica, Arial, "Liberation Sans", "DejaVu Sans", sans-serif;
  color-scheme: light;
}

:root[data-modus="nacht"] {
  --papier: #121211;
  --tinte: #ECEAE2;
  --gelb: #FFD83D;
  --auf-gelb: #111111;
  --rot: #FF5D52;
  --grau: #9C9A92;
  --linie-zart: #3A3A36;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-modus="hell"]) {
    --papier: #121211;
    --tinte: #ECEAE2;
    --gelb: #FFD83D;
    --auf-gelb: #111111;
    --rot: #FF5D52;
    --grau: #9C9A92;
    --linie-zart: #3A3A36;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  background: var(--papier);
  color: var(--tinte);
  font: 17px/1.4 var(--schrift);
  -webkit-text-size-adjust: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.zahl { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Kopfband */

.band {
  display: flex;
  align-items: stretch;
  border-bottom: 3px solid var(--tinte);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding-top: env(safe-area-inset-top);
  position: sticky;
  top: 0;
  background: var(--papier);
  z-index: 5;
}
.band > * { padding: 10px 12px; border-right: 1px solid var(--tinte); white-space: nowrap; }
.band .nr { background: var(--tinte); color: var(--papier); }
.band .titel { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.band .rest { border-right: 0; }
.band .rest.getrennt { color: var(--rot); }
.band a { color: inherit; text-decoration: none; }

/* ---------------------------------------------------------------- Grundlayout */

main {
  flex: 1;
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 22px;
}

h1, .gross {
  font-size: clamp(26px, 7vw, 38px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -.01em;
}
h2 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 8px;
}
p.leise, .leise { color: var(--grau); font-size: 15px; }
mark { background: var(--gelb); color: var(--auf-gelb); padding: 0 3px; }

/* ---------------------------------------------------------------- Kästen */

.kasten { border: var(--strich) solid var(--tinte); }
.kasten > h2 {
  margin: 0;
  padding: 6px 10px;
  border-bottom: var(--strich) solid var(--tinte);
}
.kasten > .innen { padding: 12px 10px; display: flex; flex-direction: column; gap: 10px; }

/* Liste mit Linien, wie die Rangliste im Entwurf */
.liste { list-style: none; }
.liste li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--linie-zart);
  min-height: 44px;
}
.liste li:last-child { border-bottom: 0; }
.liste .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.liste .weg { color: var(--grau); }
.etikett {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  border: 1px solid currentColor;
  padding: 1px 5px;
}
.etikett.rot { color: var(--rot); }

/* ---------------------------------------------------------------- Bedienung */

label.feld { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 700;
             text-transform: uppercase; letter-spacing: .05em; }
input[type=text], input[type=password] {
  border: var(--strich) solid var(--tinte);
  background: transparent;
  padding: 12px 10px;
  font-size: 19px;
  border-radius: 0;
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}
input:focus { outline: 3px solid var(--gelb); outline-offset: 0; }
input.code { text-transform: uppercase; letter-spacing: .3em; font-weight: 800; font-size: 26px; }

.knopf {
  display: block;
  width: 100%;
  border: var(--strich) solid var(--tinte);
  background: var(--tinte);
  color: var(--papier);
  padding: 14px 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
  text-align: center;
  border-radius: 0;
  min-height: 52px;
}
.knopf.hell { background: transparent; color: var(--tinte); }
.knopf:disabled { opacity: .35; cursor: default; }
.knopf:active:not(:disabled) { transform: translateY(1px); }
.knopfreihe { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Wahlkästen mit Buchstabe, gewählt = gelb */
.wahlen { display: flex; flex-direction: column; }
.wahl {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: var(--strich) solid var(--tinte);
  margin-bottom: calc(-1 * var(--strich));
  background: transparent;
  padding: 12px 10px;
  text-align: left;
  min-height: 52px;
  border-radius: 0;
}
.wahl .bst {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: var(--strich) solid currentColor;
  font-size: 13px;
  font-weight: 700;
}
.wahl .text { flex: 1; }
.wahl .text small { display: block; color: var(--grau); font-size: 14px; }
.wahl.gewaehlt { background: var(--gelb); color: var(--auf-gelb); position: relative; z-index: 1; }
.wahl.gewaehlt .bst { background: var(--auf-gelb); color: var(--gelb); border-color: var(--auf-gelb); }
.wahl.gewaehlt .text small { color: var(--auf-gelb); }
.wahl:disabled { opacity: .4; cursor: default; }

.textknopf {
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--grau);
  font-size: 15px;
  padding: 6px 0;
  text-align: left;
}
.mini {
  background: none;
  border: 1px solid var(--tinte);
  font-size: 13px;
  font-weight: 700;
  min-width: 34px;
  min-height: 34px;
}

p.fehler, .fehler { color: var(--rot); font-weight: 700; }

/* ---------------------------------------------------------------- Einladung */

.einladung { display: flex; gap: 14px; align-items: center; }
.einladung img { width: 132px; height: 132px; background: #fff; flex: none; image-rendering: pixelated; }
.einladung img.gross { width: 260px; height: 260px; }
.einladung .code-gross { font-size: 40px; font-weight: 800; letter-spacing: .12em; line-height: 1; }

/* ---------------------------------------------------------------- Buzzer */

.buzzer {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: 58dvh;
  border: 3px solid var(--tinte);
  background: transparent;
  display: grid;
  place-items: center;
  font-size: clamp(30px, 11vw, 56px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  border-radius: 0;
  line-height: 1.05;
  text-align: center;
  padding: 10px;
}
.buzzer.zu { border-style: dashed; color: var(--grau); font-size: clamp(20px, 6vw, 30px); }
.buzzer.offen { background: var(--gelb); color: var(--auf-gelb); }
.buzzer.gedrueckt { background: var(--tinte); color: var(--papier); }
.buzzer.dran { background: var(--gelb); color: var(--auf-gelb); border-width: 8px; }
.buzzer.gesperrt { color: var(--rot); border-color: var(--rot); font-size: clamp(20px, 6vw, 30px); }
.buzzer small { display: block; font-size: 15px; font-weight: 700; letter-spacing: .04em; margin-top: 6px; }

.dran-kasten { border: 3px solid var(--tinte); padding: 18px 14px; text-align: center; }
.dran-kasten.aktiv { background: var(--gelb); color: var(--auf-gelb); }
.dran-kasten .gross { font-size: clamp(34px, 10vw, 60px); }

.fuss {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: auto;
}

/* Tisch-Ansicht: größer, für Laptop oder Tablet in der Mitte */
body.tisch main { max-width: 1100px; }
body.tisch .dran-kasten .gross { font-size: clamp(48px, 9vw, 120px); }
body.tisch .liste li { font-size: 22px; }

@media (min-width: 760px) {
  .zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
}

/* Grauer Text auf Gelb ist in der Nachtausgabe kaum lesbar (grau ist dort hell). */
.dran-kasten.aktiv .leise { color: var(--auf-gelb); opacity: .75; }

/* Auf dem Tisch muss der Code quer über den Tisch lesbar sein. */
body.tisch .einladung .code-gross { font-size: clamp(56px, 8vw, 104px); }
body.tisch .einladung { gap: 28px; }
