:root {
  --primary: #1b6ec2;
  --primary-dark: #155a9c;
  --bg: #0f172a;
  --bg-soft: #1e293b;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --accent: #f59e0b;
  --danger: #ef4444;
  --ok: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "UKIJ", "Alpida", "Segoe UI", Tahoma, sans-serif;
  background: linear-gradient(160deg, var(--bg) 0%, var(--bg-soft) 100%);
  color: var(--text);
  min-height: 100vh;
  direction: ltr;
}

/* ============================================================
   ئاممىۋى بەت (Public Page)
   ============================================================ */
.public { display: none; }
.public.show { display: block; }
.public {
  /* بەت قىياپىتى — ئارقا بەتتىن تەڭشىلىدۇ (سۈكۈت قىممەتلىرى) */
  /* تۈپ خەت چوڭلۇقى: ھەر قانداق ئېكرانغا ماسلىشىدۇ (14px ~ 18px) */
  font-size: clamp(14px, 1.1vw + 11px, 18px);
  --p-primary: #1b6ec2;
  --p-primary-dark: #155a9c;
  --p-text: #1f2937;
  --p-muted: #6b7280;
  --p-title-size: 20px;
  --p-title-color: #1b6ec2;
  --p-love-color: #c62828;
  --p-love-size: 18px;
  --p-sub-color: #cbd5e1;
  --p-slider-img-h: 130px;
  --p-slider-speed: 30s;
  --p-enter-color: #22c55e;
  --p-enter-dark: #16a34a;
  --p-entry-bg: #22c55e;
  --p-entry-bg-hover: #16a34a;
  --p-search-color: #22c55e;
  --p-search-dark: #16a34a;
  --p-play-color: #ef4444;
  --p-play-dark: #dc2626;
  --p-notice-bg: #fef3c7;
  --p-notice-border: #fcd34d;
  --p-notice-color: #92400e;
  --p-hint-color: #ef4444;
  --p-ad-color: #ef4444;
  --p-movie-img-h: 120px;
  --p-love-bg: transparent;
  background: #ffffff;
  min-height: 100vh;
  color: var(--p-text);
  padding-bottom: 30px;
  font-family: "UKIJ", "Alpida", "Segoe UI", Tahoma, sans-serif;
}

/* ئۈستىدىكى ئىزدەش رامكىسى */
.top-search {
  background: linear-gradient(180deg, #ffffff 0%, color-mix(in srgb, var(--p-primary) 25%, #ffffff) 100%);
  padding: 22px 16px 18px;
  text-align: center;
}
.top-search-inner {
  display: flex; gap: 10px; max-width: 720px; margin: 0 auto;
}
.top-search-inner input {
  flex: 1; padding: 14px 18px; border: none; border-radius: 999px;
  font-size: 16px; outline: none; background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  text-align: right;
}
.btn-search {
  padding: 0 32px; border: none; border-radius: 999px;
  background: var(--p-search-color); color: #fff; font-size: 16px; font-weight: bold; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
  white-space: nowrap;
}
.btn-search:hover { background: var(--p-search-dark); }
.top-hint { color: var(--p-hint-color); margin-top: 12px; font-size: 15px; }

/* بۆلەك */
.section { max-width: 1000px; margin: 18px auto; padding: 0 16px; }
.section-title {
  color: var(--p-title-color); font-size: var(--p-title-size); margin-bottom: 6px;
  text-align: center; font-weight: bold;
}
.section-sub {
  color: var(--p-muted); font-size: 20px; font-weight: bold; margin-bottom: 16px;
  text-align: right;
}

/* ئەڭ يېڭى رەسىملەر — ماۋزۇ بىلەن سىيرىلغۇچنى بىر قېنىق كۆك كارتا ئىچىگە بىرىكتۈرۈش */
#latestImagesSection {
  background: linear-gradient(135deg, #14233f 0%, #1e3a5f 50%, #0b1830 100%);
  max-width: 1000px;
  margin: 22px auto;
  padding: 16px 20px;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 31, 58, .35);
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
}
.latest-inner {
  display: flex;
  align-items: center;
  gap: 22px;
  direction: rtl;
}
.latest-side {
  flex: 0 0 320px;
  text-align: right;
  padding: 0 6px;
}
#latestImagesSection .section-title {
  color: #fff;
  font-size: 22px;
  margin-bottom: 8px;
}
#latestImagesSection .section-sub {
  color: var(--p-sub-color);
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 16px;
  line-height: 1.6;
  text-align: right;
  white-space: nowrap;
}
.latest-cta {
  display: inline-block;
  background: var(--p-primary);
  color: #fff;
  padding: 10px 22px;
  border-radius: 22px;
  font-size: 15px;
  font-weight: bold;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(27, 110, 194, .4);
  transition: background .25s ease, transform .25s ease;
}
.latest-cta:hover {
  background: var(--p-primary-dark);
  transform: translateY(-2px);
}
.latest-inner .slider-rtl {
  flex: 1;
  min-width: 0;
}
@media (max-width: 720px) {
  .latest-inner { flex-direction: column; }
  .latest-side { flex: 1 1 auto; width: 100%; }
}

