/* ============================================================
   GRIT — Fun Page (Fails & Funny Moments)
   fun.css
   ============================================================ */

.fun-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px 120px;
}

/* ── Hero ─────────────────────────────────────────────────── */
.fun-hero {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 32px 0 28px;
  padding: 52px 52px;
}
.fun-hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 100% at 15% 50%, rgba(255,100,50,0.15) 0%, transparent 65%),
    radial-gradient(ellipse 50% 80% at 85% 25%, rgba(255,200,50,0.1) 0%, transparent 65%),
    linear-gradient(135deg, rgba(5,6,15,0.98) 0%, rgba(15,8,5,0.95) 100%);
}
.fun-hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,100,50,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,100,50,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.fun-hero-content {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.fun-hero-badge {
  font-size: 28px; margin-bottom: 12px; letter-spacing: 8px;
}
.fun-hero-text h1 {
  font-family: 'Rajdhani', sans-serif;
  font-size: 52px; font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, #ff8c50 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; margin-bottom: 10px; line-height: 1.05;
}
.fun-hero-text p { font-size: 15px; color: var(--text-muted); max-width: 480px; line-height: 1.65; }

.fun-submit-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  background: linear-gradient(135deg, #ff6030, #ff9030);
  border: none; border-radius: var(--radius-lg);
  color: #fff; font-size: 15px; font-weight: 700;
  font-family: 'Rajdhani', sans-serif; letter-spacing: 0.05em;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(255,96,48,0.4);
  flex-shrink: 0;
}
.fun-submit-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(255,96,48,0.5); }

/* ── Filter bar ───────────────────────────────────────────── */
.fun-filter-bar {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 32px; flex-wrap: wrap; gap: 12px;
}
.fun-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.fun-filter {
  padding: 8px 18px; border-radius: 99px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-muted); font-size: 13px;
  font-weight: 500; font-family: inherit; cursor: pointer;
  transition: all 0.18s;
}
.fun-filter:hover { border-color: var(--border-lit); color: var(--text); }
.fun-filter.active {
  background: rgba(255,96,48,0.12);
  border-color: rgba(255,96,48,0.35);
  color: #ff8c50; font-weight: 600;
}
.fun-sort-wrap { display: flex; align-items: center; gap: 8px; }
.fun-select {
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); padding: 8px 28px 8px 12px;
  border-radius: var(--radius-sm); font-size: 13px;
  font-family: inherit; cursor: pointer; outline: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7194' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
}

/* ── Clips grid ───────────────────────────────────────────── */
.fun-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

/* ── Clip card ────────────────────────────────────────────── */
.clip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  animation: cardFadeUp 0.35s ease both;
}
.clip-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,96,48,0.3);
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
}
@keyframes cardFadeUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Video embed */
.clip-video-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  height: 0;
  background: #000;
  overflow: hidden;
}
.clip-video-wrap iframe {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%; border: none;
}

/* Card body */
.clip-card-body { padding: 16px 18px; }

