/* ==========================================================
   Cleef Chat – modern start page
   ========================================================== */

@font-face {
  font-family: "SCRIPTBL";
  src: url("fonts/SCRIPTBL.eot");
  src: url("fonts/SCRIPTBL.eot?#iefix") format("embedded-opentype"),
    url("fonts/SCRIPTBL.woff") format("woff"),
    url("fonts/SCRIPTBL.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "text-security-disc";
  src: url("fonts/text-security-disc.eot");
  src: url("fonts/text-security-disc.eot?#iefix") format("embedded-opentype"),
    url("fonts/text-security-disc.woff") format("woff"),
    url("fonts/text-security-disc.ttf") format("truetype"),
    url("fonts/text-security-disc.svg#text-security") format("svg");
}

:root {
  --bg: #161618;
  --bg-2: #1e1e21;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #ececee;
  --muted: #a1a1a8;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --pink: #ff5ca8;
  --green: #34d399;
  --land: rgba(220, 220, 226, 0.26);
  --link-hover: #fff;
  --header-bg: rgba(22, 22, 24, 0.8);
  --menu-bg: rgba(22, 22, 24, 0.97);
  --tint: linear-gradient(180deg, rgba(18, 18, 20, 0.55) 0%, rgba(18, 18, 20, 0.78) 45%, rgba(18, 18, 20, 0.92) 100%);
  --card: rgba(30, 30, 33, 0.72);
  --map-bg: linear-gradient(180deg, rgba(34, 34, 37, 0.84), rgba(27, 27, 30, 0.88));
  --field: rgba(255, 255, 255, 0.06);
  --field-2: rgba(255, 255, 255, 0.05);
  --check-border: rgba(255, 255, 255, 0.25);
  --item: rgba(255, 255, 255, 0.035);
  --bubble-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  --radius: 22px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #eef1fb;
  --bg-2: #ffffff;
  --surface: rgba(22, 30, 80, 0.04);
  --surface-2: rgba(22, 30, 80, 0.07);
  --border: rgba(22, 30, 80, 0.1);
  --text: #161b36;
  --muted: #5b6385;
  --accent-2: #0aa5c7;
  --green: #059669;
  --land: rgba(70, 80, 170, 0.32);
  --link-hover: var(--accent);
  --header-bg: rgba(255, 255, 255, 0.72);
  --menu-bg: rgba(255, 255, 255, 0.97);
  --tint: linear-gradient(180deg, rgba(238, 241, 251, 0.5) 0%, rgba(238, 241, 251, 0.78) 45%, rgba(238, 241, 251, 0.93) 100%);
  --card: rgba(255, 255, 255, 0.72);
  --map-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(241, 244, 255, 0.86));
  --field: rgba(255, 255, 255, 0.85);
  --field-2: rgba(22, 30, 80, 0.05);
  --check-border: rgba(22, 30, 80, 0.28);
  --item: rgba(255, 255, 255, 0.6);
  --bubble-shadow: 0 4px 12px rgba(40, 45, 70, 0.12);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  overflow-x: hidden;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--link-hover); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
}

/* ---------- ambient background ---------- */
/* daily background photo comes from ./?Background on body; this layer tints it */
.bg-glow {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--tint);
  transition: background 0.3s;
}

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; height: 66px; gap: 16px; }

