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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  background: #fafafa;
  color: #262626;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.container {
  width: 100%;
  max-width: 420px;
  padding: 16px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.info-link {
  position: absolute;
  right: 0;
  width: 28px;
  height: 28px;
  border: 2px solid #d4d4d4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  font-style: italic;
  color: #737373;
  text-decoration: none;
  transition: border-color 0.1s;
}

.info-link:active {
  border-color: #a3a3a3;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 4px;
  color: #262626;
}

.date {
  font-size: 14px;
  color: #737373;
  margin-top: 4px;
}

.nav-chevron {
  color: #737373;
  text-decoration: none;
  font-size: 18px;
  padding: 0 8px;
  transition: color 0.1s;
}

.nav-chevron:active {
  color: #262626;
}

/* Info page */
.info-page main {
  padding-top: 48px;
  align-items: flex-start;
}

.info-page h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.instructions {
  list-style: disc;
  padding-left: 20px;
  font-size: 15px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-page footer {
  margin-top: auto;
  padding: 24px 0;
  font-size: 13px;
  color: #737373;
}

.info-page footer a {
  color: #262626;
}

main {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 24px;
}

/* Letter buttons */
.letters {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.letter {
  width: 52px;
  height: 52px;
  border: 2px solid #d4d4d4;
  border-radius: 2px;
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s;
}

.letter:active {
  background: #f5f5f5;
}

.letter.center {
  border-color: #22c55e;
  color: #22c55e;
  width: 60px;
  height: 60px;
  font-size: 24px;
}

.other-letters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Current word display */
.current-word {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  min-height: 40px;
  text-transform: uppercase;
  text-align: center;
}

.current-word .center-letter {
  color: #22c55e;
}

/* Controls */
.controls {
  display: flex;
  gap: 12px;
}

.btn {
  padding: 12px 24px;
  border: 2px solid #d4d4d4;
  border-radius: 2px;
  background: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  min-width: 100px;
  min-height: 44px;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.1s;
}

.btn:active {
  background: #f5f5f5;
}

.btn-primary {
  background: #262626;
  color: #fff;
  border-color: #262626;
}

.btn-primary:active {
  background: #404040;
}

/* Feedback */
.feedback {
  font-size: 14px;
  font-weight: 600;
  min-height: 20px;
  text-align: center;
  transition: opacity 0.3s;
}

.feedback.error {
  color: #ef4444;
}

.feedback.success {
  color: #22c55e;
}

.feedback.uncommon {
  color: #3b82f6;
}

.feedback.rare {
  color: #a855f7;
}

.feedback.legendary {
  color: #f59e0b;
}

/* Rarity breakdown */
.rarity-breakdown {
  font-size: 12px;
  color: #737373;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

.rarity-breakdown .tier {
  white-space: nowrap;
}

.rarity-breakdown .tier.uncommon {
  color: #3b82f6;
}

.rarity-breakdown .tier.rare {
  color: #a855f7;
}

.rarity-breakdown .tier.legendary {
  color: #f59e0b;
}

/* Found words */
.found-words {
  width: 100%;
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  padding: 12px;
}

.found-words h2 {
  font-size: 14px;
  font-weight: 600;
  color: #737373;
  margin-bottom: 8px;
}

.word-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-list .word {
  font-size: 14px;
  font-weight: 500;
  padding: 4px 8px;
  background: #f5f5f5;
  border-radius: 2px;
  text-transform: uppercase;
}

.word-list .word.bloom {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #f59e0b;
}

.word-list .word.uncommon {
  background: #eff6ff;
  color: #3b82f6;
}

.word-list .word.rare {
  background: #faf5ff;
  color: #a855f7;
}

.word-list .word.legendary {
  background: #fffbeb;
  color: #f59e0b;
}

/* Progress bar */
.progress {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: #e5e5e5;
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.progress-bar::after {
  content: "";
  display: block;
  height: 100%;
  width: var(--progress, 0%);
  background: #22c55e;
  border-radius: 2px;
  transition: width 0.3s;
}

.progress-text {
  font-size: 13px;
  font-weight: 600;
  color: #737373;
  min-width: 36px;
  text-align: right;
}

/* Animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.3s;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.pop {
  animation: pop 0.2s;
}
