﻿:root {
  color-scheme: light;
  --bg: #0b0f1a;
  --bg-2: #0f172a;
  --card: rgba(15, 23, 42, 0.75);
  --ink: #f8fafc;
  --muted: #b6c3d6;
  --accent: #f97316;
  --accent-2: #22d3ee;
  --border: rgba(148, 163, 184, 0.2);
  --layout-max-width: 1200px;
  --layout-padding: 40px;
  --heading-size: 32px;
  --table-padding-y: 6px;
  --table-padding-x: 8px;
  --button-height: 32px;
  --button-font-size: 13px;
  --card-gap: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
  background: radial-gradient(circle at top, #1e293b, var(--bg));
  color: var(--ink);
  min-height: 100vh;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  z-index: 0;
}

.bg-orb-1 {
  width: 420px;
  height: 420px;
  background: #f97316;
  top: -120px;
  left: -120px;
}

.bg-orb-2 {
  width: 520px;
  height: 520px;
  background: #22d3ee;
  bottom: -200px;
  right: -140px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 5vw;
  background: rgba(11, 15, 26, 0.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-weight: 800;
  letter-spacing: 0.12em;
}

.nav {
  display: flex;
  gap: 20px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.topbar-actions {
  display: flex;
  gap: 10px;
}

.topbar-actions #customerLoginLink {
  display: none;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-user:empty {
  display: none;
}

.user-chip {
  border: 1px solid rgba(34, 211, 238, 0.45);
  color: var(--accent-2);
  background: rgba(34, 211, 238, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
}

.user-name {
  font-weight: 700;
  color: var(--ink);
}

.user-menu {
  position: relative;
}

.avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: pointer;
}

.avatar-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: var(--accent-2);
}

.avatar-icon svg {
  width: 100%;
  height: 100%;
}

.user-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  background: rgba(10, 15, 28, 0.95);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: none;
  flex-direction: column;
  gap: 10px;
  min-width: 220px;
  z-index: 6;
  box-shadow: 0 16px 40px rgba(8, 12, 24, 0.45);
}

.user-menu.open .user-panel {
  display: flex;
}

.user-section {
  display: grid;
  gap: 8px;
}

.user-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.user-info {
  display: grid;
  gap: 4px;
}

.user-info span {
  font-size: 12px;
  color: var(--muted);
}

.user-points {
  color: var(--accent);
  font-weight: 700;
}

.user-inventory-preview {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--ink);
}

.user-inventory-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.user-inventory-item .count {
  color: var(--accent);
  font-weight: 700;
}

.user-panel a,
.user-panel button {
  text-align: left;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}

.user-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.user-setting-row .switch {
  margin-left: auto;
}

.no-scroll {
  overflow: hidden;
}

.page {
  position: relative;
  z-index: 1;
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: var(--layout-padding) 5vw calc(var(--layout-padding) * 2);
  display: flex;
  flex-direction: column;
  gap: 90px;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

.auth-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px;
  width: min(420px, 92vw);
  display: grid;
  gap: 16px;
  text-align: center;
}

.auth-card-wide {
  width: min(520px, 92vw);
  text-align: left;
}

.auth-card-wide .logo {
  text-align: center;
}

.tab-group {
  display: flex;
  gap: 10px;
}

.tab {
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab.active {
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.15);
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 12px;
}

.auth-card h1 {
  margin: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

.admin-sidebar {
  background: rgba(11, 15, 26, 0.9);
  border-right: 1px solid var(--border);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.admin-sidebar nav {
  display: grid;
  gap: 6px;
}

.admin-sidebar a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
}

.admin-sidebar a:focus-visible,
.admin-sidebar .nav-group summary:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.6);
  outline-offset: 2px;
}

.admin-sidebar .nav-group {
  display: grid;
  gap: 4px;
}

.admin-sidebar .nav-group summary {
  list-style: none;
  cursor: pointer;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.admin-sidebar .nav-group summary::-webkit-details-marker {
  display: none;
}

.admin-sidebar .nav-group summary::after {
  content: "▾";
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.admin-sidebar .nav-group[open] summary::after {
  transform: rotate(180deg);
}

.admin-sidebar .nav-group summary:hover {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.5);
}

.admin-sidebar .nav-group[open] summary {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.7);
}

