/* ==========================================================================
   EGG HUNTER - style.css
   ========================================================================== */
:root {
  --bg: #fdfbf5;
  --bg-alt: #f3efe2;
  --text: #2c2418;
  --text-mute: #6b6152;
  --accent: #e07a29;
  --accent-2: #4a8f6b;
  --card: #ffffff;
  --border: #e6ddc9;
  --shadow: 0 4px 18px rgba(60, 45, 10, 0.08);
  --radius: 14px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #171310;
  --bg-alt: #211c17;
  --text: #f1ead9;
  --text-mute: #b8ab90;
  --accent: #f0a05c;
  --accent-2: #7fcf9f;
  --card: #221d18;
  --border: #3a3226;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  transition: background 0.3s, color 0.3s;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-2); }
button { font-family: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.4; }
.eh-hidden { display: none !important; }

/* ---------------- Header ---------------- */
header.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-h);
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
#site-logo {
  font-weight: 800; font-size: 1.25rem; border: none; background: none;
  color: var(--accent); display: flex; align-items: center; gap: 6px; padding: 6px;
}
nav.site-nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav.site-nav a {
  text-decoration: none; color: var(--text); font-size: 0.92rem;
  padding: 8px 12px; border-radius: 8px; transition: background 0.2s;
}
nav.site-nav a:hover, nav.site-nav a.active { background: var(--bg-alt); color: var(--accent); }
#header-bell { background: none; border: none; font-size: 1.1rem; padding: 6px; border-radius: 8px; }
#header-bell:hover { background: var(--bg-alt); }
.header-right { display: flex; align-items: center; gap: 6px; }

/* ---------------- Sections / pages ---------------- */
main { min-height: 60vh; }
.page-section { display: none; padding: 32px 20px 80px; max-width: 880px; margin: 0 auto; }
.page-section.active { display: block; animation: eh-fade 0.35s ease; }
@keyframes eh-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero {
  text-align: center; padding: 60px 20px; background: linear-gradient(135deg, var(--bg-alt), var(--bg));
  border-radius: var(--radius); margin-bottom: 32px; position: relative; overflow: hidden;
}
.hero img { margin: 0 auto 20px; width: 160px; cursor: pointer; user-select: none; -webkit-user-drag: none; }
.hero h1 { font-size: 2.1rem; margin: 0 0 8px; }
.hero p { color: var(--text-mute); }

.icon-cycler { font-size: 3rem; cursor: pointer; user-select: none; display: inline-block; transition: transform 0.15s; }
.icon-cycler:active { transform: scale(0.9); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 24px 0; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}

.like-widget { display: flex; align-items: center; gap: 10px; margin: 20px 0; }
.like-widget button {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 18px; font-size: 1rem;
}
.like-widget button.liked { background: #ffe3e3; border-color: #ffb3b3; }

.snow-globe { text-align: center; margin: 28px 0; }
.snow-globe .globe { font-size: 4rem; display: inline-block; transition: transform 0.15s; }
.snow-globe.shaking .globe { animation: eh-shake 0.4s; }
@keyframes eh-shake {
  0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); }
  40% { transform: rotate(12deg); } 60% { transform: rotate(-10deg); } 80% { transform: rotate(8deg); }
}
.snow-globe button {
  margin-top: 10px; background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 10px 20px; font-size: 0.95rem;
}

/* ---------------- gallery ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 14px; }
.gallery-item {
  aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-alt);
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem;
  border: 1px solid var(--border); user-select: none;
}
.gallery-item.broken { cursor: pointer; }
.dnd-zone { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 30px 0; flex-wrap: wrap; }
.dnd-item {
  font-size: 3rem; padding: 14px; border-radius: 12px; background: var(--card); border: 2px dashed var(--border);
  cursor: grab; touch-action: none;
}
.dnd-target {
  flex: 1; min-width: 140px; min-height: 100px; border: 2px dashed var(--accent); border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 2.4rem; color: var(--text-mute);
}
.dnd-target.drag-over { background: var(--bg-alt); }

/* ---------------- forms ---------------- */
form.site-form { display: grid; gap: 14px; max-width: 480px; }
form.site-form label { font-size: 0.88rem; color: var(--text-mute); display: grid; gap: 6px; }
form.site-form input, form.site-form textarea, form.site-form select {
  padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--card); color: var(--text); font-size: 1rem;
}
form.site-form button, .btn {
  background: var(--accent); color: #fff; border: none; border-radius: 10px;
  padding: 11px 20px; font-size: 0.98rem; width: fit-content;
}
.btn-outline { background: transparent; color: var(--accent); border: 1px solid var(--accent); }

