* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #111;
  color: #fff;
  font-family: Arial, sans-serif;
  min-height: 100%;
}

body {
  display: flex;
  justify-content: center;
  padding: 10px;
}

.game-shell {
  width: 100%;
  max-width: 480px;
  text-align: center;
  padding: 8px 6px 16px;
}

.title {
  margin: 4px 0 10px;
  font-size: 1.5rem;
  line-height: 1.1;
  letter-spacing: 0.4px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.top-bar-buttons {
  display: flex;
  gap: 6px;
}

.timer-pill {
  background: #1f1f1f;
  border: 1px solid #2d2d2d;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.95rem;
  font-weight: bold;
  min-width: 88px;
  text-align: center;
}

.ui-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  min-height: 42px;
}

.ui-btn.small {
  padding: 8px 10px;
  min-height: 38px;
  font-size: 0.84rem;
}

.ui-btn.primary {
  background: #f5f5f5;
  color: #111;
}

.ui-btn.primary:hover {
  background: #ddd;
}

.ui-btn.secondary {
  background: #2d2d2d;
  color: #fff;
}

.ui-btn.secondary:hover {
  background: #444;
}

.palette-wrap {
  margin-bottom: 10px;
}

.palette {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.colour-btn {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 3px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  min-height: 36px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset;
}

.colour-btn.selected {
  border-color: #ffffff;
  transform: scale(1.04);
}

.grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 2px;
  width: min(92vw, 420px);
  margin: 0 auto 12px;
  background: #2a2a2a;
  padding: 2px;
  border-radius: 8px;
}

.cell {
  aspect-ratio: 1 / 1;
  background: #8a8a8a;
  cursor: pointer;
  border: 1px solid #222;
  border-radius: 2px;
}

.cell.revealed {
  cursor: default;
}

.answer-section {
  margin-top: 4px;
}

.answer-boxes {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  margin: 0 0 10px;
}

.letter-box {
  width: 46px;
  height: 52px;
  font-size: 1.35rem;
  font-weight: bold;
  text-transform: uppercase;
  text-align: center;
  border-radius: 8px;
  border: 2px solid #555;
  background: #fff;
  color: #111;
}

.message {
  min-height: 22px;
  margin: 10px 0 0;
  font-size: 0.95rem;
  font-weight: bold;
  color: #d6d6d6;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  width: 100%;
  max-width: 360px;
  background: #1b1b1b;
  border: 1px solid #333;
  border-radius: 18px;
  padding: 24px 18px 18px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.overlay-card h2 {
  margin: 0 0 12px;
  font-size: 1.5rem;
}

.overlay-text {
  margin: 0 0 18px;
  color: #dcdcdc;
  font-size: 1rem;
  line-height: 1.45;
}

.howto-text p {
  margin: 0 0 10px;
}

.howto-text p:last-child {
  margin-bottom: 0;
}

.overlay-buttons {
  display: grid;
  gap: 10px;
}

.share-status {
  min-height: 22px;
  margin: 12px 0 0;
  color: #cfcfcf;
  font-size: 0.92rem;
}

@media (max-width: 420px) {
  body {
    padding: 6px;
  }

  .game-shell {
    max-width: 100%;
    padding: 6px 4px 14px;
  }

  .title {
    font-size: 1.35rem;
    margin-bottom: 8px;
  }

  .top-bar {
    gap: 6px;
    margin-bottom: 8px;
  }

  .top-bar-buttons {
    gap: 5px;
  }

  .timer-pill {
    font-size: 0.9rem;
    padding: 7px 10px;
    min-width: 78px;
  }

  .ui-btn {
    font-size: 0.88rem;
    padding: 9px 10px;
    min-height: 40px;
  }

  .ui-btn.small {
    font-size: 0.78rem;
    padding: 7px 8px;
    min-height: 36px;
  }

  .palette {
    gap: 5px;
  }

  .letter-box {
    width: 40px;
    height: 46px;
    font-size: 1.15rem;
  }

  .message {
    font-size: 0.9rem;
  }

  .overlay-card {
    padding: 20px 16px 16px;
  }

  .overlay-card h2 {
    font-size: 1.35rem;
  }

  .overlay-text {
    font-size: 0.95rem;
  }
}
.site-footer {
  margin-top: 14px;
  font-size: 0.72rem;
  color: #8f8f8f;
  text-align: center;
  line-height: 1.4;
  padding-bottom: 4px;
}