.admin-sidebar .nav-sub {
  display: grid;
  gap: 4px;
  margin-left: 6px;
  padding: 6px 6px 6px 12px;
  border-left: 1px dashed var(--border);
  background: rgba(15, 23, 42, 0.35);
  border-radius: 12px;
}

.admin-sidebar .nav-sub a {
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.admin-sidebar .nav-sub a:hover {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.6);
}

.admin-sidebar a.active,
.admin-sidebar a:hover {
  color: var(--ink);
  border-color: var(--border);
  background: rgba(15, 23, 42, 0.7);
}

.admin-main {
  max-width: var(--layout-max-width);
  margin: 0 auto;
  padding: var(--layout-padding) 5vw calc(var(--layout-padding) * 2);
  display: grid;
  gap: 40px;
}

body[data-layout-page] .admin-main {
  max-width: none;
  width: 100%;
}

.layout-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 1px dashed var(--border);
  background: rgba(15, 23, 42, 0.65);
  position: fixed;
  top: 20px;
  right: 20px;
  width: min(420px, 92vw);
  z-index: 50;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.45);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

html.layout-loading body[data-layout-page] .admin-main {
  opacity: 0;
  pointer-events: none;
}

html.layout-ready body[data-layout-page] .admin-main {
  opacity: 1;
  transition: opacity 0.2s ease;
}

.layout-toolbar--collapsed {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.layout-toolbar-fab {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 51;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.4);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.layout-toolbar-fab.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
}

.layout-toolbar-info {
  display: grid;
  gap: 4px;
}

.layout-toolbar-info strong {
  font-size: 15px;
}

.layout-toolbar-info p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.layout-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.layout-message {
  margin: 0;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 600;
}

.layout-editing .layout-block {
  position: relative;
  outline: 2px dashed rgba(248, 250, 252, 0.35);
  outline-offset: 4px;
}

.layout-canvas {
  position: relative;
}

.layout-canvas .layout-block {
  position: absolute;
}

.layout-editing .layout-canvas {
  background-image: linear-gradient(
      rgba(148, 163, 184, 0.12) 1px,
      transparent 1px
    ),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 32px 32px;
  background-position: -1px -1px;
}

.layout-handle,
.layout-resize,
.layout-lock {
  display: none;
}

.layout-editing .layout-handle,
.layout-editing .layout-lock {
  display: inline-flex;
}

.layout-editing .layout-resize {
  display: block;
}

.layout-resize {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 12px;
  height: 12px;
  border-right: 2px solid rgba(248, 250, 252, 0.6);
  border-bottom: 2px solid rgba(248, 250, 252, 0.6);
  cursor: se-resize;
  opacity: 0.8;
}

.layout-lock {
  position: absolute;
  top: 8px;
  right: 54px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  z-index: 2;
}

.layout-locked .layout-handle,
.layout-locked .layout-resize {
  opacity: 0.25;
  pointer-events: none;
}

.layout-dragging {
  user-select: none;
}

.layout-block.dragging {
  opacity: 0.6;
}

.layout-guide-x,
.layout-guide-y {
  position: absolute;
  background: rgba(34, 211, 238, 0.7);
  pointer-events: none;
  z-index: 3;
  display: none;
}

.layout-guide-x {
  top: 0;
  bottom: 0;
  width: 1px;
}

.layout-guide-y {
  left: 0;
  right: 0;
  height: 1px;
}

.layout-handle {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.85);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: grab;
  z-index: 2;
}

.layout-handle:active {
  cursor: grabbing;
}

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

.stat-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  padding: 18px;
  border-radius: 16px;
  display: grid;
  gap: 10px;
}

.stat-setting-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.stat-setting-row input {
  flex: 1;
  min-width: 0;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
}

.stat-setting-row button {
  white-space: nowrap;
}

.stat-label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 40px;
  align-items: center;
}

.tag {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.18em;
  font-size: 12px;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(32px, 4vw, 56px);
  margin: 12px 0 16px;
  line-height: 1.1;
}

.hero h1 span {
  display: block;
  color: var(--accent-2);
  font-size: clamp(20px, 3vw, 36px);
}

.lead {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 24px 0;
}

.hero-stats {
  display: flex;
  gap: 24px;
}

.hero-stats strong {
  font-size: 22px;
}

.hero-stats span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 24px;
  border-radius: 20px;
  display: grid;
  gap: 18px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.45);
}

