/* ========================================
   Giveaway Detail Modal - Epic Edition
   ======================================== */

:root {
  --gdm-bg: rgba(15, 17, 30, 0.98);
  --gdm-border: rgba(255, 255, 255, 0.08);
  --gdm-text: #e2e8f0;
  --gdm-text-muted: #94a3b8;
  --gdm-accent: #fbbf24;
  --gdm-overlay: rgba(0, 0, 0, 0.6);
}

[data-theme="light"] {
  --gdm-bg: rgba(255, 255, 255, 0.99);
  --gdm-border: rgba(0, 0, 0, 0.08);
  --gdm-text: #1a1d2e;
  --gdm-text-muted: #6b7280;
  --gdm-accent: #f59e0b;
  --gdm-overlay: rgba(0, 0, 0, 0.6);
}

/* Giveaway modal — light theme internal overrides */
[data-theme="light"] .gdm-platform-icon {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .gdm-section {
  background: rgba(0, 0, 0, 0.02);
}
[data-theme="light"] .gdm-section-header:hover {
  background: rgba(0, 0, 0, 0.04);
}
[data-theme="light"] .gdm-comment {
  background: rgba(0, 0, 0, 0.03);
}
[data-theme="light"] .gdm-comment-input textarea {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--gdm-text);
}
[data-theme="light"] .gdm-comment-input textarea::placeholder {
  color: rgba(0, 0, 0, 0.35);
}

