:root {
  --primary: #E60000;
  --primary-hover: #CC0000;
  --bg-dark: #121212;
  --bg-card: #1E1E1E;
  --bg-input: #2A2A2A;
  --text-main: #FFFFFF;
  --text-muted: #AAAAAA;
  --border-color: #333333;
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

* {
  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; }

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.header {
  background-color: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}
.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}
.logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.logo span {
  color: var(--primary);
}
nav {
  display: flex;
  gap: 20px;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  transition: color 0.3s;
  padding: 10px 0;
  position: relative;
}
.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

/* Hero */
.hero {
  position: relative;
  background-size: cover;
  background-position: center;
  padding: 100px 0;
  text-align: center;
}
.hero-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(18,18,18,0.7) 0%, rgba(18,18,18,1) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
}
.badge {
  display: inline-block;
  padding: 6px 16px;
  background-color: rgba(230, 0, 0, 0.2);
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.2;
}
.hero p {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Prizes */
.prizes-section {
  padding: 40px 0 20px;
}
.prizes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}
.prize-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.prize-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}
.prize-card h3 {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.prize-card p {
  color: var(--primary);
  font-weight: 600;
}

/* Main Content */
.main-content {
  padding: 40px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  max-width: 700px;
  margin: 0 auto;
}
.card h2 {
  font-family: var(--font-heading);
  margin-bottom: 10px;
}
.card > p {
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* Form */
.form-group {
  margin-bottom: 24px;
  text-align: left;
}
label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  padding: 14px 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 0.3s;
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23AAAAAA' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
}
input[type="file"] {
  width: 100%;
  padding: 10px;
  background-color: var(--bg-input);
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
}
.file-preview {
  margin-top: 10px;
  max-width: 200px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.file-preview img {
  width: 100%;
  display: block;
}

.btn {
  display: inline-block;
  padding: 14px 28px;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
}
.btn-primary {
  background-color: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}
.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
.btn-secondary {
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background-color: var(--border-color);
}

.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 600;
}
.alert.error {
  background-color: rgba(230, 0, 0, 0.1);
  color: #ff6b6b;
  border: 1px solid rgba(230, 0, 0, 0.3);
}

/* Share Panel */
.share-panel {
  margin-top: 30px;
  padding-top: 30px;
  border-top: 1px solid var(--border-color);
}
.share-controls {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}
.share-controls input {
  flex: 1;
}
.share-controls button {
  width: auto;
}
.my-entry-preview {
  margin-top: 20px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.my-entry-preview img {
  width: 100%;
  display: block;
}

/* Gallery */
.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.gallery-header h2 {
  font-family: var(--font-heading);
  font-size: 2rem;
}
.gallery-filters select {
  width: 200px;
  padding: 10px 16px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}
.gallery-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s, border-color 0.3s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.gallery-item:hover {
  transform: translateY(-4px);
  border-color: #555;
}
.gallery-thumb {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}
.gallery-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.gallery-caption {
  font-size: 0.95rem;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gallery-author {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
  margin-bottom: 12px;
}
.btn-vote {
  background-color: rgba(255,255,255,0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.btn-vote:hover:not(:disabled) {
  background-color: rgba(230, 0, 0, 0.1);
  border-color: var(--primary);
  color: var(--primary);
}
.btn-vote:disabled {
  opacity: 0.7;
  cursor: default;
}
.btn-vote.voted {
  background-color: rgba(230, 0, 0, 0.2);
  border-color: var(--primary);
  color: var(--primary);
}

.gallery-empty {
  text-align: center;
  padding: 60px 20px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 1px dashed var(--border-color);
}
.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.gallery-empty h3 {
  font-family: var(--font-heading);
  margin-bottom: 8px;
}
.gallery-empty p {
  color: var(--text-muted);
  margin-bottom: 24px;
}
.gallery-empty .btn {
  width: auto;
}

.load-more-container {
  text-align: center;
  margin-top: 40px;
}
.load-more-container .btn {
  width: auto;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0,0,0,0.9);
  backdrop-filter: blur(5px);
}
.lightbox-content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 1200px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: var(--primary); }

.lightbox-image-container {
  position: relative;
  height: 60vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
#lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s;
}
.lightbox-nav:hover { background: var(--primary); }
.lightbox-nav.prev { left: 15px; }
.lightbox-nav.next { right: 15px; }

.lightbox-info {
  padding: 24px;
}
#lightbox-caption {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.lightbox-author {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.lightbox-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.lightbox-actions .btn-vote {
  width: auto;
  min-width: 150px;
}
.lightbox-share {
  display: flex;
  gap: 10px;
}
.btn-icon {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s;
}
.btn-icon:hover {
  background: var(--border-color);
}

#wbx-powered-by-slot {
  margin-top: 40px;
  padding: 20px;
  display: flex;
  justify-content: center;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }
  .gallery-filters select { width: 100%; }
  .lightbox-content { max-height: 95vh; }
  .lightbox-image-container { height: 50vh; }
}
