:root {
  color-scheme: dark;
  --bg: #050506;
  --panel: rgba(5, 7, 11, 0.66);
  --panel-strong: rgba(7, 9, 14, 0.84);
  --line: rgba(255, 214, 149, 0.28);
  --gold: #ffd18a;
  --gold-strong: #ffad42;
  --turquoise: #27d6c3;
  --text: #fff7ea;
  --muted: #c7b9aa;
  --danger: #ff7168;
  --ok: #6ee7a8;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.58);
  --ornament: rgba(255, 209, 138, 0.13);
  --ornament-strong: rgba(255, 173, 66, 0.34);
}

@font-face {
  font-family: "QazaqSoftArab";
  src: url("assets/fonts/KAZAKHSOFTASILYAQANIQ.TTF") format("truetype");
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  position: relative;
  margin: 0;
  direction: rtl;
  text-align: right;
  font-family: "QazaqSoftArab", "Segoe UI", "Tahoma", "Arial", sans-serif;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  background:
    linear-gradient(rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.66)),
    url("assets/ktv-kazakh-stage.png") center / cover fixed no-repeat,
    #030303;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.78;
  background:
    linear-gradient(90deg, transparent 0 24px, var(--ornament) 24px 26px, transparent 26px 52px),
    linear-gradient(0deg, transparent 0 24px, rgba(39, 214, 195, 0.055) 24px 26px, transparent 26px 52px),
    radial-gradient(circle at 12% 18%, rgba(39, 214, 195, 0.12), transparent 22%),
    radial-gradient(circle at 88% 12%, rgba(255, 173, 66, 0.16), transparent 24%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.84), rgba(0,0,0,0.18));
}
.site-shell,
.mobile-app,
.tv-screen,
.login-shell,
.admin-layout {
  position: relative;
  z-index: 1;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, textarea, select { direction: rtl; text-align: right; }
table { direction: rtl; }

.site-shell { width: min(1240px, calc(100% - 42px)); margin: 0 auto; padding: 28px 0 42px; }
.site-header {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 74px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}
.site-header::before,
.panel::before,
.player-side::before,
.control-bar::before,
.mobile-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.62;
  background:
    repeating-linear-gradient(135deg, transparent 0 13px, rgba(255, 209, 138, 0.09) 13px 15px, transparent 15px 28px),
    linear-gradient(90deg, rgba(39, 214, 195, 0.1), transparent 22%, transparent 78%, rgba(255, 173, 66, 0.12));
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent 68%);
}
.brand { display: inline-flex; align-items: center; gap: 10px; min-width: max-content; color: var(--gold); }
.brand-mark {
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 8px; background:
    radial-gradient(circle at 35% 28%, #fff1c8, transparent 28%),
    linear-gradient(135deg, #ffe7bd, #c46a26);
  color: #241205; font-size: 26px; font-weight: 900;
  box-shadow: 0 0 22px rgba(255, 173, 66, 0.36), inset 0 0 0 1px rgba(255,255,255,0.42);
}
.brand-text { font-size: 22px; font-weight: 900; letter-spacing: 0; }
.main-nav { display: flex; align-items: center; justify-content: center; gap: 6px; overflow-x: auto; }
.main-nav a, .admin-link, .filter-row button, .ghost-btn {
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #eadccf;
}
.main-nav a { padding: 10px 13px; white-space: nowrap; }
.main-nav a.active, .main-nav a:hover, .admin-link:hover, .filter-row button.active {
  color: #251406;
  background: var(--gold);
}
.admin-link { padding: 10px 14px; }

.ktv-console {
  position: relative;
  overflow: hidden;
  min-height: 730px;
  margin-top: 22px;
  padding: 30px 44px 30px 30px;
  border: 0;
  outline: 10px solid rgba(255, 214, 161, 0.94);
  outline-offset: -1px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(2, 3, 6, 0.12), rgba(2, 3, 6, 0.48)),
    url("assets/ktv-kazakh-stage.png") center / cover no-repeat;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.ktv-console::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 7%, rgba(255, 185, 66, 0.15) 8%, transparent 10%),
    radial-gradient(circle at 70% 8%, rgba(255, 209, 138, 0.18), transparent 28%);
}
.ktv-console::after {
  content: "";
  position: absolute;
  inset: 12px 26px 12px 12px;
  pointer-events: none;
  border-radius: 8px;
  border: 1px solid rgba(39, 214, 195, 0.18);
  background:
    linear-gradient(90deg, var(--ornament-strong), transparent 24%, transparent 76%, var(--ornament-strong)) top / 100% 2px no-repeat,
    linear-gradient(90deg, var(--ornament-strong), transparent 24%, transparent 76%, var(--ornament-strong)) bottom / 100% 2px no-repeat,
    linear-gradient(0deg, var(--ornament-strong), transparent 24%, transparent 76%, var(--ornament-strong)) right / 2px 100% no-repeat,
    linear-gradient(0deg, var(--ornament-strong), transparent 24%, transparent 76%, var(--ornament-strong)) left / 2px 100% no-repeat;
  opacity: 0.72;
}
.hero-zone, .player-zone, .category-grid, .dashboard-grid, .control-bar { position: relative; z-index: 1; }
.hero-zone { min-height: 250px; display: flex; justify-content: space-between; align-items: flex-end; gap: 28px; }
.hero-copy { max-width: 670px; }
.player-zone {
  display: grid;
  grid-template-columns: minmax(270px, 320px) minmax(0, 1fr);
  grid-template-areas: "info video";
  gap: 20px;
  align-items: stretch;
  direction: ltr;
}
.video-shell {
  position: relative;
  grid-area: video;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  padding: 0;
  border: 1px solid rgba(255, 214, 149, 0.42);
  border-radius: 8px;
  background: #000;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.52), 0 0 34px rgba(255, 173, 66, 0.16);
}
.video-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(255, 238, 197, 0.16), 0 0 34px rgba(255, 173, 66, 0.12);
}
.ktv-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  border-radius: 8px;
  background: #000;
}
.video-overlay {
  position: absolute;
  left: auto;
  right: 14px;
  top: 14px;
  bottom: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  max-width: min(520px, calc(100% - 28px));
  min-width: min(300px, calc(100% - 28px));
  padding: 10px 16px 10px 12px;
  border: 1px solid rgba(255, 214, 149, 0.28);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(12px);
  z-index: 2;
  direction: rtl;
}
.video-overlay small { color: var(--muted); }
.video-overlay > div {
  min-width: 0;
  width: 100%;
  text-align: right;
  direction: rtl;
}
.video-overlay strong {
  display: block;
  overflow: visible;
  max-width: 100%;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.player-side {
  grid-area: info;
  min-width: 0;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: end;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(2, 3, 7, 0.58);
  backdrop-filter: blur(14px);
  direction: rtl;
}
.player-side::after,
.panel::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  right: 10px;
  width: 5px;
  pointer-events: none;
  border-radius: 8px;
  background:
    linear-gradient(var(--turquoise), transparent 22%, transparent 78%, var(--gold-strong)),
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(255, 255, 255, 0.28) 8px 9px, transparent 9px 18px);
  opacity: 0.72;
}
.player-side h1 { font-size: clamp(30px, 3.4vw, 48px); }
.home-slogan {
  margin-bottom: 12px;
  color: #fff2df;
  font-size: 17px;
  line-height: 1.55;
}
.home-contact {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(39, 214, 195, 0.26);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(39, 214, 195, 0.12), transparent 44%),
    rgba(0, 0, 0, 0.26);
}
.home-contact span {
  color: var(--turquoise);
  font-weight: 900;
}
.home-contact strong {
  color: var(--gold);
  font-size: 22px;
  letter-spacing: 0;
}
.player-status {
  padding: 14px;
  border: 1px solid rgba(255, 214, 149, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.player-status span, .player-status small { color: var(--muted); }
.player-status strong { display: block; color: var(--gold); font-size: 42px; line-height: 1; }
.eyebrow { margin: 0 0 8px; color: var(--turquoise); font-size: 13px; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 12px; font-size: clamp(34px, 5vw, 72px); line-height: 1; letter-spacing: 0; text-shadow: 0 0 24px rgba(255, 173, 66, 0.6); }
h2 { margin-bottom: 0; font-size: 24px; }
p { color: #e6d8c8; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.primary-btn, .ghost-btn, .song-action, .small-btn, .danger-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 40px; padding: 0 15px; border-radius: 8px; font-weight: 900;
  border: 1px solid rgba(255, 214, 149, 0.52);
}
.primary-btn, .song-action { color: #241205; background: linear-gradient(135deg, #ffe1b1, #bd6b2d); }
.primary-btn, .song-action, .ghost-btn, .small-btn {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 8px 22px rgba(0,0,0,0.18);
}
.ghost-btn, .small-btn { color: var(--text); background: linear-gradient(135deg, rgba(39, 214, 195, 0.1), rgba(255, 255, 255, 0.06)); }
.danger-btn { color: #fff; background: rgba(255, 113, 104, 0.18); border-color: rgba(255, 113, 104, 0.48); }
.full { width: 100%; }
.room-status {
  width: 190px; padding: 18px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(2, 3, 7, 0.62); backdrop-filter: blur(14px);
}
.room-status span, .room-status small { color: var(--muted); }
.room-status strong { display: block; color: var(--gold); font-size: 50px; line-height: 1; }

.category-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 16px; margin-top: 24px; }
.category-card {
  min-height: 142px; position: relative; display: grid; align-content: end; padding: 14px;
  text-align: right; border: 1px solid rgba(255, 220, 157, 0.62); border-radius: 8px;
  background:
    radial-gradient(circle at 16% 14%, rgba(39, 214, 195, 0.18), transparent 26%),
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 209, 138, 0.08) 14px 16px, transparent 16px 28px),
    linear-gradient(160deg, rgba(255, 225, 172, 0.2), transparent 42%),
    rgba(3, 7, 13, 0.78);
  overflow: hidden; transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.category-card::before {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 8px;
  border: 1px solid rgba(39, 214, 195, 0.16);
  pointer-events: none;
}
.category-card:hover { transform: translateY(-3px); box-shadow: 0 0 32px rgba(255, 173, 66, 0.32); }
.category-card span { position: absolute; right: 16px; top: 12px; color: var(--gold); font-size: 58px; text-shadow: 0 0 22px rgba(255, 173, 66, 0.72); }
.category-card strong { font-size: 22px; }
.category-card small { color: var(--muted); }

.dashboard-grid, .page-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; margin-top: 22px; }
.page-grid { align-items: start; }
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(39, 214, 195, 0.055), transparent 28%),
    linear-gradient(315deg, rgba(255, 173, 66, 0.075), transparent 32%),
    var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
  padding: 18px;
}
.wide { min-width: 0; }
.page-panel { margin-top: 22px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.text-link { color: var(--gold); font-weight: 800; }
.badge {
  min-width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 8px; color: #221104; background: var(--gold); font-weight: 900;
}
.search-box {
  display: flex; align-items: center; gap: 8px; min-width: min(360px, 100%);
  height: 42px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px; background: rgba(2, 3, 6, 0.58);
}
.search-box input, .form-field input, .admin-form input, .admin-form select, .admin-textarea {
  width: 100%; min-width: 0; border: 0; outline: 0; color: var(--text); background: transparent;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filter-row button { min-height: 36px; padding: 0 12px; }

.song-list { display: grid; gap: 10px; }
.song-row {
  position: relative;
  overflow: hidden;
  min-height: 66px; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 173, 66, 0.1), transparent 24%),
    linear-gradient(270deg, rgba(39, 214, 195, 0.08), transparent 24%),
    rgba(255, 255, 255, 0.035);
}
.song-row::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 4px;
  background: linear-gradient(var(--gold), var(--turquoise));
  opacity: 0.82;
}
.song-row:hover {
  border-color: rgba(255, 214, 149, 0.34);
  box-shadow: 0 0 26px rgba(255, 173, 66, 0.14);
}
.song-list.large .song-row { min-height: 74px; }
.rank {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px;
  color: #201104; background: linear-gradient(135deg, var(--gold), var(--gold-strong)); font-weight: 900;
}
.song-title { margin: 0 0 4px; font-size: 17px; font-weight: 900; color: var(--text); }
.song-meta { margin: 0; color: var(--muted); font-size: 13px; }
.tag {
  padding: 6px 8px; color: var(--turquoise); border: 1px solid rgba(39, 214, 195, 0.35);
  border-radius: 8px; background: rgba(39, 214, 195, 0.08); font-size: 12px; white-space: nowrap;
}
.now-playing { display: flex; gap: 12px; align-items: center; min-height: 64px; margin-bottom: 12px; padding: 12px; border-radius: 8px; background: rgba(255, 184, 74, 0.13); }
.pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--turquoise); box-shadow: 0 0 0 8px rgba(39, 214, 195, 0.1), 0 0 22px rgba(39, 214, 195, 0.7); }
.now-playing small { color: var(--muted); }
.now-playing strong { display: block; }
.queue-list { margin: 0; padding: 0 22px 0 0; display: grid; gap: 10px; color: #e8dccf; }
.queue-list li { padding: 9px 4px 9px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }

.control-bar {
  position: relative;
  overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 68px;
  margin-top: 18px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(4, 5, 8, 0.72); backdrop-filter: blur(18px); overflow-x: auto;
}
.control-bar button {
  min-width: 54px; min-height: 42px; border: 0; color: #f5eadc; background: transparent;
}
.control-bar button.active {
  color: #241205;
  border-radius: 8px;
  background: var(--gold);
  box-shadow: 0 0 22px rgba(255, 173, 66, 0.28);
}
.vocal-switch {
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}
.vocal-switch button {
  min-width: 56px;
  border-radius: 8px;
}
.vocal-switch button.active {
  color: #241205;
  background: var(--gold);
}
.audio-status {
  min-width: max-content;
  color: var(--turquoise);
  font-size: 13px;
  font-weight: 900;
}
.volume { display: flex; align-items: center; gap: 8px; min-width: 160px; color: #fff2df; white-space: nowrap; }
.volume input { accent-color: var(--gold-strong); }

.rank-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rank-board { padding: 14px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.rank-board ol { margin: 0; padding-right: 24px; display: grid; gap: 10px; }
.feature-list { display: grid; gap: 10px; }
.feature-list a { padding: 14px; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 8px; background: rgba(255, 255, 255, 0.05); }

.singer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.singer-card {
  position: relative;
  min-height: 250px;
  display: grid;
  grid-template-rows: 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(255, 214, 149, 0.28);
  border-radius: 8px;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(255, 209, 138, 0.055) 14px 16px, transparent 16px 28px),
    rgba(255, 255, 255, 0.055);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.singer-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(255, 214, 149, 0.18);
  border-radius: 8px;
}
.singer-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 32px rgba(255, 173, 66, 0.26);
}
.singer-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #090909;
}
.singer-card div {
  display: grid;
  gap: 4px;
  padding: 12px;
}
.singer-card strong { color: var(--text); font-size: 20px; }
.singer-card span { color: var(--muted); }
.singer-card small { color: var(--turquoise); font-weight: 900; }