/* Modal wrapper */
.giveaway-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.giveaway-detail-modal.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Glass-morphism overlay */
.gdm-overlay {
  position: absolute;
  inset: 0;
  background: var(--gdm-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Dialog box */
.gdm-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1000px;
  max-height: 90vh;
  background: var(--gdm-bg);
  border: 1px solid var(--gdm-border);
  border-radius: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  color: var(--gdm-text);
  transform: scale(1) translateY(0);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.giveaway-detail-modal:not(.hidden) .gdm-dialog {
  animation: gdm-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes gdm-enter {
  from {
    transform: scale(0.95) translateY(-30px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* Platform-specific glow */
.gdm-dialog[style*="--gdm-glow-color"] {
  box-shadow: 0 0 40px -10px var(--gdm-glow-color, transparent),
              0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Custom scrollbar */
.gdm-dialog::-webkit-scrollbar {
  width: 8px;
}

.gdm-dialog::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.gdm-dialog::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.gdm-dialog::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Close button */
.gdm-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gdm-text-muted);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0.6;
  transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.gdm-close:hover {
  background: rgba(255, 255, 255, 0.12);
  opacity: 1;
  transform: rotate(90deg);
}

/* Header */
.gdm-header {
  padding: 2rem 4rem 1.5rem 2rem;
  border-bottom: 1px solid var(--gdm-border);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gdm-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0;
  color: var(--gdm-text);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.gdm-platform-icon {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.7rem;
  background: rgba(10, 10, 10, 0.85);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--gdm-text-muted);
  backdrop-filter: blur(4px);
  flex-shrink: 0;
}

.gdm-platform-icon[data-platform="steam"] {
  background: linear-gradient(135deg, rgba(27, 40, 56, 0.95), rgba(23, 26, 33, 0.95));
  border: 1px solid rgba(102, 192, 244, 0.4);
  color: #66c0f4;
}

.gdm-platform-icon[data-platform="epic"] {
  background: linear-gradient(135deg, rgba(32, 32, 32, 0.95), rgba(18, 18, 18, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

.gdm-platform-icon[data-platform="gog"] {
  background: linear-gradient(135deg, rgba(92, 46, 138, 0.95), rgba(61, 31, 92, 0.95));
  border: 1px solid rgba(171, 130, 255, 0.4);
  color: #ab82ff;
}

/* PEGI badge in modal header */
.gdm-pegi-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.gdm-pegi-badge.pegi-3,
.gdm-pegi-badge.pegi-7 {
  background: rgba(34, 197, 94, 0.15);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #4ade80;
}
.gdm-pegi-badge.pegi-12 {
  background: rgba(251, 191, 36, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fbbf24;
}
.gdm-pegi-badge.pegi-16 {
  background: rgba(249, 115, 22, 0.15);
  border: 1px solid rgba(249, 115, 22, 0.4);
  color: #fb923c;
}
.gdm-pegi-badge.pegi-18 {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Countdown timer */
.gdm-countdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Courier New', monospace;
}

.gdm-countdown .cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.gdm-countdown .cd-val {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gdm-accent);
  line-height: 1;
}

.gdm-countdown .cd-lbl {
  font-size: 0.625rem;
  text-transform: uppercase;
  color: var(--gdm-text-muted);
  letter-spacing: 0.5px;
}

.gdm-countdown .cd-sep {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gdm-text-muted);
  margin: 0 0.25rem;
}

/* Join button in header */
.gdm-join-btn {
  padding: 0.75rem 2rem;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #1f2937;
  font-weight: 700;
  font-size: 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
}

.gdm-join-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
  animation: gdm-pulse 1.5s infinite;
}

@keyframes gdm-pulse {
  0%, 100% {
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
  }
  50% {
    box-shadow: 0 8px 30px rgba(251, 191, 36, 0.6);
  }
}

/* Star rating */
.gdm-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.gdm-star {
  font-size: 1.25rem;
  color: #4b5563;
}

.gdm-star.filled {
  color: #fbbf24;
}

/* Body layout */
.gdm-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  padding: 2rem;
}

/* Left column */
.gdm-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Right column */
.gdm-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

/* Carousel */
.gdm-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.gdm-carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  height: 100%;
}

.gdm-slide {
  min-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gdm-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gdm-slide iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* Carousel arrows */
.gdm-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: white;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  transition: background 0.2s ease;
}

.gdm-arrow:hover {
  background: rgba(0, 0, 0, 0.7);
}

.gdm-arrow.prev {
  left: 1rem;
}

.gdm-arrow.next {
  right: 1rem;
}

/* Carousel dots */
.gdm-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 2;
}

.gdm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gdm-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.gdm-dot.active {
  background: white;
}

/* Thumbnail strip */
.gdm-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.gdm-thumbs::-webkit-scrollbar {
  height: 4px;
}

.gdm-thumbs::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
}

.gdm-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}

.gdm-thumb {
  width: 80px;
  height: 45px;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: border-color 0.2s ease, transform 0.2s ease;
  opacity: 0.6;
}

.gdm-thumb:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.gdm-thumb.active {
  border-color: var(--gdm-accent);
  opacity: 1;
}

.gdm-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Short description */
.gdm-short-desc {
  color: var(--gdm-text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Expandable sections */
.gdm-section {
  border: 1px solid var(--gdm-border);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

.gdm-section-header {
  padding: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
  font-weight: 600;
}

.gdm-section-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gdm-section-header .toggle-icon {
  transition: transform 0.3s ease;
  font-size: 1.25rem;
  line-height: 1;
}

.gdm-section.expanded .toggle-icon {
  transform: rotate(45deg);
}

.gdm-section-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.gdm-section.expanded .gdm-section-body {
  max-height: 2000px;
}

/* Comments */
.gdm-comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.gdm-comment {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.gdm-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.gdm-comment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.gdm-comment-meta strong {
  color: var(--gdm-text);
  font-size: 0.875rem;
}

.gdm-comment-meta time {
  color: var(--gdm-text-muted);
  font-size: 0.75rem;
}

.gdm-comment-text {
  color: var(--gdm-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.gdm-comment-delete {
  margin-left: auto;
  padding: 0.25rem 0.5rem;
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  border-radius: 4px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.gdm-comment-delete:hover {
  background: rgba(239, 68, 68, 0.1);
}

.gdm-comment-input {
  padding: 1rem;
  border-top: 1px solid var(--gdm-border);
  display: flex;
  gap: 0.75rem;
}

.gdm-comment-input textarea {
  flex: 1;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--gdm-border);
  border-radius: 6px;
  color: var(--gdm-text);
  font-size: 0.875rem;
  font-family: inherit;
  resize: none;
  min-height: 60px;
}

.gdm-comment-input textarea::placeholder {
  color: var(--gdm-text-muted);
}

.gdm-comment-input textarea:focus {
  outline: none;
  border-color: var(--gdm-accent);
}

.gdm-comment-input button {
  padding: 0.75rem 1.5rem;
  background: var(--gdm-accent);
  color: #1f2937;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
  align-self: flex-end;
}

.gdm-comment-input button:hover {
  transform: translateY(-2px);
}

/* Participants */
.gdm-participants-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  gap: 1rem;
  padding: 1rem;
}

.gdm-participant {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.gdm-participant img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gdm-border);
}

.gdm-participant span {
  font-size: 0.75rem;
  color: var(--gdm-text-muted);
  word-break: break-word;
}

/* Full description */
.gdm-description {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--gdm-border);
  border-radius: 8px;
  line-height: 1.7;
  color: var(--gdm-text-muted);
  font-size: 0.95rem;
}

/* Multiplayer badge */
.gdm-multiplayer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 6px;
  color: #60a5fa;
  font-size: 0.875rem;
  font-weight: 500;
}

.gdm-multiplayer-badge[data-type="coop"] {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.gdm-multiplayer-badge[data-type="pvp"] {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

/* Game info grid */
.gdm-game-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--gdm-border);
  border-radius: 8px;
}

.gdm-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gdm-info-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gdm-text-muted);
}

.gdm-info-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gdm-text);
}

