:root {
  --bg-dark: #0a0a0f;
  --bg-darker: #060609;
  --bg-card: #0e0b06;
  --bg-input: #1a1510;
  --gold: #e2b766;
  --gold-dark: #c9a050;
  --gold-glow: rgba(226, 183, 102, 0.3);
  --text: #d4d4d4;
  --text-muted: #888;
  --text-bright: #f0e6d2;
  --border: #222;
  --border-gold: rgba(226, 183, 102, 0.2);
}

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

@font-face {
  font-family: "InitiumTitle";
  src: url("/FRIZQUAD.TTF");
  font-display: swap;
}

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--gold-dark); }

/* ===== Hero Section ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-video-bg iframe {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: 177.78vh;
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse at center, rgba(10,10,15,0.75) 0%, rgba(10,10,15,0.9) 60%, rgba(10,10,15,0.98) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 600px;
  width: 90%;
  padding: 20px;
}

.hero-logo {
  max-width: 400px;
  width: 80%;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 30px var(--gold-glow));
  animation: logoPulse 4s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { filter: drop-shadow(0 0 20px var(--gold-glow)); }
  50% { filter: drop-shadow(0 0 40px var(--gold-glow)) drop-shadow(0 0 60px rgba(226,183,102,0.15)); }
}

.hero-tagline {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}

/* ===== Top Bar ===== */
.top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: linear-gradient(to bottom, rgba(14,11,6,0.9) 0%, transparent 100%);
}

.top-bar-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

.top-bar-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.2s;
}

.top-bar-links a:hover { color: var(--gold); }

.top-bar-social {
  display: flex;
  gap: 10px;
  align-items: center;
}

