/* style.css — Beehive Spelling Game */
:root {
  --bg: #1a1207;
  --bg2: #2a1f10;
  --surface: #3d2e1a;
  --surface2: #4a3720;
  --accent: #f5a623;
  --accent-glow: #ffcc44;
  --text: #f0e6d3;
  --text2: #b8a88a;
  --success: #4ade80;
  --error: #f87171;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fdf6e3;
    --bg2: #f5edd6;
    --surface: #fff8e7;
    --surface2: #f0e4c8;
    --accent: #d4900a;
    --accent-glow: #f5a623;
    --text: #3d2e1a;
    --text2: #7a6640;
    --shadow: 0 4px 24px rgba(0,0,0,0.1);
  }
}

html[data-theme="dark"] {
  --bg: #1a1207; --bg2: #2a1f10; --surface: #3d2e1a; --surface2: #4a3720;
  --accent: #f5a623; --accent-glow: #ffcc44; --text: #f0e6d3; --text2: #b8a88a;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

html[data-theme="light"] {
  --bg: #fdf6e3; --bg2: #f5edd6; --surface: #fff8e7; --surface2: #f0e4c8;
  --accent: #d4900a; --accent-glow: #f5a623; --text: #3d2e1a; --text2: #7a6640;
  --shadow: 0 4px 24px rgba(0,0,0,0.1);
}

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

html { color-scheme: dark light; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  overflow-x: hidden;
}

#app { max-width: 520px; width: 100%; }

.header { text-align: center; margin-bottom: 0.75rem; }
.title { font-size: 1.6rem; font-weight: 700; color: var(--accent-glow); letter-spacing: -0.02em; }
.subtitle { font-size: 0.85rem; color: var(--text2); margin-top: 0.15rem; }

.stats-bar {
  display: flex;
  justify-content: space-around;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 0.6rem 0.5rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--surface2);
}
.stat { text-align: center; display: flex; flex-direction: column; gap: 0.15rem; }
.stat-label { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text2); }
.stat-value { font-size: 1.05rem; font-weight: 700; color: var(--accent); transition: transform 0.2s; }
.stat-value.flash { transform: scale(1.25); }

.game-area {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--surface2);
  text-align: center;
}

.clue {
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 1rem;
  min-height: 2.4em;
  opacity: 1;
  transition: opacity 0.3s;
}

.input-area {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

#input {
  flex: 1;
  padding: 0.7rem 1rem;
  border: 2px solid var(--surface2);
  border-radius: 10px;
  background: var(--bg2);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}
#input:focus { border-color: var(--accent); }
#input:disabled { opacity: 0.5; }

button {
  padding: 0.7rem 1.1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--accent);
  color: #1a1207;
}
button:hover { filter: brightness(1.15); transform: translateY(-1px); }
button:active { transform: translateY(0); filter: brightness(0.95); }

#listenBtn { background: var(--surface2); color: var(--text); font-size: 1.1rem; padding: 0.7rem 0.9rem; }
#restartBtn { margin-top: 1rem; }

.message {
  font-size: 0.8rem;
  min-height: 1.4em;
  font-weight: 600;
  transition: all 0.2s;
}
.message.info { color: var(--text2); }
.message.success { color: var(--success); }
.message.error { color: var(--error); }

.hive {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.5rem 0;
}

.hex {
  width: 58px;
  height: 54px;
  background: var(--surface2);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  transition: all 0.4s cubic-bezier(.34,1.56,.64,1);
}
.hex.filled {
  background: var(--accent);
  animation: beeDrop 0.5s cubic-bezier(.34,1.56,.64,1);
}

.hex.offset { margin-left: -29px; }

@keyframes beeDrop {
  0% { transform: translateY(-30px) scale(0.5); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.victory {
  position: fixed;
  inset: 0;
  background: rgba(26,18,7,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(8px);
}
.victory.hidden { display: none; }
.victory-content {
  text-align: center;
  padding: 2.5rem 2rem;
  background: var(--surface);
  border-radius: 20px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 60px rgba(245,166,35,0.3);
  animation: popIn 0.5s cubic-bezier(.34,1.56,.64,1);
}
.victory-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.victory-content h2 { color: var(--accent-glow); font-size: 1.5rem; margin-bottom: 0.5rem; }
.victory-content p { color: var(--text2); margin-bottom: 1rem; }

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 400px) {
  .hex { width: 48px; height: 44px; font-size: 1.1rem; }
  .hex.offset { margin-left: -24px; }
  .title { font-size: 1.3rem; }
  .clue { font-size: 0.85rem; }
}

@media (min-width: 600px) {
  .hex { width: 66px; height: 61px; font-size: 1.6rem; }
  .hex.offset { margin-left: -33px; }
}
