/* â”€â”€ Reset & Base â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg:           #0B0D14;
  --surface:      #12151D;
  --glass:        rgba(255,255,255,0.02);
  --glass-border: rgba(255,255,255,0.05);
  --accent:       #e01e3c;
  --accent2:      #a00723;
  --accent3:      #738899;
  --text:         #e8eaf6;
  --muted:        #7a7f9a;
  --card-bg:      #161923;
  --chip-bg:      #1C202C;
  --chip-active:  #e01e3c;
  --danger:       #ff4757;
  --success:      #00e676;
  --warn:         #ffab40;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 10px 30px rgba(0,0,0,0.5);
  --transition:   0.2s ease-in-out;
}

[data-theme="light"] {
  --bg:           #f0f2ff;
  --surface:      #ffffff;
  --glass:        rgba(255,255,255,0.7);
  --glass-border: rgba(224,30,60,0.15);
  --text:         #1a1d2e;
  --muted:        #6b7280;
  --card-bg:      #ffffff;
  --chip-bg:      #ffe8eb;
  --shadow:       0 20px 50px rgba(224,30,60,0.12);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Outfit', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* â”€â”€ Animated BG Particles â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.bg-particles {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-particles span {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.15;
  animation: float 18s linear infinite;
}
.bg-particles span:nth-child(1)  { left:10%; top:20%; animation-duration:20s; width:6px;height:6px; background:var(--accent2); }
.bg-particles span:nth-child(2)  { left:30%; top:70%; animation-duration:25s; animation-delay:-5s; }
.bg-particles span:nth-child(3)  { left:50%; top:40%; animation-duration:15s; animation-delay:-8s; background:var(--accent3); opacity:0.1; width:8px;height:8px; }
.bg-particles span:nth-child(4)  { left:70%; top:10%; animation-duration:22s; animation-delay:-2s; }
.bg-particles span:nth-child(5)  { left:85%; top:60%; animation-duration:18s; animation-delay:-12s; background:var(--accent2); }
.bg-particles span:nth-child(6)  { left:15%; top:85%; animation-duration:30s; animation-delay:-6s; width:5px;height:5px; }
.bg-particles span:nth-child(7)  { left:60%; top:80%; animation-duration:20s; animation-delay:-15s; background:var(--accent3); }
.bg-particles span:nth-child(8)  { left:40%; top:15%; animation-duration:24s; animation-delay:-3s; width:3px;height:3px; }
.bg-particles span:nth-child(9)  { left:90%; top:35%; animation-duration:28s; animation-delay:-10s; background:var(--accent2); opacity:0.08; width:10px;height:10px; }
.bg-particles span:nth-child(10) { left:5%;  top:50%; animation-duration:22s; animation-delay:-18s; }

@keyframes float {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0.15; }
  50%  { opacity: 0.25; }
  100% { transform: translateY(-120vh) rotate(720deg); opacity: 0; }
}

/* â”€â”€ Topbar â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.topbar {
  position: sticky; top: 20px; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 10px 20px;
  margin: 20px auto 20px auto;
  max-width: 1232px;
  width: calc(100% - 48px);
  background: var(--card-bg);
  border: 1px solid rgba(224, 30, 60, 0.2);
  border-radius: 16px;
  box-shadow: 0 4px 25px rgba(0,0,0,0.5);
  transition: all var(--transition);
}
.topbar-main {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
}

/* ── Inline Ticker ───────────────────────────────── */
.ticker-inline {
  flex: 1;
  display: flex;
  align-items: center;
  min-width: 0;
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  margin: 0 8px;
  height: 36px;
  overflow: hidden;
}
.ticker-label {
  flex-shrink: 0;
  padding: 0 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  display: flex; align-items: center; gap: 5px;
  border-right: 1px solid rgba(224, 30, 60, 0.25);
  height: 100%;
  background: rgba(224, 30, 60, 0.07);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ticker-wrap {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex; align-items: center;
  -webkit-mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
  mask-image: linear-gradient(to right, transparent, black 4%, black 96%, transparent);
}
.ticker {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.76rem;
  color: var(--muted);
  animation: ticker-scroll 40s linear infinite;
  padding-left: 100%;
}
@keyframes ticker-scroll {
  0%   { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}
[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(224, 30, 60, 0.2);
  box-shadow: 0 15px 35px rgba(224, 30, 60, 0.1), inset 0 1px 0 rgba(255,255,255,1), 0 0 20px rgba(224, 30, 60, 0.1);
}
.topbar-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.5rem; font-weight: 800;
}
.logo-emoji { font-size: 1.8rem; }
.logo-img { height: 32px; width: auto; object-fit: contain; }
.logo-text {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.topbar-actions { display: flex; gap: 10px; }

.icon-btn {
  width: 40px; height: 40px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--glass);
  color: var(--text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: all var(--transition);
  position: relative;
}
.icon-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: scale(1.1);
}
.fav-btn:hover { background: var(--accent2); border-color: var(--accent2); }

.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--accent2);
  color: white;
  border-radius: 50%;
  width: 18px; height: 18px;
  font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}
