/* =============================================
   GAME JOURNAL — style.css
   ============================================= */

/* ---------- Design Tokens — Light Mode (default) ---------- */
:root {
  --bg:            #f0f2fc;
  --bg-2:          #e6e9f7;
  --bg-3:          #ffffff;
  --surface:       rgba(255, 255, 255, 0.75);
  --surface-hover: rgba(108, 92, 231, 0.06);
  --border:        rgba(0, 0, 0, 0.08);
  --border-hover:  rgba(0, 0, 0, 0.16);

  --accent:        #6c5ce7;
  --accent-2:      #a855f7;
  --accent-glow:   rgba(108, 92, 231, 0.3);
  --accent-light:  rgba(108, 92, 231, 0.1);

  --green:         #059669;
  --green-light:   rgba(5, 150, 105, 0.1);
  --yellow:        #d97706;
  --yellow-light:  rgba(217, 119, 6, 0.1);
  --red:           #dc2626;
  --red-light:     rgba(220, 38, 38, 0.1);

  --text-primary:  #111827;
  --text-secondary:#374151;
  --text-muted:    #9ca3af;

  --font-display:  'Outfit', sans-serif;
  --font-body:     'Inter', sans-serif;

  --radius-sm:     8px;
  --radius-md:     14px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --shadow-card:   0 4px 24px rgba(0, 0, 0, 0.09);
  --shadow-glow:   0 0 40px rgba(108, 92, 231, 0.18);
}

/* ---------- Dark Mode ---------- */
html.dark {
  --bg:            #0c0e14;
  --bg-2:          #111521;
  --bg-3:          #181d2e;
  --surface:       rgba(255, 255, 255, 0.04);
  --surface-hover: rgba(255, 255, 255, 0.07);
  --border:        rgba(255, 255, 255, 0.08);
  --border-hover:  rgba(255, 255, 255, 0.15);

  --accent:        #7c6dff;
  --accent-2:      #a855f7;
  --accent-glow:   rgba(124, 109, 255, 0.35);
  --accent-light:  rgba(124, 109, 255, 0.12);

  --green:         #22d3a6;
  --green-light:   rgba(34, 211, 166, 0.12);
  --yellow:        #fbbf24;
  --yellow-light:  rgba(251, 191, 36, 0.12);
  --red:           #f87171;
  --red-light:     rgba(248, 113, 113, 0.12);

  --text-primary:  #f0f2ff;
  --text-secondary:#9aa3c2;
  --text-muted:    #5a6382;

  --shadow-card:   0 4px 32px rgba(0,0,0,0.4);
  --shadow-glow:   0 0 40px rgba(124, 109, 255, 0.2);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* Smooth theme transitions */
body, .card, .site-header, .pin-overlay, .modal-card,
.text-input, .text-area, .select-input, .btn, .tag-chip,
.recommend-btn, .pin-key, .icon-btn {
  transition: background-color 0.25s ease, border-color 0.25s ease,
              color 0.15s ease, box-shadow 0.25s ease;
}

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---------- Background Orbs ---------- */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
}
html.dark .bg-orb { opacity: 0.4; }
.orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,109,255,0.3), transparent 70%);
  top: -200px; right: -150px;
  animation: drift1 18s ease-in-out infinite alternate;
}
.orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(168,85,247,0.2), transparent 70%);
  bottom: 100px; left: -180px;
  animation: drift2 22s ease-in-out infinite alternate;
}
.orb-3 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(34,211,166,0.15), transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: drift3 16s ease-in-out infinite alternate;
}
@keyframes drift1 { from { transform: translate(0,0); } to { transform: translate(-30px, 40px); } }
@keyframes drift2 { from { transform: translate(0,0); } to { transform: translate(40px, -30px); } }
@keyframes drift3 { from { transform: translate(-50%,-50%); } to { transform: translate(-45%,-55%); } }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(240, 242, 252, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
html.dark .site-header { background: rgba(12, 14, 20, 0.85); }
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
}
.logo-icon { font-size: 1.4rem; }
.logo-text { color: var(--text-secondary); }
.logo-text strong { color: var(--text-primary); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-generate {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  box-shadow: 0 8px 40px var(--accent-glow);
  transition: all 0.25s ease;
  letter-spacing: 0.02em;
}
.btn-generate:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 14px 50px rgba(124, 109, 255, 0.5);
}
.btn-generate:active { transform: translateY(0) scale(1); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(124, 109, 255, 0.4);
}
.btn-outline:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ---------- Card ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
}

