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

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --border: #e2e5ea;
  --accent: #5b6af5;
  --accent-light: #eef0ff;
  --text: #1a1d23;
  --muted: #6b7280;
  --radius: 12px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: #1a0a3a;
  background-image: url("background.png");
  background-repeat: repeat;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem 1.75rem;
  background: rgba(8, 8, 18, 0.82);
  border: 2px solid rgba(255, 105, 180, 0.55);
  border-radius: 14px;
  box-shadow: 0 0 0 4px rgba(179, 255, 0, 0.22), 0 4px 18px rgba(0, 0, 0, 0.45);
}

header h1 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #ffe14a;
  text-shadow: 2px 2px 0 #ff3aa0, 4px 4px 0 rgba(120, 80, 255, 0.7);
}

header p {
  color: #ffb6e1;
  margin-top: 0.4rem;
  font-size: 0.95rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ── Tabs ── */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1 0 auto;
  padding: 0.85rem 1.25rem;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.tab-btn::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  transform: scaleX(0);
  transition: transform 0.2s;
}

.tab-btn:hover { color: var(--text); }

.tab-btn.active {
  color: var(--accent);
}

.tab-btn.active::after {
  transform: scaleX(1);
}

/* ── Panels ── */
.tab-panel {
  display: none;
  padding: 2rem;
  animation: fadeIn 0.2s ease;
}

.tab-panel.active { display: block; }

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

/* ── Panel content helpers ── */
.tab-panel h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.tab-panel p {
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.badge {
  background: var(--accent-light);
  color: var(--accent);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.mini-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}

.mini-card .icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.mini-card h3 { font-size: 0.9rem; font-weight: 600; }
.mini-card p  { font-size: 0.82rem; margin: 0.25rem 0 0; }

/* ── Trivia ── */
.trivia-day {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.1rem;
}

.trivia-question {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.55;
  margin-bottom: 1.35rem;
  color: var(--text);
}

.trivia-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.trivia-opt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
}

.trivia-opt:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.trivia-opt .opt-letter {
  font-weight: 700;
  color: var(--accent);
  min-width: 1.1rem;
}

.trivia-opt.correct { border-color: #22c55e; background: #f0fdf4; }
.trivia-opt.incorrect { border-color: #ef4444; background: #fef2f2; }
.trivia-opt:disabled { cursor: default; }

.trivia-result {
  margin-top: 1.1rem;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.88rem;
  display: none;
}

.trivia-result.win  { background: #f0fdf4; color: #16a34a; }
.trivia-result.lose { background: #fef2f2; color: #dc2626; }

.trivia-status { color: var(--muted); font-size: 0.9rem; }

/* ── Resources ── */
.resource-section { margin-top: 1.5rem; }
.resource-section:first-child { margin-top: 0; }

.resource-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.resource-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.resource-list a {
  color: var(--text);
  text-decoration: none;
  padding: 0.55rem 0.8rem;
  border-radius: 7px;
  border: 1px solid var(--border);
  display: block;
  font-size: 0.9rem;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.resource-list a:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Game ── */
.game-frame {
  width: 100%;
  height: min(70vh, 620px);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: block;
  background: #0a0a18;
}

/* ── Memes ── */
.meme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.meme-grid img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
  cursor: zoom-in;
  transition: transform 0.15s, border-color 0.15s;
}

.meme-grid img:hover {
  transform: scale(1.02);
  border-color: var(--accent);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 3rem 2rem;
  animation: fadeIn 0.15s ease;
}
.lightbox[hidden] { display: none; }

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7);
  cursor: zoom-out;
}

.lightbox-btn {
  position: absolute;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: opacity 0.15s;
}
.lightbox-btn:hover { opacity: 1; }

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  font-size: 2.75rem;
}

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

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.contact-form label {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.2rem;
  display: block;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color 0.2s;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  align-self: flex-start;
  padding: 0.6rem 1.4rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn:hover { opacity: 0.88; }

/* ── Contact button + modal ── */
.contact-toggle {
  margin-top: 1.5rem;
  padding: 0.55rem 1.15rem;
  background: #ff3aa0;
  color: #fff;
  border: 2px solid #ffe14a;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(179, 255, 0, 0.45), 0 4px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
}
.contact-toggle:hover { transform: scale(1.06); }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
.modal-overlay[hidden] { display: none; }

.modal-box {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  padding: 1.75rem 1.75rem 1.5rem;
  position: relative;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  border: 2px solid #ffd700;
}

.modal-close {
  position: absolute;
  top: 0.4rem;
  right: 0.6rem;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.modal-close:hover { color: var(--text); }

.modal-box h2 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.modal-box > p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

footer {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.8rem;
}