.hero-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pill {
  background: rgba(34, 211, 238, 0.18);
  color: var(--accent-2);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.price {
  font-weight: 700;
  color: var(--accent);
}

.hero-card-body ul {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.hero-banner {
  font-weight: 700;
  font-size: 18px;
}

.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 32px;
  border-radius: 24px;
  background: linear-gradient(120deg, rgba(249, 115, 22, 0.25), rgba(34, 211, 238, 0.25));
  border: 1px solid var(--border);
}

.banner h2 {
  margin: 8px 0 6px;
  font-size: clamp(24px, 3vw, 36px);
}

.banner-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  color: var(--ink);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.14em;
}

.banner-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}














.section {
  display: grid;
  gap: 24px;
}

.section.dark {
  background: rgba(15, 23, 42, 0.7);
  padding: 40px;
  border-radius: 24px;
  border: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: var(--heading-size);
}

.section-head p {
  margin: 0;
  color: var(--muted);
}

.search input {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 12px;
  min-width: 220px;
}

.filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  background: rgba(15, 23, 42, 0.7);
}

.tag-pill.active,
.tag-pill:hover {
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.4);
}

.category-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.admin-category-tabs {
  margin: 6px 0 4px;
  flex-wrap: wrap;
  position: relative;
  z-index: 2;
}

.admin-category-tabs .category-tab {
  font-size: 13px;
  padding: 6px 14px;
}

.admin-category-tabs .category-tab.active {
  background: rgba(34, 211, 238, 0.18);
  color: var(--accent-2);
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 10px 22px rgba(34, 211, 238, 0.12);
}

.admin-category-meta {
  flex-basis: 100%;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.category-tab {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  background: rgba(15, 23, 42, 0.7);
}

.category-tab.active,
.category-tab:hover {
  background: rgba(249, 115, 22, 0.2);
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.4);
}

.category-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
  gap: 24px;
  padding: 24px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid var(--border);
}

.category-text {
  display: grid;
  gap: 10px;
}

.category-pool {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.category-pool.is-hidden {
  display: none;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.category-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
}

.category-draw-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-actions {
  display: flex;
  gap: 10px;
}

.category-pill {
  display: inline-flex;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.18);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.category-media {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  min-height: 180px;
}

.category-media img {
  width: 100%;
  height: 100%;
  max-height: 220px;
  object-fit: contain;
  object-position: center;
  border-radius: 16px;
}

.sort {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.sort select {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 10px;
}

.card-grid {
  display: grid;
  gap: var(--card-gap);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pool-list {
  grid-template-columns: 1fr;
}

.pool-card {
  background: rgba(15, 23, 42, 0.6);
}

.pool-card.is-selected {
  border-color: rgba(249, 115, 22, 0.6);
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.2);
}

.pool-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pool-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  gap: 12px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.4);
}

.pool-card {
  grid-template-rows: auto minmax(160px, 1fr) auto;
  gap: 0;
}

.pool-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.6);
}

.pool-card-image {
  position: relative;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.55);
  min-height: 220px;
  overflow: hidden;
  cursor: pointer;
}

.pool-card-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--thumb-image);
  background-size: cover;
  background-position: center;
  filter: blur(20px);
  transform: scale(1.1);
  opacity: 0;
}

.pool-card-image.has-image::before {
  opacity: 0.45;
}

.pool-card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 1;
}

.pool-card-bottom {
  display: grid;
  gap: 8px;
  padding: 8px 10px 12px;
  background: rgba(15, 23, 42, 0.7);
}

.pool-card-bottom .progress {
  margin: 0;
}

.pool-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
}

.draw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 9, 18, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.draw-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.draw-overlay-card {
  width: min(820px, 92vw);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  position: relative;
  display: grid;
  gap: 16px;
  box-shadow: 0 20px 50px rgba(8, 12, 24, 0.5);
}

.draw-video {
  width: 100%;
  max-height: 60vh;
  border-radius: 16px;
  background: #000;
}

.draw-skip {
  position: absolute;
  top: 16px;
  right: 16px;
  display: none;
}

.draw-skip.is-visible {
  display: inline-flex;
}

.draw-result {
  display: none;
  gap: 12px;
}

.draw-result.is-visible {
  display: grid;
}

.result-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.result-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 8px;
  text-align: center;
}

.result-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 12, 24, 0.6);
}

.result-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.result-info strong {
  display: block;
  font-size: 14px;
}

.result-info span {
  font-size: 12px;
  color: var(--muted);
}

