/* ============================
   TENGチャンネル — Design System
   ============================ */

:root {
  /* Colors */
  --bg-primary: #0c0c14;
  --bg-secondary: #13131f;
  --bg-card: #1a1a2e;
  --bg-card-hover: #222240;
  --bg-glass: rgba(26, 26, 46, 0.7);

  --text-primary: #f0f0f5;
  --text-secondary: #9393b0;
  --text-muted: #5e5e7a;

  --accent: #ff4d4d;
  --accent-glow: rgba(255, 77, 77, 0.4);
  --accent-gradient: linear-gradient(135deg, #ff4d4d, #ff8a3d);
  --accent-2: #ff8a3d;
  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;

  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);

  /* Typography */
  --font-jp: 'Noto Sans JP', sans-serif;
  --font-en: 'Outfit', sans-serif;

  /* Spacing */
  --container-width: 1200px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Shadows */
  --shadow-card: 0 4px 30px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 40px var(--accent-glow);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-jp);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================
   Header
   ============================ */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(12, 12, 20, 0.8);
  border-bottom: 1px solid var(--border);
  transition: all 0.3s ease;
}

.header.scrolled {
  background: rgba(12, 12, 20, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

.header-inner {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 32px;
  animation: float 3s ease-in-out infinite;
}

.logo-text {
  font-family: var(--font-en);
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.logo-accent {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 16px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 1px;
}

.btn-post {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 50px;
  font-family: var(--font-jp);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-post:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ============================
   Hero
   ============================ */

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 120px 24px 80px;
  max-width: var(--container-width);
  margin: 0 auto;
  position: relative;
  gap: 60px;
}

.hero-bg-shapes {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}

.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
}

.shape-1 {
  width: 600px;
  height: 600px;
  background: var(--accent);
  top: -200px;
  right: -100px;
  animation: pulse 8s ease-in-out infinite;
}

.shape-2 {
  width: 400px;
  height: 400px;
  background: #6C63FF;
  bottom: 20%;
  left: -100px;
  animation: pulse 10s ease-in-out infinite reverse;
}

.shape-3 {
  width: 300px;
  height: 300px;
  background: var(--accent-2);
  top: 40%;
  right: 20%;
  animation: pulse 12s ease-in-out infinite;
}

.hero-content {
  flex: 1;
  z-index: 1;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 77, 77, 0.15);
  border: 1px solid rgba(255, 77, 77, 0.3);
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 28px;
  animation: fadeInUp 0.8s ease;
}

.hero-title {
  font-size: 72px;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-title-line {
  display: block;
}

.hero-title-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 40px;
  line-height: 1.8;
  animation: fadeInUp 0.8s ease 0.4s both;
}

.hero-stats {
  display: flex;
  gap: 48px;
  margin-bottom: 48px;
  animation: fadeInUp 0.8s ease 0.6s both;
}

.stat {
  display: flex;
  flex-direction: column;
}

.stat-number {
  font-family: var(--font-en);
  font-size: 36px;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 18px 40px;
  border-radius: 60px;
  font-family: var(--font-jp);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.4s;
  animation: fadeInUp 0.8s ease 0.8s both;
}

.btn-cta:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: var(--shadow-glow);
}

.btn-cta-arrow {
  font-size: 20px;
  transition: transform 0.3s;
}

.btn-cta:hover .btn-cta-arrow {
  transform: translateX(5px);
}

/* Hero Visual — Floating Cards */
.hero-visual {
  flex: 1;
  position: relative;
  min-height: 500px;
  z-index: 1;
}

.floating-card {
  position: absolute;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  width: 260px;
  box-shadow: var(--shadow-card);
  animation: floatCard 6s ease-in-out infinite;
}

.floating-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.floating-card p {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.card-1 {
  top: 0;
  right: 20px;
  animation-delay: 0s;
}

.card-2 {
  top: 180px;
  right: 180px;
  animation-delay: -2s;
}

.card-3 {
  top: 340px;
  right: 40px;
  animation-delay: -4s;
}

/* ============================
   Feed Section
   ============================ */

.feed-section {
  padding: 100px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
}

.section-title {
  font-size: 32px;
  font-weight: 900;
}

.section-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  margin-top: 8px;
}

.feed-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 4px;
  border-radius: 50px;
}

.feed-tab {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 20px;
  border-radius: 50px;
  font-family: var(--font-jp);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.feed-tab.active {
  background: var(--accent-gradient);
  color: white;
}

.feed-tab:hover:not(.active) {
  color: var(--text-primary);
}

.feed-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
}

/* Post Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all 0.4s;
  animation: fadeInUp 0.6s ease both;
}

.post-card:nth-child(2) { animation-delay: 0.1s; }
.post-card:nth-child(3) { animation-delay: 0.2s; }
.post-card:nth-child(4) { animation-delay: 0.3s; }
.post-card:nth-child(5) { animation-delay: 0.4s; }
.post-card:nth-child(6) { animation-delay: 0.5s; }

.post-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.post-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.post-user-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-username {
  font-size: 15px;
  font-weight: 700;
}

.post-handle {
  font-size: 12px;
  color: var(--text-muted);
}

.post-time {
  font-size: 12px;
  color: var(--text-muted);
}

.post-image-wrap {
  position: relative;
  margin-bottom: 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
}

.post-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s;
}

.post-card:hover .post-image {
  transform: scale(1.03);
}

.tengu-level {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 14px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.tengu-level-5 {
  background: rgba(255, 77, 77, 0.8);
  color: white;
  box-shadow: 0 0 20px rgba(255, 77, 77, 0.5);
}

.tengu-level-4 {
  background: rgba(255, 138, 61, 0.8);
  color: white;
}

.tengu-level-3 {
  background: rgba(108, 99, 255, 0.8);
  color: white;
}

.post-body {
  margin-bottom: 16px;
}

.post-text {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.6;
  margin-bottom: 12px;
}

.post-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 12px;
  color: var(--accent);
  background: rgba(255, 77, 77, 0.1);
  padding: 4px 12px;
  border-radius: 50px;
  cursor: pointer;
  transition: background 0.3s;
}

.tag:hover {
  background: rgba(255, 77, 77, 0.2);
}

.post-actions {
  display: flex;
  gap: 4px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-jp);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.action-btn.liked {
  color: var(--accent);
}

.action-btn.liked .action-icon {
  animation: pop 0.3s ease;
}

.action-icon {
  font-size: 16px;
}

.bookmark-btn {
  margin-left: auto;
}

/* ============================
   Ranking Section
   ============================ */