/* ---------- Inputs ---------- */
.text-input, .select-input {
  width: 100%;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
}
html.dark .text-input, html.dark .select-input { background: rgba(255,255,255,0.04); }
.text-input::placeholder { color: var(--text-muted); }
.text-input:focus, .select-input:focus {
  border-color: var(--accent);
  background: rgba(124, 109, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 109, 255, 0.15);
}
.text-input--large {
  font-size: 1rem;
  padding: 14px 18px;
  border-radius: var(--radius-md);
}
.select-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}
html.dark .select-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235a6382' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
.select-input option { background: var(--bg-3); }
html.dark .select-input option { background: #181d2e; }

.text-area {
  width: 100%;
  background: rgba(255,255,255,0.8);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  padding: 11px 14px;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  outline: none;
  line-height: 1.6;
}
html.dark .text-area { background: rgba(255,255,255,0.04); }
.text-area::placeholder { color: var(--text-muted); }
.text-area:focus {
  border-color: var(--accent);
  background: rgba(124, 109, 255, 0.06);
  box-shadow: 0 0 0 3px rgba(124, 109, 255, 0.15);
}

.field-group { display: flex; flex-direction: column; gap: 8px; }
.field-group--half { flex: 1; min-width: 0; }
.field-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field-row {
  display: flex;
  gap: 16px;
}
.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.input-row .text-input { flex: 1; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.field-hint {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal-card {
  background: var(--bg-3);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.25s ease;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.modal-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}
.modal-desc {
  color: var(--text-secondary);
  font-size: 13.5px;
  margin-bottom: 20px;
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.modal-hint {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}
.modal-hint a { color: var(--accent); text-decoration: none; }
.modal-hint a:hover { text-decoration: underline; }

/* ---------- Main Container ---------- */
.main-container {
  position: relative;
  z-index: 1;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}
.section { animation: fadeIn 0.35s ease; }

/* ---------- Hero Section ---------- */
.hero-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
  min-height: calc(100vh - 160px);
}
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.7;
}
.game-entry-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 32px;
}

/* ---------- Library ---------- */
.library-section { padding-top: 8px; }

.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
  gap: 16px;
  flex-wrap: wrap;
}
.library-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
}
.library-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.games-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: row;
  height: 120px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
  position: relative;
  overflow: hidden;
}
.game-card:hover {
  border-color: rgba(108, 92, 231, 0.4);
  box-shadow: 0 8px 32px rgba(108, 92, 231, 0.12);
  transform: translateY(-2px);
}
html.dark .game-card:hover {
  box-shadow: 0 8px 32px rgba(124, 109, 255, 0.15);
}

.game-card-cover-side {
  width: 180px;
  height: 100%;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  transition: transform 0.3s ease;
}
.game-card:hover .game-card-cover-side {
  transform: scale(1.03);
}
.game-card-cover-side.placeholder {
  background: linear-gradient(135deg, var(--bg-3), var(--border));
}
html.dark .game-card-cover-side.placeholder {
  background: linear-gradient(135deg, var(--bg-2), var(--border));
}

.game-card-content {
  flex: 1;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.game-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.game-card-name-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.game-card-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.game-card-rename-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s, opacity 0.2s;
  opacity: 0;
  flex-shrink: 0;
}
.game-card:hover .game-card-rename-btn {
  opacity: 1;
}
.game-card-rename-btn:hover {
  color: var(--accent);
  background-color: var(--accent-light);
}
.game-rename-input {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--accent);
  background: var(--bg-3);
  color: var(--text-primary);
  width: 100%;
  outline: none;
}
html.dark .game-rename-input {
  background: var(--bg-2);
}
.game-card-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.game-card-delete:hover { color: var(--red); background: var(--red-light); }