.settings-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.switch { position: relative; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; background: var(--border); border-radius: 999px; cursor: pointer; transition: 0.2s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

#eh-width-display { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--accent); }

.tiny-dot {
  width: 10px; height: 10px; border-radius: 50%; background: var(--border); border: none;
  opacity: 0.55; padding: 0; display: inline-block;
}

footer.site-footer {
  padding: 40px 20px 60px; text-align: center; color: var(--text-mute); font-size: 0.86rem;
  border-top: 1px solid var(--border); position: relative;
}
#footer-year { cursor: pointer; }

/* ---------------- Cookie banner ---------------- */
#cookie-banner {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center;
  gap: 14px; flex-wrap: wrap; max-width: 560px; margin: 0 auto;
}
#cookie-banner p { margin: 0; font-size: 0.85rem; flex: 1; min-width: 200px; }
#cookie-banner button { border: none; background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 14px; }
#cookie-close { background: none !important; color: var(--text-mute) !important; font-size: 1.1rem; padding: 4px 8px !important; }

/* ---------------- Egg Hunter UI ---------------- */
#eh-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 60;
  background: var(--accent); color: #fff; border: none; border-radius: 999px;
  padding: 12px 18px; box-shadow: var(--shadow); font-size: 1rem; display: flex; align-items: center; gap: 8px;
}
#eh-fab-icon { font-size: 1.3rem; }
#eh-konami-fab { position: fixed; right: 18px; bottom: 76px; z-index: 60; }
#eh-konami-toggle {
  background: var(--card); border: 1px solid var(--border); border-radius: 999px; width: 46px; height: 46px;
  font-size: 1.2rem; box-shadow: var(--shadow);
}
#eh-konami-pad {
  position: fixed; right: 18px; bottom: 128px; z-index: 60; background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px; box-shadow: var(--shadow);
}
.eh-kpad-row { display: flex; gap: 6px; margin: 3px 0; justify-content: center; }
#eh-konami-pad button {
  width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg-alt);
  font-size: 1.1rem;
}
#eh-konami-pad button.eh-kpad-ab { background: var(--accent); color: #fff; }

#eh-panel-overlay {
  position: fixed; inset: 0; background: rgba(20, 15, 5, 0.5); z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { #eh-panel-overlay { align-items: center; } }
#eh-panel {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 86vh; overflow-y: auto;
  border-radius: 18px 18px 0 0; padding: 20px; box-shadow: var(--shadow);
}
@media (min-width: 640px) { #eh-panel { border-radius: 18px; } }
.eh-panel-head { display: flex; align-items: center; justify-content: space-between; }
.eh-panel-head h2 { margin: 0; font-size: 1.2rem; }
#eh-panel-close { background: none; border: none; font-size: 1.3rem; color: var(--text-mute); }
.eh-progress-row { display: flex; align-items: center; gap: 10px; margin: 14px 0; }
.eh-progress-bar { flex: 1; height: 10px; background: var(--bg-alt); border-radius: 999px; overflow: hidden; }
#eh-progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width 0.4s; }
#eh-progress-text { font-size: 0.82rem; color: var(--text-mute); white-space: nowrap; }
.eh-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; }
.eh-tab {
  border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 7px 13px;
  font-size: 0.84rem; white-space: nowrap; color: var(--text);
}
.eh-tab-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.eh-tab small { opacity: 0.85; }
.eh-list { display: grid; gap: 10px; margin-top: 12px; }
.eh-item { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.eh-item-icon { font-size: 1.5rem; }
.eh-item-found { border-color: var(--accent-2); }
.eh-item-title { font-weight: 700; font-size: 0.95rem; }
.eh-item-desc, .eh-item-hint { font-size: 0.82rem; color: var(--text-mute); margin-top: 3px; }
.eh-item-date { font-size: 0.72rem; color: var(--text-mute); margin-top: 4px; opacity: 0.8; }
.eh-hint-btn { margin-top: 4px; background: none; border: none; color: var(--accent); font-size: 0.8rem; padding: 0; }
.eh-empty { color: var(--text-mute); font-size: 0.85rem; }

/* ---------------- Toast ---------------- */
#eh-toast-wrap { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(92vw, 360px); }
.eh-toast {
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow); border-radius: 12px;
  padding: 12px 14px; display: flex; gap: 10px; align-items: center; animation: eh-toast-in 0.35s ease;
}
.eh-toast-legendary { border-color: gold; box-shadow: 0 0 24px rgba(255, 200, 0, 0.5); }
.eh-toast-icon { font-size: 1.6rem; }
.eh-toast-title { font-size: 0.72rem; color: var(--text-mute); }
.eh-toast-name { font-weight: 800; }
.eh-toast-out { animation: eh-toast-out 0.4s ease forwards; }
@keyframes eh-toast-in { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }
@keyframes eh-toast-out { to { opacity: 0; transform: translateY(-16px); } }

