/* =========================================================================
   click2play — STYLES
   Dark, high-contrast "gaming offer wall" theme. Colors are tokenized as
   CSS variables at the top so a full re-brand is a find/replace away.
   ========================================================================= */

:root {
  --bg: #0b0d17;
  --bg-elevated: #131629;
  --bg-card: #171b31;
  --border: #262b4a;
  --text: #f1f3fb;
  --text-muted: #9aa0c3;
  --accent: #7c3aed;
  --accent-2: #22d3ee;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at 20% -10%, #1c1f3d 0%, var(--bg) 45%);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

body.no-scroll {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ------------------------------- Header -------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 13, 23, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-mark {
  font-size: 1.5rem;
}

.main-nav {
  display: flex;
  gap: 24px;
}

.main-nav a {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--text);
  border-bottom-color: var(--accent-2);
}

/* -------------------------------- Hero ---------------------------------- */

.hero {
  padding: 56px 0 40px;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  margin: 0 0 14px;
  background: linear-gradient(90deg, var(--text), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
}

.hero-sub {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 32px;
  flex-wrap: wrap;
}

.hero-stats div {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stats strong {
  font-size: 1.4rem;
  color: var(--accent-2);
}

.hero-stats span {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ------------------------------- Ad slots -------------------------------- */

.ad-container {
  padding-top: 16px;
}

.ad-slot {
  width: 100%;
  text-align: center;
}

.ad-frame {
  display: block;
  margin: 0 auto;
  border: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Games on the left, 160px ad sidebar on the right (wide screens only). */
.page-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.page-main {
  flex: 1;
  min-width: 0;
}

.sidebar {
  display: none;
  width: 160px;
  flex-shrink: 0;
  align-self: stretch;
  padding-top: 36px;
}

.sidebar .ad-slot {
  margin-bottom: 24px;
}

.sidebar .ad-placeholder {
  padding: 12px 6px;
  font-size: 0.72rem;
}

.sidebar-sticky {
  position: sticky;
  top: 84px;
}

@media (min-width: 1100px) {
  .sidebar {
    display: block;
  }
}

.ad-placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  color: var(--text-muted);
  padding: 18px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
}

.ad-placeholder small {
  color: #666c94;
  font-size: 0.72rem;
}

/* ------------------------------- Controls -------------------------------- */

.controls {
  padding: 36px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#offer-search {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1rem;
}

#offer-search:focus {
  outline: none;
  border-color: var(--accent-2);
}

.chips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  color: var(--text);
  border-color: var(--accent-2);
}

.chip-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ------------------------------- Offer grid ------------------------------ */

.offer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  padding: 28px 0 60px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--accent-2);
}

