/* ==============================================================================
   Rossaland - Core Game Portal Stylesheet
   ============================================================================== */

@import url("./variables.css");
@import url("./animations.css");

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-main);
}

body {
  font-family: var(--font-family-en);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% -20%, #1e1b4b 0%, var(--bg-primary) 65%);
  -webkit-font-smoothing: antialiased;
}

body.lang-fa {
  font-family: var(--font-family-fa);
  direction: rtl;
  text-align: right;
}

/* Typography & Helpers */
a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

.container {
  width: 100%;
  max-width: var(--container-max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-cyan-glow) 0%, var(--accent-purple) 50%, var(--accent-gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

/* ==============================================================================
   Navbar
   ============================================================================== */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(9, 8, 24, 0.75);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 0;
  transition: all var(--transition-normal);
}

.nav-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: 0.5px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.5));
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.nav-links a:hover {
  color: var(--text-main);
  background: var(--bg-glass);
}

.nav-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition-fast);
}

.icon-btn:hover {
  color: var(--text-main);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

.lang-switch {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.lang-switch:hover {
  border-color: var(--accent-purple);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #0088cc 0%, #06b6d4 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.72rem 1.45rem;
  border-radius: var(--radius-full);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28), 0 4px 18px rgba(0, 136, 204, 0.42);
  transition: all var(--transition-spring);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 26px rgba(0, 136, 204, 0.62);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 8px rgba(0, 136, 204, 0.35);
}

/* ==============================================================================
   Hero Section
   ============================================================================== */
.hero-section {
  position: relative;
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
  gap: 3rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.4);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-cyan-glow);
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.2rem;
  line-height: 1.15;
  font-weight: 900;
  margin-bottom: 1.25rem;
  letter-spacing: -1px;
}

body.lang-fa .hero-title {
  font-size: 2.8rem;
  letter-spacing: normal;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
  max-width: 540px;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.72rem 1.45rem;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), var(--shadow-sm);
  transition: all var(--transition-spring);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(34, 211, 238, 0.25);
}

.btn-secondary:active {
  transform: translateY(1px) scale(0.97);
}

.hero-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.stat-item h4 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent-cyan);
}

.stat-item p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-island-img {
  width: 100%;
  max-width: 480px;
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.6));
}

.hero-mascot-badge {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 130px;
  filter: drop-shadow(0 10px 20px rgba(124, 58, 237, 0.4));
}

body.lang-fa .hero-mascot-badge {
  right: auto;
  left: 20px;
}

/* ==============================================================================
   Interactive World Canvas Section
   ============================================================================== */
.canvas-section {
  padding: 4rem 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 3rem;
}

.section-tag {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-cyan);
  letter-spacing: 1.5px;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: 2.4rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.canvas-card {
  position: relative;
  background: #060515;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 58, 237, 0.15);
}

#world-canvas {
  width: 100%;
  height: 480px;
  display: block;
  cursor: crosshair;
}

.canvas-overlay-ui {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
}

.canvas-tip {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--accent-cyan-glow);
  border: 1px solid rgba(56, 189, 248, 0.3);
  pointer-events: auto;
}

.canvas-energy-pill {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-gold);
}

/* ==============================================================================
   Telegram Mini-App Simulator Section
   ============================================================================== */
.simulator-section {
  padding: 4rem 0;
}

.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 3.5rem;
}

.phone-mockup {
  width: 320px;
  height: 600px;
  margin: 0 auto;
  background: #0f111a;
  border: 10px solid #232738;
  border-radius: 42px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 136, 204, 0.25);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-notch {
  width: 120px;
  height: 18px;
  background: #232738;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  z-index: 10;
}

.phone-header {
  background: #17212b;
  padding: 1.6rem 1rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.phone-close-icon {
  font-size: 0.75rem;
  color: #82868a;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.phone-close-icon:hover {
  color: #ffffff;
}

.tg-app-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tg-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
}

.phone-body {
  flex: 1;
  background: linear-gradient(180deg, #101226 0%, #171836 100%);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  position: relative;
  user-select: none;
}

.sim-player-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}

.sim-combo-badge {
  color: #38bdf8;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.sim-combo-badge.combo-active {
  color: #facc15;
  text-shadow: 0 0 10px rgba(250, 204, 21, 0.65);
  animation: glowPulse 1.2s ease-in-out infinite;
}

.sim-coin-display {
  margin: 1rem 0 0.5rem;
}

.sim-coin-val {
  font-size: 2.3rem;
  font-weight: 900;
  color: var(--accent-gold);
  letter-spacing: -0.5px;
  text-shadow: 0 0 18px rgba(245, 158, 11, 0.4);
}