.game-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.game-card-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-stars {
  display: flex;
  gap: 2px;
}
.card-star {
  font-size: 13px;
  color: var(--yellow);
  opacity: 0.3;
}
.card-star.lit { opacity: 1; }
.card-rating-val {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.game-card-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.game-card-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.game-card-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  transition: width 0.4s ease;
}
.game-card-progress-label {
  font-size: 11px;
  color: var(--text-muted);
}

.game-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.status-badge.logging {
  background: var(--yellow-light);
  color: var(--yellow);
  border: 1px solid rgba(217,119,6,0.25);
}
.status-badge.reviewed {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(5,150,105,0.25);
}
.status-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.game-card-actions {
  display: flex;
  gap: 6px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.empty-icon { font-size: 3.5rem; opacity: 0.4; }
.empty-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
}
.empty-desc { font-size: 14px; color: var(--text-secondary); max-width: 340px; }


.questionnaire-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.game-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-light);
  border: 1px solid rgba(124, 109, 255, 0.3);
  border-radius: 999px;
  padding: 8px 16px;
  flex: 1;
}
.game-badge-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
}
.autosave-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.5s ease;
}
.autosave-indicator.visible { opacity: 1; }
.autosave-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 32px;
}
.progress-bar-track {
  flex: 1;
  height: 5px;
  background: var(--surface-hover);
  border-radius: 99px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 99px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}
.progress-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.2s;
}
.category-card:hover { transform: translateY(-2px); }
.category-card.has-rating { border-color: rgba(124,109,255,0.3); }

.category-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.category-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.category-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.category-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.rating-badge {
  margin-left: auto;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
  transition: all 0.2s;
}
.rating-badge.rated {
  background: var(--accent-light);
  border-color: rgba(124,109,255,0.3);
  color: var(--accent);
}

.rating-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.rating-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.star-rating {
  display: flex;
  gap: 4px;
}
.star {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
  padding: 2px;
  transition: color 0.15s ease, transform 0.15s ease;
  opacity: 0.4;
}
.star:hover, .star.active { color: var(--yellow); opacity: 1; }
.star:hover { transform: scale(1.2); }
.star.active { transform: scale(1.1); }

/* Tag Chips */
.tag-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tag-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}
.tag-chip:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}
.tag-chip.selected {
  background: var(--accent-light);
  border-color: rgba(124,109,255,0.5);
  color: var(--accent);
}

/* Extra card */
.extra-card { margin-bottom: 32px; }
.extra-card .field-row { gap: 16px; margin-bottom: 16px; }

/* Recommend buttons */
.recommend-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.recommend-btn {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}
.recommend-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.recommend-btn.selected[data-value="yes"] {
  background: var(--green-light);
  border-color: rgba(34, 211, 166, 0.4);
  color: var(--green);
}
.recommend-btn.selected[data-value="maybe"] {
  background: var(--yellow-light);
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--yellow);
}
.recommend-btn.selected[data-value="no"] {
  background: var(--red-light);
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--red);
}

/* Generate section */
.generate-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 48px 24px;
  text-align: center;
}
.overall-display {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.overall-label {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}
.overall-score {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
}
.overall-max {
  font-size: 1rem;
  color: var(--text-muted);
}
.generate-hint {
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- Review Section ---------- */
.review-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.review-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  flex: 1;
  text-align: center;
}

.review-meta-bar {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 16px 24px;
  overflow: hidden;
}
.review-meta-item {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.review-meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.review-meta-value {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.score-value { color: var(--accent); }
.review-meta-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 8px;
}

.review-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 80px 24px;
  color: var(--text-secondary);
}
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.review-output {
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  padding: 36px;
  margin-bottom: 28px;
}
.review-output h1, .review-output h2, .review-output h3 {
  font-family: var(--font-display);
  color: var(--text-primary);
  margin: 1.5em 0 0.5em;
}
.review-output h1 { font-size: 1.5rem; }
.review-output h2 { font-size: 1.25rem; color: var(--accent); }
.review-output h3 { font-size: 1.05rem; }
.review-output p { margin-bottom: 1em; }
.review-output strong { color: var(--accent); }

.review-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--bg-3);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 14px;
  color: var(--text-primary);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 999;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-color: rgba(34, 211, 166, 0.4); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }
.toast-icon { font-size: 1.1rem; }

@keyframes slideInRight {
  from { transform: translateX(80px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 800px) {
  .hero-section {
    grid-template-columns: 1fr;
    min-height: unset;
    gap: 32px;
    padding-top: 32px;
  }
  .categories-grid { grid-template-columns: 1fr; }
  .field-row { flex-direction: column; }
  .review-meta-bar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .review-meta-divider { display: none; }
  .review-meta-item { min-width: 40%; }
  .recommend-btn { min-width: 100px; }
}
@media (max-width: 500px) {
  .main-container { padding: 24px 16px 60px; }
  .game-entry-card { padding: 20px; }
}

/* ---------- PIN Lock ---------- */
.pin-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.4s ease;
}
.pin-overlay.unlocking {
  opacity: 0;
  pointer-events: none;
}
.pin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 320px;
}
.pin-logo {
  font-size: 3rem;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
.pin-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  text-align: center;
}
.pin-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -10px;
}
.pin-dots {
  display: flex;
  gap: 16px;
  margin: 8px 0;
}
.pin-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-hover);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.pin-dot.filled {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
  transform: scale(1.15);
}
.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}
.pin-key {
  aspect-ratio: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pin-key:hover:not(.pin-key--empty) {
  background: var(--accent-light);
  border-color: rgba(124, 109, 255, 0.4);
  color: var(--accent);
  transform: scale(1.05);
}
.pin-key:active:not(.pin-key--empty) {
  transform: scale(0.95);
}
.pin-key--empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  pointer-events: none;
}
.pin-key--action {
  color: var(--text-secondary);
  font-size: 1rem;
}
.pin-error {
  font-size: 13px;
  color: var(--red);
  text-align: center;
  min-height: 20px;
  font-weight: 500;
}
.pin-forgot {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-body);
  transition: color 0.2s;
}
.pin-forgot:hover { color: var(--text-secondary); }

@keyframes pinShake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(10px); }
  60%      { transform: translateX(-6px); }
  80%      { transform: translateX(6px); }
}
.pin-dots.shake { animation: pinShake 0.45s ease; }

/* ---------- Autocomplete ---------- */
.autocomplete-container {
  position: relative;
  width: 100%;
}
.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-top: 6px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: var(--shadow-card);
}
html.dark .autocomplete-suggestions {
  background: var(--bg-2);
}
.autocomplete-suggestion {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 14.5px;
  font-weight: 500;
  transition: background-color 0.15s ease, color 0.15s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.autocomplete-suggestion:hover {
  background-color: var(--surface-hover);
  color: var(--accent);
}
.autocomplete-suggestion:not(:last-child) {
  border-bottom: 1px solid var(--border);
}

/* ---------- Category status dot ---------- */
.category-title-wrap {
  flex: 1;
  min-width: 0;
}
.category-status-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.category-status-dot.empty {
  border: 2px dashed var(--text-muted);
  background: transparent;
}
.category-status-dot.empty::after {
  content: ' ';
}
.category-status-dot.filled {
  border: 2px solid var(--green);
  background: var(--green-light);
  color: var(--green);
}
.category-status-dot.filled::after {
  content: '✓';
}

/* ---------- Sentiment matrix ---------- */
.sentiment-matrix-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 4px;
}
.sentiment-matrix-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.sentiment-matrix {
  display: flex;
  gap: 8px;
}
.sentiment-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}
html.dark .sentiment-btn {
  background: var(--bg-2);
}
.sentiment-btn:hover {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}
.sentiment-btn.selected[data-sentiment="great"] {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green);
}
.sentiment-btn.selected[data-sentiment="average"] {
  background: var(--yellow-light);
  color: var(--yellow);
  border-color: var(--yellow);
}
.sentiment-btn.selected[data-sentiment="disliked"] {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red);
}