.card-thumb {
  position: relative;
  height: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon {
  font-size: 3rem;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-rating {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--warning);
}

.card-body {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-category {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  font-weight: 700;
}

.card-title {
  margin: 0;
  font-size: 1.1rem;
}

.card-desc {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  flex: 1;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-reward {
  margin: 4px 0 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--success);
}

.card-sponsored {
  margin: 4px 0 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn {
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 18px;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), #a855f7);
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.1);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.btn-block {
  width: 100%;
}

/* The native ad takes a whole row of the grid (so it can't stretch the game
   cards beside it) and is capped in height. */
.ad-slot-infeed {
  grid-column: 1 / -1;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  max-height: 340px;
  min-height: 0;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

/* ---------------------------- How it works -------------------------------- */

.how-it-works {
  background: var(--bg-elevated);
  padding: 56px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.how-it-works h2 {
  text-align: center;
  margin: 0 0 32px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
}

.step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  margin-bottom: 12px;
}

.step h3 {
  margin: 0 0 8px;
}

.step p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* -------------------------------- Footer ---------------------------------- */

.site-footer {
  padding: 40px 0 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  padding-bottom: 24px;
}

.footer-brand {
  font-weight: 800;
  font-size: 1.05rem;
  margin: 0 0 8px;
}

.footer-disclaimer {
  max-width: 520px;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 0;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

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

.footer-admin-link {
  opacity: 0.55;
  font-size: 0.78rem;
}

.footer-admin-link:hover {
  opacity: 1;
}

.footer-copy {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--border);
  padding: 16px 0;
  margin: 0;
}

/* -------------------------------- Locker ----------------------------------- */

.locker-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 12, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 100;
}

.locker-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.locker-panel {
  position: relative;
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.locker-panel h3 {
  margin: 0 0 6px;
  padding-right: 24px;
}

.locker-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 18px;
}

.locker-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.locker-close:hover {
  color: var(--text);
}

.locker-tasks {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  text-align: left;
}

.task-btn:hover {
  border-color: var(--accent-2);
}

.task-check {
  opacity: 0;
  color: var(--success);
  font-weight: 800;
  transition: opacity 0.1s ease;
}

.task-done {
  border-color: var(--success);
}

.task-done .task-check {
  opacity: 1;
}

.locker-note {
  margin: 14px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.locker-success {
  text-align: center;
  padding: 10px 0;
}

.success-icon {
  font-size: 2.6rem;
  display: block;
  margin-bottom: 10px;
}

/* --------------------------- Simple content pages ---------------------------- */

.page-content {
  padding: 48px 0 80px;
  max-width: 760px;
  margin: 0 auto;
}

.page-content h1 {
  margin-top: 0;
}

.page-content h2 {
  margin-top: 32px;
}

.page-content p,
.page-content li {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.contact-form input,
.contact-form textarea {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* --------------------------------- Responsive --------------------------------- */

@media (max-width: 640px) {
  .main-nav {
    gap: 14px;
  }
  .header-inner {
    height: auto;
    padding: 12px 0;
    flex-wrap: wrap;
    gap: 10px;
  }
  .hero {
    padding: 40px 0 28px;
  }
  .footer-inner {
    flex-direction: column;
  }
}

/* ---------------------------------- Admin ----------------------------------- */

.admin-wrap {
  padding: 40px 0 80px;
  max-width: 880px;
  margin: 0 auto;
}

.admin-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.85rem;
  color: var(--text);
  margin-bottom: 28px;
}

.admin-warning strong {
  color: var(--warning);
}

.admin-warning.admin-info {
  background: rgba(34, 211, 238, 0.08);
  border-color: var(--accent-2);
}

.admin-warning.admin-info strong {
  color: var(--accent-2);
}

/* Banners that only make sense in one admin mode (body[data-mode] is set by admin.js) */
.only-local,
.only-server {
  display: none;
}

body[data-mode="local"] .only-local,
body[data-mode="server"] .only-server {
  display: block;
}

.admin-login-card {
  max-width: 380px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
}

.admin-login-card h1 {
  margin-top: 0;
  font-size: 1.3rem;
}

.admin-login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  margin: 16px 0;
  font-size: 0.95rem;
}

.admin-login-error {
  color: var(--danger);
  font-size: 0.85rem;
  min-height: 1.2em;
  margin: 0 0 8px;
}

.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.admin-toolbar h1 {
  margin: 0;
  font-size: 1.5rem;
}

.admin-toolbar-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  border-color: var(--accent-2);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid var(--danger);
  color: #fca5a5;
}

.btn-danger:hover {
  filter: brightness(1.15);
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.82rem;
}

.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.admin-section h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
}

.admin-item-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
}

.admin-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-item-body {
  flex: 1;
  min-width: 0;
}

.admin-item-title {
  font-weight: 700;
  margin: 0;
}

.admin-item-meta {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
}

.badge-custom {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.badge-shipped {
  background: rgba(34, 211, 238, 0.15);
  color: var(--accent-2);
}

.admin-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px 0;
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.field.field-full {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.field textarea {
  min-height: 80px;
  resize: vertical;
}

.emoji-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.emoji-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  font-size: 1.1rem;
  cursor: pointer;
}

.emoji-btn:hover,
.emoji-btn.emoji-active {
  border-color: var(--accent-2);
}

.admin-form-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.admin-status {
  font-size: 0.85rem;
  margin-top: 10px;
  min-height: 1.2em;
}

.admin-status.status-ok {
  color: var(--success);
}

.admin-status.status-error {
  color: var(--danger);
}

@media (max-width: 640px) {
  .admin-form {
    grid-template-columns: 1fr;
  }
  .admin-item {
    flex-wrap: wrap;
  }
}