/* Tasks list in modal */
.gdm-tasks-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--gdm-border);
  border-radius: 8px;
}

.gdm-task {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--gdm-border);
  border-radius: 6px;
  transition: background 0.2s ease;
}

.gdm-task:hover {
  background: rgba(255, 255, 255, 0.05);
}

.gdm-task i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.gdm-task .task-name {
  flex: 1;
  font-size: 0.875rem;
  color: var(--gdm-text);
}

.gdm-task .task-points {
  font-weight: 700;
  color: var(--gdm-accent);
  font-size: 0.875rem;
}

/* Campaign / Sponsor section */
.gdm-campaign {
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--gdm-border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.gdm-sponsor-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gdm-accent);
  flex-shrink: 0;
}

.gdm-campaign-info {
  flex: 1;
}

.gdm-campaign-info small {
  display: block;
  font-size: 0.75rem;
  color: var(--gdm-text-muted);
  margin-bottom: 0.25rem;
}

.gdm-sponsor-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--gdm-text);
}

/* Platform-specific accent colors */
[data-platform="steam"] {
  --platform-color: #1b9fff;
}

[data-platform="epic"] {
  --platform-color: #fff;
}

[data-platform="gog"] {
  --platform-color: #a855f7;
}

.gdm-dialog[data-platform] .gdm-join-btn {
  background: linear-gradient(135deg, var(--platform-color, #fbbf24) 0%, var(--platform-color, #f59e0b) 100%);
}

.gdm-dialog[data-platform="steam"] .gdm-join-btn {
  background: linear-gradient(135deg, #1b9fff 0%, #1589e8 100%);
  color: white;
}

.gdm-dialog[data-platform="epic"] .gdm-join-btn {
  background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
  color: #1f2937;
}

.gdm-dialog[data-platform="gog"] .gdm-join-btn {
  background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
  color: white;
}

/* ── Platform Benefits Strip ─────────────────────────────────────────── */
.gdm-platform-benefits {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.875rem 1rem;
  margin: 0.75rem 0;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--gdm-border);
  border-radius: 10px;
}

.gdm-benefits-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gdm-text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.gdm-benefits-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.gdm-benefit-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--platform-color, #fbbf24) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--platform-color, #fbbf24) 30%, transparent);
  color: color-mix(in srgb, var(--platform-color, #fbbf24) 90%, var(--gdm-text) 10%);
  white-space: nowrap;
}

.gdm-benefit-chip i {
  font-size: 0.7rem;
  opacity: 0.85;
}

[data-theme="light"] .gdm-platform-benefits {
  background: rgba(0, 0, 0, 0.025);
}

[data-theme="light"] .gdm-benefit-chip {
  color: color-mix(in srgb, var(--platform-color, #f59e0b) 70%, #1a1d2e 30%);
}

/* Tablet portrait: dialog was sitting too close to the top because align-items:center
   puts a tall dialog (max-height 90vh) only ~5vh from the top edge.
   Mirror the mobile approach: anchor to top and clear the 70px desktop nav. */
@media (min-width: 769px) and (max-width: 1024px) {
  .giveaway-detail-modal {
    align-items: flex-start;
    padding-top: 5rem; /* clear 70px nav + comfortable breathing room */
  }

  .gdm-dialog {
    max-height: calc(100svh - 5rem - 1rem); /* subtract top padding + bottom padding */
    max-height: calc(100vh - 5rem - 1rem);  /* fallback */
  }
}

/* Tablet landscape: width exceeds 1024px so the portrait rule above doesn't fire,
   but the viewport is short (~768–900px) so centering still glues the dialog to the top.
   Target by orientation + height to avoid catching tall desktop monitors. */
@media (orientation: landscape) and (min-width: 769px) and (max-height: 900px) {
  .giveaway-detail-modal {
    align-items: flex-start;
    padding-top: 4.5rem; /* 70px nav clearance; less than portrait to save vertical space */
  }

  .gdm-dialog {
    max-height: calc(100svh - 4.5rem - 1rem);
    max-height: calc(100vh - 4.5rem - 1rem);
  }
}

/* Responsive design */
@media (max-width: 768px) {
  .giveaway-detail-modal {
    padding: 0;
    padding-top: 56px; /* offset below mobile nav (height: 56px, z-index: 10001) */
    align-items: flex-start;
  }

  @supports (padding-top: env(safe-area-inset-top)) {
    .giveaway-detail-modal {
      padding-top: calc(56px + env(safe-area-inset-top));
    }
  }

  .gdm-dialog {
    max-width: 100%;
    max-height: calc(100vh - 56px);   /* fallback */
    max-height: calc(100svh - 56px);  /* small viewport height minus nav bar */
    border-radius: 0;
  }

  @supports (padding-top: env(safe-area-inset-top)) {
    .gdm-dialog {
      max-height: calc(100svh - 56px - env(safe-area-inset-top));
    }
  }

  /* Points sub-bar visible (56px nav + 28px sub-bar = 84px) */
  body.has-mobile-subbar .giveaway-detail-modal {
    padding-top: 84px;
  }

  body.has-mobile-subbar .gdm-dialog {
    max-height: calc(100vh - 84px);
    max-height: calc(100svh - 84px);
  }

  @supports (padding-top: env(safe-area-inset-top)) {
    body.has-mobile-subbar .giveaway-detail-modal {
      padding-top: calc(84px + env(safe-area-inset-top));
    }
    body.has-mobile-subbar .gdm-dialog {
      max-height: calc(100svh - 84px - env(safe-area-inset-top));
    }
  }

  .gdm-body {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.5rem;
  }

  /* Reset desktop grid placement — single column, DOM order applies */
  .gdm-right {
    grid-column: auto;
    grid-row: auto;
  }


  /* Header padding: tight left, generous right for the close button */
  .gdm-header {
    padding: 0.75rem 3.25rem 0.75rem 1rem;
    gap: 0.4rem;
  }

  /* Row 1-3: platform icon → title → rating stacked vertically */
  .gdm-header-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  /* Title left-aligned on mobile */
  .gdm-header-top .gdm-title {
    justify-content: flex-start;
  }

  /* Row 1: Platform badge */
  .gdm-platform-icon {
    width: auto;
    height: auto;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--gdm-text-muted);
    line-height: 1;
  }

  /* Row 2: Title */
  .gdm-header-top .gdm-title {
    font-size: 1.15rem;
    line-height: 1.3;
    min-width: 0;
    word-break: break-word;
    flex: unset;
    margin: 0;
  }

  /* Row 3: Rating stays inline after title, already in flex column */

  /* Row 4: Countdown, Row 5: Join button — each on its own line */
  .gdm-header-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.25rem;
  }

  .gdm-countdown .cd-val {
    font-size: 1rem;
  }

  .gdm-countdown .cd-sep {
    font-size: 1rem;
  }

  .gdm-header-meta .gdm-join-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    text-align: center;
  }

  .gdm-game-info {
    grid-template-columns: 1fr;
  }

  .gdm-participants-grid {
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  }

  .gdm-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 20px;
    height: 20px;
    font-size: 12px;
  }

  /* On mobile the dialog is 100% viewport width, so the spring overshoot
     (cubic-bezier y2=1.56 → scale briefly > 1) makes content appear to
     extend horizontally beyond the screen edges. Use a simple ease-out here. */
  .giveaway-detail-modal:not(.hidden) .gdm-dialog {
    animation: gdm-enter 0.2s ease-out forwards;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .gdm-dialog,
  .gdm-close,
  .gdm-arrow,
  .gdm-dot,
  .gdm-thumb,
  .gdm-join-btn,
  .gdm-section-header .toggle-icon,
  .gdm-section-body,
  .gdm-carousel-track,
  .gdm-comment-input button {
    transition: none;
    animation: none;
  }

  .giveaway-detail-modal:not(.hidden) .gdm-dialog {
    animation: none;
  }
}

/* Utility states */
.gdm-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  color: var(--gdm-text-muted);
}

.gdm-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--gdm-border);
  border-top-color: var(--gdm-accent);
  border-radius: 50%;
  animation: gdm-spin 0.8s linear infinite;
}