.top-bar-social img {
  height: 24px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.top-bar-social img:hover { opacity: 1; }

/* ===== Auth Box ===== */
.auth-box {
  background: rgba(14, 11, 6, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 28px 24px;
  backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}

.auth-box .pane { display: none; }
.auth-box .pane.active { display: block; }

.auth-switch {
  text-align: right;
  margin-bottom: 12px;
}

.auth-switch a {
  font-size: 0.85rem;
  color: var(--gold);
  font-weight: 600;
  cursor: pointer;
}

.auth-input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: var(--bg-input);
  border: 1px solid #333;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus { border-color: var(--gold); }
.auth-input::placeholder { color: #666; }

.auth-submit {
  display: block;
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  background: var(--gold);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}

.auth-submit:hover { background: var(--gold-dark); color: var(--bg-dark); }
.auth-submit:active { transform: scale(0.98); }

.auth-divider {
  text-align: center;
  color: #666;
  margin: 14px 0;
  font-size: 0.8rem;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #333;
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-oauth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.auth-oauth img { height: 36px; vertical-align: middle; }

.auth-footer {
  text-align: center;
  margin-top: 12px;
}

.auth-footer a {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-footer a:hover { color: var(--gold); }

.auth-logged-in {
  text-align: center;
  padding: 12px 0;
}

.auth-logged-in a {
  display: inline-block;
  padding: 12px 32px;
  background: var(--gold);
  color: var(--bg-dark);
  border-radius: 6px;
  font-weight: 700;
  font-size: 1rem;
}

.auth-logged-in a:hover { background: var(--gold-dark); color: var(--bg-dark); }

.auth-warning {
  background: rgba(200, 50, 50, 0.15);
  border: 1px solid rgba(200, 50, 50, 0.3);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 0.8rem;
  margin-top: 8px;
  color: #e88;
}

.auth-warning a { color: #faa; }

/* reCAPTCHA scaling */
.recaptcha-wrap {
  transform: scale(0.82);
  transform-origin: center;
  margin: 8px 0 4px;
}

/* ===== Scroll Indicator ===== */
.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  animation: bounce 2s infinite;
  cursor: pointer;
}

.scroll-indicator svg {
  width: 28px;
  height: 28px;
  stroke: var(--gold);
  opacity: 0.6;
}

@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(10px); }
}

/* ===== Sections ===== */
.section {
  position: relative;
  padding: 80px 24px;
  overflow: hidden;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  font-family: "InitiumTitle", serif;
  font-size: 2.2rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 48px;
  text-shadow: 0 2px 12px var(--gold-glow);
}

/* ===== Gameplay Showcase ===== */
.showcase {
  background: var(--bg-darker);
}

.showcase-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("/images/banner---castle1.jpg") center center / cover no-repeat;
  background: url("/images/banner---castle1.webp") center center / cover no-repeat;
  opacity: 0.15;
}

.showcase .section-inner { position: relative; z-index: 2; }

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.showcase-card {
  background: rgba(14, 11, 6, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px 20px;
  text-align: center;
  transition: border-color 0.3s, transform 0.3s;
  backdrop-filter: blur(4px);
}

.showcase-card:hover {
  border-color: var(--gold);
  transform: translateY(-4px);
}

.showcase-card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.showcase-card h3 {
  font-family: "InitiumTitle", serif;
  color: var(--text-bright);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.showcase-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ===== Demo Videos ===== */
.demos {
  background: var(--bg-dark);
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-top: 32px;
}

.demo-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}

.demo-item video,
.demo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.demo-item iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.demo-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  transition: opacity 0.3s, transform 0.3s;
}

.demo-play svg {
  width: 68px;
  height: 48px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.demo-item:hover .demo-play svg {
  filter: drop-shadow(0 2px 12px rgba(0,0,0,0.8));
}

.demo-item:hover .demo-play svg path:first-child {
  fill: rgba(226, 183, 102, 0.9);
}

.demo-item.playing .demo-play { display: none; }

.demo-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  font-family: "InitiumTitle", serif;
  color: var(--text-bright);
  font-size: 0.95rem;
  z-index: 1;
  transition: opacity 0.3s;
}

.demo-item.playing .demo-label { opacity: 0; }

.demo-gif-row {
  position: relative;
  margin-top: 32px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.demo-gif {
  width: 100%;
  display: block;
}

/* ===== Features Section ===== */
.features {
  background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
  position: relative;
}

.features-bg {
  position: absolute;
  inset: 0;
  background: url("/images/banner---grassy-plains-river1.jpg") center center / cover no-repeat;
  background: url("/images/banner---grassy-plains-river1.webp") center center / cover no-repeat;
  opacity: 0.08;
}

.features .section-inner { position: relative; z-index: 1; }

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.feature-card {
  padding: 24px;
  border-left: 3px solid var(--gold);
  background: rgba(14, 11, 6, 0.6);
  border-radius: 0 8px 8px 0;
}

.feature-card h3 {
  font-family: "InitiumTitle", serif;
  color: var(--gold);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ===== Testimonials ===== */
.testimonials {
  background: var(--bg-card);
}

.testimonial-track-container {
  overflow: hidden;
  position: relative;
  margin-top: 32px;
}

.testimonial-track-container::before,
.testimonial-track-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  z-index: 1;
  pointer-events: none;
}

.testimonial-track-container::before {
  left: 0;
  background: linear-gradient(to right, var(--bg-card), transparent);
}

.testimonial-track-container::after {
  right: 0;
  background: linear-gradient(to left, var(--bg-card), transparent);
}

.testimonial-track {
  display: flex;
  gap: 20px;
  animation: scrollTestimonials 60s linear infinite;
  width: max-content;
}

.testimonial-track:hover { animation-play-state: paused; }

@keyframes scrollTestimonials {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.testimonial-card {
  flex-shrink: 0;
  width: 300px;
  background: rgba(21, 18, 24, 0.8);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
}

.testimonial-card blockquote {
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.5;
  font-style: italic;
  margin-bottom: 12px;
}

.testimonial-card cite {
  font-size: 0.8rem;
  color: var(--gold);
  font-style: normal;
}

/* ===== Newsletter Section ===== */
.newsletter {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(180deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.newsletter-subtitle {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 500px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.newsletter-form {
  display: flex;
  gap: 0;
  max-width: 440px;
  margin: 0 auto;
}

.newsletter-input {
  flex: 1;
  padding: 14px 18px;
  background: rgba(14, 11, 6, 0.85);
  border: 1px solid rgba(226, 183, 102, 0.25);
  border-right: none;
  border-radius: 6px 0 0 6px;
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.newsletter-input:focus {
  border-color: var(--gold);
}

.newsletter-submit {
  padding: 14px 24px;
  background: var(--gold);
  color: var(--bg-dark);
  border: none;
  border-radius: 0 6px 6px 0;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.newsletter-submit:hover {
  background: var(--gold-dark);
}

.newsletter-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.newsletter-status {
  margin-top: 16px;
  font-size: 0.9rem;
  min-height: 1.4em;
}

.newsletter-status.success { color: #4ade80; }
.newsletter-status.error { color: #f87171; }

/* ===== CTA Section ===== */
.cta {
  text-align: center;
  padding: 100px 24px;
  position: relative;
}

.cta-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(14,11,6,0.95) 0%, rgba(26,15,32,0.9) 50%, rgba(14,11,6,0.95) 100%);
}

.cta .section-inner { position: relative; z-index: 1; }

.cta-description {
  max-width: 650px;
  margin: 0 auto 40px;
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
}

.cta-button {
  display: inline-block;
  padding: 16px 48px;
  background: var(--gold);
  color: var(--bg-dark);
  border-radius: 8px;
  font-family: "InitiumTitle", serif;
  font-size: 1.3rem;
  font-weight: 700;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 20px var(--gold-glow);
}

.cta-button:hover {
  background: var(--gold-dark);
  color: var(--bg-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--gold-glow);
}

.cta-stores {
  margin-top: 24px;
}

.cta-stores img {
  max-width: 150px;
}

/* ===== Footer ===== */
.landing-new-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 24px;
  text-align: center;
}

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

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}

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

.footer-classic {
  font-size: 0.75rem;
  color: #555;
  margin-top: 8px;
}

/* ===== Animations ===== */
.fade-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Popup Messages ===== */
.popupWrapperBackground {
  position: fixed;
  inset: 0;
  z-index: 15000000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.popupWrapper {
  display: contents;
}

.popup {
  background: rgba(14, 11, 6, 0.92);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  max-width: 380px;
  width: 88%;
  padding: 32px 28px 24px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), 0 0 1px rgba(226, 183, 102, 0.2);
  backdrop-filter: blur(16px);
  position: static;
  height: auto;
  margin: 0;
}

.popup_header {
  font-family: "InitiumTitle", serif;
  color: var(--gold);
  font-size: 1.05rem;
  text-align: center;
  margin-bottom: 12px;
  width: auto;
  height: auto;
  padding: 0;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 8px var(--gold-glow);
}

.popup_body {
  width: auto;
  min-height: auto;
}

.popup_text {
  width: auto;
  height: auto;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
  text-align: center;
}

.popup_footer {
  text-align: center;
  margin-top: 20px;
}

.popup_message_okay {
  display: inline-block;
  padding: 8px 28px;
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.popup_message_okay:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-dark);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .hero-logo { max-width: 280px; }
  .hero-tagline { font-size: 0.95rem; }
  .auth-box { padding: 20px 16px; }
  .section { padding: 60px 16px; }
  .section-title { font-size: 1.7rem; margin-bottom: 32px; }
  .top-bar { padding: 8px 12px; }
  .top-bar-links { gap: 10px; }
  .top-bar-links a { font-size: 0.75rem; }
  .top-bar-social img { height: 40px; }
  .demo-grid { grid-template-columns: 1fr; }
  .showcase-card { padding: 20px 16px; }
  .testimonial-card { width: 260px; }
  .newsletter-form { flex-direction: column; gap: 10px; }
  .newsletter-input { border-right: 1px solid rgba(226, 183, 102, 0.25); border-radius: 6px; }
  .newsletter-submit { border-radius: 6px; }
  .cta-button { padding: 14px 36px; font-size: 1.1rem; }
}

@media (max-width: 480px) {
  .hero-logo { max-width: 220px; }
  .auth-box { margin: 0 8px; }
  .top-bar-social { gap: 6px; }
  .top-bar-social img { height: 36px; }
  .showcase-grid { grid-template-columns: 1fr; }
}

/* ===== Utility ===== */
.hidden-submit { display: none; }
.g-recaptcha { margin: 0 auto; }