.room-grid, .product-grid, .stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.room-card, .product-card, .stat-card {
  position: relative;
  overflow: hidden;
  padding: 16px; border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 209, 138, 0.12), transparent 36%),
    rgba(255, 255, 255, 0.055);
}
.room-card strong, .stat-card strong { display: block; font-size: 30px; color: var(--gold); }
.status-free { color: var(--ok); }
.status-busy { color: var(--gold); }
.status-clean { color: var(--turquoise); }
.product-card { display: grid; gap: 10px; }
.product-card .price { color: var(--gold); font-weight: 900; }
.cart-list { min-height: 160px; display: grid; gap: 10px; margin-bottom: 14px; }
.cart-item { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }

.mobile-app { min-height: 100vh; padding: 18px; }
.mobile-hero { padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: rgba(3, 4, 8, 0.72); backdrop-filter: blur(18px); }
.mobile-hero h1 { font-size: 38px; }
.phone-grid { display: grid; gap: 14px; margin-top: 14px; }
.mobile-remote { margin-top: 14px; }
.remote-pad {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.remote-vocal { width: 100%; margin-bottom: 12px; }
.remote-vocal button { flex: 1; }
.remote-volume { width: 100%; min-width: 0; }

.tv-screen {
  min-height: 100vh;
  overflow: hidden;
  background: #000;
}
.tv-player {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.48)),
    url("assets/ktv-kazakh-stage.png") center / cover no-repeat;
}
.tv-video {
  width: 100vw;
  height: 100vh;
  display: block;
  object-fit: contain;
  background: #000;
}
.tv-topbar,
.tv-now,
.tv-queue {
  position: absolute;
  z-index: 2;
}
.tv-topbar {
  top: 24px;
  left: 28px;
  right: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.tv-pair {
  min-width: 126px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-align: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(14px);
}
.tv-pair small { display: block; color: var(--muted); }
.tv-pair strong { display: block; color: var(--gold); font-size: 32px; line-height: 1; }
.tv-now {
  left: 28px;
  right: 28px;
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 64vw;
  padding: 16px 18px;
  border: 1px solid rgba(255, 214, 149, 0.34);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(16px);
}
.tv-now small { color: var(--turquoise); }
.tv-now strong { display: block; font-size: clamp(28px, 4vw, 58px); line-height: 1.05; }
.tv-queue {
  top: 108px;
  left: 28px;
  width: min(360px, calc(100vw - 56px));
  max-height: 56vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(16px);
  padding: 16px;
}
.tv-start {
  position: absolute;
  z-index: 3;
  right: 28px;
  bottom: 38px;
  min-width: 132px;
  min-height: 52px;
}
.tv-start.is-hidden { display: none; }

.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(420px, 100%); display: grid; gap: 18px; }
.form-field { display: grid; gap: 8px; color: var(--muted); }
.form-field input, .admin-form input, .admin-form select {
  min-height: 42px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px; background: rgba(255, 255, 255, 0.06);
}
.admin-form select {
  color: #fff7ea;
  background-color: #17110c;
  border-color: rgba(255, 214, 149, 0.34);
}
.admin-form select option {
  color: #fff7ea;
  background-color: #17110c;
}
.admin-form select option:checked,
.admin-form select option:hover {
  color: #241205;
  background-color: #ffd18a;
}

