:root {
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --accent-color: #10b981;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --glass-backdrop: blur(12px);
}

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

body {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  background-image: radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%), radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.15), transparent 25%);
}

.container {
  width: 100%;
  max-width: 1200px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  background: linear-gradient(to right, #60a5fa, #34d399);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.ranking-section {
  width: 100%;
  max-width: 800px;
  margin-bottom: 30px;
  text-align: center;
}

.ranking-section {
  width: 100%;
  max-width: 800px;
  margin-bottom: 30px;
  text-align: left;
  background: var(--card-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
}

.ranking-section h2 {
  font-size: 1.25rem;
  color: var(--text-main);
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.last-update {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
}

.ranking-tags {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
  margin-top: 15px;
}

.ranking-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 12px 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ranking-tag:hover {
  border-color: var(--primary-color);
  background: rgba(59, 130, 246, 0.1);
  transform: translateX(5px);
}

.rank-badge {
  font-weight: 800;
  font-size: 1.1rem;
  min-width: 65px;
  text-align: center;
  flex-shrink: 0;
}

.rank-1 .rank-badge { color: #fbbf24; }
.rank-2 .rank-badge { color: #94a3b8; }
.rank-3 .rank-badge { color: #b45309; }
.rank-other .rank-badge { color: var(--text-muted); font-size: 0.95rem; }

.genre-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.genre-name {
  font-weight: 700;
  color: var(--text-main);
  font-size: 1rem;
}

.genre-reason {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.loader-small {
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

.search-section {
  display: flex;
  width: 100%;
  max-width: 600px;
  gap: 10px;
  margin-bottom: 40px;
}

#keyword-input {
  flex: 1;
  padding: 15px 20px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 1rem;
  backdrop-filter: var(--glass-backdrop);
  transition: all 0.3s ease;
}

#keyword-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

#generate-btn {
  padding: 15px 30px;
  border-radius: 50px;
  border: none;
  background: linear-gradient(135deg, var(--primary-color), #2dd4bf);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.4);
}

#generate-btn:active {
  transform: translateY(0);
}

.loader {
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 20px auto;
}

.hidden {
  display: none !important;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  width: 100%;
}

.idea-card {
  background: var(--card-bg);
  backdrop-filter: var(--glass-backdrop);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.3s ease, border-color 0.3s ease;
  animation: slideUp 0.5s ease backwards;
}

.idea-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.idea-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.badge {
  display: inline-block;
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-color);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 15px;
}

.card-section {
  margin-bottom: 12px;
}

.card-section h4 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.card-section p {
  font-size: 0.95rem;
  line-height: 1.5;
}

.upsell {
  margin-top: 15px;
  padding: 12px;
  background: rgba(245, 158, 11, 0.1);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
}

.upsell h4 {
  color: #fbbf24;
}

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