/* باش كارتا (رەسىم بىلەن بىرلىكتە) — يولغۇن رەڭلىك چىرايلىق رامكا */
.hero-card {
  /* يولغۇن رەڭلىك قوش قاتلام گىرادىيېنت كاناي */
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg,
      #1b6ec2 0%,
      #38bdf8 18%,
      #06b6d4 30%,
      #10b981 42%,
      #84cc16 55%,
      #facc15 68%,
      #f59e0b 82%,
      #ef4444 92%,
      #ec4899 100%) border-box;
  border: 5px solid transparent;
  border-radius: 26px;
  padding: 10px;
  box-shadow:
    0 14px 40px rgba(99, 102, 241, .25),
    0 4px 12px rgba(0, 0, 0, .08),
    0 0 0 1px rgba(255, 255, 255, .5) inset;
  display: block;
  width: 100%;
  position: relative;
  line-height: 0;
  text-align: center;
  transition: transform .35s ease, box-shadow .35s ease;
}
.hero-card:hover {
  transform: translateY(-6px) scale(1.01);
  box-shadow:
    0 22px 55px rgba(27, 110, 194, .30),
    0 6px 16px rgba(0, 0, 0, .12);
}
/* تولۇق رەسىم — ھەممە قىسمى كۆرۈنىدۇ */
.hero-full-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
  /* ئىچكى ئاق نېپىز رامكا + سايە */
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, .9) inset,
    0 6px 18px rgba(0, 0, 0, .18);
}
/* رەسىم تولۇق ئېنىق چىقىشى ئۈچۈن ئاق قەۋەت ئۆچۈرۈلدى */
.hero-card::before {
  display: none;
}
.hero-overlay {
  display: none;
}
.hero-text { flex: 1; }
.hero-text h2 { color: var(--p-primary); font-size: 22px; margin-bottom: 8px; }
.hero-text h2 span { color: var(--p-primary); font-weight: bold; }
.hero-text h3 { color: #111; font-size: 32px; font-weight: bold; }
/* كونا كىچىك رەسىم (ئىشلىتىلمىسە يوشۇرۇلىدۇ) */
.hero-img { display: none; }
.enter-link {
  display: block; width: fit-content; margin: 18px auto 0;
  background: var(--p-entry-bg, var(--p-search-color)); color: #fff;
  padding: 10px 26px; border-radius: 999px; text-decoration: none;
  font-size: 17px; font-weight: bold; text-align: center;
  box-shadow: 0 4px 10px rgba(34,197,94,.3);
}
.enter-link:hover { background: var(--p-entry-bg-hover, var(--p-search-dark)); }

/* كىرىش ئاستىدىكى ئۇقتۇرۇش تېكىستى */
.hero-notice {
  max-width: 700px;
  margin: 14px auto 0;
  padding: 14px 18px;
  background: var(--p-notice-bg);
  border: 1px solid var(--p-notice-border);
  border-radius: 12px;
  color: var(--p-notice-color);
  font-size: 15px;
  text-align: center;
  line-height: 1.6;
  min-height: 20px;
}
.hero-notice:empty { display: none; }

/* كىرىش ئاستىدىكى مۇھەببەت تېكىستى */
.hero-love-text {
  max-width: 700px;
  margin: 16px auto 0;
  padding: 0;
  background: var(--p-love-bg);
  color: var(--p-love-color);
  font-size: var(--p-love-size);
  font-weight: bold;
  text-align: center;
  line-height: 1.6;
  letter-spacing: 1px;
}
.hero-love-text:empty { display: none; }

/* قىزىل ئېلان تېكىستى */
.ad-row { max-width: 1000px; margin: 12px auto; padding: 0 16px; text-align: center; }
.ad-text { color: var(--p-ad-color); font-size: 15px; }

/* كىنو كارتىلىرى */
.movie-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  max-width: 1000px; margin: 14px auto; padding: 0 16px;
  align-items: end;
}
.movie-card {
  background: #fff; border-radius: 10px; overflow: hidden;
  box-shadow: 0 3px 10px rgba(0,0,0,.12);
}
.movie-card img { width: 100%; height: var(--p-movie-img-h); object-fit: cover; display: block; }
.look-btn {
  grid-column: 1 / -1;
  display: block; max-width: 200px; margin: 14px auto 0;
  padding: 12px 32px; border-radius: 999px;
  background: var(--p-primary); color: #fff; text-decoration: none;
  font-size: 15px; font-weight: bold; text-align: center;
}
.look-btn:hover { background: var(--p-primary-dark); }