.admin-layout { min-height: 100vh; display: grid; grid-template-columns: 250px minmax(0, 1fr); background: rgba(0, 0, 0, 0.42); }
body[data-page^="admin"], body[data-page="login"] {
  font-family: "QazaqSoftArab", "Microsoft YaHei", "Segoe UI", "Tahoma", "Arial", sans-serif;
}
.admin-side { padding: 22px; border-right: 1px solid var(--line); background: rgba(3, 4, 8, 0.82); backdrop-filter: blur(18px); }
.admin-side nav { display: grid; gap: 8px; margin-top: 28px; }
.admin-side nav a { padding: 12px; border-radius: 8px; color: #e9dccf; background: rgba(255, 255, 255, 0.04); }
.admin-side nav a.active, .admin-side nav a:hover { color: #241205; background: var(--gold); }
.admin-main { padding: 28px; display: grid; align-content: start; gap: 18px; }
.admin-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; }
.song-editor { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.singer-editor { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.singer-editor .admin-textarea { grid-column: 1 / -1; }
.song-editor .primary-btn,
.song-editor .small-btn,
.singer-editor .primary-btn,
.singer-editor .small-btn { min-height: 42px; }
.admin-table { overflow-x: auto; }
.admin-table table { width: 100%; border-collapse: collapse; min-width: 680px; }
.admin-table th, .admin-table td { padding: 12px; border-bottom: 1px solid rgba(255, 255, 255, 0.09); text-align: right; }
.admin-table th { color: var(--gold); font-weight: 900; }
.small-btn, .danger-btn { min-height: 34px; padding: 0 10px; margin-right: 6px; }
.admin-thumb {
  width: 76px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 214, 149, 0.28);
  background: #090909;
}
.compact-search { min-width: min(460px, 100%); }
.muted { color: var(--muted); }
.admin-textarea {
  min-height: 120px;
  resize: vertical;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  line-height: 1.5;
}
.admin-textarea.tall { min-height: 240px; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.settings-grid .primary-btn { align-self: end; }
.audio-note p { margin-bottom: 0; }

@media (max-width: 980px) {
  .site-header, .dashboard-grid, .page-grid, .admin-layout { grid-template-columns: 1fr; }
  .main-nav { justify-content: start; order: 3; grid-column: 1 / -1; }
  .category-grid, .room-grid, .product-grid, .stats-grid, .rank-columns, .singer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-zone { align-items: stretch; flex-direction: column; }
  .player-zone {
    grid-template-columns: 1fr;
    grid-template-areas:
      "video"
      "info";
  }
  .video-overlay {
    left: auto;
    right: 14px;
    max-width: min(520px, calc(100% - 28px));
  }
  .room-status { width: 100%; }
  .admin-side { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 640px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  .site-shell { width: 100%; padding: 0; }
  .site-header, .ktv-console, .panel, .mobile-hero { border-radius: 0; }
  .site-header {
    grid-template-columns: auto 1fr;
    gap: 10px;
    padding: 14px 12px 12px;
    border-left: 0;
    border-right: 0;
  }
  .brand { gap: 8px; min-width: 0; }
  .brand-mark { width: 50px; height: 50px; font-size: 30px; }
  .brand-text { font-size: 22px; line-height: 1; }
  .admin-link {
    min-height: 42px;
    padding: 0 12px;
    justify-self: end;
    font-size: 15px;
  }
  .main-nav {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    overflow: visible;
  }
  .main-nav a {
    min-width: 0;
    min-height: 42px;
    padding: 0 6px;
    display: grid;
    place-items: center;
    text-align: center;
    font-size: 15px;
  }
  .ktv-console {
    min-height: auto;
    border: 0;
    outline: 0;
    padding: 12px;
    overflow: visible;
  }
  .ktv-console::after { display: none; }
  .player-zone { gap: 12px; }
  .video-shell {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
  }
  .video-overlay {
    left: 8px;
    right: 8px;
    top: 8px;
    width: auto;
    min-width: 0;
    max-width: none;
    gap: 8px;
    padding: 8px 10px;
  }
  .video-overlay small { font-size: 11px; }
  .video-overlay strong { font-size: 15px; line-height: 1.2; }
  .player-side {
    gap: 10px;
    padding: 14px 16px;
    min-height: 0;
  }
  .player-side::after,
  .panel::after {
    right: auto;
    left: 8px;
    top: 8px;
    bottom: 8px;
    width: 4px;
  }
  .player-side h1 {
    margin-bottom: 6px;
    font-size: 34px;
    line-height: 1.05;
  }
  .home-slogan {
    margin-bottom: 4px;
    font-size: 16px;
    line-height: 1.55;
  }
  .home-contact {
    padding: 10px 12px;
    text-align: center;
  }
  .home-contact strong { font-size: 23px; }
  .player-status {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 4px 10px;
    padding: 12px;
  }
  .player-status strong {
    grid-row: span 2;
    font-size: 38px;
  }
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr 74px;
    gap: 8px;
    margin-top: 8px;
  }
  .hero-actions a {
    min-width: 0;
    padding: 0 8px;
    text-align: center;
  }
  .category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    margin-top: 14px;
  }
  .category-card {
    min-width: 0;
    min-height: 110px;
    padding: 12px 10px;
  }
  .category-card span {
    right: 12px;
    top: 8px;
    font-size: 42px;
  }
  .category-card strong { font-size: 18px; }
  .category-card small { font-size: 13px; }
  .dashboard-grid, .page-grid { gap: 12px; margin-top: 14px; }
  .panel {
    padding: 14px;
    border-left: 0;
    border-right: 0;
  }
  .section-head {
    align-items: stretch;
    flex-direction: row;
    margin-bottom: 12px;
  }
  .section-head h2 { font-size: 23px; line-height: 1.15; }
  .text-link { align-self: center; font-size: 13px; white-space: nowrap; }
  .song-list { gap: 8px; }
  .song-row {
    min-height: 86px;
    grid-template-columns: 42px minmax(0, 1fr) 68px;
    gap: 9px;
    padding: 10px;
  }
  .song-list.large .song-row { min-height: 88px; }
  .song-title {
    font-size: 19px;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }
  .song-meta {
    font-size: 13px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .rank { width: 40px; height: 40px; font-size: 18px; }
  .song-action {
    width: 68px;
    min-height: 44px;
    padding: 0;
    font-size: 15px;
  }
  .tag { display: none; }
  .queue-panel .section-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .now-playing {
    min-height: 58px;
    margin-bottom: 8px;
    padding: 10px;
  }
  .queue-list {
    max-height: 160px;
    overflow: auto;
    gap: 6px;
  }
  .queue-list li {
    padding: 8px 2px 8px 6px;
    font-size: 15px;
    line-height: 1.35;
  }
  .control-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
    margin-top: 14px;
    padding: 12px;
    overflow: visible;
  }
  .control-bar button,
  .vocal-switch button {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 0 8px;
    font-size: 14px;
  }
  .vocal-switch {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }
  .volume {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: auto 1fr;
    min-width: 0;
    width: 100%;
    gap: 10px;
  }
  .audio-status {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: center;
    white-space: normal;
    line-height: 1.35;
  }
  .room-grid, .product-grid, .stats-grid, .rank-columns, .singer-grid, .admin-form, .song-editor, .singer-editor, .settings-grid { grid-template-columns: 1fr; }
  .remote-pad { grid-template-columns: 1fr; }
  .tv-topbar { top: 14px; left: 14px; right: 14px; }
  .tv-now { left: 14px; right: 14px; bottom: 18px; max-width: none; }
  .tv-queue { top: 86px; left: 14px; width: min(320px, calc(100vw - 28px)); max-height: 42vh; }
  .tv-start { right: 14px; bottom: 112px; }
  h1 { font-size: 36px; }
}
