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

:root {
  --background: hsl(240 7% 97%);
  --foreground: hsl(240 10% 3.9%);
  --card: hsl(0 0% 100%);
  --card-foreground: hsl(240 10% 3.9%);
  --primary: hsl(36 100% 50%);
  --primary-foreground: hsl(0 0% 100%);
  --muted: hsl(240 4.8% 95.9%);
  --muted-foreground: hsl(240 3.8% 46.1%);
  --border: hsl(240 5.9% 90%);
  --tag-bg: rgba(255, 153, 0, 0.15);
  --tag-text: hsl(36 100% 50%);
  --official-bg: rgba(34, 197, 94, 0.15);
  --official-text: hsl(142 71% 45%);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  padding: 3rem 0;
  text-align: center;
}

.header-inner {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.header-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.header-emoji {
  font-size: 3rem;
}

.header-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .header-title { font-size: 3rem; }
}

.header-desc {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  max-width: 40rem;
  margin: 0 auto;
}

/* Submit Card */
.submit-card {
  border: 2px dashed var(--border);
  background: transparent;
  box-shadow: none;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  max-width: 100%;
}

.submit-card:hover {
  border-color: var(--primary);
  background: var(--tag-bg);
  box-shadow: none;
}

.submit-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1.5rem;
  height: 100%;
}

.submit-card-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  transition: background 0.2s;
}

.submit-card:hover .submit-card-icon {
  background: var(--primary);
}

.submit-card:hover .submit-card-icon svg {
  stroke: var(--primary-foreground);
}

.submit-card-icon svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: var(--muted-foreground);
  transition: stroke 0.2s;
}

.submit-card-inner h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.submit-card-inner p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Grid */
.grid-container {
  max-width: 72rem;
  margin: 0 auto;
  padding: 0 1.5rem 4rem;
}

.skins-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  gap: 1.5rem;
}

@media (min-width: 640px) {
  .skins-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .skins-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Card */
.skin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: box-shadow 0.3s ease;
}

.skin-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.card-image-wrapper {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
}

.card-media-container {
  width: 100%;
  height: 100%;
}

.card-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.skin-card:hover .card-media-container img.card-media {
  transform: scale(1.05);
}

.official-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--official-bg);
  color: var(--official-text);
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.official-badge svg {
  width: 0.875rem;
  height: 0.875rem;
}

.zoom-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0);
  transition: background 0.3s;
  z-index: 1;
}

.skin-card:hover .zoom-overlay {
  background: rgba(0,0,0,0.05);
}

.zoom-icon {
  opacity: 0;
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  padding: 0.75rem;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s;
}

.skin-card:hover .zoom-icon {
  opacity: 1;
}

.zoom-icon svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--foreground);
}

/* Carousel controls on cards */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 9999px;
  padding: 0.375rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.skin-card:hover .carousel-btn {
  opacity: 1;
}

.carousel-btn svg {
  width: 1rem;
  height: 1rem;
  color: var(--foreground);
}

.carousel-prev { left: 0.5rem; }
.carousel-next { right: 0.5rem; }

.carousel-dots {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.375rem;
  z-index: 3;
}

.carousel-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  border: none;
  cursor: pointer;
  background: rgba(255,255,255,0.5);
  transition: background 0.2s;
  padding: 0;
}

.carousel-dot.active {
  background: var(--primary);
}

.card-body {
  padding: 1.25rem;
}

.card-body h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--card-foreground);
  margin-bottom: 0.25rem;
}

.card-body p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-bottom: 1rem;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.625rem;
  border-radius: 9999px;
  background: var(--tag-bg);
  color: var(--tag-text);
  font-size: 0.75rem;
  font-weight: 500;
}

.github-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--foreground);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
  cursor: pointer;
  font-family: inherit;
}

.github-btn:hover {
  background: var(--muted);
}

.github-btn svg {
  width: 1rem;
  height: 1rem;
}

/* Footer */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
}

.footer p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.footer a {
  font-weight: 600;
  color: var(--foreground);
  text-decoration: none;
  transition: color 0.2s;
}

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

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  position: relative;
  max-width: 48rem;
  width: calc(100% - 2rem);
}

.lightbox-close {
  position: absolute;
  top: -3rem;
  right: 0;
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  transition: color 0.2s;
}

.lightbox-close:hover { color: white; }
.lightbox-close svg { width: 2rem; height: 2rem; }

.lb-media {
  width: 100%;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px rgba(0,0,0,0.4);
}

.lightbox-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  border-radius: 0 0 0.75rem 0.75rem;
}

.lightbox-info h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: white;
}

.lightbox-info p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.8);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.8);
  backdrop-filter: blur(4px);
  border: none;
  border-radius: 9999px;
  padding: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transition: background 0.2s;
}

.lightbox-nav:hover { background: white; }
.lightbox-nav svg { width: 1.25rem; height: 1.25rem; color: var(--foreground); }

.lightbox-prev { left: 0.75rem; }
.lightbox-next { right: 0.75rem; }

.lightbox-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.lightbox-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background: rgba(255,255,255,0.4);
  transition: background 0.2s;
}

.lightbox-dot.active {
  background: var(--primary);
}

/* Submit Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  position: relative;
  background: var(--card);
  border-radius: 0.75rem;
  padding: 2rem;
  max-width: 32rem;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.modal-close:hover { color: var(--foreground); }
.modal-close svg { width: 1.25rem; height: 1.25rem; }

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.375rem;
  color: var(--foreground);
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: 0.875rem;
  background: var(--background);
  color: var(--foreground);
  transition: border-color 0.2s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.char-count {
  display: block;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--border);
  border-radius: 9999px;
  transition: background 0.2s, border-color 0.2s;
}

.tag-checkbox:has(input:checked) {
  background: var(--tag-bg);
  border-color: var(--tag-text);
}

.tag-checkbox input { display: none; }

.file-drop-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
  cursor: pointer;
}

.file-drop-zone.dragover {
  border-color: var(--primary);
  background: var(--tag-bg);
}

.file-drop-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-text {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.file-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.file-previews:empty { margin-top: 0; }

.file-preview {
  position: relative;
  width: 4rem;
  height: 4rem;
  border-radius: 0.375rem;
  overflow: hidden;
  border: 1px solid var(--border);
}

.file-preview img,
.file-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-preview-remove {
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  background: rgba(0,0,0,0.6);
  color: white;
  border: none;
  border-radius: 9999px;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.submit-info {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-bottom: 0.75rem;
}

.submit-btn {
  width: 100%;
  padding: 0.625rem;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}

.submit-btn:hover { opacity: 0.85; }
.submit-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.submit-status {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
  text-align: center;
}

.submit-status.error { color: #ef4444; }
.submit-status.success { color: var(--official-text); }
.submit-status a { color: var(--primary); font-weight: 600; }