.result-count {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

.inventory-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.inventory-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.inventory-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(8, 12, 24, 0.6);
  display: grid;
  place-items: center;
}

.inventory-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.inventory-meta {
  display: grid;
  gap: 4px;
}

.inventory-meta strong {
  font-size: 14px;
}

.inventory-meta span {
  font-size: 12px;
  color: var(--muted);
}

.inventory-count {
  font-weight: 700;
  font-size: 12px;
  color: var(--accent);
}

.pool-draw-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card .thumb {
  height: clamp(170px, 20vw, 220px);
  background: linear-gradient(140deg, rgba(249, 115, 22, 0.2), rgba(34, 211, 238, 0.2));
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ink);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}

.card .thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--thumb-image);
  background-size: cover;
  background-position: center;
  filter: blur(18px);
  transform: scale(1.1);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.card .thumb.has-image::before {
  opacity: 0.45;
}

.card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  position: relative;
  z-index: 1;
}

.thumb-overlay {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 2;
}

.thumb-overlay.top {
  top: 12px;
}

.thumb-overlay.bottom {
  bottom: 12px;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, rgba(8, 12, 24, 0), rgba(8, 12, 24, 0.75));
  padding: 22px 10px 10px;
  border-radius: 12px;
}

.thumb-price {
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  text-shadow: 0 2px 12px rgba(15, 23, 42, 0.6);
}

.card .card-body {
  padding: 0 16px 16px;
  display: grid;
  gap: 10px;
}

.pagination {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.pagination .page-label {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1024px) {
  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
  }
}

.card-info {
  display: grid;
  gap: 6px;
}

.card .meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.card .status {
  font-weight: 700;
  color: var(--accent-2);
}

.draw-options {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
}

.draw-option {
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.draw-option.active {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #0b1220;
  box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.4);
}

.modal-message {
  margin: 8px 0 0;
  color: var(--ink);
  line-height: 1.5;
}

.draw-option:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.draw-option:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-tag {
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(34, 211, 238, 0.18);
  color: var(--accent-2);
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.progress-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.empty {
  display: none;
  text-align: center;
  color: var(--muted);
}

.detail {
  display: grid;
  gap: 32px;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr minmax(220px, 280px);
  gap: 32px;
  align-items: center;
}

.detail-main {
  display: grid;
  gap: 12px;
}

.detail-thumb {
  height: 320px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(140deg, rgba(249, 115, 22, 0.25), rgba(34, 211, 238, 0.25));
  display: grid;
  place-items: center;
  font-weight: 700;
}

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

.detail-tags {
  color: var(--muted);
  margin: 6px 0 14px;
}

.detail-meta {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.detail-meta div {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.detail-meta strong {
  color: var(--ink);
  font-size: 20px;
}

.detail-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-side {
  display: grid;
  gap: 16px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 18px;
}

.detail-side span {
  color: var(--muted);
  font-size: 13px;
}

.detail-side strong {
  font-size: 20px;
}

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

.detail-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 16px;
}

.detail-card ul {
  padding-left: 20px;
  color: var(--muted);
}

.tier-list {
  display: grid;
  gap: 16px;
}

.tier-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.7);
  display: grid;
  gap: 12px;
}

.tier-card .tier-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.tier-prizes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.prize-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(12, 16, 30, 0.7);
  display: grid;
  grid-template-rows: 1fr auto;
  text-align: left;
  font-size: 12px;
  box-shadow: 0 10px 24px rgba(8, 12, 24, 0.35);
}

.prize-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 0;
}

.prize-card span {
  padding: 8px 10px;
  background: rgba(8, 12, 24, 0.8);
  font-weight: 600;
  color: var(--ink);
}

.detail-desc {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.has-draw-bar .page {
  padding-bottom: 140px;
}

.draw-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(100% - 32px, 980px);
  background: rgba(8, 12, 24, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  z-index: 40;
  backdrop-filter: blur(10px);
}

.draw-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.draw-summary strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.draw-bar #drawSubmit {
  display: none;
}

@media (max-width: 768px) {
  .draw-bar {
    grid-template-columns: 1fr;
  }
  .draw-summary {
    grid-template-columns: 1fr 1fr;
  }
}

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

.feature-grid article,
.prize {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: 16px;
}

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 16px;
}

.steps li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  background: rgba(11, 15, 26, 0.6);
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.steps span {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(249, 115, 22, 0.25);
  color: var(--accent);
  font-weight: 700;
}

