/* Tessera · bewusst einfaches CSS für alte und neue Browser: Flexbox mit -webkit-, keine CSS-Variablen, kein Grid.
   Farben: om3-Rot #E73B1F für Akzente, sonst Schwarz, Grau, Weiss. */
* { -webkit-box-sizing: border-box; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fbfaf8; color: #1f1f1f; font-family: -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 18px; line-height: 1.45; }
body.gross { font-size: 21px; }
#app { max-width: 720px; margin: 0 auto; padding: 12px 14px 40px; padding-top: calc(12px + env(safe-area-inset-top)); }
.laden { text-align: center; color: #6b6b6b; padding: 40px 0; }
h1 { font-size: 1.7em; margin: 6px 0 4px; letter-spacing: .5px; }
h1 .neun { color: #E73B1F; }
h2 { font-size: 1.25em; margin: 18px 0 8px; }
p { margin: 8px 0; }
.leise { color: #6b6b6b; font-size: .88em; }
.zentriert { text-align: center; }
a { color: #E73B1F; }

button { font: inherit; color: inherit; -webkit-appearance: none; border-radius: 12px; border: 1px solid #cfcac2; background: #fff; padding: 12px 16px; margin: 0; cursor: pointer; -webkit-tap-highlight-color: rgba(0,0,0,0); touch-action: manipulation; }
button:active { background: #f1eee9; }
button:focus { outline: 3px solid rgba(231,59,31,.35); outline-offset: 1px; }
button[disabled] { opacity: .45; }
.haupt { display: block; width: 100%; background: #E73B1F; border-color: #E73B1F; color: #fff; font-size: 1.3em; font-weight: 600; padding: 20px 16px; margin: 14px 0 8px; }
.haupt:active { background: #c9301a; }
.zweit { display: block; width: 100%; margin: 8px 0; text-align: left; padding: 14px 16px; }
.zweit small { display: block; color: #6b6b6b; font-size: .78em; }
.zeile { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -4px; }
.zeile > * { -webkit-box-flex: 1; -webkit-flex: 1 1 0; flex: 1 1 0; margin: 4px; min-width: 0; }
.wahl button { padding: 12px 6px; }
.wahl button.an { background: #E73B1F; border-color: #E73B1F; color: #fff; font-weight: 600; }
.kopf { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; margin-bottom: 8px; }
.kopf .titel { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; text-align: center; font-weight: 600; }
.kopf button { padding: 8px 12px; font-size: .9em; }

/* Sudoku-Gitter */
.gitter { margin: 4px auto 10px; border-collapse: collapse; border: 3px solid #1f1f1f; background: #fff; table-layout: fixed; -webkit-user-select: none; user-select: none; }
.gitter td { border: 1px solid #c7c2ba; text-align: center; vertical-align: middle; padding: 0; position: relative; font-weight: 500; }
.gitter td.br { border-right: 3px solid #1f1f1f; }
.gitter td.bb { border-bottom: 3px solid #1f1f1f; }
.gitter td.diag { background: #fbf1ee; }
.gitter td.vor { color: #1f1f1f; font-weight: 700; }
.gitter td.eig { color: #E73B1F; }
.gitter td.gleich { background: #f2ebe9; }
.gitter td.bereich { background: #f6f3ef; }
.gitter td.wahl { background: #f9d6cd !important; }
.gitter td.falsch { color: #fff !important; background: #6b6b6b !important; }
.gitter td.zeig { -webkit-animation: zeig 1.2s ease-in-out 2; animation: zeig 1.2s ease-in-out 2; }
@-webkit-keyframes zeig { 50% { background: #f6c3b8; } }
@keyframes zeig { 50% { background: #f6c3b8; } }
.notiz { display: block; font-weight: 400; color: #6b6b6b; line-height: 1.05; letter-spacing: -.5px; }

.tasten { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; margin: 0 -3px; }
.tasten button { margin: 3px; padding: 0; font-size: 1.35em; font-weight: 600; }
.tasten button.fertig { opacity: .3; }
.werkzeug { margin-top: 4px; }
.werkzeug button { font-size: .85em; padding: 12px 2px; }
.werkzeug button.an { background: #E73B1F; border-color: #E73B1F; color: #fff; }
.meldung { min-height: 1.5em; text-align: center; color: #444; font-size: .92em; margin: 4px 0; }

/* Bild, das sich aufdeckt */
.bild { position: relative; margin: 10px auto; max-width: 560px; background: #e9e5df; border-radius: 10px; overflow: hidden; }
.bild img { display: block; width: 100%; height: auto; }
.bild .ersatz { padding: 60% 0 0; }
.bild .felder { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.bild .feld { position: absolute; width: 33.3334%; height: 33.3334%; background: #d9d4cc; border: 1px solid #fbfaf8; -webkit-transition: opacity 1.4s ease; transition: opacity 1.4s ease; }
.bild .feld:nth-child(even) { background: #e2ddd5; }
.bild .feld.offen { opacity: 0; }
.bild .feld.neu { background: #E73B1F; }
.fortschritt { text-align: center; color: #6b6b6b; font-size: .9em; }
.punkte span { display: inline-block; width: 12px; height: 12px; border-radius: 6px; background: #d9d4cc; margin: 0 3px; }
.punkte span.an { background: #E73B1F; }
.geschichte { background: #fff; border-left: 4px solid #E73B1F; padding: 10px 14px; margin: 12px 0; }
.geschichte b { display: block; }

/* Galerie */
.galerie { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-flex-wrap: wrap; flex-wrap: wrap; margin: 0 -5px; }
.galerie a { display: block; width: 33.33%; padding: 5px; color: inherit; text-decoration: none; font-size: .8em; }
.galerie img { display: block; width: 100%; height: 100px; object-fit: cover; border-radius: 8px; background: #e9e5df; }

/* Wortbluff */
.karte { background: #fff; border: 1px solid #e2ddd5; border-radius: 16px; padding: 22px 16px; margin: 14px 0; text-align: center; }
.karte .wort { font-size: 2em; font-weight: 700; color: #E73B1F; word-break: break-word; -webkit-hyphens: auto; hyphens: auto; }
.karte .bedeutung { margin-top: 14px; font-size: 1.05em; }
.regeln { padding-left: 1.2em; }
.regeln li { margin: 4px 0; }

.schalter { display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; padding: 12px 0; border-bottom: 1px solid #e7e3dc; }
.schalter span { -webkit-box-flex: 1; -webkit-flex: 1; flex: 1; }
.schalter button { min-width: 84px; }
.schalter button.an { background: #E73B1F; border-color: #E73B1F; color: #fff; }

.decke { position: fixed; left: 0; top: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); display: -webkit-box; display: -webkit-flex; display: flex; -webkit-box-align: center; -webkit-align-items: center; align-items: center; -webkit-box-pack: center; -webkit-justify-content: center; justify-content: center; padding: 16px; z-index: 5; }
.decke .karte { max-width: 420px; width: 100%; }

/* Nachtmodus */
body.nacht { background: #141414; color: #ececec; }
body.nacht button { background: #222; border-color: #444; }
body.nacht button:active { background: #2c2c2c; }
body.nacht .haupt, body.nacht .wahl button.an, body.nacht .werkzeug button.an, body.nacht .schalter button.an { background: #E73B1F; border-color: #E73B1F; color: #fff; }
body.nacht .leise, body.nacht .zweit small, body.nacht .fortschritt { color: #a8a8a8; }
body.nacht .gitter { background: #1c1c1c; border-color: #ececec; }
body.nacht .gitter td { border-color: #474747; }
body.nacht .gitter td.br { border-right-color: #ececec; }
body.nacht .gitter td.bb { border-bottom-color: #ececec; }
body.nacht .gitter td.vor { color: #ececec; }
body.nacht .gitter td.eig { color: #ff7a63; }
body.nacht .gitter td.diag { background: #2a1d1a; }
body.nacht .gitter td.gleich, body.nacht .gitter td.bereich { background: #262626; }
body.nacht .gitter td.wahl { background: #5a2a20 !important; }
body.nacht .karte, body.nacht .geschichte { background: #1f1f1f; border-color: #3a3a3a; }
body.nacht .bild { background: #262626; }
body.nacht .bild .feld { background: #333; border-color: #141414; }
body.nacht .bild .feld:nth-child(even) { background: #3a3a3a; }
body.nacht .schalter { border-color: #333; }

@media (prefers-reduced-motion: reduce) {
  .bild .feld { -webkit-transition: none; transition: none; }
  .gitter td.zeig { -webkit-animation: none; animation: none; }
}

/* N2: Eingaben, Familie, Zeitstrahl, Ausschnitt, Spielbrett */
input, textarea, select { display: block; width: 100%; font: inherit; color: inherit; background: #fff; border: 1px solid #cfcac2; border-radius: 10px; padding: 12px; margin: 8px 0; -webkit-appearance: none; }
textarea { resize: vertical; min-height: 3.2em; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(231,59,31,.35); outline-offset: 1px; }
.karte b { display: block; margin-bottom: 4px; }
.qr { margin: 12px auto 4px; }
.qr img { display: block; margin: 0 auto; width: 180px; height: 180px; image-rendering: pixelated; }
.antwort { padding: 10px 0; border-top: 1px solid #ece8e1; text-align: left; }
.herz { padding: 4px 10px; margin-left: 6px; font-size: .9em; border-radius: 16px; }
.herz.an { background: #E73B1F; border-color: #E73B1F; color: #fff; }
.zweit.richtig { border: 2px solid #E73B1F; font-weight: 600; }
.zweit.daneben { background: #ece8e1; }
.ausschnitt { width: 100%; max-width: 420px; height: 260px; margin: 10px auto; border-radius: 12px; background-color: #e9e5df; background-repeat: no-repeat; }
.spielerliste { margin: 10px 0; }
.spieler { display: inline-block; padding: 6px 12px; margin: 3px; border-radius: 16px; background: #ece8e1; font-size: .9em; }
.spieler.fertig { background: #E73B1F; color: #fff; }
.option { padding: 10px 14px; margin: 8px 0; background: #fff; border-radius: 10px; border: 1px solid #e2ddd5; font-size: 1.1em; }
.geschichte.echt { border-left-width: 8px; }
body.nacht input, body.nacht textarea, body.nacht select, body.nacht .option { background: #1f1f1f; border-color: #444; }
body.nacht .spieler, body.nacht .zweit.daneben { background: #2c2c2c; }
body.nacht .spieler.fertig, body.nacht .herz.an { background: #E73B1F; color: #fff; }
body.nacht .antwort { border-color: #333; }
.kopf .titel { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
body.nacht .punkte span { background: #3a3a3a; }
body.nacht .punkte span.an { background: #E73B1F; }
