@import url('https://fonts.googleapis.com/css2?family=Russo+One&family=Noto+Sans:wght@400;500;600;700;900&display=swap');

:root {
  --background: #14141a;
  --foreground: #f2f2f2;
  --card: #1e1e27;
  --card-foreground: #f2f2f2;
  --primary: #d42f5a;
  --primary-foreground: #ffffff;
  --secondary: #7a3db8;
  --muted: #27272f;
  --muted-foreground: #8e8e9a;
  --border: #2e2e38;
  --destructive: #ef4444;
  --anime-red: #d42f5a;
  --anime-purple: #7a3db8;
  --radius: 0.75rem;
}

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

body {
  font-family: 'Noto Sans', sans-serif;
  background: var(--background);
  color: var(--foreground);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 { font-family: 'Russo One', sans-serif; }

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }

/* Gradient text */
.anime-gradient-text {
  background: linear-gradient(135deg, var(--anime-red), var(--anime-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Cards */
.anime-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid rgba(46, 46, 56, 0.5);
  padding: 1.5rem;
  transition: all 0.3s;
}
.anime-card:hover {
  border-color: rgba(212, 47, 90, 0.5);
  box-shadow: 0 0 30px rgba(212, 47, 90, 0.15);
}

/* Buttons */
.anime-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: var(--radius); padding: 1rem 2rem;
  font-family: 'Russo One', sans-serif; font-size: 1.125rem; font-weight: bold;
  background: linear-gradient(135deg, var(--anime-red), var(--anime-purple));
  color: white; border: none; cursor: pointer; transition: all 0.3s;
  text-decoration: none;
}
.anime-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 40px rgba(212, 47, 90, 0.4); text-decoration: none; }
.anime-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.anime-btn.small { font-size: 0.875rem; padding: 0.75rem 1.5rem; }

.anime-btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: var(--radius); padding: 1rem 2rem;
  font-family: 'Russo One', sans-serif; font-size: 1.125rem; font-weight: bold;
  border: 2px solid var(--anime-red); color: var(--anime-red);
  background: transparent; cursor: pointer; transition: all 0.3s;
  text-decoration: none;
}
.anime-btn-outline:hover { background: rgba(212, 47, 90, 0.1); transform: translateY(-2px); text-decoration: none; }
.anime-btn-outline.small { font-size: 0.875rem; padding: 0.75rem 1.5rem; }

.muted-btn {
  padding: 0.75rem 1rem; border-radius: var(--radius); background: var(--muted);
  color: var(--muted-foreground); font-size: 0.875rem; font-weight: 500;
  border: none; cursor: pointer; transition: all 0.3s;
}
.muted-btn:hover { color: var(--foreground); }

/* Inputs */
.anime-input {
  width: 100%; padding: 0.75rem 1rem; border-radius: var(--radius);
  background: var(--muted); border: 1px solid var(--border);
  color: var(--foreground); font-size: 0.875rem; font-family: 'Noto Sans', sans-serif;
  outline: none; transition: border-color 0.3s;
}
.anime-input::placeholder { color: var(--muted-foreground); }
.anime-input:focus { border-color: var(--primary); }

textarea.anime-input { resize: none; }

/* Glow */
.anime-glow { box-shadow: 0 0 20px rgba(212, 47, 90, 0.4), 0 0 60px rgba(122, 61, 184, 0.2); }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 20px rgba(212, 47, 90, 0.4); }
  50% { box-shadow: 0 0 40px rgba(212, 47, 90, 0.7), 0 0 80px rgba(122, 61, 184, 0.3); }
}
.pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