@keyframes gdm-spin {
  to { transform: rotate(360deg); }
}

.gdm-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 200px;
  padding: 2rem;
  color: var(--gdm-text-muted);
  text-align: center;
}

.gdm-empty {
  color: var(--gdm-text-muted);
  font-size: 0.85rem;
  font-style: italic;
  padding: 0.75rem 0;
  text-align: center;
}

/* Header layout refinements */
.gdm-header-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
}

.gdm-platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.gdm-header-top .gdm-title {
  justify-content: center;
  width: 100%;
}

/* join button now lives in .gdm-header-meta alongside countdown */
.gdm-header-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  margin-top: 0.75rem;
}

.gdm-header-meta .gdm-join-btn {
  flex-shrink: 0;
}

/* Meta footer (below thumbs in left column) */
.gdm-meta-footer {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  border-top: 1px solid var(--gdm-border);
  border-bottom: 1px solid var(--gdm-border);
  font-size: 0.82rem;
  color: var(--gdm-text-muted);
}

.gdm-meta-footer span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.gdm-meta-footer i {
  font-size: 0.78rem;
  opacity: 0.7;
}

/* Tasks section in modal */
.gdm-tasks-section h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
  color: var(--gdm-text);
}

/* Video link fallback */
.gdm-video-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  color: var(--gdm-accent);
  font-size: 1.5rem;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.6);
}