.eh-confetti {
  position: fixed; top: 10px; left: 0; width: 8px; height: 8px; border-radius: 2px; z-index: 95;
  animation: eh-confetti-fall 1.5s ease-in forwards;
}
@keyframes eh-confetti-fall {
  to { transform: translate(var(--dx), 70vh) rotate(540deg); opacity: 0; }
}

.eh-flash-msg {
  position: fixed; z-index: 95; background: var(--text); color: var(--bg); font-size: 0.78rem;
  padding: 6px 10px; border-radius: 8px; animation: eh-fade 0.2s ease;
}

/* ---------------- onboarding / celebration ---------------- */
#eh-onboard, #eh-celebrate {
  position: fixed; inset: 0; background: rgba(15, 10, 5, 0.6); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.eh-onboard-card, .eh-celebrate-card {
  background: var(--bg); border-radius: 18px; padding: 30px 26px; max-width: 420px; text-align: center;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.eh-onboard-emoji, .eh-celebrate-emoji { font-size: 2.4rem; margin-bottom: 6px; }
.eh-onboard-card p { font-size: 0.88rem; color: var(--text-mute); text-align: left; }
#eh-onboard-start, #eh-celebrate-close {
  margin-top: 14px; background: var(--accent); color: #fff; border: none; border-radius: 10px; padding: 11px 26px;
}

/* ---------------- console overlay ---------------- */
#eh-console-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 110; display: flex; align-items: center; justify-content: center; padding: 16px; }
#eh-console { background: #14110c; color: #b6f0c0; width: 100%; max-width: 420px; border-radius: 12px; padding: 14px; font-family: "Consolas", monospace; }
.eh-console-head { display: flex; justify-content: space-between; color: #fff; margin-bottom: 8px; font-size: 0.85rem; }
.eh-console-head button { background: none; border: none; color: #fff; }
#eh-console-log { height: 120px; overflow-y: auto; font-size: 0.82rem; margin-bottom: 8px; white-space: pre-wrap; }
#eh-console-input { width: 100%; background: #0c0a07; border: 1px solid #333; color: #b6f0c0; padding: 8px; border-radius: 6px; font-family: inherit; }

/* ---------------- hidden secret text (select-all egg) ---------------- */
.secret-text { color: var(--bg); background: var(--bg); user-select: text; }
.secret-text::selection { color: var(--text); background: #ffe27a; }

/* ---------------- riddle box ---------------- */
.riddle-box { background: var(--bg-alt); border-left: 4px solid var(--accent); padding: 16px 18px; border-radius: 8px; font-size: 0.92rem; margin: 20px 0; }

/* ---------------- zukan ---------------- */
.zukan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 10px; margin: 14px 0 28px; }
.zukan-tile {
  aspect-ratio: 1; border-radius: 12px; background: var(--card); border: 1px solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 1.6rem; padding: 6px; user-select: none; touch-action: manipulation;
}
.zukan-tile .zukan-tile-title { font-size: 0.6rem; color: var(--text-mute); text-align: center; line-height: 1.2; }
.zukan-tile.collected { border-color: var(--accent-2); background: var(--bg-alt); box-shadow: 0 0 0 2px var(--accent-2) inset; }

/* ---------------- minigame ---------------- */
#reaction-arena { position: relative; height: 220px; background: var(--bg-alt); border-radius: 12px; margin-top: 10px; overflow: hidden; }
#reaction-target {
  position: absolute; width: 56px; height: 56px; border-radius: 50%; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 1.6rem; border: none; cursor: pointer;
}
#click100-target {
  width: 70px; height: 70px; border-radius: 50%; border: none; font-size: 1.8rem; background: var(--bg-alt);
  margin-top: 10px;
}
#stillness-target {
  width: 90px; height: 90px; border-radius: 50%; background: var(--bg-alt); border: 2px dashed var(--accent-2);
  display: flex; align-items: center; justify-content: center; font-size: 2rem; margin: 14px auto 0; user-select: none;
}

/* ---------------- responsive ---------------- */
@media (max-width: 640px) {
  header.site-header { padding: 0 12px; }
  nav.site-nav { display: none; }
  nav.site-nav.mobile-open { display: flex; position: fixed; top: var(--header-h); left: 0; right: 0; background: var(--card); flex-direction: column; padding: 10px; border-bottom: 1px solid var(--border); z-index: 39; }
  #nav-toggle { display: inline-block !important; }
}
#nav-toggle { display: none; background: none; border: none; font-size: 1.3rem; padding: 6px; }