.hidden { display: none !important; }

/* â”€â”€ Main Layout â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.main-layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.main-layout > * {
  min-width: 0;
}

/* â”€â”€ Glass Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px);
  border-radius: var(--radius);
}

/* â”€â”€ Filters Panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.filters-panel {
  padding: 28px 22px;
  display: flex; flex-direction: column; gap: 22px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  position: sticky; top: 80px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
}
.filters-panel > * {
  flex-shrink: 0;
}
.filters-panel::-webkit-scrollbar { width: 4px; }
.filters-panel::-webkit-scrollbar-track { background: transparent; }
.filters-panel::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}
.panel-title {
  font-size: 1.1rem; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.panel-title i { color: var(--accent); }

.reset-btn {
  background: none; border: none;
  color: var(--muted); font-size: 0.85rem; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; gap: 6px;
  transition: color var(--transition);
}
.reset-btn:hover { color: var(--text); }

/* â”€â”€ Filter Groups â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.filter-group { display: flex; flex-direction: column; gap: 10px; }

.filter-label {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.filter-label i { color: var(--accent); }


.chip-group { display: flex; flex-wrap: wrap; gap: 7px; }

.chip {
  padding: 6px 13px;
  border-radius: 50px;
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  color: var(--text);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: 'Outfit', sans-serif;
}
.chip:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.chip.active {
  background: var(--accent);
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 18px rgba(224,30,60,0.4);
}

/* â”€â”€ Styled Select â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.styled-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  cursor: pointer;
  transition: border-color var(--transition);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%237a7f9a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.styled-select:focus { outline: none; border-color: var(--accent); }

/* â”€â”€ Segmented Control â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.segmented-control {
  display: flex; gap: 10px;
}
.segment-btn {
  flex: 1; cursor: pointer;
}
.segment-btn input { display: none; }
.segment-content {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 0.85rem; font-weight: 500;
  transition: all var(--transition);
}
.segment-btn input:checked + .segment-content {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  box-shadow: 0 4px 15px rgba(224,30,60,0.4);
}
.radio-circle {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
  transition: all var(--transition);
}
.segment-btn input:checked + .segment-content .radio-circle {
  border-color: white;
  background: white;
  box-shadow: inset 0 0 0 3px var(--accent);
}

/* â”€â”€ Flag Grid â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.flag-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

.flag-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition);
  user-select: none;
}
.flag-chip input { display: none; }
.flag-chip:has(input:checked) {
  border-color: var(--danger);
  background: rgba(255,71,87,0.12);
  color: var(--danger);
}
.flag-chip span { pointer-events: none; }

/* â”€â”€ Styled Input â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.styled-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--chip-bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  transition: border-color var(--transition);
}
.styled-input:focus { outline: none; border-color: var(--accent); }
.styled-input::placeholder { color: var(--muted); }
.styled-input.small { width: auto; flex: 1; }

/* â”€â”€ Range Slider â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.amount-header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; margin-bottom: 6px;
}
.amount-title {
  display: flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted);
}
.amount-title i { color: var(--accent); }
.amount-badge {
  color: var(--accent);
  font-size: 1.2rem; font-weight: 800;
  background: none; -webkit-text-fill-color: initial;
}
.styled-range {
  -webkit-appearance: none;
  width: 100%; height: 4px;
  border-radius: 50px;
  background: linear-gradient(to right, var(--accent) 0%, var(--accent) 10%, var(--chip-bg) 10%);
  outline: none; cursor: pointer;
  transition: background var(--transition);
}
.styled-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid white;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(224,30,60,0.5);
  transition: transform var(--transition);
}
.styled-range::-webkit-slider-thumb:hover { transform: scale(1.2); }


/* ── Advanced Filters Accordion ───────────────────── */
.advanced-filters {
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 5px;
  transition: all var(--transition);
}
.advanced-filters-summary {
  padding: 12px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none; /* Hide default arrow */
  user-select: none;
  background: rgba(255,255,255,0.02);
  transition: background var(--transition);
}
.advanced-filters-summary::-webkit-details-marker {
  display: none;
}
.advanced-filters-summary:hover {
  background: rgba(255,255,255,0.05);
}
.advanced-filters-summary span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.advanced-filters-summary span i {
  color: var(--accent);
}
.advanced-filters-summary .chevron-icon {
  transition: transform 0.3s ease;
  color: var(--muted);
}
.advanced-filters[open] .advanced-filters-summary .chevron-icon {
  transform: rotate(180deg);
}
.advanced-filters[open] .advanced-filters-summary {
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
}
.advanced-filters-content {
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}