.gdm-video-link:hover {
  color: #fff;
}

/* Comment form */
.gdm-comment-form {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  align-items: flex-start;
}

.gdm-comment-input-field {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--gdm-border);
  border-radius: 8px;
  color: var(--gdm-text);
  font-size: 0.85rem;
  resize: vertical;
  min-height: 36px;
}

.gdm-comment-input-field:focus {
  outline: none;
  border-color: var(--gdm-accent);
}

.gdm-comment-send {
  padding: 0.5rem 1rem;
  background: var(--gdm-accent);
  color: #0d0f18;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.gdm-comment-send:hover {
  opacity: 0.9;
}

/* Comment body layout */
.gdm-comment-body {
  flex: 1;
  min-width: 0;
}

.gdm-comment-name {
  font-weight: 600;
  color: var(--gdm-text);
}

.gdm-comment-time {
  font-size: 0.75rem;
  color: var(--gdm-text-muted);
}

/* Rating value next to stars */
.gdm-rating-value {
  margin-left: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gdm-accent);
}

/* Task check icon */
.gdm-task-check {
  color: #22c55e;
  margin-left: auto;
  font-size: 0.8rem;
}

/* Read More button style */
.btn-read-more {
  font-size: 0.85rem;
}

/* Campaign Rules PDF link */
.gdm-campaign-rules-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 6px;
  color: #ef4444;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
}