.faq {
  display: grid;
  gap: 12px;
}

.faq details {
  background: var(--card);
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: linear-gradient(120deg, rgba(249, 115, 22, 0.28), rgba(34, 211, 238, 0.28));
  padding: 32px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.footer {
  text-align: center;
  padding: 30px 16px 60px;
  color: rgba(226, 232, 240, 0.6);
}

.btn {
  text-decoration: none;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: var(--button-height);
  line-height: var(--button-height);
  font-size: var(--button-font-size);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: #0b0f1a;
  box-shadow: 0 12px 24px rgba(249, 115, 22, 0.35);
}

.btn.ghost {
  border: 1px solid rgba(248, 250, 252, 0.45);
  color: #f8fafc;
  background: rgba(248, 250, 252, 0.08);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-compact {
  padding: 8px 12px;
  font-size: 13px;
}

.admin-simple .btn-compact {
  padding: 0 16px;
  font-size: var(--button-font-size);
  border-radius: 10px;
  line-height: var(--button-height);
  height: var(--button-height);
}

.admin-form {
  display: grid;
  gap: 14px;
  max-width: 520px;
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 10px;
}

.admin-form textarea {
  resize: vertical;
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
  line-height: 1.4;
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 12px;
  align-items: center;
}

.is-hidden {
  display: none;
}

.form-actions {
  display: flex;
  gap: 10px;
}

.form-message {
  margin: 0;
  color: var(--accent-2);
  font-weight: 600;
}

.form-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-list {
  display: grid;
  gap: var(--card-gap);
  position: relative;
  z-index: 1;
}

.admin-title-block {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.admin-id {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.admin-desc {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: 16px;
}

.admin-thumb {
  width: 96px;
  height: 96px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
}

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

.admin-info h3 {
  margin: 0;
  font-size: 18px;
}

.admin-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.status-pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}

.status-pill.active {
  color: #86efac;
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.4);
}

.status-pill.inactive {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.35);
}

.admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 12px;
}

.admin-stats {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}

.admin-stat.admin-weight-inline {
  grid-column: 1 / -1;
}

.admin-weight {
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.admin-weight-summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.admin-weight-summary::-webkit-details-marker {
  display: none;
}

.admin-weight-value {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
}

.admin-weight-body {
  display: none;
  margin-top: 10px;
  gap: 6px;
}

.admin-weight.is-open .admin-weight-body,
.admin-weight[open] .admin-weight-body {
  display: grid;
}

.admin-weight-row input {
  flex: 1;
  min-width: 0;
}

.admin-weight-inline .admin-weight-row input {
  padding: 8px 10px;
}

.admin-weight-inline .admin-weight-hint {
  display: none;
}

.admin-weight-hint,
.admin-weight-msg {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.admin-weight-msg.is-error {
  color: rgba(248, 113, 113, 0.95);
}

.admin-weight-msg.is-ok {
  color: rgba(52, 211, 153, 0.95);
}

.admin-stat {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.admin-stat .label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}

.admin-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assignment-list {
  display: grid;
  gap: 10px;
}

.assignment-item {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 12px;
}

.assignment-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.assignment-order {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--ink);
}

.preview-card {
  display: grid;
  gap: 10px;
  padding: 20px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
}

.table-wrap {
  overflow-x: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.admin-table thead th {
  background: rgba(15, 23, 42, 0.85);
  position: sticky;
  top: 0;
  z-index: 1;
}

.admin-table th,
.admin-table td {
  padding: var(--table-padding-y) var(--table-padding-x);
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.admin-table th {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.admin-table.resizable {
  table-layout: fixed;
}

.admin-table.resizable th,
.admin-table.resizable td {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table tbody tr {
  background: rgba(15, 23, 42, 0.38);
  transition: background 0.2s ease;
}

.admin-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.25);
}

.admin-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.12);
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.input-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--ink);
  font-size: 13px;
}

.pill-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge.ok {
  background: rgba(34, 211, 238, 0.2);
  border-color: rgba(34, 211, 238, 0.4);
  color: var(--accent-2);
}

.badge.warn {
  background: rgba(249, 115, 22, 0.18);
  border-color: rgba(249, 115, 22, 0.35);
  color: rgba(253, 186, 116, 0.95);
}

.badge.muted {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.25);
  color: var(--muted);
}

.admin-table td.table-warn {
  color: rgba(253, 186, 116, 0.95);
  font-weight: 700;
}

