#hive-five-app {
  --hf-ivory: #f7fff8;
  --hf-grey: #3a526a;
  --hf-pink: #e03c7f;
  --hf-gold: #e8a94c;
  --hf-teal: #2f8f7a;
  --hf-plum: #6b4a7a;
  --hf-tile-bg: #ffffff;
  --hf-tile-border: #dfe6e4;

  font-family: 'Quattrocento Sans', sans-serif;
  color: var(--hf-grey);
  display: flex;
  justify-content: center;
  padding: 24px 16px 60px;
}
#hive-five-app * { box-sizing: border-box; }

#hive-five-app .hf-wrap { width: 100%; max-width: 520px; }

#hive-five-app .hf-header { text-align: center; margin-bottom: 18px; }
#hive-five-app .hf-logo {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--hf-grey);
}
#hive-five-app .hf-logo .hf-accent { color: var(--hf-pink); }
#hive-five-app .hf-sub { font-size: 13px; opacity: 0.7; margin-top: 4px; }
#hive-five-app .hf-meta-row {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 10px;
  font-size: 13px;
}
#hive-five-app .hf-meta-row div { display: flex; align-items: center; gap: 6px; }

#hive-five-app .hf-instructions {
  text-align: center;
  font-size: 14px;
  margin: 14px 0 18px;
  opacity: 0.85;
}

#hive-five-app .hf-solved-stack { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
#hive-five-app .hf-solved-band {
  border-radius: 10px;
  padding: 12px 14px;
  color: #fff;
  text-align: center;
  animation: hf-reveal 0.5s ease;
}
#hive-five-app .hf-solved-band .hf-cat-name { font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: 0.5px; }
#hive-five-app .hf-solved-band .hf-cat-words { font-size: 13px; margin-top: 2px; }

@keyframes hf-reveal {
  0% { transform: scale(0.9) rotate(-1deg); opacity: 0; }
  60% { transform: scale(1.03) rotate(0.5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

#hive-five-app .hf-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
#hive-five-app .hf-tile {
  background: var(--hf-tile-bg);
  border: 1.5px solid var(--hf-tile-border);
  border-radius: 10px;
  font-weight: 700;
  font-size: 12.5px;
  text-align: center;
  padding: 0 4px;
  aspect-ratio: 1 / 0.72;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
#hive-five-app .hf-tile:hover { transform: translateY(-2px); }
#hive-five-app .hf-tile.hf-selected {
  background: var(--hf-grey);
  color: #fff;
  border-color: var(--hf-grey);
}
#hive-five-app .hf-tile.hf-shake { animation: hf-shake 0.4s ease; }
#hive-five-app .hf-tile.hf-gone { visibility: hidden; }
@keyframes hf-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

#hive-five-app .hf-mistakes-row { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; }
#hive-five-app .hf-dots { display: flex; gap: 6px; }
#hive-five-app .hf-dot { font-size: 16px; opacity: 1; transition: opacity 0.3s ease, transform 0.3s ease; }
#hive-five-app .hf-dot.hf-used { opacity: 0.15; transform: scale(0.7) rotate(20deg); }

#hive-five-app .hf-msg {
  text-align: center;
  min-height: 20px;
  font-size: 13px;
  font-weight: 700;
  color: var(--hf-pink);
  margin-bottom: 8px;
}

#hive-five-app .hf-hints-list { text-align: center; font-size: 12.5px; margin-bottom: 10px; }
#hive-five-app .hf-hints-list div { opacity: 0.8; margin-bottom: 2px; }
#hive-five-app .hf-hints-list strong { color: var(--hf-grey); }

#hive-five-app .hf-controls { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
#hive-five-app button.hf-action {
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--hf-grey);
  background: transparent;
  color: var(--hf-grey);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
#hive-five-app button.hf-action:hover { background: var(--hf-grey); color: #fff; }
#hive-five-app button.hf-action.hf-primary { background: var(--hf-pink); color: #fff; border-color: var(--hf-pink); }
#hive-five-app button.hf-action.hf-primary:hover { background: #c02f6a; }
#hive-five-app button.hf-action:disabled { opacity: 0.35; cursor: default; }
#hive-five-app button.hf-action:disabled:hover { background: transparent; color: var(--hf-grey); }

.hf-modal-overlay {
  position: fixed; inset: 0; background: rgba(58,82,106,0.55);
  display: none; align-items: center; justify-content: center; z-index: 999;
  padding: 20px;
}
.hf-modal-overlay.hf-show { display: flex; }
.hf-modal {
  background: var(--hf-ivory, #f7fff8);
  border-radius: 16px;
  padding: 28px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  font-family: 'Quattrocento Sans', sans-serif;
  color: var(--hf-grey, #3a526a);
}
.hf-modal h2 { margin: 0 0 6px; font-size: 24px; }
.hf-modal p { font-size: 14px; margin: 6px 0 16px; opacity: 0.85; }
.hf-modal .hf-streak-line { font-weight: 700; color: #e03c7f; }

.hf-fly {
  position: fixed;
  font-size: 22px;
  pointer-events: none;
  animation: hf-fly-across 1.1s ease forwards;
  z-index: 1000;
}
@keyframes hf-fly-across {
  0% { transform: translate(0,0) scale(0.8); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: translate(140px, -60px) scale(1.1); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  #hive-five-app *, .hf-modal-overlay, .hf-fly { animation: none !important; transition: none !important; }
}