@keyframes floating {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.floating { animation: floating 3s ease-in-out infinite; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.animate-fade-in { animation: fadeIn 0.5s ease-out; }

@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }
.animate-scale-in { animation: scaleIn 0.4s ease-out; }

.particles-bg {
  background-image:
    radial-gradient(circle at 20% 50%, rgba(212, 47, 90, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(122, 61, 184, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(212, 47, 90, 0.05) 0%, transparent 50%);
}

/* Navbar */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  border-bottom: 1px solid rgba(46, 46, 56, 0.5);
  background: rgba(20, 20, 26, 0.8); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; }
.navbar .logo { font-family: 'Russo One', sans-serif; font-size: 1.25rem; text-decoration: none; }
.navbar .nav-links { display: flex; align-items: center; gap: 0.25rem; }
.navbar .nav-links a {
  padding: 0.5rem 1rem; border-radius: var(--radius); font-size: 0.875rem;
  font-weight: 500; color: var(--muted-foreground); text-decoration: none; transition: all 0.2s;
}
.navbar .nav-links a:hover { color: var(--foreground); background: var(--muted); }
.navbar .nav-links a.active { background: rgba(212, 47, 90, 0.2); color: var(--primary); }

.mobile-menu-btn { display: none; background: none; border: none; color: var(--foreground); font-size: 1.5rem; cursor: pointer; padding: 0.5rem; }
.mobile-menu { display: none; border-top: 1px solid rgba(46, 46, 56, 0.5); background: rgba(20, 20, 26, 0.95); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.mobile-menu a { display: block; padding: 0.75rem 1.5rem; font-size: 0.875rem; font-weight: 500; color: var(--muted-foreground); text-decoration: none; transition: color 0.2s; }
.mobile-menu a:hover { color: var(--foreground); }
.mobile-menu a.active { background: rgba(212, 47, 90, 0.2); color: var(--primary); }

@media (max-width: 768px) {
  .navbar .nav-links { display: none; }
  .mobile-menu-btn { display: block; }
  .mobile-menu.open { display: block; }
}

/* Footer */
.footer {
  border-top: 1px solid rgba(46, 46, 56, 0.5);
  background: rgba(30, 30, 39, 0.5);
  padding: 2rem 0; margin-top: 4rem; text-align: center;
}
.footer .footer-title { font-family: 'Russo One', sans-serif; font-size: 1.125rem; margin-bottom: 0.5rem; }
.footer .footer-sub { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 1rem; }
.footer .footer-copy { font-size: 0.75rem; color: var(--muted-foreground); }

/* Share widget */
.share-widget { position: fixed; right: 0.75rem; top: 50%; transform: translateY(-50%); z-index: 40; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.share-toggle { width: 2.75rem; height: 2.75rem; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.3); transition: transform 0.2s; font-size: 1rem; }
.share-toggle:hover { transform: scale(1.1); }
.share-btn { width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--muted); color: var(--foreground); display: flex; align-items: center; justify-content: center; border: none; cursor: pointer; font-size: 0.75rem; font-weight: bold; transition: background 0.3s; }
.share-btn:hover { background: rgba(212, 47, 90, 0.2); }

/* Filter / tag buttons */
.tag-btn {
  padding: 0.375rem 0.75rem; border-radius: var(--radius); font-size: 0.75rem;
  font-weight: 500; border: none; cursor: pointer; transition: all 0.3s;
  background: var(--muted); color: var(--muted-foreground);
}
.tag-btn:hover { color: var(--foreground); }
.tag-btn.active { background: var(--primary); color: white; }

/* Search engine selector */
.engine-selector { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.engine-selector .label { font-size: 0.875rem; color: var(--muted-foreground); margin-right: 0.25rem; }

/* Grid helpers */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(3, 1fr); } .grid-4 { grid-template-columns: repeat(4, 1fr); } }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

.font-heading { font-family: 'Russo One', sans-serif; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }

.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }
.pt-24 { padding-top: 6rem; }
.pb-16 { padding-bottom: 4rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }

.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.w-full { width: 100%; }
.min-h-screen { min-height: 100vh; }

