/* ══════════════════════════════════════════════
   SPIN WHEEL — style.css
   ══════════════════════════════════════════════ */

:root {
  /* Games palette */
  --bg:      #fdf6ec;
  --card:    #fff9f1;
  --card2:   #fff3e0;
  --border:  #f0d9b5;
  --text:    #3d2c1e;
  --muted:   #a08060;
  --accent1: #ff7043;
  --accent2: #ffb300;
  --accent3: #66bb6a;
  --accent4: #42a5f5;
  --accent5: #ab47bc;
  --accent6: #ef5350;
  --shadow:  0 4px 24px rgba(120,80,40,0.10);
  --radius:  20px;

  /* Productivity palette */
  --prod-bg:   #f0fafa;
  --prod-card: #e8f8f8;
  --prod-border: #b2dfdb;
  --prod1: #26c6da;   /* teal */
  --prod2: #66bb6a;   /* green */
  --prod3: #ffa726;   /* orange */
  --prod4: #ef5350;   /* red */
  --prod5: #5c6bc0;   /* indigo */
  --prod6: #ab47bc;   /* purple */
  --prod-shadow: 0 4px 24px rgba(0,120,120,0.10);
}

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

body {
  font-family: 'Nunito', sans-serif;
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3 { font-family: 'Fredoka One', cursive; }

/* ── TOP NAV ── */
.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  border-bottom: 2px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}

.nav-btn {
  padding: 10px 26px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  font-family: 'Fredoka One', cursive;
  font-size: 1rem;
  color: var(--muted);
  transition: all 0.2s;
}
.nav-btn:hover { background: var(--card2); }
.nav-btn.active {
  background: var(--accent1);
  color: white;
  border-color: var(--accent1);
  box-shadow: 0 3px 12px rgba(255,112,67,0.35);
}
.nav-btn.prod-active {
  background: var(--prod1);
  color: white;
  border-color: var(--prod1);
  box-shadow: 0 3px 12px rgba(38,198,218,0.35);
}

.sync-btn {
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid var(--accent3);
  background: white;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent3);
  transition: all 0.2s;
}
.sync-btn:hover {
  background: var(--accent3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102,187,106,0.4);
}

.settings-btn {
  padding: 10px 16px;
  border-radius: 50px;
  border: 2px solid var(--muted);
  background: white;
  cursor: pointer;
  font-size: 1.2rem;
  color: var(--muted);
  transition: all 0.2s;
}
.settings-btn:hover {
  background: var(--muted);
  color: white;
  transform: translateY(-2px);
}

