/* ── Design Tokens ─────────────────────────────────────────────────────────── */
:root {
  --primary:    #FF6B35;
  --secondary:  #8B5CF6;
  --green:      #10B981;
  --pink:       #EC4899;
  --yellow:     #F59E0B;
  --blue:       #3B82F6;
  --teal:       #34D399;
  --red:        #EF4444;
  --bg:         #FFFBF5;
  --surface:    #FFFFFF;
  --text:       #1F2937;
  --muted:      #6B7280;
  --border:     #E5E7EB;
  --shadow:     0 2px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.14);
  --radius-sm:  8px;
  --radius:     16px;
  --radius-lg:  24px;
  --nav-h:      70px;
  --header-h:   64px;
}

/* ── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Nunito', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea { font-family: inherit; }
img { max-width: 100%; }
a { text-decoration: none; color: inherit; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
#app { display: flex; flex-direction: column; min-height: 100vh; }

.top-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  box-shadow: 0 1px 12px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  gap: 12px;
}
.top-bar h1 { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.top-bar .subtitle { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
.top-bar-right { display: flex; align-items: center; gap: 10px; }

#child-mode-toggle {
  background: var(--border); border-radius: 20px; padding: 6px 14px;
  font-size: 0.8rem; font-weight: 700; color: var(--muted);
  transition: all .2s;
}
#child-mode-toggle.active {
  background: linear-gradient(135deg, #FFD700, #FF8C00);
  color: white;
}

#page-content {
  flex: 1;
  padding-top: calc(var(--header-h) + 12px);
  padding-bottom: calc(var(--nav-h) + 16px);
  min-height: 100vh;
}

/* ── Bottom Nav ─────────────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--surface);
  box-shadow: 0 -2px 20px rgba(0,0,0,0.1);
  display: flex; align-items: stretch;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  overflow: hidden;
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  padding: 8px 4px;
  font-size: 0.68rem; font-weight: 700;
  color: var(--muted);
  transition: all .2s;
  position: relative;
}
.nav-item .nav-icon { font-size: 1.5rem; transition: transform .2s; }
.nav-item:hover .nav-icon { transform: scale(1.15); }
.nav-item.active { color: var(--primary); }
.nav-item.active::after {
  content: '';
  position: absolute; top: 0; left: 20%; right: 20%;
  height: 3px; background: var(--primary);
  border-radius: 0 0 4px 4px;
}
.nav-item.active .nav-icon { transform: scale(1.2); }

/* ── Page Sections ──────────────────────────────────────────────────────────── */
.page { padding: 16px; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

.section-title {
  font-size: 1.1rem; font-weight: 800; color: var(--text);
  margin: 20px 0 12px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Greeting Card ──────────────────────────────────────────────────────────── */
.greeting-card {
  background: linear-gradient(135deg, var(--primary) 0%, #FF9C6B 100%);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: white;
  margin-bottom: 16px;
  position: relative; overflow: hidden;
}
.greeting-card::before {
  content: '🌟';
  position: absolute; right: -10px; top: -10px;
  font-size: 80px; opacity: 0.15;
}
.greeting-card h2 { font-size: 1.4rem; font-weight: 800; }
.greeting-card p  { font-size: 0.9rem; opacity: 0.9; margin-top: 4px; }
.weather-toggle {
  margin-top: 12px;
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.4);
  border-radius: 20px;
  padding: 6px 16px;
  color: white; font-size: 0.82rem; font-weight: 700;
  display: inline-flex; align-items: center; gap: 6px;
}
.weather-toggle:hover { background: rgba(255,255,255,.35); }

/* ── Stats Row ──────────────────────────────────────────────────────────────── */
.stats-row {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .stat-icon { font-size: 1.5rem; }
.stat-card .stat-value { font-size: 1.3rem; font-weight: 800; color: var(--primary); display: block; margin-top: 2px; }
.stat-card .stat-label { font-size: 0.65rem; color: var(--muted); font-weight: 600; }

/* ── Daily Game ─────────────────────────────────────────────────────────────── */
.daily-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin-bottom: 16px;
}
.daily-card-header {
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between;
}
.daily-card-header span { color: white; font-size: 0.85rem; font-weight: 700; }
.daily-card-body {
  padding: 16px 20px 20px;
  display: flex; align-items: center; gap: 16px;
}
.daily-emoji { font-size: 3.5rem; }
.daily-info h3 { font-size: 1.3rem; font-weight: 800; }
.daily-info p  { font-size: 0.85rem; color: var(--muted); margin-top: 4px; }
.daily-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ── Age Quick Filters ──────────────────────────────────────────────────────── */
.age-quick-filters {
  display: flex; gap: 10px; margin-bottom: 8px;
}
.age-chip {
  flex: 1; padding: 10px 4px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  font-size: 0.82rem; font-weight: 800;
  color: var(--muted);
  text-align: center;
  transition: all .2s;
}
.age-chip:hover, .age-chip.active {
  border-color: var(--primary); color: var(--primary);
  background: #FFF0EB;
  transform: translateY(-2px);
}

/* ── Game Cards ─────────────────────────────────────────────────────────────── */
.games-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.game-card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  cursor: pointer;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}
.game-card:active { transform: scale(0.97); }
.game-card:hover  { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.game-card-top {
  padding: 14px 14px 10px;
  display: flex; align-items: flex-start; justify-content: space-between;
}
.game-emoji { font-size: 2.4rem; line-height: 1; }
.fav-btn {
  font-size: 1.3rem; padding: 2px;
  transition: transform .2s;
  line-height: 1;
}
.fav-btn:hover { transform: scale(1.3); }

.game-card-info { padding: 0 14px 14px; }
.game-name { font-size: 0.92rem; font-weight: 800; line-height: 1.3; }
.cat-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px; margin-top: 6px;
}
.game-badges {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}
.badge {
  font-size: 0.62rem; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
  background: var(--bg); color: var(--muted);
  display: inline-flex; align-items: center; gap: 3px;
}

.played-check {
  position: absolute; top: 8px; left: 8px;
  background: var(--green); color: white;
  border-radius: 50%; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800;
}

/* ── Child Mode Cards ───────────────────────────────────────────────────────── */
body.child-mode .games-grid { grid-template-columns: 1fr; }
body.child-mode .game-card-top { padding: 20px; }
body.child-mode .game-emoji { font-size: 4rem; }
body.child-mode .game-name { font-size: 1.3rem; }
body.child-mode .cat-chip,
body.child-mode .game-badges { display: none; }

/* ── Filters ────────────────────────────────────────────────────────────────── */
.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 12px;
  transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-bar input {
  flex: 1; border: none; outline: none;
  font-size: 0.9rem; background: transparent;
  color: var(--text);
}
.search-bar span { color: var(--muted); }

.filter-scroll {
  display: flex; gap: 8px;
  overflow-x: auto; padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-group { display: flex; gap: 6px; flex-shrink: 0; }
.filter-sep { width: 1px; background: var(--border); flex-shrink: 0; margin: 0 2px; }

.filter-chip {
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.75rem; font-weight: 700;
  color: var(--muted); background: var(--surface);
  white-space: nowrap; transition: all .15s;
}
.filter-chip:hover  { border-color: var(--primary); color: var(--primary); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: white; }

.results-count {
  font-size: 0.8rem; color: var(--muted); font-weight: 600;
  margin-bottom: 12px;
}
.clear-filters {
  color: var(--primary); font-weight: 700; font-size: 0.8rem;
  background: none; border: none; padding: 0;
}

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: flex-end;
  animation: overlayIn .2s ease;
}
@keyframes overlayIn { from { opacity:0; } to { opacity:1; } }

.modal-sheet {
  width: 100%; max-height: 92vh;
  background: var(--bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow-y: auto;
  animation: sheetUp .3s cubic-bezier(0.34, 1.56, 0.64, 1);
  -webkit-overflow-scrolling: touch;
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.modal-drag { width: 40px; height: 4px; background: var(--border); border-radius: 2px; margin: 12px auto 0; }

.modal-hero {
  padding: 16px 20px 20px;
  display: flex; align-items: flex-start; gap: 16px;
}
.modal-hero-emoji { font-size: 4rem; }
.modal-hero-info  { flex: 1; }
.modal-hero-info h2 { font-size: 1.4rem; font-weight: 800; }
.modal-hero-origin { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--border); font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
}

.info-chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 20px 16px;
}
.info-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; padding: 5px 12px;
  font-size: 0.75rem; font-weight: 700; color: var(--text);
}

