/* ============================================================
   SYRVINA - Luxury Voting Theme
   Based on tp.syrvina.cc design
   ============================================================ */

:root {
  --bg: #faf6f0;
  --bg-card: #ffffff;
  --text: #3d2b1f;
  --text-secondary: #8b7355;
  --text-light: #b8a088;
  --brown: #8b5e3c;
  --brown-dark: #6d4828;
  --brown-light: #a67c52;
  --gold: #c9a96e;
  --gold-light: #e8d5a8;
  --gold-pale: #f5e6c8;
  --border: #f0e6d6;
  --border-light: #f5ede0;
  --shadow: 0 2px 12px rgba(139, 94, 60, 0.08);
  --shadow-hover: 0 8px 24px rgba(139, 94, 60, 0.15);
  --radius: 16px;
  --radius-sm: 10px;
  --font-serif: 'Playfair Display', 'Noto Serif SC', Georgia, serif;
  --font-sans: 'Noto Sans', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   Header
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 246, 240, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 500;
  color: var(--brown);
  letter-spacing: 0.5px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.share-btn {
  padding: 8px 20px;
  border: 1px solid var(--brown);
  border-radius: 100px;
  font-size: 13px;
  color: var(--brown);
  background: transparent;
  transition: all 0.2s;
  white-space: nowrap;
}

.share-btn:hover {
  background: var(--brown);
  color: #fff;
}

/* Language Dropdown */
.lang-dropdown {
  position: relative;
}

.lang-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  background: var(--bg-card);
  transition: all 0.2s;
}

.lang-toggle:hover {
  border-color: var(--brown);
  color: var(--brown);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: all 0.2s;
  z-index: 200;
  overflow: hidden;
}

.lang-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.lang-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  transition: background 0.15s;
}

.lang-option:hover {
  background: var(--gold-pale);
}

.lang-option.active {
  color: var(--brown);
  font-weight: 600;
  background: var(--gold-pale);
}

/* ============================================================
   Hero
   ============================================================ */

.hero {
  width: 100%;
}

.hero-bg {
  position: relative;
  width: 100%;
  min-height: 520px;
  background: linear-gradient(135deg, #f5e6d0 0%, #e8d5b8 30%, #d4b896 60%, #c9a96e 100%);
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 50%, rgba(255,255,255,0.3) 0%, transparent 60%),
    radial-gradient(ellipse at 70% 30%, rgba(201,169,110,0.2) 0%, transparent 50%);
  pointer-events: none;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(250,246,240,0.85) 0%, rgba(250,246,240,0.4) 50%, transparent 100%);
}

.hero-content {
  position: relative;
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 16px;
  max-width: 600px;
}

.hero-subtitle {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-stats {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius);
  padding: 16px 22px;
  width: fit-content;
  max-width: 100%;
  box-shadow: 0 4px 20px rgba(139, 94, 60, 0.08);
  border: 1px solid rgba(255,255,255,0.5);
}

.hero-stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-light);
}

.hero-stat:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hero-stat:first-child {
  padding-top: 0;
}

.hero-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--gold-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  flex-shrink: 0;
}

.hero-stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.hero-stat-value {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

/* Hero Vote Button */
.hero-vote-btn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin-top: 22px;
  padding: 14px 36px;
  background: linear-gradient(135deg, #a67b5b, #8b5e3c);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(139, 94, 60, 0.35);
  transition: all 0.3s;
  letter-spacing: 1px;
}
.hero-vote-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(139, 94, 60, 0.45);
  background: linear-gradient(135deg, #b8896a, #9a6b4a);
}
.hero-vote-btn svg { flex-shrink: 0; }

/* ============================================================
   Main Content
   ============================================================ */

.main-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
}

.section-line {
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.section-deco {
  color: var(--gold);
  font-size: 0.7em;
}

/* ============================================================
   Voting Section
   ============================================================ */

.voting-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-top: -30px;
  position: relative;
  z-index: 10;
  box-shadow: var(--shadow);
  margin-bottom: 32px;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.product-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  margin-top: 22px;
}

.product-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
  border-color: var(--gold-light);
}

.product-card.disabled {
  opacity: 0.6;
}

/* Crown + Rank Badge */
.product-crown {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

.crown-svg {
  width: 48px;
  height: 40px;
  filter: drop-shadow(0 2px 6px rgba(201,169,110,0.5));
}

.rank-badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--brown-light));
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -14px;
  border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(139,94,60,0.3);
  position: relative;
  z-index: 1;
}

.rank-badge.top-1 { background: linear-gradient(135deg, #f5d061, #d4a017); }
.rank-badge.top-2 { background: linear-gradient(135deg, #d8d8d8, #a8a8a8); }
.rank-badge.top-3 { background: linear-gradient(135deg, #d4956a, #a06b4a); }

.product-image {
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.product-image img {
  width: 140%;
  height: 140%;
  object-fit: cover;
}

.no-image {
  color: var(--text-light);
  font-size: 13px;
}

.product-info {
  padding: 12px 16px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 40px;
}

.product-votes {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--brown);
}

.product-votes .unit {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: 2px;
}

.vote-btn {
  width: 100%;
  padding: 9px 0;
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: #fff;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  margin-top: 4px;
}

.vote-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brown-light), var(--brown));
  transform: scale(1.02);
}

.vote-btn:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

/* ============================================================
   Rules Section
   ============================================================ */

.rules-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 40px 32px;
  margin-bottom: 40px;
  box-shadow: var(--shadow);
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.rule-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  padding: 20px;
  position: relative;
}

.rule-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -12px;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border);
}