.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 50px;
  margin-left: auto;
  transition: all 0.3s;
}
.sync-status.ok      { background: #e8f5e9; color: #388e3c; }
.sync-status.saving  { background: #fff8e1; color: #f57f17; }
.sync-status.error   { background: #ffebee; color: #c62828; }
.sync-status.loading { background: #e3f2fd; color: #1565c0; }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.sync-status.saving .sync-dot { animation: pulse 0.8s infinite; }

/* ── MODES ── */
.mode { display: none; }
.mode.active { display: block; }

/* ── GAMES BG ── */
#mode-games {
  background: var(--bg);
  background-image:
    radial-gradient(circle at 20% 20%, #ffe0b2 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, #f3e5f5 0%, transparent 50%),
    radial-gradient(circle at 60% 10%, #e3f2fd 0%, transparent 40%);
  min-height: 100vh;
}

/* ── PRODUCTIVITY BG ── */
#mode-productivity {
  background: var(--prod-bg);
  background-image:
    radial-gradient(circle at 15% 25%, #b2ebf2 0%, transparent 45%),
    radial-gradient(circle at 85% 75%, #c8e6c9 0%, transparent 45%),
    radial-gradient(circle at 55% 5%,  #e8eaf6 0%, transparent 35%);
  min-height: 100vh;
}

/* ── APP CONTAINER ── */
.app { max-width: 1100px; margin: 0 auto; padding: 28px 16px; }

/* ── HEADERS ── */
header { text-align: center; margin-bottom: 32px; }
header h1 { font-size: 2.8rem; color: var(--accent1); letter-spacing: 1px; }
header p  { color: var(--muted); font-size: 1rem; margin-top: 4px; font-weight: 600; }

.prod-header h1 { color: var(--prod1); }
.prod-header p  { color: #607d8b; }

/* ── TABS ── */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 28px; }
.tab {
  padding: 10px 24px; border-radius: 50px; border: 2px solid var(--border);
  background: white; cursor: pointer; font-family: 'Fredoka One', cursive;
  font-size: 1rem; color: var(--muted); transition: all 0.2s;
}
.tab.active, .tab:hover {
  background: var(--accent1); color: white; border-color: var(--accent1);
  transform: translateY(-2px); box-shadow: 0 4px 12px rgba(255,112,67,0.3);
}
.prod-tab { border-color: var(--prod-border); }
.prod-tab.active, .prod-tab:hover {
  background: var(--prod1); border-color: var(--prod1);
  box-shadow: 0 4px 12px rgba(38,198,218,0.3);
}

.panel { display: none; }
.panel.active { display: block; }

/* ── WHEEL ── */
.filter-bar {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.filter-bar select {
  padding: 8px 16px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}
.filter-bar select:hover {
  border-color: var(--accent1);
}
#mode-productivity .filter-bar select:hover {
  border-color: var(--prod1);
}

.wheel-layout { display: flex; gap: 28px; align-items: flex-start; flex-wrap: wrap; justify-content: center; }
.wheel-wrap   { position: relative; flex-shrink: 0; }

.wheel-pointer {
  position: absolute; top: -18px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 16px solid transparent; border-right: 16px solid transparent;
  border-top: 36px solid var(--accent1);
  filter: drop-shadow(0 4px 6px rgba(255,112,67,0.5)); z-index: 10;
}
.prod-pointer { border-top-color: var(--prod1); filter: drop-shadow(0 4px 6px rgba(38,198,218,0.5)); }

#gWheelCanvas, #pWheelCanvas {
  border-radius: 50%;
  box-shadow: 0 8px 40px rgba(120,80,40,0.18), 0 2px 8px rgba(120,80,40,0.10);
  display: block;
}
#pWheelCanvas { box-shadow: 0 8px 40px rgba(0,120,120,0.15), 0 2px 8px rgba(0,120,120,0.08); }

.spin-btn {
  display: block; margin: 20px auto 0; padding: 14px 48px; border-radius: 50px;
  border: none; background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: white; font-family: 'Fredoka One', cursive; font-size: 1.3rem; cursor: pointer;
  box-shadow: 0 4px 16px rgba(255,112,67,0.4); transition: transform 0.15s, box-shadow 0.15s;
}
.spin-btn:hover:not(:disabled) { transform: translateY(-3px) scale(1.04); box-shadow: 0 8px 24px rgba(255,112,67,0.5); }
.spin-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.prod-spin {
  background: linear-gradient(135deg, var(--prod1), var(--prod2));
  box-shadow: 0 4px 16px rgba(38,198,218,0.4);
}
.prod-spin:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(38,198,218,0.5); }

.challenge-btn {
  display: block; margin: 12px auto 0; padding: 10px 24px; border-radius: 50px;
  border: 2px solid var(--accent5); background: white; color: var(--accent5);
  font-family: 'Nunito', sans-serif; font-size: 0.9rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s;
}
.challenge-btn:hover { background: var(--accent5); color: white; transform: translateY(-2px); }
.challenge-btn.active { background: var(--accent5); color: white; box-shadow: 0 4px 12px rgba(171,71,188,0.4); }
.prod-challenge { border-color: var(--prod1); color: var(--prod1); }
.prod-challenge:hover { background: var(--prod1); color: white; }
.prod-challenge.active { background: var(--prod1); color: white; box-shadow: 0 4px 12px rgba(38,198,218,0.4); }

/* ── RESULT CARD ── */
.result-card {
  background: white; border: 3px solid var(--accent2); border-radius: var(--radius);
  padding: 18px 24px; text-align: center; margin-top: 16px; min-width: 200px;
  box-shadow: var(--shadow); min-height: 80px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.prod-result { border-color: var(--prod1); }

.result-label { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.result-name  { font-family: 'Fredoka One', cursive; font-size: 1.6rem; color: var(--accent1); margin-top: 4px; }
.prod-result .result-name { color: var(--prod1); }
.result-genre { font-size: 0.85rem; color: var(--muted); margin-top: 2px; }
.result-count { font-size: 0.9rem; font-weight: 700; color: var(--accent3); margin-top: 4px; }

.result-challenge {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent5), var(--accent1));
  color: white;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  margin-top: 8px;
  box-shadow: 0 3px 10px rgba(171,71,188,0.3);
}

#mode-productivity .result-challenge {
  background: linear-gradient(135deg, var(--prod1), var(--prod2));
  box-shadow: 0 3px 10px rgba(38,198,218,0.3);
}

/* one-off badge on result */
.oneoff-badge {
  display: inline-block;
  background: #fff3e0; color: var(--prod3); border: 1.5px solid var(--prod3);
  border-radius: 50px; font-size: 0.75rem; font-weight: 700;
  padding: 2px 10px; margin-top: 6px;
}

/* ── SIDE INFO ── */
.side-info { flex: 1; min-width: 220px; max-width: 320px; display: flex; flex-direction: column; gap: 16px; }

.mini-stats-card { background: white; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1.5px solid var(--border); }
.mini-stats-card h3 { font-size: 1.1rem; margin-bottom: 12px; color: var(--accent5); }

.mini-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; font-weight: 600; }
.mini-stat-row:last-child { border-bottom: none; }
.val      { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: var(--accent1); }
.prod-val { color: var(--prod1); }

.history-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.history-item { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; font-weight: 600; color: var(--text); }
.history-dot  { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.history-time { font-size: 0.75rem; color: var(--muted); margin-left: auto; }

/* ── GAMES / TASKS HEADER ── */
.games-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.games-header h2 { font-size: 1.6rem; color: var(--accent5); flex: 1; }

.search-box {
  padding: 10px 16px;
  border-radius: 50px;
  border: 2px solid var(--border);
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  min-width: 200px;
}

.search-box:focus {
  border-color: var(--accent1);
}

#mode-productivity .search-box:focus {
  border-color: var(--prod1);
}

.add-btn {
  padding: 10px 22px; border-radius: 50px; border: none; background: var(--accent3);
  color: white; font-family: 'Fredoka One', cursive; font-size: 1rem; cursor: pointer;
  box-shadow: 0 3px 10px rgba(102,187,106,0.4); transition: transform 0.15s;
}
.add-btn:hover { transform: translateY(-2px); }
.prod-add { background: var(--prod1); box-shadow: 0 3px 10px rgba(38,198,218,0.4); }

/* ── CARD GRID ── */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }

.game-card {
  background: white; border-radius: var(--radius); padding: 18px;
  border: 2px solid var(--border); box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.game-card:hover { transform: translateY(-3px); box-shadow: 0 8px 32px rgba(120,80,40,0.13); }
.game-card.disabled { opacity: 0.55; background: #f9f5f0; }

.bulk-checkbox {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  cursor: pointer;
}

.bulk-bar {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--accent5), var(--accent1));
  border-radius: var(--radius);
  margin-bottom: 16px;
  color: white;
  font-weight: 700;
  flex-wrap: wrap;
}

.bulk-bar.show {
  display: flex;
}

.bulk-count {
  font-family: 'Fredoka One', cursive;
  font-size: 1.2rem;
}

.bulk-btn {
  padding: 6px 14px;
  border-radius: 50px;
  border: 2px solid white;
  background: rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.bulk-btn:hover {
  background: white;
  color: var(--accent1);
}

.bulk-btn.danger:hover {
  background: var(--accent6);
  border-color: var(--accent6);
  color: white;
}

/* task card variant */
.task-card { border-color: var(--prod-border); }
.task-card:hover { box-shadow: 0 8px 32px rgba(0,120,120,0.12); }
.task-card.disabled { background: #f0fafa; }

/* one-off completed card */
.task-card.completed { opacity: 0.5; background: #f5f5f5; border-style: dashed; }

.game-card-color { width: 14px; height: 14px; border-radius: 50%; display: inline-block; margin-right: 8px; vertical-align: middle; }
.game-card-title { font-family: 'Fredoka One', cursive; font-size: 1.2rem; display: flex; align-items: center; cursor: text; }
.game-card-title:focus { outline: 2px solid var(--accent1); outline-offset: 2px; border-radius: 4px; }
.game-card-genre { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-top: 4px; }
.game-card-plays { margin-top: 10px; font-size: 0.85rem; font-weight: 700; color: var(--accent4); }
.game-card-plays span { font-family: 'Fredoka One', cursive; font-size: 1.3rem; color: var(--accent1); }
.task-card .game-card-plays span { color: var(--prod1); }

.task-type-pill {
  display: inline-block;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 9px; border-radius: 50px; margin-top: 5px;
}
.pill-recurring { background: #e0f7fa; color: #00838f; }
.pill-oneoff    { background: #fff3e0; color: #e65100; }

.card-actions { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.card-btn {
  padding: 5px 12px; border-radius: 50px; border: 1.5px solid var(--border);
  background: transparent; cursor: pointer; font-size: 0.8rem; font-weight: 700;
  color: var(--muted); transition: all 0.15s; font-family: 'Nunito', sans-serif;
}
.card-btn:hover                    { background: var(--card2); }
.card-btn.danger:hover             { background: #ffebee; border-color: var(--accent6); color: var(--accent6); }
.card-btn.toggle-btn.enabled       { background: #e8f5e9; border-color: var(--accent3); color: var(--accent3); }
.card-btn.toggle-btn.disabled-state { background: #fff3e0; border-color: var(--accent2); color: var(--accent2); }

.no-games { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 1rem; grid-column: 1/-1; }
.no-games .emoji { font-size: 3rem; margin-bottom: 12px; }

/* ── STATS ── */
.stats-toolbar { display: flex; justify-content: flex-end; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar-btn {
  padding: 10px 20px; font-size: 0.9rem; border-radius: 50px; background: white;
  font-weight: 700; cursor: pointer; transition: all 0.15s; font-family: 'Nunito', sans-serif;
}
.toolbar-btn.blue   { border: 2px solid var(--accent4); color: var(--accent4); }
.toolbar-btn.green  { border: 2px solid var(--accent3); color: var(--accent3); }
.toolbar-btn.purple { border: 2px solid var(--accent5); color: var(--accent5); }
.toolbar-btn.teal   { border: 2px solid var(--prod1); color: var(--prod1); }
.toolbar-btn:hover  { opacity: 0.8; transform: translateY(-1px); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-tile {
  background: white; border-radius: var(--radius); padding: 20px;
  text-align: center; box-shadow: var(--shadow); border: 1.5px solid var(--border);
}
.prod-tile { border-color: var(--prod-border); box-shadow: var(--prod-shadow); }
.stat-icon { font-size: 2rem; margin-bottom: 6px; }
.stat-num  { font-family: 'Fredoka One', cursive; font-size: 2rem; color: var(--accent1); }
.prod-num  { color: var(--prod1); }
.stat-lbl  { font-size: 0.8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }

.chart-card { background: white; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border: 1.5px solid var(--border); margin-bottom: 24px; }
.chart-card h3 { font-size: 1.2rem; color: var(--accent5); margin-bottom: 16px; }

.bar-row   { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 0.88rem; font-weight: 600; }
.bar-label { width: 130px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; background: var(--border); border-radius: 10px; height: 20px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 10px; transition: width 0.6s cubic-bezier(0.34,1.56,0.64,1); }
.bar-val   { width: 36px; text-align: right; font-family: 'Fredoka One', cursive; color: var(--accent1); }

.genre-grid  { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.genre-tile  { background: white; border-radius: 14px; padding: 16px 18px; border: 1.5px solid var(--border); box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; }
.genre-icon  { font-size: 1.6rem; }
.genre-name  { font-family: 'Fredoka One', cursive; font-size: 1rem; }
.genre-count { font-size: 0.82rem; color: var(--muted); font-weight: 600; }

/* ── RECOMMENDATIONS ── */
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.rec-card { background: linear-gradient(135deg, var(--accent2), var(--accent1)); color: white; border-radius: 14px; padding: 16px; text-align: center; box-shadow: 0 4px 16px rgba(255,112,67,0.3); }
.rec-icon { font-size: 2rem; margin-bottom: 8px; }
.rec-title { font-family: 'Fredoka One', cursive; font-size: 1rem; margin-bottom: 4px; }
.rec-plays { font-size: 0.85rem; opacity: 0.9; margin-bottom: 4px; }
.rec-reason { font-size: 0.75rem; opacity: 0.8; text-transform: uppercase; letter-spacing: 0.5px; }

#mode-productivity .rec-card { background: linear-gradient(135deg, var(--prod1), var(--prod2)); box-shadow: 0 4px 16px rgba(38,198,218,0.3); }

/* ── MODALS ── */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(60,40,20,0.35); z-index: 100; align-items: center; justify-content: center; backdrop-filter: blur(3px); }
.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg); border-radius: 24px; padding: 32px; width: 90%; max-width: 420px;
  box-shadow: 0 16px 60px rgba(60,40,20,0.22); animation: popIn 0.25s cubic-bezier(0.34,1.56,0.64,1);
}
.modal h2 { font-size: 1.5rem; color: var(--accent1); margin-bottom: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.9rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select {
  width: 100%; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--border);
  background: white; font-family: 'Nunito', sans-serif; font-size: 1rem; color: var(--text);
  outline: none; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus { border-color: var(--accent1); }

/* task type toggle */
.type-toggle { display: flex; gap: 8px; margin-top: 4px; }
.type-btn {
  flex: 1; padding: 10px; border-radius: 12px; border: 2px solid var(--prod-border);
  background: white; cursor: pointer; font-family: 'Nunito', sans-serif; font-size: 0.9rem;
  font-weight: 700; color: var(--muted); transition: all 0.15s;
}
.type-btn.active { background: var(--prod1); border-color: var(--prod1); color: white; }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.btn-cancel {
  padding: 10px 22px; border-radius: 50px; border: 2px solid var(--border);
  background: transparent; cursor: pointer; font-weight: 700; color: var(--muted); font-family: 'Nunito', sans-serif;
}
.btn-save {
  padding: 10px 22px; border-radius: 50px; border: none;
  background: var(--accent1); color: white; font-weight: 700; cursor: pointer;
  font-family: 'Nunito', sans-serif; box-shadow: 0 3px 10px rgba(255,112,67,0.4);
}

/* ── SETTINGS ── */
.setting-row {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.setting-row:last-child { border-bottom: none; }
.setting-row label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-weight: 600;
}
.setting-row input[type="checkbox"] {
  width: 48px;
  height: 24px;
  cursor: pointer;
}

/* ── CONFETTI ── */
.confetti-piece { position: fixed; pointer-events: none; z-index: 999; animation: confettiFall 1.8s ease-in forwards; }

/* ── ACHIEVEMENTS ── */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.achievement-card {
  background: white;
  border-radius: 14px;
  padding: 16px;
  text-align: center;
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.achievement-card.unlocked {
  border-color: var(--accent2);
  box-shadow: 0 4px 16px rgba(255,179,0,0.2);
}

.achievement-card.locked {
  opacity: 0.4;
  filter: grayscale(1);
}

.ach-icon-big {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.achievement-card .ach-name {
  font-family: 'Fredoka One', cursive;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}

.achievement-card .ach-desc {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.achievement-toast {
  position: fixed;
  top: 80px;
  right: -400px;
  background: linear-gradient(135deg, var(--accent2), var(--accent1));
  color: white;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(255,112,67,0.4);
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 1000;
  min-width: 300px;
  transition: right 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

.achievement-toast.show {
  right: 24px;
}

.achievement-toast .ach-icon {
  font-size: 2.5rem;
  flex-shrink: 0;
}

.achievement-toast .ach-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
  opacity: 0.9;
}

.achievement-toast .ach-name {
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  margin-top: 2px;
}

.achievement-toast .ach-desc {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-top: 2px;
}

/* ── TIMER ── */
.timer-presets {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.timer-preset-btn {
  flex: 1;
  padding: 12px;
  border-radius: 12px;
  border: 2px solid var(--prod-border);
  background: white;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  transition: all 0.2s;
}

.timer-preset-btn:hover {
  background: var(--prod1);
  border-color: var(--prod1);
  color: white;
  transform: translateY(-2px);
}

.timer-display {
  position: fixed;
  top: 80px;
  right: 24px;
  background: linear-gradient(135deg, var(--prod1), var(--prod2));
  color: white;
  padding: 16px 24px;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(38,198,218,0.4);
  display: none;
  align-items: center;
  gap: 12px;
  z-index: 1000;
  animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1);
}

.timer-display.active {
  display: flex;
}

.timer-icon {
  font-size: 1.8rem;
}

.timer-time {
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem;
  min-width: 80px;
}

.timer-stop {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.timer-stop:hover {
  background: rgba(255,255,255,0.3);
}

/* ── UNDO BUTTON ── */
.undo-btn {
  position: fixed;
  bottom: -80px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent5), var(--accent1));
  color: white;
  border: none;
  padding: 14px 28px;
  border-radius: 50px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(171,71,188,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  transition: bottom 0.4s cubic-bezier(0.34,1.56,0.64,1), transform 0.2s;
}

.undo-btn.show {
  bottom: 24px;
}

.undo-btn:hover {
  transform: translateX(-50%) translateY(-3px);
  box-shadow: 0 12px 40px rgba(171,71,188,0.5);
}

.undo-icon {
  font-size: 1.3rem;
}

/* ── ANIMATIONS ── */
@keyframes pulse       { 0%,100%{opacity:1} 50%{opacity:0.3} }
@keyframes popIn       { from{transform:scale(0.8);opacity:0} to{transform:scale(1);opacity:1} }
@keyframes confettiFall{ 0%{transform:translateY(-20px) rotate(0deg);opacity:1} 100%{transform:translateY(100vh) rotate(720deg);opacity:0} }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  header h1 { font-size: 2rem; }
  .wheel-layout { flex-direction: column; align-items: center; }
  #gWheelCanvas, #pWheelCanvas { width: 300px !important; height: 300px !important; }
  .top-nav { padding: 10px 14px; }
  .nav-btn { padding: 8px 16px; font-size: 0.9rem; }
}
