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

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: Arial, Helvetica, sans-serif;
  background: #f8fafc;
  color: #17202a;
}

.topbar {
  background: white;
  border-bottom: 1px solid #e2e8f0;
  padding: 16px 20px;
}

.topbar-inner {
  max-width: 700px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-size: 1.5rem;
  letter-spacing: 3px;
}

.brand span {
  color: #16a34a;
}

.account {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
}

.account a {
  color: white;
  background: #5865f2;
  padding: 9px 13px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
}

main {
  width: 100%;
  max-width: 700px;
  margin: auto;
  padding: 28px 16px;
  flex: 1;
}

.game-heading {
  text-align: center;
  margin-bottom: 22px;
}

.eyebrow {
  color: #16a34a;
  font-size: 0.75rem;
  font-weight: bold;
  letter-spacing: 2px;
}

h1 {
  font-size: 2.2rem;
  margin: 5px 0;
}

.game-heading > p:last-child {
  margin-top: 8px;
  color: #64748b;
  font-size: 0.9rem;
}

.game-date {
  margin-top: 10px;
  font-size: 0.85rem;
  color: #64748b;
}

.notice {
  max-width: 420px;
  margin: 25px auto;
  padding: 18px;
  text-align: center;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 10px;
}

.board {
  display: grid;
  grid-template-columns: repeat(5, 58px);
  grid-template-rows: repeat(6, 58px);
  gap: 7px;
  justify-content: center;
  margin: 20px auto;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #cbd5e1;
  border-radius: 5px;
  background: white;
  font-size: 1.65rem;
  font-weight: 800;
  text-transform: uppercase;
}

.cell.filled {
  border-color: #64748b;
}

.correct {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: white !important;
}

.present {
  background: #ca8a04 !important;
  border-color: #ca8a04 !important;
  color: white !important;
}

.absent {
  background: #64748b !important;
  border-color: #64748b !important;
  color: white !important;
}

.game-message {
  min-height: 26px;
  margin: 15px 0;
  text-align: center;
  font-weight: bold;
  color: #334155;
}

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 520px;
  margin: 20px auto 35px;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  gap: 5px;
}

.key {
  min-width: 34px;
  height: 52px;
  padding: 0 7px;
  border: 0;
  border-radius: 5px;
  background: #dbe2ea;
  color: #17202a;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
}

.key-wide {
  min-width: 58px;
  font-size: 0.72rem;
}

.stats {
  max-width: 460px;
  margin: 30px auto;
  padding: 20px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.stats h2,
.stats h3 {
  text-align: center;
  margin-bottom: 16px;
}

.stats h3 {
  margin-top: 24px;
  font-size: 0.95rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  text-align: center;
}

.stats-grid div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stats-grid strong {
  font-size: 1.5rem;
}

.stats-grid span {
  color: #64748b;
  font-size: 0.7rem;
}

.distribution {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.distribution-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.distribution-row > span {
  width: 15px;
  font-weight: bold;
}

.distribution-bar {
  min-width: 25px;
  min-height: 24px;
  padding: 2px 8px;
  background: #64748b;
  color: white;
  font-weight: bold;
  border-radius: 3px;
}

footer {
  padding: 18px 12px;
  text-align: center;
  background: white;
  border-top: 1px solid #e2e8f0;
  color: #475569;
  font-size: 0.75rem;
}

footer code {
  overflow-wrap: anywhere;
}

[hidden] {
  display: none !important;
}

@media (max-width: 430px) {
  .board {
    grid-template-columns: repeat(5, 52px);
    grid-template-rows: repeat(6, 52px);
    gap: 5px;
  }

  .key {
    min-width: 27px;
    height: 47px;
    padding: 0 4px;
    font-size: 0.78rem;
  }

  .key-wide {
    min-width: 45px;
    font-size: 0.65rem;
  }

  .account {
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}