/* ── Generate Button ────────────────────────────── */
.btn-generate {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem; font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
  box-shadow: 6px 6px 0px #000;
  position: relative; overflow: hidden;
  margin-top: 10px;
}
.btn-generate::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 0;
}
.btn-generate i, .btn-generate span { 
  position: relative; 
  z-index: 1; 
}
.btn-generate:hover {
  transform: translate(2px, 2px);
  box-shadow: 4px 4px 0px #000;
}
.btn-generate:hover::after {
  opacity: 1;
}
.btn-generate:active {
  transform: translate(6px, 6px);
  box-shadow: 0px 0px 0px #000;
}
.btn-generate:disabled { 
  opacity: 0.5; 
  cursor: not-allowed; 
  transform: translate(6px, 6px);
  box-shadow: 0px 0px 0px #000;
}

/* ── Mini Stats ── */
.stats-grid {
  display: flex; gap: 10px;
  margin-top: 5px;
}
.stat-card {
  flex: 1;
  background: var(--chip-bg);
  border-radius: 8px;
  padding: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 1px solid var(--glass-border);
}
.stat-card i { color: var(--accent); font-size: 1.1rem; }
.stat-card span { font-size: 0.7rem; color: var(--muted); }
.stat-card strong { font-size: 1.4rem; font-weight: 800; color: var(--accent); }

/* â”€â”€ Jokes Panel â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.jokes-panel {
  display: flex; flex-direction: column; gap: 18px;
}

.joke-results {
  display: flex; flex-direction: column; gap: 18px;
  min-height: 300px;
}

/* â”€â”€ Empty State â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  background: transparent;
  border: none;
  padding: 80px 40px;
  animation: fadeIn 0.4s ease;
}
.empty-masks-custom {
  margin-bottom: 20px;
  animation: floatUpDown 3s ease-in-out infinite;
}
@keyframes floatUpDown {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.empty-title {
  font-size: 2.6rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 12px 0;
  letter-spacing: -0.5px;
}
.empty-desc {
  font-size: 1.15rem;
  color: #9ca3af;
  line-height: 1.6;
  margin: 0;
}
.highlight-generate {
  color: #ff3b5c;
  font-weight: 700;
}
.empty-underline {
  margin-top: 15px;
}

/* ── Info Cards ── */
.info-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  margin-top: 20px;
}
.info-card {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 20px;
  display: flex; align-items: flex-start; gap: 15px;
}
.info-card .icon-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 15px rgba(224,30,60,0.4);
  flex-shrink: 0;
}
.info-text h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.info-text p { font-size: 0.8rem; color: var(--muted); line-height: 1.4; }