.row-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.row-thumb {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

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

.row-thumb span {
  font-size: 12px;
  color: var(--muted);
}

.row-text strong {
  display: block;
}

.row-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.code-block {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 12px;
  line-height: 1.45;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.65);
  color: var(--ink);
}

.input-inline {
  width: 100%;
  min-width: 140px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 10px;
}

.input-inline.compact {
  min-width: 90px;
  max-width: 120px;
}

.video-thumb {
  width: 160px;
  height: 90px;
  background: #000;
  border-radius: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(34, 211, 238, 0.2);
  color: var(--accent-2);
  border: 1px solid rgba(34, 211, 238, 0.4);
}

.status-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  width: 42px;
  height: 22px;
  background: rgba(148, 163, 184, 0.4);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
  border: 1px solid var(--border);
}

.switch .slider::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.switch input:checked + .slider {
  background: rgba(56, 189, 248, 0.55);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.switch input:disabled + .slider {
  opacity: 0.6;
  cursor: not-allowed;
}

.switch-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.image-preview {
  width: 140px;
  height: 140px;
  border-radius: 18px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  background: rgba(12, 16, 30, 0.6);
  padding: 8px;
  display: none;
  align-items: center;
  justify-content: center;
}

.image-preview.is-visible {
  display: flex;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.image-upload-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 44px;
}

.image-upload-row .btn {
  white-space: nowrap;
}

.tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
}

.tag-option input {
  accent-color: var(--accent);
}

.tag-option.is-disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.tag-empty {
  color: var(--muted);
  font-size: 12px;
}

body[data-layout-page="admin-pool-manage"] .admin-form {
  max-width: 1040px;
  align-items: start;
}

/* Use a 2-column grid only when not in free-canvas layout mode. */
body[data-layout-page="admin-pool-manage"] .admin-form:not(.layout-canvas) {
  grid-template-columns: minmax(0, 1fr) 360px;
}

body[data-layout-page="admin-pool-manage"] .admin-form:not(.layout-canvas) > * {
  grid-column: 1 / -1;
}

body[data-layout-page="admin-pool-manage"] .admin-form:not(.layout-canvas) #tierList {
  grid-column: 1 / 2;
}

body[data-layout-page="admin-pool-manage"] .admin-form:not(.layout-canvas) #tierCalculator {
  grid-column: 2 / 3;
  align-self: start;
}

@media (max-width: 980px) {
  body[data-layout-page="admin-pool-manage"] .admin-form:not(.layout-canvas) {
    grid-template-columns: 1fr;
  }

  body[data-layout-page="admin-pool-manage"] .admin-form:not(.layout-canvas) #tierList,
  body[data-layout-page="admin-pool-manage"] .admin-form:not(.layout-canvas) #tierCalculator {
    grid-column: 1 / -1;
  }
}

.tier-calculator {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 14px;
}

.calc-head h3 {
  margin: 0;
  font-size: 16px;
}

.calc-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.calc-metrics {
  display: grid;
  gap: 10px;
}

.calc-metric {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.35);
}

.calc-metric span {
  color: var(--muted);
  font-size: 13px;
}

.calc-metric strong {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.calc-metric strong.is-negative {
  color: rgba(248, 113, 113, 0.95);
}

.calc-metric strong.is-positive {
  color: rgba(52, 211, 153, 0.95);
}

.calc-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  color: rgba(148, 163, 184, 0.9);
  font-size: 12px;
}

.calc-meta b {
  color: var(--ink);
}

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

.calc-options .calc-option {
  margin: 0;
}

.calc-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.25);
  color: rgba(148, 163, 184, 0.95);
  font-size: 12px;
}

.calc-field input {
  width: 84px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.85);
  color: var(--ink);
  font-size: 12px;
}

.calc-field input:disabled {
  opacity: 0.6;
}

.calc-metrics--recycle {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 12px;
}

.calc-loop {
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  padding-top: 12px;
  display: grid;
  gap: 12px;
}

.calc-loop-head h4 {
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.calc-loop-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.calc-breakdown {
  display: grid;
  gap: 10px;
}

.calc-tier {
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.25);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.calc-tier-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.calc-tier-meta {
  font-size: 12px;
  color: rgba(148, 163, 184, 0.9);
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.tier-admin-section {
  display: grid;
  gap: 12px;
}

.tier-admin-list {
  display: grid;
  gap: 16px;
}

.tier-admin {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.65);
  display: grid;
  gap: 12px;
}

.tier-admin.is-active {
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2);
}

