/* ===== Honeybee Hollow — styles ===== */

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

:root {
  --honey: #f2a516;
  --honey-dark: #c47f0a;
  --honey-light: #ffd977;
  --cream: #fff8e7;
  --bark: #5a3d23;
  --leaf: #4e8a3c;
  --ink: #3b2a16;
  --panel-bg: #fff6dd;
  --danger: #c0563e;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #7fb069;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
}

#game-container { position: relative; width: 100%; height: 100%; }

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: crosshair;
}

.hidden { display: none !important; }

/* ===== HUD ===== */

#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
  font-size: 17px;
}

#hud > div { position: absolute; }

#hud-top-left {
  top: 14px; left: 16px;
  background: rgba(59, 42, 22, 0.72);
  color: var(--cream);
  border-radius: 14px;
  padding: 10px 16px;
  min-width: 240px;
  backdrop-filter: blur(2px);
}

#hud-day-name { font-weight: 700; font-size: 18px; }

#hud-timer { font-size: 22px; font-weight: 700; margin: 2px 0 6px; letter-spacing: 1px; }
#hud-timer.low { color: #ffb0a0; }

#hud-honey-bar {
  position: relative;
  height: 24px;
  background: rgba(0,0,0,0.35);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 217, 119, 0.5);
}
#hud-honey-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(180deg, var(--honey-light), var(--honey));
  border-radius: 10px;
  transition: width 0.3s ease;
}
#hud-honey-fill.done { background: linear-gradient(180deg, #ffe9a8, #ffb628); box-shadow: 0 0 10px #ffd977; }
#hud-honey-text {
  position: absolute;
  inset: 0;
  text-align: center;
  line-height: 22px;
  font-weight: 700;
  font-size: 15px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

#hud-challenge { margin-top: 6px; font-size: 14px; color: #ffe9a8; }
#hud-challenge.done { color: #b5f0a0; }

#hud-top-right { top: 14px; right: 16px; display: flex; gap: 8px; }

.hud-btn {
  pointer-events: auto;
  width: 48px; height: 48px;
  border-radius: 12px;
  border: 2px solid var(--honey-dark);
  background: var(--panel-bg);
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--honey-dark);
}
.hud-btn:hover { transform: translateY(-1px); }
.hud-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--honey-dark); }

#hud-bottom-left {
  bottom: 16px; left: 16px;
  background: rgba(59, 42, 22, 0.72);
  color: var(--cream);
  border-radius: 14px;
  padding: 10px 16px;
  width: 210px;
}
.meter-label { font-size: 13px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; opacity: 0.85; }
#hud-stamina-bar {
  height: 14px;
  background: rgba(0,0,0,0.35);
  border-radius: 8px;
  overflow: hidden;
  margin: 4px 0 6px;
}
#hud-stamina-fill {
  height: 100%; width: 100%;
  background: linear-gradient(180deg, #9fe38a, #58a844);
  border-radius: 8px;
}
#hud-stamina-fill.low { background: linear-gradient(180deg, #ffc68a, #e07b39); }
#hud-dash { font-size: 14px; font-weight: 700; color: #ffe9a8; }
#hud-dash.cooling { opacity: 0.5; }

#hud-bottom-center {
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  background: rgba(59, 42, 22, 0.72);
  color: var(--cream);
  border-radius: 14px;
  padding: 8px 16px;
  text-align: center;
  min-width: 220px;
}
#hud-basket { display: flex; gap: 6px; justify-content: center; min-height: 34px; align-items: center; flex-wrap: wrap; max-width: 420px; }
.basket-chip {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  border: 2px solid rgba(255,255,255,0.55);
  animation: chip-pop 0.25s ease;
}
@keyframes chip-pop { from { transform: scale(0.2); } to { transform: scale(1); } }
.basket-empty { font-size: 14px; opacity: 0.7; font-style: italic; }
#hud-capacity { font-size: 14px; font-weight: 700; margin-top: 4px; }
#hud-capacity.full { color: #ffb0a0; }