/* سىيرىلما رەسىملەر — dil.tumak.cn ئۇسلۇبىدا */
.slider-rtl {
  overflow: hidden;
  position: relative;
  -webkit-mask-image: linear-gradient(to left, transparent, #000 5%, #000 95%, transparent);
          mask-image: linear-gradient(to left, transparent, #000 5%, #000 95%, transparent);
}
.slider-track {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
  width: max-content;
  direction: rtl;
  animation: slide-rtl var(--p-slider-speed) linear infinite;
}
.slider-rtl:hover .slider-track { animation-play-state: paused; }
.slider-track .public-card { flex: 0 0 200px; }
@keyframes slide-rtl {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.public-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
}
.public-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.public-card img {
  width: 100%; height: var(--p-slider-img-h); object-fit: cover; display: block;
}
/* سىيرىلغۇچتىكى رەسىم ئاستىدىكى خەتلەرنى يوق قىلىش */
.public-card-body { display: none; }

/* دامكا باننېرى */
.game-banner {
  position: relative;
  max-width: 1000px; margin: 22px auto; padding: 28px 20px;
  min-height: 130px;
  text-align: center; border-radius: 14px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--p-primary) 70%, #0f1f3a) 0%, #0f1f3a 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
  overflow: hidden;
}
.game-banner::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background .3s ease;
  pointer-events: none;
}
.game-banner.has-bg::before {
  background: rgba(0, 0, 0, .45);
}
.game-banner > * { position: relative; z-index: 1; }
.game-pre { font-size: 20px; font-weight: bold; text-align: right;
  position: absolute; right: 20px; top: 24px; margin: 0; }
.play-btn {
  position: absolute; right: 20px; bottom: 24px;
  display: inline-block; padding: 12px 32px; border-radius: 999px;
  background: var(--p-play-color); color: #fff; text-decoration: none;
  font-size: 16px; font-weight: bold; text-align: center;
  box-shadow: 0 4px 10px rgba(239,68,68,.3);
}
.play-btn:hover { background: var(--p-play-dark); }

/* ============================================================
   كىرىش بېتى (Login)
   ============================================================ */
.login-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 16px;
  padding: 36px 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
  text-align: center;
}
.login-card h1 { color: var(--primary); margin-bottom: 6px; font-size: 24px; }
.login-card p { color: var(--muted); margin-bottom: 24px; font-size: 14px; }
.login-card input {
  width: 100%;
  padding: 12px 14px;
  margin-bottom: 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  font-size: 15px;
}
.login-card button {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}
.login-card button:hover { background: var(--primary-dark); }
.login-error { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 16px; }

/* ============================================================
   باشقۇرۇش بېتى (Admin)
   ============================================================ */
.admin { display: none; }
.admin.show { display: block; }