/* ---------- Status toggle row ---------- */
.status-toggle-row {
  display: flex;
  gap: 8px;
}
.status-toggle-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}
html.dark .status-toggle-btn {
  background: var(--bg-2);
}
.status-toggle-btn:hover {
  background: var(--surface-hover);
}
.status-toggle-btn.selected[data-value="playing"] {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.status-toggle-btn.selected[data-value="abandoned"] {
  background: var(--red-light);
  color: var(--red);
  border-color: var(--red);
}
.status-toggle-btn.selected[data-value="finished"] {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green);
}

/* ---------- Status badge colors ---------- */
.status-badge.playing {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(108, 92, 231, 0.25);
}
.status-badge.abandoned {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.25);
}
.status-badge.finished {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(5, 150, 105, 0.25);
}

/* ---------- Timestamp ---------- */
.meta-timestamp {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* ---------- Live Review overlay/split-screen ---------- */
@media (min-width: 992px) {
  /* On desktop, show a slide-out split panel from the right */
  .review-section {
    position: fixed;
    top: 0;
    right: 0;
    width: 500px;
    height: 100vh;
    background: var(--surface);
    border-left: 1px solid var(--border);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    z-index: 100;
    padding: 32px;
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(100%);
    display: block !important;
  }
  .review-section.hidden {
    transform: translateX(100%);
  }
  .review-section:not(.hidden) {
    transform: translateX(0);
  }
}

/* ---------- Responsive rows ---------- */
@media (max-width: 600px) {
  .game-card.game-card-row {
    flex-direction: column;
    height: auto;
  }
  .game-card-cover-side {
    width: 100%;
    height: 100px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .status-toggle-row {
    flex-direction: column;
  }
}

/* ---------- Category Bullet Note Input & Lists ---------- */
.category-notes-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 14px;
}
.category-notes-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}
.note-bullet-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text-primary);
  animation: slideInFast 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 0;
  gap: 8px;
}
html.dark .note-bullet-item {
  background: var(--bg-2);
}
.note-bullet-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  word-break: break-word;
  line-height: 1.4;
  flex: 1;
}
.remove-bullet-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.remove-bullet-btn:hover {
  color: var(--red);
  background-color: var(--red-light);
}
.category-input-row {
  display: flex;
  gap: 8px;
}
.category-note-input {
  flex: 1;
  font-size: 13.5px;
  padding: 8px 12px;
}
.add-note-btn {
  padding: 0 12px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

@keyframes slideInFast {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Note Edit Input ---------- */
.note-edit-input {
  font-size: 13.5px !important;
  padding: 6px 10px !important;
  height: auto !important;
  border-radius: var(--radius-sm) !important;
  background: var(--bg-1) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--accent) !important;
}

/* ---------- Dashboard Card Vibes ---------- */
.game-card-vibes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.vibe-dot-item {
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
html.dark .vibe-dot-item {
  background: var(--bg-2);
}

/* ---------- Playstyle & Trophy Toggles ---------- */
.playstyle-toggle-row, .trophy-toggle-row {
  display: flex;
  gap: 8px;
}
.playstyle-btn, .trophy-btn {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  text-align: center;
}
html.dark .playstyle-btn, html.dark .trophy-btn {
  background: var(--bg-2);
}
.playstyle-btn:hover, .trophy-btn:hover {
  background: var(--surface-hover);
}
.playstyle-btn.selected[data-value="main"] {
  background: var(--yellow-light);
  color: var(--yellow);
  border-color: var(--yellow);
}
.playstyle-btn.selected[data-value="sides"] {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}
.trophy-btn.selected[data-value="no"] {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}
.trophy-btn.selected[data-value="yes"] {
  background: var(--green-light);
  color: var(--green);
  border-color: var(--green);
}