.gdm-campaign-rules-link:hover {
  background: rgba(239, 68, 68, 0.2);
}

.gdm-sponsor-logo {
  display: block;
  max-width: 120px;
  max-height: 60px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: 0.5rem;
}

.gdm-sponsor-message {
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-left: 3px solid var(--gdm-accent, #fbbf24);
  border-radius: 0 6px 6px 0;
  font-size: 0.9rem;
  color: var(--gdm-text-muted, #a0a0b0);
  line-height: 1.5;
  font-style: italic;
}

.gdm-sponsor-message i {
  color: var(--gdm-accent, #fbbf24);
  margin-right: 0.3rem;
  font-size: 0.8rem;
}

/* ===== COMMENT MODERATION (v2.5.0) ===== */

/* Moderation action buttons row */
.gdm-comment-actions {
  display: flex;
  gap: 0.25rem;
  margin-top: 0.35rem;
  position: relative;
}

.gdm-mod-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  transition: background 0.15s, transform 0.1s;
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
}
.gdm-mod-btn:hover { transform: scale(1.15); }

.gdm-mod-approve { color: #22c55e; }
.gdm-mod-approve:hover { background: rgba(34,197,94,0.15); }
.gdm-mod-hide { color: #f59e0b; }
.gdm-mod-hide:hover { background: rgba(245,158,11,0.15); }
.gdm-mod-edit { color: #3b82f6; }
.gdm-mod-edit:hover { background: rgba(59,130,246,0.15); }
.gdm-mod-delete { color: #ef4444; }
.gdm-mod-delete:hover { background: rgba(239,68,68,0.15); }
.gdm-mod-ban { color: #a855f7; }
.gdm-mod-ban:hover { background: rgba(168,85,247,0.15); }

/* Hidden/pending comment muted style */
.gdm-comment--muted {
  opacity: 0.5;
  border-left: 2px solid #f59e0b;
  padding-left: 0.5rem;
}

/* Comment badges */
.gdm-comment-badge {
  display: inline-block;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.gdm-badge-hidden {
  background: rgba(245,158,11,0.15);
  color: #f59e0b;
}
.gdm-badge-pending {
  background: rgba(59,130,246,0.15);
  color: #3b82f6;
}

/* Edited indicator */
.gdm-comment-edited {
  font-size: 0.7rem;
  color: #64748b;
  font-style: italic;
}

/* Ban duration picker popup */
.gdm-ban-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 8px;
  padding: 0.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 140px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.gdm-ban-picker-title {
  font-size: 0.75rem;
  color: #94a3b8;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  margin-bottom: 0.15rem;
}
.gdm-ban-picker button {
  background: rgba(255,255,255,0.05);
  border: none;
  color: #e2e8f0;
  padding: 0.35rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
  text-align: left;
  transition: background 0.15s;
}
.gdm-ban-picker button:hover {
  background: rgba(168,85,247,0.2);
}

/* Inline edit */
.gdm-comment-edit-area {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.gdm-edit-textarea {
  width: 100%;
  min-height: 50px;
  background: var(--bg-secondary, #0f172a);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 6px;
  color: var(--text-primary, #e2e8f0);
  padding: 0.4rem;
  font-size: 0.85rem;
  resize: vertical;
}
.gdm-comment-edit-btns {
  display: flex;
  gap: 0.35rem;
}
.gdm-comment-edit-btns button {
  padding: 0.25rem 0.6rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background 0.15s;
}
.gdm-edit-save {
  background: rgba(34,197,94,0.2);
  color: #22c55e;
}
.gdm-edit-save:hover { background: rgba(34,197,94,0.35); }
.gdm-edit-cancel {
  background: rgba(239,68,68,0.2);
  color: #ef4444;
}
.gdm-edit-cancel:hover { background: rgba(239,68,68,0.35); }

/* ===== EMOJI & MEME PICKERS ===== */

.gdm-comment-toolbar {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.35rem;
  position: relative;
}
.gdm-emoji-btn, .gdm-meme-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.15s;
}
.gdm-emoji-btn:hover, .gdm-meme-btn:hover {
  background: rgba(255,255,255,0.1);
}

/* Emoji picker panel */
.gdm-emoji-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 10px;
  padding: 0.6rem;
  z-index: 200;
  width: 280px;
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.gdm-emoji-category {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.3rem 0 0.15rem;
}
.gdm-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
}
.gdm-emoji-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.1s;
}
.gdm-emoji-item:hover {
  background: rgba(255,255,255,0.1);
}

/* Meme picker panel */
.gdm-meme-picker {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: var(--bg-secondary, #1e293b);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 10px;
  padding: 0.6rem;
  z-index: 200;
  width: 300px;
  max-height: 280px;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.gdm-meme-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.gdm-meme-item {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border: none;
  background: rgba(255,255,255,0.03);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, transform 0.1s;
  padding: 4px;
}
.gdm-meme-item:hover {
  background: rgba(255,255,255,0.1);
  transform: scale(1.1);
}
.gdm-meme-item img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Inline meme in comment text */
.gdm-comment-meme {
  display: inline-block;
  width: 48px;
  height: 48px;
  vertical-align: middle;
  object-fit: contain;
  margin: 0 2px;
}

/* Comments disabled / banned notices */
.gdm-comments-disabled, .gdm-banned-notice {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}
.gdm-comments-disabled {
  background: rgba(100,116,139,0.1);
  color: #94a3b8;
  border: 1px solid rgba(100,116,139,0.2);
}
.gdm-banned-notice {
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  border: 1px solid rgba(239,68,68,0.2);
}

/* ===== SPONSOR GIVEAWAYS CAROUSEL ===== */
.gdm-sponsor-giveaways {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--gdm-border, rgba(255,255,255,0.08));
}
.gdm-sponsor-giveaways h3 {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  color: var(--gdm-text, #e0e0e0);
}
.gdm-sponsor-carousel {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}
.gdm-sc-track {
  display: flex;
  transition: transform 0.35s ease;
}
.gdm-sc-slide {
  flex: 0 0 100%;
  min-width: 100%;
  cursor: pointer;
  position: relative;
  border-radius: 10px;
  overflow: hidden;
}
.gdm-sc-slide img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.gdm-sc-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 1.5rem 0.75rem 0.6rem;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}
.gdm-sc-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gdm-sc-entries {
  font-size: 0.72rem;
  color: rgba(255,255,255,0.7);
  flex-shrink: 0;
}
.gdm-sc-entries i {
  margin-right: 3px;
}

/* Arrows */
.gdm-sc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  z-index: 2;
}
.gdm-sponsor-carousel:hover .gdm-sc-arrow { opacity: 1; }
.gdm-sc-prev { left: 6px; }
.gdm-sc-next { right: 6px; }
.gdm-sc-arrow:hover { background: rgba(0,0,0,0.75); }

/* Dots */
.gdm-sc-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
}
.gdm-sc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: var(--gdm-border, rgba(255,255,255,0.15));
  cursor: pointer;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s, transform 0.2s;
}
.gdm-sc-dot.active {
  background: var(--gdm-accent, #8b5cf6);
  transform: scale(1.3);
}
.gdm-sc-dot:hover:not(.active) {
  background: rgba(255,255,255,0.35);
}

@media (max-width: 768px) {
  .gdm-sc-dot {
    width: 5px;
    height: 5px;
  }
}

/* Description in left column */
.gdm-left .gdm-description {
  margin-top: 0.75rem;
}
.gdm-left .gdm-description h3 {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}
.gdm-left .gdm-description p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--gdm-text-muted, #a0a0b0);
}