/* ── Inline Footer ── */
.site-footer-inline {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--glass-border);
}
.disclaimer-icon {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; flex-shrink: 0;
}
.site-footer-inline p { font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin: 0; }
.site-footer-inline strong { color: var(--text); }

/* â”€â”€ Joke Card â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.joke-card-item {
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 26px;
  display: flex; flex-direction: column; gap: 16px;
  position: relative; overflow: hidden;
  animation: slideUp 0.4s cubic-bezier(0.4,0,0.2,1) both;
  transition: transform var(--transition), box-shadow var(--transition);
}
.joke-card-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}
.joke-card-item::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2), var(--accent3));
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Stagger delays for multiple jokes */
.joke-card-item:nth-child(1) { animation-delay: 0s; }
.joke-card-item:nth-child(2) { animation-delay: 0.06s; }
.joke-card-item:nth-child(3) { animation-delay: 0.12s; }
.joke-card-item:nth-child(4) { animation-delay: 0.18s; }
.joke-card-item:nth-child(5) { animation-delay: 0.24s; }
.joke-card-item:nth-child(6) { animation-delay: 0.30s; }
.joke-card-item:nth-child(7) { animation-delay: 0.36s; }
.joke-card-item:nth-child(8) { animation-delay: 0.42s; }
.joke-card-item:nth-child(9) { animation-delay: 0.48s; }
.joke-card-item:nth-child(10){ animation-delay: 0.54s; }