.text-primary { color: var(--primary); }
.text-foreground { color: var(--foreground); }
.text-muted-fg { color: var(--muted-foreground); }
.text-destructive { color: var(--destructive); }
.text-green { color: #22c55e; }
.text-yellow { color: #eab308; }

.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

.hidden { display: none; }
.block { display: block; }

.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.max-h-60 { max-height: 15rem; }

.relative { position: relative; }
.absolute { position: absolute; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }

.object-cover { object-fit: cover; }
.w-48 { width: 12rem; }
.h-48 { height: 12rem; }

.space-y-1 > * + * { margin-top: 0.25rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cursor-pointer { cursor: pointer; }
.transition-all { transition: all 0.3s; }
.transition-colors { transition: color 0.3s, background-color 0.3s; }

.border-t { border-top: 1px solid rgba(46, 46, 56, 0.3); }

/* Hero section */
.hero { position: relative; min-height: 90vh; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.hero .overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    rgba(20, 20, 26, 0.6) 0%,
    rgba(20, 20, 26, 0.8) 50%,
    rgb(20, 20, 26) 100%
  );
  z-index: 1;
}
.hero .content { position: relative; z-index: 10; text-align: center; padding: 5rem 1rem; }

/* Wheel */
.wheel-container { position: relative; width: 18rem; height: 18rem; }
.wheel {
  width: 100%; height: 100%; border-radius: 50%;
  border: 4px solid rgba(212, 47, 90, 0.5);
  overflow: hidden; position: relative;
  background-size: cover; background-position: center;
  transition: none;
}
.wheel.spinning { transition: transform 4s cubic-bezier(0.17, 0.67, 0.12, 0.99); }
.wheel-item {
  position: absolute; width: 100%; height: 100%;
}
.wheel-item-label {
  position: absolute; top: 0.5rem; left: 50%; transform: translateX(-50%);
  font-size: 0.6rem; font-weight: bold; padding: 0.15rem 0.4rem; border-radius: 0.25rem;
  max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-align: center; color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.wheel-center {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.wheel-center-circle {
  width: 4rem; height: 4rem; border-radius: 50%; background: var(--background);
  border: 4px solid var(--primary); display: flex; align-items: center; justify-content: center;
  font-family: 'Russo One', sans-serif; font-size: 0.75rem; color: var(--primary);
}
.wheel-pointer { position: absolute; top: 0; left: 50%; transform: translateX(-50%) translateY(-0.5rem); z-index: 20; font-size: 2rem; color: var(--primary); }
@media (min-width: 768px) { .wheel-container { width: 24rem; height: 24rem; } .wheel-center-circle { width: 5rem; height: 5rem; } }

/* Category accordion */
.cat-header { width: 100%; display: flex; align-items: center; justify-content: space-between; text-align: left; background: none; border: none; color: var(--foreground); cursor: pointer; }
.cat-arrow { font-size: 1.5rem; color: var(--primary); transition: transform 0.3s; }
.cat-arrow.open { transform: rotate(180deg); }
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 0.5rem; margin-top: 1.5rem; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(3, 1fr); } }
.cat-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  background: rgba(39, 39, 47, 0.5); font-size: 0.875rem;
  color: var(--foreground); cursor: pointer; transition: all 0.3s; border: none; width: 100%; text-align: left;
}
.cat-item:hover { background: rgba(212, 47, 90, 0.1); color: var(--primary); }

/* Watchlist item */
.watchlist-item { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 640px) { .watchlist-item { flex-direction: row; align-items: center; } }
.star-btn { background: none; border: none; font-size: 1.125rem; cursor: pointer; transition: color 0.3s; padding: 0; }
.star-btn.active { color: #eab308; }
.star-btn.inactive { color: rgba(142, 142, 154, 0.3); }
.status-select {
  padding: 0.375rem 0.75rem; border-radius: var(--radius); font-size: 0.75rem;
  font-weight: 500; border: none; cursor: pointer; font-family: 'Noto Sans', sans-serif;
}
.status-plan { background: var(--muted); color: var(--muted-foreground); }
.status-watching { background: rgba(212, 47, 90, 0.2); color: var(--primary); }
.status-completed { background: rgba(34, 197, 94, 0.2); color: #22c55e; }
.status-dropped { background: rgba(239, 68, 68, 0.2); color: var(--destructive); }
.remove-btn { background: none; border: none; color: var(--muted-foreground); cursor: pointer; font-size: 0.875rem; transition: color 0.3s; }
.remove-btn:hover { color: var(--destructive); }

/* Pros tags */
.pro-tag { font-size: 0.75rem; padding: 0.25rem 0.75rem; border-radius: 9999px; background: rgba(212, 47, 90, 0.1); color: var(--primary); font-weight: 500; }

/* Modal overlay */
.modal-overlay { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.8); display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s; }
.modal-content { background: var(--background); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; max-width: 28rem; width: 90%; }
.modal-title { font-family: 'Russo One', sans-serif; font-size: 1.125rem; margin-bottom: 0.5rem; }
.modal-desc { font-size: 0.875rem; color: var(--muted-foreground); margin-bottom: 1.5rem; }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.5rem; }

/* Responsive text */
@media (max-width: 768px) {
  .text-5xl { font-size: 2.25rem; }
  .text-6xl { font-size: 2.5rem; }
  .text-4xl { font-size: 1.875rem; }
  .hero .content { padding: 3rem 1rem; }
  .w-48 { width: 8rem; }
  .h-48 { height: 8rem; }
}

@media (min-width: 768px) {
  .md-flex-row { flex-direction: row; }
  .md-grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* Suggestion item */
.suggestion-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 0.75rem; border-radius: var(--radius); font-size: 0.875rem;
  background: none; border: none; color: var(--foreground); cursor: pointer;
  text-align: left; transition: background 0.3s;
}
.suggestion-item:hover { background: rgba(212, 47, 90, 0.1); }