#hud-combo {
  top: 50%; right: 24px;
  transform: translateY(-50%);
  font-size: 34px;
  font-weight: 800;
  color: var(--honey-light);
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
  text-align: right;
}
#hud-combo .combo-label { display: block; font-size: 13px; letter-spacing: 2px; color: var(--cream); }

/* ===== Hints and toasts ===== */

#hint-banner {
  position: absolute;
  top: 90px; left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 246, 221, 0.95);
  color: var(--ink);
  border: 2px solid var(--honey-dark);
  border-radius: 14px;
  padding: 10px 22px;
  font-size: 18px;
  font-weight: 700;
  z-index: 20;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#toast-stack {
  position: absolute;
  bottom: 110px; left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: rgba(59, 42, 22, 0.9);
  color: var(--honey-light);
  border-radius: 12px;
  padding: 8px 20px;
  font-size: 18px;
  font-weight: 700;
  animation: toast-in 0.3s ease;
  border: 2px solid var(--honey);
}
.toast.recipe-toast { background: rgba(242, 165, 22, 0.95); color: #4a2e08; font-size: 20px; }
@keyframes toast-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.toast.fade-out { transition: opacity 0.5s; opacity: 0; }

/* ===== Screens ===== */

.screen {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(43, 58, 32, 0.55);
  overflow-y: auto;
  padding: 24px;
}

.panel {
  background: var(--panel-bg);
  border: 4px solid var(--bark);
  border-radius: 24px;
  padding: 28px 36px;
  max-width: 560px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  max-height: 92vh;
  overflow-y: auto;
}
.panel-wide { max-width: 860px; }

.title-panel { background: linear-gradient(180deg, #fff9e4, #ffedbe); }

.game-title {
  font-size: 52px;
  color: var(--honey-dark);
  text-shadow: 0 2px 0 #fff, 0 4px 0 rgba(90, 61, 35, 0.25);
  margin-bottom: 6px;
  letter-spacing: 1px;
}
.subtitle { font-size: 18px; margin-bottom: 22px; color: #6b4c26; }

h2 { font-size: 32px; color: var(--honey-dark); margin-bottom: 14px; }
h3 { font-size: 20px; color: var(--bark); margin: 12px 0 6px; }
.muted { color: #8a6b40; font-size: 15px; margin-bottom: 14px; }

.btn-column { display: flex; flex-direction: column; gap: 10px; align-items: center; margin-bottom: 16px; }

.btn {
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  background: linear-gradient(180deg, var(--honey-light), var(--honey));
  border: 2px solid var(--honey-dark);
  border-radius: 14px;
  padding: 10px 28px;
  cursor: pointer;
  min-width: 220px;
  box-shadow: 0 4px 0 var(--honey-dark);
  transition: transform 0.08s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--honey-dark); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-big { font-size: 22px; padding: 14px 36px; }
.btn-small { font-size: 14px; min-width: 0; padding: 6px 16px; }
.btn-danger { background: linear-gradient(180deg, #e8967e, var(--danger)); border-color: #8a3826; box-shadow: 0 3px 0 #8a3826; color: #fff; }

.settings-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0;
  padding-top: 14px;
  border-top: 2px dashed rgba(90, 61, 35, 0.3);
}
.setting-toggle {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 20px;
  border: 2px solid var(--bark);
  background: #e8dcc0;
  color: var(--bark);
  cursor: pointer;
}
.setting-toggle.on { background: var(--leaf); color: #fff; border-color: #2f5c22; }

/* ===== Day select ===== */

#day-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.day-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fff;
  border: 2px solid var(--honey-dark);
  border-radius: 14px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  color: var(--ink);
}
.day-row:hover:not(:disabled) { background: var(--honey-light); }
.day-row:disabled { opacity: 0.45; cursor: default; }
.day-row .day-stars { color: var(--honey); font-size: 18px; letter-spacing: 2px; }
.day-row .day-best { font-size: 13px; color: #8a6b40; font-weight: 400; }

/* ===== Help ===== */

.help-cols { display: flex; gap: 28px; text-align: left; margin-bottom: 18px; }
.help-cols > div { flex: 1; }
.help-cols ul { list-style: none; }
.help-cols li { margin: 5px 0; font-size: 15px; }
.help-cols p { font-size: 15px; line-height: 1.45; }
.flower-guide .fg {
  display: inline-flex;
  width: 26px; height: 26px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  color: #fff;
  margin-right: 4px;
  font-size: 15px;
}
.fg-daisy { background: #d9a300; }
.fg-lavender { background: #8a6fc8; }
.fg-sunflower { background: #cf7f1a; }
.fg-tulip { background: #d8566e; }
.fg-golden { background: #b98a00; }

/* ===== Recipes ===== */

#recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
  text-align: left;
}
.recipe-card {
  background: #fff;
  border: 2px solid var(--honey-dark);
  border-radius: 16px;
  padding: 12px 16px;
  position: relative;
}
.recipe-card.locked { background: #ece2ca; border-color: #b09a6e; }
.recipe-card.locked .recipe-name { color: #8a7a58; }
.recipe-card.completed-today { box-shadow: 0 0 12px 2px rgba(242, 165, 22, 0.65); }
.recipe-name { font-weight: 800; font-size: 17px; color: var(--honey-dark); margin-bottom: 4px; }
.recipe-ingredients { display: flex; gap: 5px; margin: 6px 0; flex-wrap: wrap; }
.recipe-ing {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 15px;
  border: 2px solid rgba(0,0,0,0.15);
}
.recipe-ing.unknown { background: #b8a988; color: #6d5c3d; font-weight: 800; }
.recipe-bonus { font-size: 14px; font-weight: 700; color: var(--leaf); }
.recipe-desc { font-size: 13px; color: #7a6440; margin-top: 3px; line-height: 1.35; }
.recipe-check { position: absolute; top: 8px; right: 12px; font-size: 18px; }
.recipe-hint-tag { font-size: 11px; font-weight: 700; color: #fff; background: #8a6fc8; border-radius: 8px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }

/* ===== Upgrades ===== */

#upgrade-cards { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.upgrade-card {
  font-family: inherit;
  background: #fff;
  border: 3px solid var(--honey-dark);
  border-radius: 18px;
  padding: 20px 18px;
  width: 220px;
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  color: var(--ink);
}
.upgrade-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 8px 20px rgba(0,0,0,0.25); background: #fffbe8; }
.upgrade-icon { font-size: 42px; margin-bottom: 8px; }
.upgrade-name { font-size: 19px; font-weight: 800; color: var(--honey-dark); margin-bottom: 6px; }
.upgrade-desc { font-size: 14px; line-height: 1.4; color: #6b5433; }

/* ===== Results ===== */

#results-stars { font-size: 44px; letter-spacing: 6px; color: var(--honey); margin-bottom: 10px; min-height: 54px; }
#results-stars .star-dim { color: #cbbd9c; }
#results-stats {
  text-align: left;
  background: #fff;
  border-radius: 14px;
  border: 2px solid var(--honey-dark);
  padding: 14px 20px;
  margin-bottom: 18px;
  font-size: 16px;
}
#results-stats .stat-row { display: flex; justify-content: space-between; padding: 3px 0; }
#results-stats .stat-row.total { border-top: 2px dashed rgba(90,61,35,0.3); margin-top: 6px; padding-top: 8px; font-weight: 800; font-size: 18px; }
#results-stats .stat-good { color: var(--leaf); font-weight: 700; }
#results-stats .stat-miss { color: #a0764a; }

/* High-contrast text everywhere on canvas overlays */
#hud, .toast, #hint-banner { text-rendering: optimizeLegibility; }

@media (max-width: 700px) {
  .help-cols { flex-direction: column; }
  #hud { font-size: 14px; }
  #hud-combo { font-size: 26px; right: 12px; }
  .game-title { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .btn, .upgrade-card, .hud-btn { transition: none; }
  .basket-chip { animation: none; }
}
