/* Alle Spielseiten: links Feld und Werteleiste, rechts die Erklaerung. */

.spielseite {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  padding: 28px var(--rand);
  align-items: start;
  min-height: 0;
}

/* --- Werteleiste --- */
.leiste {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--linie);
  flex-wrap: wrap;
}
.leiste .nummer {
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--schwach);
}
.leiste h1 {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.18em;
}
.werte {
  margin-left: auto;
  display: flex;
  gap: 24px;
}
.werte > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.werte dt {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--schwach);
}
.werte dd {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  min-width: 2ch;
}
.werte dd.hervorgehoben {
  color: var(--akzent);
}

/* --- Spielfeld --- */
.buehne {
  position: relative;
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
/* Umschliesst die Leinwand genau, damit die Ueberlagerung nicht daneben laeuft. */
.buehne .feld {
  position: relative;
  line-height: 0;
}
.buehne canvas {
  display: block;
  background: #0a0c0e;
  border: 1px solid var(--linie);
  touch-action: none;
}

.ueberlagerung {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  line-height: 1.5;
  background: rgba(8, 9, 11, 0.86);
  border: 1px solid var(--linie);
}
.ueberlagerung[hidden] {
  display: none;
}
.ueberlagerung .zeile {
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--gedaempft);
}
.ueberlagerung .gross {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text);
}
.ueberlagerung .gross.rekord {
  color: var(--akzent);
}

/* --- Bedienfelder fuer Touch --- */
.tasten {
  display: none;
  margin-top: 16px;
  gap: 8px;
  justify-content: center;
}
.tasten button {
  width: 58px;
  height: 46px;
  border: 1px solid var(--linie-2);
  background: var(--tafel);
  color: var(--gedaempft);
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.tasten button:active {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #0a0a0a;
}
.tasten .kreuz {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 8px;
}
.tasten .kreuz .leer {
  visibility: hidden;
}
@media (pointer: coarse) {
  .tasten[data-tasten] {
    display: flex;
  }
}

/* --- Erklaerungsspalte --- */
.info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--linie);
  border: 1px solid var(--linie);
}
.info section {
  background: var(--tafel);
  padding: 14px 16px;
}
.info h2 {
  font-size: 9.5px;
  letter-spacing: 0.26em;
  color: var(--schwach);
  font-weight: 400;
  margin-bottom: 10px;
}
.info p {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  color: var(--gedaempft);
}
.info dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 11.5px;
}
.info dt {
  color: var(--text);
  letter-spacing: 0.06em;
  white-space: nowrap;
}
.info dd {
  color: var(--schwach);
  font-family: var(--sans);
}
.info .zurueck {
  background: var(--tafel);
  padding: 14px 16px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--gedaempft);
  text-decoration: none;
  display: flex;
  gap: 12px;
  align-items: center;
}
.info .zurueck:hover {
  color: var(--akzent);
}

/* --- Tagescode --- */
.tagescode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
}
.wortgitter {
  display: grid;
  gap: 6px;
}
.wortreihe {
  display: grid;
  grid-template-columns: repeat(5, 54px);
  gap: 6px;
}
.buchstabe {
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border: 1px solid var(--linie);
  background: var(--tafel);
  color: var(--text);
}
.buchstabe.gesetzt {
  border-color: var(--linie-2);
}
.buchstabe.falsch {
  background: #101317;
  border-color: #101317;
  color: var(--schwach);
}
.buchstabe.vorhanden {
  background: var(--akzent-dunkel);
  border-color: rgba(255, 174, 53, 0.45);
  color: var(--akzent);
}
.buchstabe.richtig {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #0a0a0a;
}

.meldung {
  min-height: 20px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--akzent);
  text-align: center;
}
.meldung.dauerhaft {
  color: var(--gedaempft);
}

.klaviatur {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  width: 100%;
  max-width: 520px;
}
.tastenreihe {
  display: flex;
  gap: 5px;
  justify-content: center;
  width: 100%;
}
.taste {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 1px solid var(--linie-2);
  background: var(--tafel);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.06em;
}
.taste.breit {
  flex: 2.2;
  font-size: 9.5px;
  letter-spacing: 0.16em;
  color: var(--gedaempft);
}
.taste:hover {
  border-color: var(--gedaempft);
}
.taste.falsch {
  background: #101317;
  border-color: #101317;
  color: var(--schwach);
}
.taste.vorhanden {
  background: var(--akzent-dunkel);
  border-color: rgba(255, 174, 53, 0.45);
  color: var(--akzent);
}
.taste.richtig {
  background: var(--akzent);
  border-color: var(--akzent);
  color: #0a0a0a;
}

@media (max-width: 640px) {
  .wortreihe {
    grid-template-columns: repeat(5, 48px);
  }
  .buchstabe {
    height: 48px;
    font-size: 19px;
  }
  .taste {
    height: 42px;
    font-size: 12px;
  }
}

@media (max-width: 940px) {
  .spielseite {
    grid-template-columns: 1fr;
  }
  .info {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .spielseite {
    padding-top: 18px;
    gap: 20px;
  }
  .werte {
    width: 100%;
    margin-left: 0;
    gap: 18px;
  }
  .leiste h1 {
    font-size: 15px;
  }
}