.tier-admin .tier-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.tier-admin .tier-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.tier-admin .tier-prob-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.tier-admin .tier-prob {
  width: 100px;
}

.tier-prizes {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

.prize-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(12, 16, 30, 0.7);
}

.prize-row select {
  width: 100%;
}

.prize-item-wrap {
  display: grid;
  gap: 4px;
}

.prize-item-meta {
  font-size: 11px;
  color: rgba(148, 163, 184, 0.9);
  line-height: 1.2;
}

.prize-prob-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.prize-prob {
  width: 92px;
}

.prize-preview {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  display: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.prize-preview.is-visible {
  display: flex;
}

.prize-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.prize-upload.is-disabled {
  opacity: 0.6;
  pointer-events: none;
}

@media (max-width: 768px) {
  .prize-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}

.draw-options-fieldset {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(12, 16, 30, 0.6);
}

.draw-options-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  color: var(--muted);
}

.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.25);
  color: rgba(248, 250, 252, 0.92);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.check-pill:hover {
  background: rgba(2, 6, 23, 0.4);
  border-color: rgba(148, 163, 184, 0.35);
}

.check-pill input {
  accent-color: var(--accent);
}

.draw-options-fieldset .check-pill {
  margin-right: 12px;
}

.input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.column-dragger {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 10px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 6px;
  cursor: grab;
  user-select: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.admin-table.resizable th:hover .column-dragger,
.admin-table.resizable th:focus-within .column-dragger {
  opacity: 1;
  pointer-events: auto;
}

.column-dragger:active {
  cursor: grabbing;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 6px;
  height: 100%;
  cursor: col-resize;
}

.admin-table.resizable th:hover .column-resizer {
  background: rgba(248, 250, 252, 0.2);
}

.table-row {
  cursor: pointer;
}

.table-row.active {
  background: rgba(249, 115, 22, 0.15);
}

.table-actions {
  display: flex;
  gap: 8px;
}

.integrity-job-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.35);
  flex-wrap: wrap;
}

.integrity-job-metrics {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}

.integrity-job-bar strong {
  font-weight: 700;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.modal.is-hidden {
  display: none;
}

.modal-card {
  width: min(560px, 100%);
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--border);
  padding: 20px;
  display: grid;
  gap: 16px;
  max-height: calc(100vh - 48px);
  overflow: hidden auto;
  overscroll-behavior: contain;
}

.smooth-modal {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.98);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.smooth-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.draw-confirm-card {
  width: min(420px, 100%);
}

.draw-confirm-body {
  display: grid;
  gap: 12px;
}

.confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.confirm-row strong {
  color: var(--ink);
  font-size: 16px;
}

.draw-action-card {
  width: min(520px, 100%);
}

.action-buttons {
  display: grid;
  gap: 10px;
}

.action-buttons .btn {
  justify-content: center;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-card.modal-wide {
  width: min(1100px, 96vw);
  padding: 24px;
  gap: 18px;
}

.marketplaces-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.marketplaces-grid .admin-form {
  max-width: none;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}

.sites-span-2 {
  grid-column: 1 / -1;
}

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

.kv-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.kv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
  font-size: 13px;
  color: var(--muted);
}

.kv-row strong {
  color: var(--ink);
  font-weight: 700;
}

.config-editor {
  margin-top: 12px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.config-editor summary {
  cursor: pointer;
  color: var(--accent-2);
  font-weight: 700;
}

.config-editor-body {
  margin-top: 12px;
  display: grid;
  gap: 14px;
}

.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.job-card {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.5);
}

.job-card.is-hidden {
  display: none;
}

.job-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.job-logs {
  height: 240px;
  overflow: auto;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.65);
  color: rgba(226, 232, 240, 0.92);
  font-size: 12px;
  line-height: 1.55;
}

.site-domain {
  font-weight: 800;
  color: var(--ink);
}

.site-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.site-sub a {
  color: var(--accent-2);
}

.cell-ok {
  color: #34d399;
}

.cell-bad {
  color: #fb7185;
}

.modal-card.modal-wide #platformForm {
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 18px 24px;
}

.modal-card.modal-wide #platformForm .platform-span-2 {
  grid-column: 1 / -1;
}

.modal-card.modal-wide #platformForm .platform-rule-grid {
  margin-top: 6px;
}