.modal-section { padding: 0 20px 20px; }
.modal-section h3 {
  font-size: 1rem; font-weight: 800; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}

.how-to-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.how-to-list li {
  display: flex; gap: 10px;
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.how-to-list li .step-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 0.75rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.how-to-list li p { font-size: 0.85rem; line-height: 1.5; }

.tip-box {
  background: #FFFBEB; border-left: 4px solid var(--yellow);
  border-radius: var(--radius-sm); padding: 12px 14px;
  font-size: 0.85rem; line-height: 1.5;
}

.materials-list { display: flex; flex-wrap: wrap; gap: 6px; }
.material-item {
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 4px 12px;
  font-size: 0.78rem; font-weight: 600;
  display: flex; align-items: center; gap: 4px;
}

/* Stars Rating */
.stars-row { display: flex; gap: 6px; align-items: center; }
.star-btn { font-size: 1.8rem; transition: transform .15s; line-height: 1; }
.star-btn:hover { transform: scale(1.2); }

/* Timer */
.timer-box {
  background: var(--surface); border-radius: var(--radius);
  padding: 16px; text-align: center;
  box-shadow: var(--shadow);
}
.timer-display {
  font-size: 2.5rem; font-weight: 800; color: var(--primary);
  font-variant-numeric: tabular-nums;
}
.timer-controls { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }
.timer-btn {
  padding: 8px 20px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 700;
  background: var(--primary); color: white;
  transition: opacity .2s;
}
.timer-btn:hover { opacity: .85; }
.timer-btn.secondary {
  background: var(--border); color: var(--text);
}

/* Modal Actions */
.modal-actions {
  padding: 16px 20px 24px;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.btn-primary {
  flex: 1; padding: 14px;
  background: var(--primary); color: white;
  border-radius: var(--radius); font-size: 0.9rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: opacity .2s, transform .1s;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:hover { opacity: .9; }
.btn-primary.played { background: var(--green); }

.btn-secondary {
  padding: 14px 18px;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem; font-weight: 700;
  display: flex; align-items: center; gap: 6px;
  transition: border-color .2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ── Sortear Page ───────────────────────────────────────────────────────────── */
.sortear-hero {
  text-align: center; padding: 20px 16px 0;
}
.sortear-hero h2 { font-size: 1.5rem; font-weight: 800; }
.sortear-hero p  { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

.spin-area {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px;
  gap: 16px;
}
.spin-wheel {
  width: 160px; height: 160px; border-radius: 50%;
  background: conic-gradient(
    #FF6B35 0% 14.28%,   #EC4899 14.28% 28.56%,
    #3B82F6 28.56% 42.84%, #8B5CF6 42.84% 57.12%,
    #F59E0B 57.12% 71.4%,  #10B981 71.4% 85.68%,
    #34D399 85.68% 100%
  );
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  transition: transform .05s;
}
.spin-wheel::after {
  content: '🎲'; position: absolute;
  inset: 12px; background: var(--surface);
  border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 3rem;
}
.spin-wheel.spinning {
  animation: spin 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}
@keyframes spin {
  0%   { transform: rotate(0deg); }
  60%  { transform: rotate(540deg); }
  80%  { transform: rotate(680deg); }
  90%  { transform: rotate(700deg); }
  100% { transform: rotate(720deg); }
}

.btn-sort {
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--primary), var(--pink));
  color: white; border-radius: var(--radius-lg);
  font-size: 1.1rem; font-weight: 800;
  box-shadow: 0 6px 24px rgba(255,107,53,.35);
  transition: transform .15s, box-shadow .15s;
}
.btn-sort:hover  { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(255,107,53,.45); }
.btn-sort:active { transform: scale(0.97); }

.sort-result {
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: popIn .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { transform: scale(0.8); opacity:0; } to { transform: scale(1); opacity:1; } }

.sort-result-header {
  background: linear-gradient(135deg, var(--primary), #FF9C6B);
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
}
.sort-result-header span { color: white; font-weight: 700; font-size: 0.85rem; }

.sort-result-body { padding: 16px; display: flex; gap: 14px; align-items: center; }
.sort-result-body .big-emoji { font-size: 3rem; }
.sort-result-info h3 { font-size: 1.1rem; font-weight: 800; }
.sort-result-info p  { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

/* Confetti */
.confetti-wrap {
  position: fixed; inset: 0; pointer-events: none; z-index: 300; overflow: hidden;
}
.confetti-dot {
  position: absolute; width: 8px; height: 8px;
  border-radius: 2px;
  animation: confettiFall 1.5s ease-in forwards;
}
@keyframes confettiFall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ── Planner ────────────────────────────────────────────────────────────────── */
.planner-card {
  background: linear-gradient(135deg, #8B5CF6, #3B82F6);
  border-radius: var(--radius-lg);
  padding: 20px;
  color: white; margin-bottom: 16px;
}
.planner-card h3 { font-size: 1.1rem; font-weight: 800; }
.planner-card p  { font-size: 0.85rem; opacity: .85; margin-top: 4px; }
.btn-planner {
  margin-top: 14px;
  background: rgba(255,255,255,.25);
  border: 1px solid rgba(255,255,255,.5);
  color: white; padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 700; font-size: 0.85rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-planner:hover { background: rgba(255,255,255,.35); }

.planner-modal { padding: 20px; }
.planner-modal h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 16px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; color: var(--text); }
.form-group select, .form-group input[type="number"] {
  width: 100%; padding: 10px 14px;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.9rem; color: var(--text); background: var(--surface);
  outline: none; transition: border-color .2s;
  -webkit-appearance: none;
}
.form-group select:focus, .form-group input:focus { border-color: var(--primary); }

.planner-schedule { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.planner-item {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border-radius: var(--radius-sm); padding: 12px;
}
.planner-time { font-size: 0.75rem; font-weight: 800; color: var(--muted); min-width: 40px; }
.planner-emoji { font-size: 1.6rem; }
.planner-game-info h4 { font-size: 0.88rem; font-weight: 800; }
.planner-game-info p  { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }
.planner-snack {
  background: #FFFBEB; border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 0.82rem; font-weight: 600; display: flex; align-items: center; gap: 8px;
}

/* ── Memórias Page ──────────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: calc(var(--nav-h) + 16px); right: 16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: white;
  font-size: 1.5rem;
  box-shadow: 0 6px 20px rgba(255,107,53,.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; transition: transform .2s;
}
.fab:hover { transform: scale(1.1); }

.diary-entry {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px; margin-bottom: 10px;
  display: flex; gap: 12px;
}
.diary-emoji { font-size: 2rem; flex-shrink: 0; }
.diary-content { flex: 1; }
.diary-game    { font-size: 0.75rem; font-weight: 700; color: var(--primary); }
.diary-note    { font-size: 0.88rem; color: var(--text); margin-top: 4px; line-height: 1.5; }
.diary-date    { font-size: 0.72rem; color: var(--muted); margin-top: 4px; }

.photos-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 6px; margin-bottom: 12px;
}
.photo-thumb {
  aspect-ratio: 1/1; border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer; position: relative;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .photo-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,.6));
  color: white; font-size: 0.6rem; font-weight: 700;
  padding: 12px 4px 4px; text-align: center;
}

.diary-form { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.diary-form textarea {
  width: 100%; border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 12px; font-size: 0.9rem; resize: none; outline: none;
  min-height: 80px; transition: border-color .2s;
}
.diary-form textarea:focus { border-color: var(--primary); }

/* ── Conquistas Page ────────────────────────────────────────────────────────── */
.progress-header {
  background: linear-gradient(135deg, #F59E0B, #FF6B35);
  border-radius: var(--radius-lg); padding: 20px;
  color: white; margin-bottom: 16px;
}
.progress-header h2 { font-size: 1.2rem; font-weight: 800; }
.progress-bar-wrap {
  background: rgba(255,255,255,.3); border-radius: 10px;
  height: 10px; margin-top: 12px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; background: white; border-radius: 10px;
  transition: width .6s ease;
}
.progress-label { font-size: 0.8rem; opacity: .9; margin-top: 6px; }

/* Album */
.album-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 6px; margin-bottom: 20px;
}
.sticker {
  aspect-ratio: 1/1; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; position: relative;
  transition: transform .2s;
  cursor: pointer;
}
.sticker:hover { transform: scale(1.1); }
.sticker.unlocked {
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  animation: stickerPop .3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes stickerPop {
  from { transform: scale(0.5); opacity:0; }
  to   { transform: scale(1); opacity:1; }
}
.sticker.locked {
  background: var(--border); border: 2px dashed #D1D5DB;
}
.sticker.locked::after {
  content: '🔒'; position: absolute;
  font-size: 0.7rem; bottom: 2px; right: 2px;
}

/* Trophies */
.trophies-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; margin-bottom: 16px;
}
.trophy-card {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px;
  display: flex; gap: 12px; align-items: flex-start;
  transition: transform .2s;
  position: relative; overflow: hidden;
}
.trophy-card.earned {
  border: 2px solid var(--yellow);
}
.trophy-card.earned::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(245,158,11,.08), transparent);
}
.trophy-card.locked {
  opacity: .55; filter: grayscale(.5);
}
.trophy-icon { font-size: 2rem; flex-shrink: 0; }
.trophy-name { font-size: 0.85rem; font-weight: 800; }
.trophy-desc { font-size: 0.72rem; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.trophy-earned-badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: #FEF3C7; color: #92400E;
  border-radius: 20px; padding: 2px 7px;
  font-size: 0.65rem; font-weight: 700; margin-top: 4px;
}

/* Next trophy callout */
.next-trophy {
  background: linear-gradient(135deg, #EDE9FE, #FCE7F3);
  border-radius: var(--radius); padding: 14px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px;
}
.next-trophy .nt-icon { font-size: 2rem; }
.next-trophy h4 { font-size: 0.88rem; font-weight: 800; color: var(--secondary); }
.next-trophy p  { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ── Diary Modal ────────────────────────────────────────────────────────────── */
.diary-modal { padding: 20px; }
.diary-modal h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 16px; }
.game-select-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 200px; overflow-y: auto; margin-bottom: 12px;
}
.game-select-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 10px 12px; cursor: pointer; border: 2px solid transparent;
  transition: border-color .15s;
}
.game-select-item:hover     { border-color: var(--primary); }
.game-select-item.selected  { border-color: var(--primary); background: #FFF0EB; }
.game-select-item .gsi-emoji { font-size: 1.4rem; }
.game-select-item .gsi-name  { font-size: 0.85rem; font-weight: 700; }

/* ── Photo viewer ───────────────────────────────────────────────────────────── */
.photo-viewer {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,.9);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 20px;
}
.photo-viewer img {
  max-width: 100%; max-height: 75vh;
  border-radius: var(--radius); object-fit: contain;
}
.photo-viewer-info {
  text-align: center; margin-top: 12px; color: white;
}
.photo-viewer-info h3 { font-size: 1rem; font-weight: 700; }
.photo-viewer-info p  { font-size: 0.8rem; opacity: .7; margin-top: 4px; }
.photo-viewer-close {
  position: absolute; top: 16px; right: 16px;
  background: rgba(255,255,255,.2); color: white;
  border-radius: 50%; width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.photo-viewer-del {
  margin-top: 12px;
  background: rgba(239,68,68,.7); color: white;
  border-radius: var(--radius-sm); padding: 8px 20px;
  font-weight: 700; font-size: 0.85rem;
}

/* ── Toast Notification ─────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text); color: white;
  border-radius: var(--radius); padding: 12px 20px;
  font-size: 0.88rem; font-weight: 700;
  z-index: 500; white-space: nowrap;
  opacity: 0; transition: all .3s;
  max-width: 90vw; text-align: center;
}
.toast.show {
  opacity: 1; transform: translateX(-50%) translateY(0);
}
.toast.trophy-toast {
  background: linear-gradient(135deg, #F59E0B, #FF6B35);
  font-size: 1rem;
}

/* ── YouTube Button ─────────────────────────────────────────────────────────── */
.yt-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FF0000;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-family: 'Nunito', sans-serif;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
  text-decoration: none;
  transition: background .18s;
}
.yt-btn:hover { background: #CC0000; }
.yt-btn-icon { font-size: 22px; flex-shrink: 0; }
.yt-btn-txt { text-align: left; line-height: 1.3; }
.yt-btn-title { display: block; font-size: 14px; font-weight: 800; }
.yt-btn-sub { display: block; font-size: 11px; opacity: .85; margin-top: 2px; }

/* ── Print Styles ───────────────────────────────────────────────────────────── */
@media print {
  body * { visibility: hidden; }
  #print-card, #print-card * { visibility: visible; }
  #print-card {
    position: fixed; inset: 0;
    padding: 20mm; font-family: sans-serif;
    visibility: visible; display: block !important;
  }
  .print-title  { font-size: 22pt; font-weight: bold; margin-bottom: 6mm; }
  .print-origin { font-size: 10pt; color: #666; margin-bottom: 8mm; }
  .print-section { margin-bottom: 6mm; }
  .print-section h3 { font-size: 13pt; font-weight: bold; margin-bottom: 3mm; }
  .print-section p  { font-size: 11pt; line-height: 1.5; }
  .print-step { margin-bottom: 2mm; font-size: 11pt; }
}
#print-card { display: none; }

/* ── Scrollbar ──────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Suggestion Banner ──────────────────────────────────────────────────────── */
.suggestion-banner {
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 0.82rem; font-weight: 600;
}
.suggestion-banner.outdoor { background: #ECFDF5; color: #065F46; border: 1px solid #A7F3D0; }
.suggestion-banner.indoor  { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }
.suggestion-banner.evening { background: #F5F3FF; color: #4C1D95; border: 1px solid #DDD6FE; }
.suggestion-banner .sug-icon { font-size: 1.3rem; flex-shrink: 0; }

/* ── Empty State ────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 40px 20px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 4rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 0.85rem; }

/* ── Misc ───────────────────────────────────────────────────────────────────── */
.divider { height: 1px; background: var(--border); margin: 12px 0; }
.text-muted { color: var(--muted); }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (min-width: 480px) {
  .games-grid { grid-template-columns: repeat(3, 1fr); }
  .album-grid { grid-template-columns: repeat(7, 1fr); }
}
@media (min-width: 768px) {
  .games-grid { grid-template-columns: repeat(4, 1fr); }
  #page-content { max-width: 600px; margin: 0 auto; }
  .top-bar, .bottom-nav { max-width: 600px; left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
}