.brand { display: flex; align-items: center; gap: 12px; color: var(--text); margin-right: auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.brand-mark svg { width: 20px; height: 20px; fill: #fff; }
.brand h1 {
  margin: 0;
  font: normal 28px/1 "SCRIPTBL", var(--font);
}
.brand h1 small { font: 500 12px var(--font); color: var(--muted); margin-left: 6px; }

.menu { display: flex; list-style: none; margin: 0; padding: 0; gap: 4px; }
.menu a {
  display: block;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}
.menu a:hover { color: var(--text); background: var(--surface-2); }

.header .icon {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
}
.theme-toggle {
  width: 42px; height: 42px;
  flex: none;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle:active { transform: scale(0.94); }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .sun { display: none; }
:root[data-theme="light"] .theme-toggle .sun { display: block; }
:root[data-theme="light"] .theme-toggle .moon { display: none; }

.header .icon span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text); }

/* ---------- hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 1fr);
  gap: 22px;
  margin: 32px 0 26px;
}

.hero-map, .hero-login, .panel, .feature {
  background: var(--card);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.hero-map {
  position: relative;
  overflow: hidden;
  padding: 34px 34px 26px;
  display: flex;
  flex-direction: column;
  background:
    var(--map-bg);
}

.live-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: 99px;
  background: rgba(52, 211, 153, 0.12);
  color: var(--green);
  font-size: 12.5px; font-weight: 600;
}
.live-pill i {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  animation: ping 1.8s infinite;
}
.hero-title {
  margin: 16px 0 8px;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-title span {
  background: linear-gradient(90deg, var(--accent-2), var(--accent) 55%, var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { margin: 0 0 56px; color: var(--muted); max-width: 420px; }

/* ---------- map ---------- */
.map {
  position: relative;
  width: calc(100% + 28px);
  aspect-ratio: 120 / 43;
  margin: auto -14px;
}
@supports not (aspect-ratio: 1) {
  .map { height: 0; padding-bottom: 35.83%; }
}

.map-dots { position: absolute; inset: 0; }
.map-dots i {
  position: absolute;
  height: calc(100% / 43);
  background-image: radial-gradient(circle closest-side, var(--land) 58%, transparent 66%);
  background-size: calc(100% / var(--k)) 100%;
  background-repeat: repeat-x;
}

.map-arcs { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.map-arcs path {
  fill: none;
  stroke: rgba(124, 92, 255, 0.55);
  stroke-width: 1.4px;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 2 3;
  animation: flow 6s linear infinite;
}
.map-arcs path:nth-child(even) { stroke: rgba(34, 211, 238, 0.45); animation-duration: 8s; }

/* pins */
.spot { position: absolute; width: 0; height: 0; }
.spot::before, .spot::after {
  content: "";
  position: absolute;
  left: -4px; top: -4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
}
.spot::after { background: transparent; border: 2px solid var(--accent-2); animation: ripple 2.4s ease-out infinite; }

/* chat bubbles */
.bubble {
  --cycle: 18s;
  position: absolute;
  left: -16px;
  bottom: 14px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  color: #1a1f3a;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--bubble-shadow);
  transform-origin: 16px 100%;
  opacity: 0;
  animation: pop var(--cycle) calc(var(--d) - var(--cycle)) infinite both;
  z-index: 2;
}
.spot.right .bubble {
  left: auto;
  right: -16px;
  border-radius: 16px 16px 4px 16px;
  transform-origin: calc(100% - 16px) 100%;
}
.bubble[dir="rtl"] { padding: 6px 6px 6px 12px; }

.av {
  width: 24px; height: 24px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 11px; color: #fff;
}
.av1 { background: linear-gradient(135deg, #7c5cff, #b06bff); }
.av2 { background: linear-gradient(135deg, #ff5ca8, #ff8a65); }
.av3 { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.av4 { background: linear-gradient(135deg, #22d3ee, #3b82f6); }
.av5 { background: linear-gradient(135deg, #f59e0b, #ef4444); }
.av6 { background: linear-gradient(135deg, #ec4899, #8b5cf6); }
.av7 { background: linear-gradient(135deg, #06b6d4, #6366f1); }
.av8 { background: linear-gradient(135deg, #84cc16, #10b981); }

.typing, .msg { grid-row: 1; grid-column: 2; }
.msg { opacity: 0; animation: msg var(--cycle) calc(var(--d) - var(--cycle)) infinite both; }
.typing {
  justify-self: start;
  display: flex; gap: 3px;
  animation: typing var(--cycle) calc(var(--d) - var(--cycle)) infinite both;
}
.bubble[dir="rtl"] .typing { justify-self: end; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: #a3a9c9;
  animation: dot 1s infinite ease-in-out;
}
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }

.hero-stats {
  list-style: none;
  margin: 0;
  padding: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}
.hero-stats b { display: block; color: var(--text); font-size: 20px; font-weight: 700; }

/* ---------- login ---------- */
.hero-login { padding: 34px 30px 28px; display: flex; flex-direction: column; }
.titlepart h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.01em; }
.titlepart h3 { margin: 4px 0 24px; font-size: 14.5px; font-weight: 400; color: var(--muted); }

#login { margin: 0; }

.field { position: relative; margin-bottom: 14px; }
.field input, .captcha input {
  width: 100%;
  height: 54px;
  padding: 22px 16px 6px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--field);
  color: var(--text);
  font: 500 15px var(--font);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.field input:focus, .captcha input:focus {
  border-color: var(--accent);
  background: rgba(124, 92, 255, 0.08);
  box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18);
}
.field label {
  position: absolute;
  left: 17px; top: 17px;
  color: var(--muted);
  pointer-events: none;
  transition: all 0.18s ease;
}
.field input:focus + label,
.field input:not(:placeholder-shown) + label {
  top: 8px;
  font-size: 11.5px;
  color: var(--accent-2);
}

.pwinput {
  -webkit-text-security: disc !important;
  font-family: "text-security-disc" !important;
}

.field-title { display: block; font-size: 12.5px; color: var(--muted); margin: 4px 0 8px; }

.segmented {
  display: flex;
  padding: 4px;
  gap: 4px;
  border-radius: 14px;
  background: var(--field-2);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1;
  text-align: center;
  padding: 9px 6px;
  border-radius: 10px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.segmented label:hover { color: var(--text); }
.segmented input:checked + label {
  background: var(--accent);
  color: #fff;
}
.segmented input:focus-visible + label { outline: 2px solid var(--accent-2); }

.captcha { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }
.captcha img { border-radius: 10px; flex: none; }
.captcha input { height: 46px; padding: 6px 14px; }

.check { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; font-size: 13.5px; color: var(--muted); }
.check input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 20px; height: 20px;
  margin: 1px 0 0;
  border-radius: 6px;
  border: 1px solid var(--check-border);
  background: var(--field);
  cursor: pointer;
  display: grid; place-items: center;
}
.check input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after {
  content: "";
  width: 5px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: translateY(-1px) rotate(45deg);
}
.check label { cursor: pointer; }

.btn {
  display: block;
  width: 100%;
  height: 52px;
  margin-top: 8px;
  border: 0;
  border-radius: 14px;
  font: 700 16px var(--font);
  cursor: pointer;
  transition: transform 0.15s, background 0.2s, opacity 0.2s;
}
.btn-primary {
  color: #fff;
  background: var(--accent);
}
.btn-primary:hover { background: #6b4ff0; }
.btn-primary:active { transform: scale(0.99); }
.btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.btn-ghost { color: var(--text); background: var(--surface-2); border: 1px solid var(--border); }

.loggineduser { margin-bottom: 8px; color: var(--muted); }

.perks {
  list-style: none;
  margin: auto 0 0;
  padding: 22px 0 0;
  font-size: 13.5px;
  color: var(--muted);
}
.perks li { position: relative; padding-left: 26px; margin-top: 8px; }
.perks li::before {
  content: "";
  position: absolute;
  left: 0; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(52, 211, 153, 0.15);
}
.perks li::after {
  content: "";
  position: absolute;
  left: 6px; top: 6px;
  width: 3px; height: 7px;
  border: solid var(--green);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- content panels (PHP output) ---------- */
.panel { padding: 26px 28px; margin-bottom: 22px; }

.titlebox h4 { margin: 0 0 18px; font-size: 18px; font-weight: 700; }
.numcolor { color: var(--accent-2); }
.niemand { margin: 0; color: var(--muted); }

.userlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(86px, 1fr));
  gap: 18px 12px;
}
.userlist .onlineuser {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12.5px;
}
.userlist .onlineuser img {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  padding: 2px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transition: transform 0.2s;
}
.userlist .onlineuser:hover img { transform: scale(1.07); }
.userlist .onlineuser:hover { color: var(--text); }
.userlist .onlineuser b {
  max-width: 100%;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.foruments {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.foruments .item {
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--item);
  border: 1px solid var(--border);
  transition: border-color 0.2s, transform 0.2s;
}
.foruments .item:hover { border-color: rgba(124, 92, 255, 0.5); transform: translateY(-2px); }
.foruments .item h5 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--text); }
.foruments .item a:hover h5 { color: var(--accent-2); }
.foruments .item p { margin: 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin-bottom: 22px;
}
.feature { display: flex; gap: 16px; align-items: flex-start; padding: 22px; }
.feature b { display: block; margin-bottom: 2px; }
.feature p { margin: 0; color: var(--muted); font-size: 13.5px; }
.f-icon {
  flex: none;
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(124, 92, 255, 0.15);
}
.f-icon svg { width: 22px; height: 22px; fill: none; stroke: #b4a5ff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.seo { color: var(--muted); font-size: 13px; margin-bottom: 30px; }
.seo b { color: var(--text); font-weight: 600; }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 26px 0 34px; color: var(--muted); font-size: 13px; }
.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-bottom: 10px; }
.footer nav a { color: var(--muted); }
.footer nav a:hover { color: var(--text); }
.footer p { margin: 0; opacity: 0.75; }

/* ---------- animations ---------- */
@keyframes pop {
  0%   { opacity: 0; transform: translateY(8px) scale(0.6); }
  3%   { opacity: 1; transform: translateY(0) scale(1); }
  26%  { opacity: 1; transform: translateY(0) scale(1); }
  30%  { opacity: 0; transform: translateY(-6px) scale(0.95); }
  100% { opacity: 0; transform: translateY(-6px) scale(0.95); }
}
@keyframes typing { 0%, 10% { opacity: 1; } 12%, 100% { opacity: 0; } }
@keyframes msg { 0%, 11% { opacity: 0; } 13%, 100% { opacity: 1; } }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-3px); opacity: 1; } }
@keyframes ripple { 0% { transform: scale(1); opacity: 0.9; } 100% { transform: scale(3.6); opacity: 0; } }
@keyframes ping { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes flow { to { stroke-dashoffset: -50; } }

@media (prefers-reduced-motion: reduce) {
  .bubble, .msg { animation: none; opacity: 1; }
  .typing { display: none; }
  .spot::after, .map-arcs path, .live-pill i { animation: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .hero-login { order: -1; }
  .features { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .header .icon { display: flex; }
  .menu {
    display: none;
    position: absolute;
    top: 66px; left: 0; right: 0;
    flex-direction: column;
    padding: 10px 20px 16px;
    background: var(--menu-bg);
    border-bottom: 1px solid var(--border);
  }
  .menu.responsive { display: flex; }
  .menu a { padding: 12px 14px; }
  .brand h1 small { display: none; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .hero { margin-top: 18px; gap: 16px; }
  .hero-map { padding: 24px 18px 20px; }
  .hero-login { padding: 26px 20px 22px; }
  .hero-sub { font-size: 14px; margin-bottom: 48px; }
  .map { margin: 0 -8px 16px; width: calc(100% + 16px); }
  .bubble { font-size: 11px; padding: 5px 9px; gap: 0; }
  .bubble .av { display: none; }
  .bubble[dir="rtl"] { padding: 5px 9px; }
  .spot::before { left: -3px; top: -3px; width: 6px; height: 6px; }
  .spot::after { left: -3px; top: -3px; width: 6px; height: 6px; }
  .panel { padding: 22px 18px; }
  .foruments { grid-template-columns: 1fr; }
  .userlist { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .userlist .onlineuser img { width: 56px; height: 56px; }
}