.rule-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--gold-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brown);
}

.rule-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ============================================================
   Footer
   ============================================================ */

/* Bottom Actions */
.bottom-actions {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 8px;
  display: flex;
  gap: 16px;
  justify-content: center;
}
.bottom-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 48px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border: 2px solid transparent;
  min-width: 200px;
}
.bottom-btn-primary {
  background: linear-gradient(135deg, #a67b5b, #8b5e3c);
  color: #fff;
  box-shadow: 0 6px 20px rgba(139, 94, 60, 0.3);
}
.bottom-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(139, 94, 60, 0.4);
}
.bottom-btn-outline {
  background: #fff;
  color: var(--brown);
  border-color: var(--gold);
}
.bottom-btn-outline:hover {
  background: var(--gold-pale);
  border-color: var(--brown);
}
.bottom-btn-shop {
  background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
  color: #fff;
  border-color: transparent;
}
.bottom-btn-shop:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
}

/* Brand Banner */
.brand-banner-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 24px;
  text-align: center;
}
.brand-banner-img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
  opacity: 0.85;
}

.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-light);
  font-size: 13px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   Buttons
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--brown), var(--brown-dark));
  color: #fff;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--brown-light), var(--brown));
}

.btn-outline {
  border: 1px solid var(--brown);
  color: var(--brown);
  background: transparent;
}

.btn-outline:hover {
  background: var(--brown);
  color: #fff;
}

.btn-shop-full {
  background: linear-gradient(135deg, #2c2c2c, #1a1a1a);
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-shop-full:hover {
  background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ============================================================
   Modal (Lottery)
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(61, 43, 31, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  transform: scale(0.9);
  transition: transform 0.3s;
}

.modal-overlay.show .modal-content {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  background: var(--gold-pale);
  color: var(--brown);
}

.modal-title {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 24px;
  color: var(--text);
}

/* Wheel */
.wheel-container {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto 24px;
}

.wheel-svg {
  width: 100%;
  height: 100%;
  transition: transform 4.5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 20px solid var(--brown-dark);
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--brown);
  box-shadow: 0 4px 12px rgba(139,94,60,0.3);
  z-index: 5;
}

.wheel-center .wheel-logo {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 6px;
}

.wheel-center .brand-text {
  font-family: var(--font-serif);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Lottery Result */
.lottery-result {
  display: none;
  text-align: center;
}

.lottery-result.show {
  display: block;
}

.result-prize-image {
  font-size: 64px;
  margin-bottom: 16px;
}

.result-prize-image img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin: 0 auto;
}

.result-prize-name {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 8px;
}

.result-message {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ============================================================
   Toast
   ============================================================ */

.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  padding: 12px 24px;
  border-radius: 100px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  animation: toastIn 0.3s ease;
}

.toast.success { background: #5a8f5a; }
.toast.error { background: #c05050; }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Spinner
   ============================================================ */

.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--brown);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 1024px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
    height: 56px;
  }

  .brand-name { font-size: 18px; }
  .brand-icon { width: 30px; height: 30px; }
  .share-btn { padding: 6px 14px; font-size: 12px; }
  .lang-toggle { width: 34px; height: 34px; }

  .hero-bg { min-height: 420px; }
  .hero-content { padding: 40px 16px; min-height: 420px; }
  .hero-title { font-size: 28px; }
  .hero-subtitle { font-size: 15px; margin-bottom: 24px; }

  .hero-stats {
    width: fit-content;
    max-width: 100%;
    padding: 14px 18px;
  }

  .hero-stat { padding: 10px 0; gap: 12px; }
  .hero-stat-icon { width: 36px; height: 36px; }
  .hero-stat-value { font-size: 20px; }
  .hero-stat-label { font-size: 12px; }

  .hero-vote-btn {
    padding: 12px 28px;
    font-size: 15px;
    margin-top: 18px;
  }

  .main-content { padding: 0 16px; }

  .voting-section {
    padding: 28px 16px;
    margin-top: -20px;
    border-radius: 12px;
  }

  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .crown-svg { width: 34px; height: 28px; }
  .rank-badge { width: 22px; height: 22px; font-size: 10px; }
  .product-crown { top: -14px; }
  .product-card { margin-top: 18px; }

  .product-info { padding: 8px; gap: 4px; }
  .product-name { font-size: 12px; min-height: 34px; }
  .product-votes { font-size: 15px; }
  .vote-btn { padding: 7px 0; font-size: 12px; }

  .rules-section { padding: 28px 16px; }
  .rules-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .rule-item:nth-child(2)::after { display: none; }
  .rule-item::after { display: none; }

  .rule-icon { width: 44px; height: 44px; }
  .rule-text { font-size: 12px; }

  .section-title { font-size: 20px; gap: 8px; }
  .section-line { max-width: 60px; }

  .modal-content { padding: 24px 20px; }
  .wheel-container { width: 260px; height: 260px; }

  .bottom-actions {
    flex-direction: column;
    padding: 24px 16px 8px;
    gap: 12px;
  }
  .bottom-btn {
    width: 100%;
    min-width: 0;
    padding: 14px 24px;
    font-size: 15px;
  }
}

@media (max-width: 480px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .product-name {
    font-size: 11px;
    -webkit-line-clamp: 1;
    min-height: auto;
  }

  .product-votes { font-size: 14px; }
  .product-votes .unit { display: none; }
  .vote-btn { padding: 6px 0; font-size: 11px; }
}

/* Banner slides inside hero (when banners exist) */
.hero-banner-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s;
  background-size: cover;
  background-position: center;
}

.hero-banner-slide.active {
  opacity: 1;
}