.ranking-section {
  padding: 100px 0;
  background: var(--bg-secondary);
}

.ranking-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-top: 48px;
}

.ranking-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  position: relative;
  transition: all 0.4s;
}

.ranking-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-card);
}

.rank-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 16px;
  font-weight: 900;
  color: #0c0c14;
}

.rank-1 {
  border-color: rgba(255, 215, 0, 0.3);
  background: linear-gradient(180deg, rgba(255, 215, 0, 0.08), var(--bg-card));
}
.rank-1 .rank-badge { background: var(--gold); }

.rank-2 {
  border-color: rgba(192, 192, 192, 0.3);
}
.rank-2 .rank-badge { background: var(--silver); }

.rank-3 {
  border-color: rgba(205, 127, 50, 0.3);
}
.rank-3 .rank-badge { background: var(--bronze); }

.rank-4 .rank-badge,
.rank-5 .rank-badge {
  background: var(--text-muted);
}

.ranking-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
  border: 3px solid var(--border);
}

.rank-1 .ranking-avatar { border-color: var(--gold); }
.rank-2 .ranking-avatar { border-color: var(--silver); }
.rank-3 .ranking-avatar { border-color: var(--bronze); }

.ranking-name {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ranking-score {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.ranking-title {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 50px;
  background: rgba(255, 77, 77, 0.15);
  color: var(--accent);
}

/* ============================
   About Section
   ============================ */

.about-section {
  padding: 100px 0;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  transition: all 0.4s;
}

.about-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-6px);
  box-shadow: var(--shadow-card);
}

.about-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.about-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 12px;
}

.about-card p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================
   Modal
   ============================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.3s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.modal-body {
  padding: 28px;
}

.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  margin-bottom: 20px;
}

.upload-area:hover {
  border-color: var(--accent);
  background: rgba(255, 77, 77, 0.05);
}

.upload-icon {
  font-size: 40px;
  display: block;
  margin-bottom: 12px;
}

.upload-area p {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.upload-area small {
  font-size: 12px;
  color: var(--text-muted);
}

.modal-textarea {
  width: 100%;
  min-height: 120px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  color: var(--text-primary);
  font-family: var(--font-jp);
  font-size: 15px;
  resize: vertical;
  margin-bottom: 16px;
  transition: border-color 0.3s;
}

.modal-textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.modal-textarea::placeholder {
  color: var(--text-muted);
}

.modal-tags-input {
  margin-bottom: 20px;
}

.tag-input {
  width: 100%;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: var(--font-jp);
  font-size: 14px;
  transition: border-color 0.3s;
}

.tag-input:focus {
  outline: none;
  border-color: var(--accent);
}

.tag-input::placeholder {
  color: var(--text-muted);
}

.tengu-meter {
  display: flex;
  align-items: center;
  gap: 12px;
}

.meter-label {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.meter-bar {
  flex: 1;
  height: 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  width: 0;
  background: var(--accent-gradient);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.meter-level {
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  min-width: 40px;
}

.modal-footer {
  padding: 0 28px 28px;
}

.btn-submit {
  width: 100%;
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 16px;
  border-radius: 60px;
  font-family: var(--font-jp);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ============================
   Footer
   ============================ */

.footer {
  border-top: 1px solid var(--border);
  padding: 60px 0;
}

.footer-inner {
  text-align: center;
}

.footer-brand {
  margin-bottom: 24px;
}

.footer-brand .logo-icon {
  font-size: 36px;
}

.footer-brand .logo-text {
  font-size: 20px;
}

.footer-tagline {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 8px;
}

.footer-disclaimer {
  color: var(--accent);
  font-size: 13px;
  margin-top: 12px;
  padding: 8px 20px;
  background: rgba(255, 77, 77, 0.1);
  border: 1px solid rgba(255, 77, 77, 0.2);
  border-radius: 50px;
  display: inline-block;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-bottom: 24px;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-copy {
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================
   Animations
   ============================ */

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes floatCard {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-10px) rotate(1deg); }
  66% { transform: translateY(5px) rotate(-1deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.15; transform: scale(1); }
  50% { opacity: 0.25; transform: scale(1.1); }
}

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

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ============================
   Responsive
   ============================ */

@media (max-width: 1024px) {
  .hero {
    flex-direction: column;
    text-align: center;
    min-height: auto;
    padding-top: 120px;
  }

  .hero-visual {
    min-height: 400px;
    width: 100%;
  }

  .hero-stats {
    justify-content: center;
  }

  .floating-card {
    width: 220px;
  }

  .card-1 { right: 10%; }
  .card-2 { right: 40%; }
  .card-3 { right: 15%; }

  .ranking-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .about-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 48px;
  }

  .nav {
    display: none;
  }

  .feed-grid {
    grid-template-columns: 1fr;
  }

  .ranking-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    gap: 16px;
  }

  .hero-visual {
    display: none;
  }

  .modal {
    width: 95%;
    margin: 0 10px;
  }
}