.joke-card-top {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.joke-meta { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
}
.tag-cat {
  background: rgba(224,30,60,0.18);
  color: var(--accent);
  border: 1px solid rgba(224,30,60,0.3);
}
.tag-id {
  background: rgba(115,136,153,0.1);
  color: var(--accent3);
  border: 1px solid rgba(115,136,153,0.2);
}
.tag-flags {
  background: rgba(255,71,87,0.12);
  color: var(--danger);
  border: 1px solid rgba(255,71,87,0.25);
}
.tag-lang {
  background: rgba(0,230,118,0.1);
  color: var(--success);
  border: 1px solid rgba(0,230,118,0.2);
}

.joke-actions { display: flex; gap: 8px; }
.action-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.action-btn:hover { transform: scale(1.1); }
.action-btn.fav-toggle:hover { color: #ff4757; border-color: #ff4757; background: rgba(255,71,87,0.1); }
.action-btn.fav-toggle.active { color: #ff4757; border-color: #ff4757; background: rgba(255,71,87,0.15); }
.action-btn.copy-btn:hover { color: var(--accent3); border-color: var(--accent3); background: rgba(115,136,153,0.1); }
.action-btn.share-btn:hover { color: var(--success); border-color: var(--success); background: rgba(0,230,118,0.1); }
.action-btn.dl-btn:hover { color: #00bcd4; border-color: #00bcd4; background: rgba(0,188,212,0.1); }

.joke-watermark {
  text-align: right;
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--glass-border);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-family: 'Outfit', sans-serif;
}
.joke-watermark span {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.joke-body { line-height: 1.75; }

.joke-single {
  font-size: 1.1rem;
  color: var(--text);
}

.joke-setup {
  font-size: 1.05rem; font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
}
.joke-punchline {
  font-size: 1.1rem; font-style: italic;
  color: var(--accent2);
  padding: 14px 18px;
  border-left: 3px solid var(--accent2);
  background: rgba(160,7,35,0.07);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* â”€â”€ Loading Spinner â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: 80px 40px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
}
.spinner-ring {
  width: 60px; height: 60px;
  border: 4px solid var(--glass-border);
  border-top-color: var(--accent);
  border-right-color: var(--accent2);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-state p { color: var(--muted); font-size: 1rem; }

/* â”€â”€ Error State â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.error-state {
  text-align: center; padding: 50px 30px;
  background: rgba(255,71,87,0.06);
  border: 1px solid rgba(255,71,87,0.2);
  border-radius: var(--radius);
  color: var(--danger);
}
.error-state i { font-size: 2.5rem; margin-bottom: 12px; }

/* â”€â”€ Rate Limit State â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.rate-limit-state {
  background: rgba(255,171,64,0.06);
  border-color: rgba(255,171,64,0.25);
  color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.rate-limit-icon {
  font-size: 3.5rem;
  animation: pulse-warn 1.2s ease-in-out infinite;
}
@keyframes pulse-warn {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%       { transform: scale(1.15); opacity: 0.75; }
}
.rate-limit-state h3 { font-size: 1.4rem; font-weight: 700; color: var(--warn); }
.rate-limit-state p  { color: var(--muted); line-height: 1.6; }
.rate-hint { font-size: 0.82rem !important; }

.countdown-ring {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 3px solid rgba(255,171,64,0.3);
  background: rgba(255,171,64,0.08);
  box-shadow: 0 0 0 6px rgba(255,171,64,0.06), 0 0 0 12px rgba(255,171,64,0.03);
  animation: ring-pulse 1s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 6px rgba(255,171,64,0.06), 0 0 0 12px rgba(255,171,64,0.03); }
  50%       { box-shadow: 0 0 0 10px rgba(255,171,64,0.1), 0 0 0 20px rgba(255,171,64,0.05); }
}
.countdown-ring span { font-size: 2rem; font-weight: 800; color: var(--warn); line-height: 1; }
.countdown-ring small { font-size: 0.68rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* â”€â”€ Toast Notification â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(80px);
  padding: 12px 24px;
  border-radius: 50px;
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--glass-border);
  font-size: 0.9rem; font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--success); color: var(--success); }
.toast.error   { border-color: var(--danger);  color: var(--danger); }
.toast.info    { border-color: var(--accent);   color: var(--accent); }

/* â”€â”€ Modal â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-box {
  width: 100%; max-width: 600px; max-height: 90vh;
  display: flex; flex-direction: column; gap: 18px;
  padding: 28px;
  background: var(--card-bg) !important;
  animation: scaleIn 0.25s cubic-bezier(0.4,0,0.2,1);
  overflow-y: auto;
}
@keyframes scaleIn { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: scale(1); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h2 { font-size: 1.2rem; font-weight: 700; display: flex; gap: 10px; align-items: center; }
.modal-header h2 i { color: var(--accent2); }

.fav-list {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
  padding-right: 4px;
}
.fav-list::-webkit-scrollbar { width: 4px; }
.fav-list::-webkit-scrollbar-track { background: transparent; }
.fav-list::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 2px; }

.fav-item {
  background: var(--chip-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
}
.fav-item-text { flex: 1; }
.fav-remove {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 0.9rem; padding: 2px;
  transition: color var(--transition);
  flex-shrink: 0;
}
.fav-remove:hover { color: var(--danger); }

.fav-empty { text-align: center; padding: 40px; color: var(--muted); }
.btn-danger {
  padding: 10px;
  border: 1px solid rgba(255,71,87,0.3);
  border-radius: var(--radius-sm);
  background: rgba(255,71,87,0.08);
  color: var(--danger);
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem; font-weight: 600;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--transition);
}
.btn-danger:hover { background: rgba(255,71,87,0.2); }

/* ── Story Editor Modal ───────────────────────────── */
.story-modal-box {
  max-width: 900px;
}
.story-editor-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-width: 0;
}
.story-editor-layout > div {
  min-width: 0;
}
.story-controls {
  display: flex; flex-direction: column; gap: 15px;
}
.styled-color {
  width: 100%; height: 38px; border: none; border-radius: var(--radius-sm);
  background: var(--chip-bg); cursor: pointer; padding: 0; overflow: hidden;
}
.styled-color::-webkit-color-swatch-wrapper { padding: 0; }
.styled-color::-webkit-color-swatch { border: 1px solid var(--glass-border); border-radius: var(--radius-sm); }

.story-textarea {
  min-height: 100px; resize: vertical; line-height: 1.6;
}

.story-preview-wrapper {
  background: var(--bg);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  padding: 15px;
  height: 400px; 
  overflow: hidden;
  width: 100%;
}
.canvas-scaler {
  width: 194px; /* 1080 * 0.18 */
  height: 345px; /* 1920 * 0.18 */
  position: relative;
  flex-shrink: 0;
}
.story-preview-canvas {
  width: 1080px; height: 1920px;
  position: absolute;
  top: 0; left: 0;
  transform-origin: top left;
  transform: scale(0.18); 
  background: #000000;
  box-shadow: 0 0 50px rgba(0,0,0,0.5);
  pointer-events: none; /* Prevent interaction scaling issues */
}

/* ── Interactive Effects ──────────────────────────── */
.floating-emoji {
  position: fixed;
  bottom: -60px;
  font-size: 2.5rem;
  z-index: 9999;
  pointer-events: none;
  animation: floatUp 2.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  opacity: 0;
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(0.5); opacity: 0; }
  10% { opacity: 1; transform: translateY(-80px) scale(1.2); }
  100% { transform: translateY(-700px) scale(0.9); opacity: 0; }
}

/* ── Elementor Motion Effects ───────────────────── */
.el-motion {
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1);
}

.el-fade-in-up { transform: translateY(40px); }
.el-fade-in-down { transform: translateY(-40px); }
.el-fade-in-left { transform: translateX(-40px); }
.el-fade-in-right { transform: translateX(40px); }
.el-zoom-in { transform: scale(0.8); }

.el-motion.el-in-view {
  opacity: 1;
  transform: translate(0, 0) scale(1);
}

/* ── Footer ───────────────────────────────────────── */
.site-footer {
  display: none;
}

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 960px) {
  .main-layout {
    grid-template-columns: 1fr;
    padding: 20px 16px;
  }
  .filters-panel { position: static; }
  .info-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  /* Navbar wraps to two rows */
  .topbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 16px;
  }
  /* Row 1: logo stays left, buttons push right */
  .topbar-logo { flex-shrink: 0; }
  .topbar-actions { flex-shrink: 0; margin-left: auto; }
  /* Row 2: ticker goes full width below */
  .ticker-inline {
    order: 3;
    width: 100%;
    flex: none;
    margin: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--glass-border);
    height: 30px;
  }

  /* Story modal: stack vertically on mobile */
  .story-modal-box {
    max-width: 100%;
    max-height: 95vh;
  }
  .story-editor-layout {
    grid-template-columns: 1fr;
  }
  /* Shrink preview so it fits without scrolling out of view */
  .story-preview-wrapper {
    height: 260px;
    padding: 10px;
  }
  .canvas-scaler {
    width: 123px;  /* 1080 * 0.114 */
    height: 219px; /* 1920 * 0.114 */
  }
  .story-preview-canvas {
    transform: scale(0.114);
  }
}

@media (max-width: 500px) {
  .topbar { padding: 10px 14px; }
  .logo-text { display: none; }
  .joke-card-item { padding: 18px; }
  .modal-box { padding: 16px; max-height: 95vh; }
  .info-cards { grid-template-columns: 1fr; }

  /* Even smaller preview for tiny phones */
  .story-preview-wrapper {
    height: 220px;
    padding: 8px;
  }
  .canvas-scaler {
    width: 101px;  /* 1080 * 0.094 */
    height: 181px; /* 1920 * 0.094 */
  }
  .story-preview-canvas {
    transform: scale(0.094);
  }

  /* Full-width overlay with minimal side padding on tiny phones */
  .modal-overlay {
    padding: 10px;
  }
}