.sim-coin-label {
  font-size: 0.72rem;
  letter-spacing: 0.8px;
  font-weight: 700;
  color: var(--text-muted);
}

.sim-tap-island {
  position: relative;
  margin: 0 auto;
  width: 175px;
  height: 175px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(147, 51, 234, 0.35) 0%, rgba(6, 182, 212, 0.12) 50%, rgba(6, 182, 212, 0) 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.1s var(--transition-spring);
  box-shadow: 0 0 25px rgba(147, 51, 234, 0.2);
}

.sim-tap-island:hover {
  transform: scale(1.03);
}

.sim-tap-island:active,
.sim-tap-island.tap-squish-anim {
  animation: tapSquish 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.sim-island-img {
  width: 135px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.65));
  pointer-events: none;
}

.sim-tap-hint {
  font-size: 0.75rem;
  color: #94a3b8;
  letter-spacing: 0.3px;
  opacity: 0.85;
}

.sim-energy-container {
  margin-top: 1rem;
}

.sim-energy-text {
  font-size: 0.75rem;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
  font-weight: 600;
}

.sim-energy-progress {
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.sim-energy-fill {
  height: 100%;
  width: 85%;
  background: linear-gradient(90deg, #06b6d4, #10b981, #facc15);
  background-size: 200% 100%;
  border-radius: 4px;
  transition: width 0.25s ease;
  animation: energyBarGleam 4s linear infinite;
}

/* Feature Stack on Simulator Right Side */
.sim-feature-stack {
  margin: 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.sim-feature-card {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  padding: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-md);
  backdrop-filter: blur(12px);
  transition: all var(--transition-normal);
}

.sim-feature-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(34, 211, 238, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.sim-feature-icon {
  padding: 0.65rem;
  border-radius: 10px;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sim-feature-icon.icon-cyan {
  background: rgba(6, 182, 212, 0.16);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
}

.sim-feature-icon.icon-purple {
  background: rgba(147, 51, 234, 0.16);
  color: #c084fc;
  border: 1px solid rgba(147, 51, 234, 0.3);
  box-shadow: 0 0 16px rgba(147, 51, 234, 0.25);
}

.sim-feature-text h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.sim-feature-text p {
  color: var(--text-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Floating Click Tokens with Arc Motion */
.floating-click-token {
  position: absolute;
  color: #22d3ee;
  font-weight: 800;
  font-size: 1.15rem;
  pointer-events: none;
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.8);
  animation: floatDamageArc 0.85s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.floating-crit-token {
  position: absolute;
  color: #fbbf24;
  font-weight: 900;
  font-size: 1.35rem;
  pointer-events: none;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.95);
  animation: floatCritArc 0.95s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==============================================================================
   Realms / Lands Grid
   ============================================================================== */
.realms-section {
  padding: 4rem 0;
}

.realms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.realm-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), var(--shadow-sm);
}

.realm-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent-purple));
  opacity: 0.9;
  box-shadow: 0 0 12px var(--card-accent, var(--accent-purple));
}

.realm-card:hover {
  transform: translateY(-6px);
  border-color: var(--card-accent, var(--border-glow));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(147, 51, 234, 0.25);
}

.realm-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.realm-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.realm-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* ==============================================================================
   Features & Roadmap Sections
   ============================================================================== */
.features-section, .roadmap-section, .faq-section {
  padding: 4rem 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.feature-box {
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  transition: all var(--transition-fast);
}

.feature-box:hover {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.06);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.roadmap-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.roadmap-step {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.roadmap-quarter {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-cyan);
  margin-bottom: 0.5rem;
}

.roadmap-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.roadmap-points {
  list-style: none;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.roadmap-points li {
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.roadmap-points li::before {
  content: "•";
  color: var(--accent-purple);
  font-weight: bold;
}

/* ==============================================================================
   FAQ & Footer
   ============================================================================== */
.faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  padding: 1.25rem 1.5rem;
}

.faq-q {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.faq-a {
  font-size: 0.95rem;
  color: var(--text-muted);
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 5, 17, 0.95);
  padding: 3rem 0;
  margin-top: 4rem;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-copy {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.footer-links a:hover {
  color: var(--accent-cyan);
}

/* ==============================================================================
   Responsive Queries
   ============================================================================== */
@media (max-width: 900px) {
  .hero-grid, .sim-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
  .nav-links {
    display: none;
  }
  .hero-title {
    font-size: 2.4rem;
  }
}