.clip-card-top {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 10px; margin-bottom: 10px;
}
.clip-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px; font-weight: 700; color: #fff; line-height: 1.25;
  flex: 1;
}
.clip-cat-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 4px 10px; border-radius: 99px;
  flex-shrink: 0;
}
.clip-cat-badge.funny  { background: rgba(255,200,50,0.15);  color: #ffc832; border: 1px solid rgba(255,200,50,0.3); }
.clip-cat-badge.fail   { background: rgba(255,60,60,0.15);   color: #ff6060; border: 1px solid rgba(255,60,60,0.3); }
.clip-cat-badge.clutch { background: rgba(50,200,120,0.15);  color: #32c878; border: 1px solid rgba(50,200,120,0.3); }
.clip-cat-badge.rage   { background: rgba(255,100,50,0.15);  color: #ff8050; border: 1px solid rgba(255,100,50,0.3); }

.clip-meta {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-muted); margin-bottom: 12px;
  flex-wrap: wrap;
}
.clip-author { color: var(--purple); font-weight: 600; text-decoration: none; }
.clip-author:hover { color: var(--violet); }
.clip-game-tag {
  padding: 2px 8px; border-radius: 99px;
  background: rgba(124,124,255,0.1); border: 1px solid rgba(124,124,255,0.2);
  color: #a89bff; font-size: 11px; font-weight: 500;
}

/* Reaction bar */
.clip-reactions {
  display: flex; align-items: center; gap: 6px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.clip-react-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 99px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 14px; font-family: inherit;
  cursor: pointer; transition: all 0.18s; color: var(--text-muted);
}
.clip-react-btn:hover { background: rgba(255,255,255,0.09); border-color: var(--border-lit); transform: scale(1.05); }
.clip-react-btn.active { background: rgba(255,200,50,0.12); border-color: rgba(255,200,50,0.3); color: #ffc832; }
.clip-react-count { font-size: 12px; font-weight: 600; }

.clip-delete-btn {
  margin-left: auto; background: none; border: none;
  color: var(--text-hint); font-size: 11px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px; transition: all 0.15s;
}
.clip-delete-btn:hover { color: var(--red); background: rgba(255,92,92,0.08); }

/* ── Skeleton ─────────────────────────────────────────────── */
.clip-card.skeleton {
  height: 320px;
  background: linear-gradient(90deg, var(--bg-card) 25%, rgba(255,255,255,0.04) 50%, var(--bg-card) 75%);
  background-size: 400% 100%;
  animation: shimmer 1.5s infinite linear;
}
@keyframes shimmer { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* ── Empty state ──────────────────────────────────────────── */
.fun-empty {
  grid-column: 1/-1; text-align: center; padding: 80px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.fun-empty-icon { font-size: 56px; opacity: 0.35; }
.fun-empty-title { font-family:'Rajdhani',sans-serif; font-size:24px; font-weight:700; color:var(--text); }
.fun-empty-desc  { font-size:14px; color:var(--text-muted); max-width:320px; line-height:1.6; }

/* ── Load more ────────────────────────────────────────────── */
.fun-load-more { display:flex; justify-content:center; margin-top:32px; }
.fun-load-more-btn {
  padding: 12px 36px; background: rgba(255,255,255,0.04);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-muted); font-size:14px; font-weight:500;
  font-family:inherit; cursor:pointer; transition:all 0.18s;
}
.fun-load-more-btn:hover { background: rgba(255,255,255,0.08); border-color:var(--border-lit); color:var(--text); }

/* ── Submit Modal ─────────────────────────────────────────── */
.fun-modal-bg {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(8px);
  z-index: 500; align-items: center; justify-content: center; padding: 20px;
}
.fun-modal-bg.open { display: flex; }
.fun-modal {
  background: rgba(8,10,20,0.99);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl); padding: 40px 36px;
  max-width: 520px; width: 100%;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
  animation: modalIn 0.25s cubic-bezier(0.2,0.9,0.3,1) both;
  position: relative;
}
@keyframes modalIn {
  from { opacity:0; transform:translateY(20px) scale(0.96); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.fun-modal h2 {
  font-family: 'Rajdhani', sans-serif; font-size: 28px;
  font-weight: 700; color: #fff; margin-bottom: 6px;
}
.fun-modal p { font-size: 14px; color: var(--text-muted); margin-bottom: 24px; }
.fun-modal-close {
  position: absolute; top: 18px; right: 18px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted); font-size: 14px;
  width: 32px; height: 32px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all 0.18s;
}
.fun-modal-close:hover { background: rgba(255,92,92,0.12); color: #ff8a8a; }

.fun-modal-field { margin-bottom: 16px; }
.fun-modal-field label {
  display: block; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 7px;
}
.fun-modal-field label span { color: #ff6050; }
.fun-input {
  width: 100%; padding: 11px 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: var(--radius-md); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.fun-input:focus { border-color: #ff6030; box-shadow: 0 0 0 3px rgba(255,96,48,0.1); }
.fun-input::placeholder { color: var(--text-hint); }

.fun-cat-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.fun-cat-btn {
  padding: 8px 16px; border-radius: 99px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; font-weight: 500;
  font-family: inherit; cursor: pointer; transition: all 0.18s;
}
.fun-cat-btn:hover { border-color: var(--border-lit); color: var(--text); }
.fun-cat-btn.active {
  background: rgba(255,96,48,0.12); border-color: rgba(255,96,48,0.4);
  color: #ff8050; font-weight: 600;
}

.fun-modal-error { color: #ff8a8a; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
.fun-submit-modal-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #ff6030, #ff9030);
  border: none; border-radius: var(--radius-md);
  color: #fff; font-size: 15px; font-weight: 700;
  font-family: 'Rajdhani', sans-serif; letter-spacing: 0.05em;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(255,96,48,0.3); margin-top: 8px;
}
.fun-submit-modal-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(255,96,48,0.45); }
.fun-submit-modal-btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  .fun-page { padding: 0 16px 80px; }
  .fun-hero { padding: 32px 24px; }
  .fun-hero-text h1 { font-size: 36px; }
  .fun-grid { grid-template-columns: 1fr; }
  .fun-hero-content { flex-direction: column; align-items: flex-start; }
  .fun-submit-btn { width: 100%; justify-content: center; }
}