.modal-card.modal-wide #platformForm .platform-custom-fields {
  margin-top: 10px;
}

.browser-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.browser-shot-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.55);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.browser-shot {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: crosshair;
  user-select: none;
}

@media (max-width: 980px) {
  .marketplaces-grid {
    grid-template-columns: 1fr;
  }

  .sites-grid {
    grid-template-columns: 1fr;
  }

  .modal-card.modal-wide #platformForm {
    grid-template-columns: 1fr;
  }

  .platform-rule-grid {
    grid-template-columns: 1fr;
  }
}

.platform-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.platform-rule {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.platform-rule h4 {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-inline input {
  flex: 1;
  min-width: 0;
}

.field-inline .btn {
  flex: none;
  white-space: nowrap;
}

.rule-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.rule-toggle-row .custom-remove {
  margin-left: auto;
}

.platform-custom-fields {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

#customFields {
  display: grid;
  gap: 12px;
}

.custom-field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.25);
}

.custom-field-row label {
  margin: 0;
}

@media (max-width: 980px) {
  .custom-field-row {
    grid-template-columns: 1fr;
  }
}

.import-preview {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.45);
}

.import-preview-media {
  width: 140px;
  height: 140px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.4);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.import-preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.import-preview-body {
  display: grid;
  gap: 10px;
}

.import-preview-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.import-preview-row strong {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  text-align: right;
}

.import-preview-row select {
  width: 60%;
  max-width: 440px;
}

.import-preview-extra {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
}

.import-preview-extra .extra-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.import-preview-extra .extra-row strong {
  color: var(--ink);
  font-weight: 600;
  text-align: right;
}

.import-debug {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.35);
  color: var(--muted);
}

.import-debug summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

.import-debug pre {
  margin: 10px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}

.import-debug-shot {
  margin-top: 12px;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(2, 6, 23, 0.4);
}

.admin-simple .bg-orb {
  display: none;
}

.admin-simple .section {
  display: grid;
  gap: 6px;
}

.admin-simple .section-head {
  align-items: center;
  justify-content: flex-start;
}

.admin-simple .section-head h2 {
  margin: 0;
}

.admin-simple .form-actions {
  margin: 0;
}

.admin-simple .table-wrap {
  margin-top: 0;
}

.admin-simple .section-head {
  margin-bottom: 2px;
}

.admin-simple .form-actions {
  margin-bottom: 2px;
}

.admin-simple .section-head p {
  margin-top: 4px;
}

.admin-simple .admin-table th {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}

.admin-simple .admin-table td {
  color: var(--ink);
}

.admin-simple .admin-table th,
.admin-simple .admin-table td {
  padding: var(--table-padding-y) var(--table-padding-x);
}

.admin-simple .table-actions {
  gap: 4px;
}

.admin-simple .table-wrap {
  border-radius: 10px;
}

.admin-simple .assignment-item {
  background: transparent;
}

.admin-simple .preview-card {
  background: transparent;
}

@media (max-width: 900px) {
  .nav {
    display: none;
  }

  .hero-stats {
    flex-direction: column;
    gap: 10px;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .category-content {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 5;
  }

  .admin-sidebar nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 600px) {
  .topbar {
    flex-direction: column;
    gap: 12px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .topbar-user {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .cta {
    flex-direction: column;
    align-items: flex-start;
  }

  .banner {
    flex-direction: column;
    align-items: flex-start;
  }
}


.banner.carousel {
  position: relative;
  padding: 0;
  overflow: hidden;
  min-height: 260px;
}

.carousel-track {
  display: flex;
  transition: transform 0.6s ease;
}

.carousel-slide {
  position: relative;
  min-width: 100%;
  padding: 40px;
  display: flex;
  align-items: flex-end;
  background: linear-gradient(120deg, rgba(249, 115, 22, 0.2), rgba(34, 211, 238, 0.2));
  background-size: cover;
  background-position: center;
}

.carousel-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.7), rgba(2, 6, 23, 0.2));
}

.carousel-content {
  position: relative;
  z-index: 1;
  max-width: 520px;
  display: grid;
  gap: 12px;
}

.carousel-content h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
}

.carousel-control.prev {
  left: 16px;
}

.carousel-control.next {
  right: 16px;
}

.carousel-dots {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  gap: 8px;
  z-index: 2;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
}

.carousel-dot.active {
  background: #fff;
}
