:root {
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --bg-dark: #0a0a0c;
  --bg-panel: rgba(25, 25, 30, 0.6);
  --bg-panel-solid: #19191e;
  
  --accent-primary: #ff4500;
  --accent-hover: #ff6a00;
  --accent-gradient: linear-gradient(135deg, #ff4500 0%, #ff8c00 100%);
  
  --text-main: #ffffff;
  --text-muted: #a1a1aa;
  --border-color: rgba(255, 255, 255, 0.1);
  
  --radius-lg: 16px;
  --radius-md: 8px;
  --radius-sm: 4px;
  
  --transition: all 0.3s ease;
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-dark);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

/* Typography */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; }
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* =========================================
   MOBILE (BASE) STYLES
   ========================================= */

/* Hero Section */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 15px 40px;
  background: radial-gradient(circle at top, var(--bg-panel-solid) 0%, var(--bg-dark) 100%);
}
.hero-overlay {
  display: none;
}
.hero-content { z-index: 2; position: relative; width: 100%; max-width: 600px; }
.hero .badge {
  display: inline-block; padding: 6px 16px; border-radius: 99px;
  background: rgba(255, 69, 0, 0.15); border: 1px solid rgba(255, 69, 0, 0.3);
  color: var(--accent-primary); font-size: 0.85rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 24px;
}
.hero h1 {
  font-size: 2.5rem; font-weight: 900; margin-bottom: 20px;
  text-transform: uppercase; letter-spacing: -0.02em;
}
.hero p {
  font-size: 1rem; color: rgba(255,255,255,0.9); margin: 0 auto 30px;
}
.hero-ctas {
  display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px;
}
.hero-btn { width: 100%; }

.outline-btn {
  background: rgba(0,0,0,0.4); border: 2px solid var(--border-color); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 16px 24px; font-size: 1.1rem; font-weight: 700;
  font-family: var(--font-heading); border-radius: var(--radius-md);
  cursor: pointer; transition: var(--transition);
}
.outline-btn:hover {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.4);
}
.trust-line { font-size: 0.8rem; color: rgba(255,255,255,0.6); }

/* Common Section Styles */
.prizes-section, .how-to-enter-section {
  padding: 40px 20px; text-align: center;
  container-type: inline-size;
}
.prizes-section h2, .how-to-enter-section h2 {
  font-size: 2rem; margin-bottom: 10px;
}

/* Grids - Stacked on Mobile by default */
.prizes-grid, .steps-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 30px;
}

/* Container Queries for Responsive Grid based on available space */
@container (min-width: 650px) {
  .prizes-grid, .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* Cards (Updated to be fully opaque and readable) */
.prize-card, .step-card {
  background: var(--bg-panel-solid); 
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md); 
  padding: 24px 16px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  position: relative;
  cursor: default;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  
  /* Force full opacity and visibility to prevent washed-out look in cross-origin iframes */
  opacity: 1 !important;
  transform: translateY(0) !important;
  visibility: visible !important;
  transition: none !important;
}