/* Topbar */
.topbar {
  background: var(--primary);
  color: #fff;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  flex-wrap: wrap;
  gap: 10px;
}
.topbar h1 { font-size: 20px; }
.topbar .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Buttons */
.btn {
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  color: var(--primary);
  font-family: inherit;
}
.btn:hover { background: #eef2ff; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #dc2626; }
.btn.ok { background: var(--ok); color: #fff; }
.btn.ok:hover { background: #059669; }
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.btn.ghost:hover { background: rgba(255,255,255,.12); }
.btn.sm { padding: 5px 10px; font-size: 13px; }

/* Layout */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 220px;
  background: var(--bg-soft);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sidebar button {
  text-align: left;
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 12px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
}
.sidebar button:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar button.active { background: var(--primary); color: #fff; }

.content { flex: 1; padding: 24px; overflow-x: hidden; }
.panel { display: none; }
.panel.active { display: block; }

.panel h2 { color: #fff; margin-bottom: 8px; font-size: 22px; }
.panel .sub { color: #94a3b8; margin-bottom: 18px; font-size: 14px; }

/* Forms */
.form-grid {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.form-grid input, .form-grid select, .form-grid textarea {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  font-family: inherit;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid .half { grid-column: span 1; }
.form-grid .actions { grid-column: 1 / -1; display: flex; gap: 10px; flex-wrap: wrap; }

/* Cards list */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  background: var(--card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform 0.2s;
}
.card:hover { transform: translateY(-3px); }
.card img { width: 100%; height: 180px; object-fit: cover; background: #e5e7eb; }
.card .body { padding: 12px 14px; }
.card .body h3 { font-size: 16px; margin-bottom: 4px; color: #1f2937; }
.card .body .meta { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.card .body .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* Search */
.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--card);
  padding: 16px;
  border-radius: 14px;
}
.search-box input { flex: 1; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 15px; font-family: inherit; }
.search-box button { padding: 0 22px; }

/* Banner */
.banner {
  background: linear-gradient(90deg, var(--accent), #f97316);
  color: #fff;
  padding: 22px 24px;
  border-radius: 16px;
  margin-bottom: 22px;
  font-size: 18px;
  text-align: center;
}
.cinema-link {
  display: inline-block;
  margin-top: 12px;
  background: #fff;
  color: var(--accent);
  padding: 10px 20px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: bold;
}

/* تەڭشەك بۆلىكى */
.settings-group {
  background: var(--card);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 22px;
}
.settings-group h3 {
  color: var(--primary); font-size: 18px; margin-bottom: 14px;
  border-bottom: 2px solid #e5e7eb; padding-bottom: 10px;
}
.settings-group .field {
  margin-bottom: 14px;
}
.settings-group .field label {
  display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px;
}
.settings-group .field input {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db;
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
.settings-group .field .field-hint {
  font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.5;
}

/* Game (دامكا / checkers) */
.board {
  display: grid;
  grid-template-columns: repeat(8, 56px);
  grid-template-rows: repeat(8, 56px);
  margin: 0 auto 16px;
  border: 4px solid #333;
  width: max-content;
}
.cell { width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; }
.cell.dark { background: #6b4f3a; }
.cell.light { background: #f3e0c7; }
.piece {
  width: 40px; height: 40px; border-radius: 50%;
  cursor: pointer; box-shadow: 0 3px 6px rgba(0,0,0,.4);
}
.piece.red { background: radial-gradient(circle at 30% 30%, #ff7b7b, #c0392b); }
.piece.black { background: radial-gradient(circle at 30% 30%, #555, #111); }
.piece.selected { outline: 3px solid var(--accent); }
.game-info { color: #fff; text-align: center; margin-bottom: 12px; }
.game-info .turn { font-size: 18px; }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  display: none; align-items: center; justify-content: center; z-index: 50;
}
.modal-bg.show { display: flex; }
.modal {
  background: #fff; border-radius: 14px; padding: 24px; width: 100%; max-width: 420px;
}
.modal h3 { margin-bottom: 8px; color: var(--primary); }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.modal input { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #d1d5db; border-radius: 8px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ok); color: #fff; padding: 12px 22px; border-radius: 10px;
  display: none; z-index: 60; font-size: 15px;
}
.toast.show { display: block; }

/* Game CTA */
.game-cta {
  background: linear-gradient(90deg, var(--accent), #f97316);
  color: #fff; text-align: center; padding: 24px; border-radius: 16px;
  max-width: 1100px; margin: 20px auto;
}
.game-cta a { color: #fff; font-weight: bold; }

.hidden { display: none !important; }

/* Responsive */
@media (max-width: 768px) {
  .layout { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; flex-wrap: wrap;
    padding: 10px; gap: 4px;
  }
  .sidebar button { font-size: 13px; padding: 8px 10px; }
  .movie-row { grid-template-columns: repeat(2, 1fr); }
  .topbar { flex-direction: column; align-items: flex-start; }
  .topbar .right { width: 100%; justify-content: flex-start; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

