:root {
  --bg: #d8f6ff;
  --deep: #103c70;
  --blue: #169be8;
  --cyan: #7ee7ff;
  --green: #42d67d;
  --red: #f05b72;
  --glass: rgba(255, 255, 255, .34);
  --glass-strong: rgba(255, 255, 255, .62);
  --line: rgba(255, 255, 255, .68);
  --text: #08263d;
  --muted: #4e7187;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,.9), transparent 20rem),
    linear-gradient(135deg, #c4f4ff 0%, #e8fbff 44%, #7fcfff 100%);
}
a { color: inherit; text-decoration: none; }
button, input, textarea, select {
  font: inherit;
}
.shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(18px);
  background: rgba(180, 235, 255, .54);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(20, 88, 130, .12);
}
.topbar .shell {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  color: var(--deep);
  letter-spacing: .2px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, #19abff, #0f579c);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), 0 10px 24px rgba(15,87,156,.28);
}
.nav-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
  border: 1px solid rgba(255,255,255,.8);
  color: var(--deep);
  background: linear-gradient(180deg, rgba(255,255,255,.82), rgba(185,232,255,.62));
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 9px 20px rgba(19,86,138,.16);
  transition: transform .16s ease, box-shadow .16s ease;
  font-weight: 700;
}
.btn:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 #fff, 0 13px 26px rgba(19,86,138,.22); }
.btn.primary { color: white; background: linear-gradient(180deg, #37c5ff, #106fbd); }
.btn.danger { color: white; background: linear-gradient(180deg, #ff8192, #d3274a); }
.btn.small { padding: 7px 10px; font-size: 13px; }
.hero {
  padding: 34px 0 16px;
}
.hero h1 {
  margin: 0 0 8px;
  color: var(--deep);
  font-size: clamp(34px, 6vw, 72px);
  line-height: 1;
}
.hero p { margin: 0; color: var(--muted); font-size: 18px; }
.glass {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(255,255,255,.68), rgba(191,235,255,.32));
  backdrop-filter: blur(18px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 18px 42px rgba(26,93,136,.16);
  border-radius: 8px;
}
.panel { padding: 20px; }
.tabs { display: flex; gap: 8px; margin: 18px 0; }
.tab.active { color: white; background: linear-gradient(180deg, #36d4ff, #1177c4); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 18px;
  padding-bottom: 40px;
}
.card {
  overflow: hidden;
  min-height: 330px;
  display: flex;
  flex-direction: column;
}
.cover {
  height: 170px;
  background:
    linear-gradient(145deg, rgba(55,197,255,.65), rgba(16,111,189,.88)),
    repeating-linear-gradient(45deg, rgba(255,255,255,.18), rgba(255,255,255,.18) 10px, transparent 10px, transparent 20px);
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  font-size: 30px;
  text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 16px; display: flex; flex: 1; flex-direction: column; gap: 10px; }
.card h3 { margin: 0; color: var(--deep); }
.muted { color: var(--muted); }
.status {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  color: #075424;
  background: rgba(108,241,158,.64);
  border: 1px solid rgba(255,255,255,.72);
}
.empty { padding: 34px; text-align: center; color: var(--muted); }
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(430px, 100%);
  padding: 28px;
}
.auth-card h1 { margin: 0 0 16px; color: var(--deep); }
.field { display: grid; gap: 7px; margin: 12px 0; }
.field span { color: var(--muted); font-weight: 700; }
input, textarea, select {
  width: 100%;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  background: rgba(255,255,255,.72);
  outline: none;
}
textarea { min-height: 92px; resize: vertical; }
.error { color: #b51535; min-height: 22px; font-weight: 700; }
.success { color: #0f7335; min-height: 22px; font-weight: 700; }
.game-layout {
  display: grid;
  grid-template-columns: minmax(250px, 420px) 1fr;
  gap: 24px;
  align-items: start;
  padding: 26px 0 44px;
}
.game-cover { aspect-ratio: 16/10; height: auto; border-radius: 8px; overflow: hidden; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; }
.admin-layout {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
  padding: 24px 0 44px;
}
.side { padding: 12px; display: grid; gap: 8px; align-content: start; }
.admin-section { display: none; padding: 18px; }
.admin-section.active { display: block; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid rgba(255,255,255,.7); text-align: left; vertical-align: top; }
th { color: var(--deep); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.cover-thumb { width: 58px; height: 42px; object-fit: cover; border-radius: 6px; background: rgba(255,255,255,.5); }
.torrent-item { margin-top: 16px; padding: 16px; }
.torrent-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.torrent-head h3 { margin: 0 0 5px; color: var(--deep); }
.torrent-files { margin: 12px 0; max-height: 190px; overflow: auto; display: grid; gap: 6px; }
.torrent-file { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,.36); }
.progress-shell { height: 18px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.45); border: 1px solid rgba(255,255,255,.75); }
.progress-bar { height: 100%; width: 0%; background: linear-gradient(90deg, #42d67d, #37c5ff); transition: width .25s ease; }
.torrent-stats { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.play-screen {
  min-height: calc(100vh - 74px);
  display: grid;
  place-items: center;
  padding: 24px 0;
}
.play-box { width: min(760px, 100%); padding: 28px; text-align: center; }
.play-box h1 { margin-top: 0; color: var(--deep); }

@media (max-width: 780px) {
  .topbar .shell { align-items: flex-start; flex-direction: column; padding: 12px 0; }
  .game-layout, .admin-layout { grid-template-columns: 1fr; }
  .side { grid-template-columns: repeat(2, 1fr); }
  table, thead, tbody, th, td, tr { display: block; }
  thead { display: none; }
  tr { border-bottom: 1px solid rgba(255,255,255,.75); padding: 8px 0; }
  td { border: 0; padding: 6px 0; }
}