.prize-icon {
  width: 56px; height: 56px; background: rgba(255, 69, 0, 0.15);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--accent-primary); margin-bottom: 16px;
}
.prize-card h3, .step-card h3 { font-size: 1.25rem; margin-bottom: 8px; color: #ffffff; }
.prize-card p, .step-card p { color: #e5e7eb; font-size: 0.95rem; }

.step-label {
  display: inline-block; padding: 4px 12px; border-radius: 99px;
  background: rgba(255, 69, 0, 0.15); color: var(--accent-primary);
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; margin-bottom: 16px;
}

/* App Container */
.app-container {
  flex: 1; width: 100%; display: flex; flex-direction: column;
}

/* Upload Header */
.upload-header-section {
  text-align: center; padding: 40px 20px 20px;
}
.upload-header-section h2 { font-size: 1.8rem; margin-bottom: 10px; }
.upload-header-section p { color: var(--text-muted); font-size: 1rem; }

/* Main Interface Card & Glass Panel */
.main-interface-card {
  margin: 0;
  width: 100%;
}
.glass-panel {
  background: var(--bg-panel); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color); border-radius: var(--radius-lg);
  padding: 24px 15px; margin: 0 15px;
}
.panel-header { text-align: center; margin-bottom: 32px; }
.panel-header h2 { font-size: 1.75rem; margin-bottom: 8px; }
.panel-header p { color: var(--text-muted); font-size: 0.95rem; }

/* Tabs */
.tabs-container {
  display: flex; justify-content: center; gap: 12px; margin-bottom: 30px;
}
.tab-btn {
  background: transparent; border: 1px solid var(--border-color); color: var(--text-muted);
  padding: 10px 20px; font-size: 0.95rem; font-weight: 600; font-family: var(--font-heading);
  border-radius: 99px; cursor: pointer; transition: var(--transition);
}
.tab-btn.active {
  background: var(--bg-panel-solid); color: var(--text-main); border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(255, 69, 0, 0.2);
}
.tab-pane { display: none; animation: fadeIn 0.4s ease forwards; }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Forms */
.form-row { display: grid; grid-template-columns: 1fr; gap: 0; }
.form-group { margin-bottom: 24px; }
label { display: block; font-size: 0.95rem; font-weight: 500; color: #e5e7eb; margin-bottom: 8px; }
input[type="text"], input[type="email"], textarea {
  width: 100%; background: rgba(25, 25, 30, 0.8); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); padding: 16px; color: var(--text-main); font-size: 16px;
  font-family: var(--font-body); transition: var(--transition);
}
input:focus, textarea:focus {
  outline: none; border-color: var(--accent-primary); background: rgba(0,0,0,0.7);
  box-shadow: 0 0 0 2px rgba(255, 69, 0, 0.2);
}

/* Checkboxes */
.checkbox-group { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; }
.checkbox-group input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: 2px;
  flex-shrink: 0; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.5); cursor: pointer; position: relative;
}
.checkbox-group input[type="checkbox"]:checked {
  background: var(--accent-primary); border-color: var(--accent-primary);
}
.checkbox-group input[type="checkbox"]:checked::after {
  content: ''; position: absolute; top: 2px; left: 6px; width: 5px; height: 10px;
  border: solid white; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.checkbox-group label { font-size: 0.9rem; color: #d1d5db; cursor: pointer; line-height: 1.5; padding-top: 2px; }

/* File Upload */
.file-upload-zone {
  position: relative; border: 2px dashed var(--border-color); border-radius: var(--radius-md);
  background: rgba(0,0,0,0.2); padding: 30px 15px; text-align: center; transition: var(--transition);
  cursor: pointer; overflow: hidden;
}
.hidden-input { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 10; }
.upload-prompt { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); }
.upload-prompt svg { color: var(--accent-primary); }
#file-preview { max-width: 100%; max-height: 300px; border-radius: var(--radius-sm); margin-bottom: 16px; object-fit: contain; }
.remove-btn {
  position: relative; z-index: 20; background: rgba(0,0,0,0.6); border: 1px solid var(--border-color);
  color: #fff; padding: 8px 16px; border-radius: 99px; cursor: pointer; font-size: 0.85rem;
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; width: 100%;
  padding: 16px 24px; font-size: 1.1rem; font-weight: 700; font-family: var(--font-heading);
  border-radius: var(--radius-md); cursor: pointer; border: none; transition: var(--transition);
}
.btn-primary { background: var(--accent-gradient); color: #fff; box-shadow: 0 4px 15px rgba(255, 69, 0, 0.3); }
.btn-primary.outline { background: transparent; border: 2px solid var(--accent-primary); color: var(--accent-primary); box-shadow: none; }
.btn-secondary { background: rgba(255,255,255,0.1); color: #fff; width: auto; padding: 12px 24px; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid rgba(255,255,255,0.3); border-radius: 50%; border-top-color: #fff; animation: spin 1s infinite linear; margin-left: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Success */
.success-header { text-align: center; margin-bottom: 30px; }
.success-icon { margin-bottom: 16px; }
.success-preview { margin-bottom: 30px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border-color); }
.success-preview img { width: 100%; height: auto; display: block; }

.share-panel {
  background: rgba(0,0,0,0.3); padding: 20px; border-radius: var(--radius-md);
  text-align: center; margin-bottom: 30px; border: 1px dashed var(--border-color);
}
.share-panel h3 { color: var(--accent-primary); margin-bottom: 8px; font-size: 1.1rem; }
.share-panel p { font-size: 0.9rem; color: #e5e7eb; margin-bottom: 20px; }
.share-input-group { display: flex; margin-bottom: 16px; }
.share-input-group input { flex: 1; border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.share-input-group button { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 0 20px; }
.social-share-buttons { display: flex; gap: 12px; justify-content: center; }
.btn-social { padding: 10px 20px; border: none; border-radius: var(--radius-sm); color: #fff; font-weight: 600; cursor: pointer; }
.btn-social.fb { background: #1877F2; }
.btn-social.tw { background: #000000; border: 1px solid rgba(255,255,255,0.2); }

/* Gallery */
.gallery-header { text-align: center; margin-bottom: 30px; padding: 0 15px; }
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 40px; padding: 0 15px;
}
.gallery-card {
  background: var(--bg-panel-solid); border: 1px solid var(--border-color);
  border-radius: var(--radius-md); overflow: hidden; display: flex; flex-direction: column;
}
.card-img-wrap {
  position: relative; padding-top: 100%; cursor: pointer; background: #000; overflow: hidden;
}
.card-img-wrap img {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover;
}
.card-content { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.card-author { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.card-caption { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 16px; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 12px; }
.btn-vote {
  background: transparent; border: 1px solid var(--accent-primary); color: var(--accent-primary);
  padding: 6px 12px; border-radius: 99px; font-size: 0.85rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-vote.voted { background: var(--accent-primary); color: #fff; cursor: default; }
.btn-vote.voted svg { fill: currentColor; }
.card-votes { font-size: 0.85rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; }
.gallery-footer { text-align: center; }

/* Lightbox */
.lightbox {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95);
  z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.lightbox:not(.hidden) { opacity: 1; visibility: visible; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px; background: transparent; border: none;
  color: #fff; font-size: 2.5rem; cursor: pointer; z-index: 2001; line-height: 1;
}
.lightbox-content {
  background: var(--bg-panel-solid); border: 1px solid var(--border-color);
  border-radius: var(--radius-lg); width: 100%; display: flex; flex-direction: column;
  overflow-y: auto; max-height: 90vh;
}
.lightbox-image-container { background: #000; height: 50vh; display: flex; align-items: center; justify-content: center; }
.lightbox-image-container img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-info { padding: 20px; display: flex; flex-direction: column; }
.lightbox-author { font-size: 1.5rem; margin-bottom: 12px; }
.lightbox-caption { color: var(--text-muted); margin-bottom: 20px; }
.lightbox-actions { border-top: 1px solid var(--border-color); padding-top: 20px; display: flex; flex-direction: column; gap: 16px; }
.btn-vote.large { width: 100%; justify-content: center; padding: 14px; font-size: 1.1rem; }
.vote-count-display { text-align: center; }
.count-number { font-size: 2rem; font-weight: 800; font-family: var(--font-heading); color: var(--accent-primary); line-height: 1; }
.count-label { font-size: 0.85rem; text-transform: uppercase; color: var(--text-muted); letter-spacing: 1px; }

/* Toast */
.toast-container {
  position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 9999;
  background: #fff; color: #000; padding: 12px 24px; border-radius: 99px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); transition: opacity 0.3s ease;
}
.toast-container.hidden { opacity: 0; pointer-events: none; }
.toast-container.error { background: #ef4444; color: #fff; }
.toast-container.success { background: #10b981; color: #fff; }

/* Rules */
.rules-section { text-align: center; padding: 40px 20px; }
.rules-content { border-top: 1px solid var(--border-color); padding-top: 30px; }
.rules-section h2 { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; }
.rules-section p { font-size: 0.8rem; color: #a1a1aa; }

/* Powered By */
#wbx-powered-by-slot { margin: 0 auto; padding: 20px 0; width: 100%; text-align: center; }


/* =========================================
   DESKTOP (min-width: 750px)
   ========================================= */
@media (min-width: 750px) {

  /* Hero */
  .hero { min-height: auto; padding: 56px 40px; }
  .hero-content { max-width: 1000px; }
  .hero h1 { font-size: 4rem; }
  .hero p { font-size: 1.15rem; max-width: 800px; }
  .hero-ctas { flex-direction: row; justify-content: center; gap: 20px; }
  .hero-btn { width: auto; min-width: 240px; }

  /* Sections */
  .prizes-section, .how-to-enter-section {
    width: 100%; max-width: 1200px; margin: 48px auto; padding: 0 40px;
  }
  .prizes-section h2, .how-to-enter-section h2 { font-size: 2.5rem; }

  /* Horizontal Grids */
  .prizes-grid, .steps-grid {
    margin-top: 40px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
  }
  .prize-card, .step-card { padding: 30px 24px; }

  .upload-header-section { max-width: 1280px; margin: 48px auto 30px; }
  .upload-header-section h2 { font-size: 2.5rem; }
  .upload-header-section p { font-size: 1.15rem; }

  .app-container { padding: 0; max-width: 100%; }

  /* Wide Main Interface Card */
  .main-interface-card {
    max-width: 1100px; margin: 0 auto 48px; background: var(--bg-panel);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color); border-radius: var(--radius-lg);
    padding: 60px; box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  }

  /* Reset mobile glass panel inside wide card */
  .glass-panel {
    background: transparent; border: none; padding: 0; box-shadow: none; max-width: 800px; margin: 0 auto;
  }

  .form-row { grid-template-columns: 1fr 1fr; gap: 24px; }
  .form-group { margin-bottom: 30px; }

  .tabs-container { margin-bottom: 50px; gap: 20px; }
  .tab-btn { padding: 14px 30px; font-size: 1.1rem; }

  /* Gallery within Desktop Card */
  .gallery-header { margin-bottom: 40px; padding: 0; }
  .gallery-grid { gap: 24px; padding: 0; }
  
  /* Lightbox */
  .lightbox-content { flex-direction: row; max-width: 1100px; overflow: hidden; }
  .lightbox-image-container { flex: 2; height: auto; min-height: 400px; }
  .lightbox-image-container img { max-height: 85vh; }
  .lightbox-info { flex: 1; padding: 40px; min-width: 350px; }

  .rules-section { max-width: 1000px; margin: 0 auto 40px; }
}

@media (max-width: 749px) {
  .prizes-grid,
  .steps-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
  }

  /* Embed-aware mobile lightbox overrides */
  .lightbox {
    position: absolute;
    height: auto;
    min-height: 0;
    background: transparent;
    display: block;
    padding: 50px 10px 20px 10px;
  }
  .lightbox-content {
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.9);
    overflow: visible;
    max-height: none;
  }
  .lightbox-close {
    position: absolute;
    top: 5px; right: 15px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
  }
  .lightbox-image-container {
    height: auto;
    background: #000;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }
  .lightbox-image-container img {
    max-height: 70svh;
    width: 100%;
    object-fit: contain;
  }
}
