/* Sanji's Board v2 — dark + neon purple, matching the club world */
:root {
  --bg: #0b0a12;
  --bg-2: #12101d;
  --panel: rgba(24, 20, 40, 0.72);
  --panel-solid: #181428;
  --line: rgba(160, 120, 255, 0.18);
  --line-strong: rgba(170, 120, 255, 0.45);
  --text: #eeeaff;
  --muted: #9d95bd;
  --accent: #a855f7;
  --accent-2: #7c3aed;
  --glow: 0 0 18px rgba(168, 85, 247, 0.55);
  --orange: #ff9b00;
  --green: #4ade80;
  --red: #ff4d6d;
  --yellow: #ffd54f;
  --radius: 16px;
  --font: "Tajawal", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(124, 58, 237, 0.28), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(236, 72, 153, 0.14), transparent 60%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
button, input, select { font-family: inherit; font-size: 1rem; }
[hidden] { display: none !important; }

/* ===== top bar ===== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px);
  background: rgba(11, 10, 18, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; letter-spacing: 0.3px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-weight: 900;
  background: linear-gradient(135deg, var(--accent), #ec4899);
  box-shadow: var(--glow);
  color: #fff; font-size: 0.95rem;
}
.brand small { display: block; color: var(--muted); font-weight: 500; font-size: 0.75rem; }
.topbar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; }
.user-chip img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; }
[dir="rtl"] .user-chip { padding: 4px 4px 4px 12px; }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: rgba(168, 85, 247, 0.12); color: var(--text);
  cursor: pointer; font-weight: 700; transition: 0.15s ease; white-space: nowrap;
}
.btn:hover { background: rgba(168, 85, 247, 0.24); box-shadow: var(--glow); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; }
.btn.discord { background: #5865f2; border-color: transparent; }
.btn.danger { border-color: rgba(255, 77, 109, 0.5); background: rgba(255, 77, 109, 0.1); }
.btn.danger:hover { background: rgba(255, 77, 109, 0.22); box-shadow: 0 0 16px rgba(255, 77, 109, 0.4); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; font-size: 0.88rem; border-radius: 10px; }
.icon-btn { width: 38px; height: 38px; padding: 0; }

/* ===== layout ===== */
.container { width: min(1180px, 100% - 32px); margin: 28px auto 60px; }
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px); backdrop-filter: blur(10px);
}
.panel h2, .panel h3 { margin: 0 0 12px; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 10px; }

/* ===== tabs ===== */
.tabs { display: flex; gap: 6px; margin-bottom: 20px; overflow-x: auto; padding-bottom: 4px; }
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 10px 18px; border-radius: 12px; border: 1px solid transparent; background: transparent;
  color: var(--muted); cursor: pointer; font-weight: 700; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); background: rgba(168, 85, 247, 0.16); border-color: var(--line-strong); box-shadow: var(--glow); }

/* ===== landing ===== */
.hero { text-align: center; padding: clamp(40px, 8vw, 90px) 16px 30px; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem); margin: 0 0 12px; line-height: 1.2;
  background: linear-gradient(90deg, #fff, #d8b4fe, #f0abfc); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(168, 85, 247, 0.35);
}
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 26px; font-size: 1.1rem; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; margin-top: 30px; }
.feature { text-align: start; }
.feature .emoji { font-size: 1.8rem; }

/* ===== status ===== */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; border: 1px solid var(--line); }
.badge.green { color: var(--green); border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.08); }
.badge.red { color: var(--red); border-color: rgba(255, 77, 109, 0.4); background: rgba(255, 77, 109, 0.08); }
.badge.yellow { color: var(--yellow); border-color: rgba(255, 213, 79, 0.4); background: rgba(255, 213, 79, 0.08); }
.badge.purple { color: #d8b4fe; border-color: var(--line-strong); background: rgba(168, 85, 247, 0.1); }

/* ===== member code ===== */
.code-box {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 12px;
  background: #0d0b16; border: 1px dashed var(--line-strong); font-family: "Consolas", monospace; font-size: 1.25rem; letter-spacing: 2px;
  direction: ltr; justify-content: space-between; flex-wrap: wrap;
}
.code-box .value { white-space: nowrap; font-size: clamp(1rem, 2.6vw, 1.25rem); }
.code-box .value.hidden { filter: blur(7px); user-select: none; }

/* ===== inputs ===== */
.input {
  width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #0d0b16; color: var(--text); outline: none;
}
.input:focus { border-color: var(--accent); box-shadow: var(--glow); }

/* ===== posters ===== */
.posters-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .posters-layout { grid-template-columns: 1fr; } }
.map-wrap { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: #07060c; touch-action: none; user-select: none; }
.map-wrap.zoomed { cursor: grab; }
.map-wrap.zoomed:active { cursor: grabbing; }
.map-inner { position: relative; transform-origin: 0 0; }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.map-pins .pin { pointer-events: auto; }
.map-inner img { display: block; width: 100%; height: auto; opacity: 0.92; pointer-events: none; }
.map-controls { position: absolute; top: 10px; inset-inline-end: 10px; display: grid; gap: 6px; z-index: 3; }
.map-controls .btn { background: rgba(11, 10, 18, 0.85); font-size: 1.1rem; }
.pin {
  position: absolute; transform: translate(-50%, -50%);
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff;
  background: rgba(20, 16, 32, 0.9); color: #fff; font-size: 0.78rem; font-weight: 800;
  display: grid; place-items: center; cursor: pointer; transition: 0.15s; padding: 0;
}
.pin.filled { background: var(--accent); box-shadow: var(--glow); }
.pin:hover, .pin.selected { transform: translate(-50%, -50%) scale(1.25); border-color: var(--orange); z-index: 2; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 14px; }
.thumb {
  position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer;
  border: 2px solid var(--line); background: #0d0b16; padding: 0; color: var(--muted);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .num { position: absolute; inset-inline-start: 6px; top: 4px; font-size: 0.75rem; font-weight: 800; text-shadow: 0 1px 3px #000; color: #fff; }
.thumb.selected { border-color: var(--orange); box-shadow: 0 0 14px rgba(255, 155, 0, 0.5); }
.thumb .empty { display: grid; place-items: center; height: 100%; font-size: 1.4rem; opacity: 0.5; }
.editor .frame-preview {
  width: 100%; border-radius: 12px; overflow: hidden; background: #07060c; border: 1px solid var(--line);
  display: grid; place-items: center; margin-bottom: 12px;
}
.editor .frame-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: 12px; padding: 18px; text-align: center; cursor: pointer;
  color: var(--muted); transition: 0.15s;
}
.dropzone.drag, .dropzone:hover { border-color: var(--accent); color: var(--text); background: rgba(168, 85, 247, 0.08); }
.history { display: flex; gap: 8px; flex-wrap: wrap; }
.history button { width: 70px; aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); padding: 0; cursor: pointer; background: #0d0b16; }
.history img { width: 100%; height: 100%; object-fit: cover; }

/* ===== staff ===== */
.list { display: grid; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(13, 11, 22, 0.7); border: 1px solid var(--line); }
.list-item img, .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #221c36; flex: none; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; background: rgba(168, 85, 247, 0.16); border: 1px solid var(--line); }
.roles-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.role-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.role-option input { accent-color: var(--accent); width: 18px; height: 18px; }

/* ===== table (admin) ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: middle; }
th { color: var(--muted); font-weight: 700; font-size: 0.82rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { text-align: center; }
.stat b { display: block; font-size: 1.8rem; color: #d8b4fe; }

/* ===== modal & toast ===== */
.modal-backdrop { position: fixed; inset: 0; background: rgba(5, 4, 10, 0.72); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { width: min(520px, 100%); max-height: 90vh; overflow: auto; }
.toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; display: grid; gap: 8px; z-index: 60; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--glow); animation: pop 0.2s ease; max-width: 340px; }
.toast.error { border-color: rgba(255, 77, 109, 0.6); box-shadow: 0 0 16px rgba(255, 77, 109, 0.35); }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

.steps { counter-reset: s; display: grid; gap: 10px; padding: 0; margin: 0; list-style: none; }
.steps li { counter-increment: s; display: flex; gap: 10px; align-items: flex-start; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-2); font-weight: 800; font-size: 0.85rem; }
.footer { text-align: center; color: var(--muted); font-size: 0.85rem; padding: 30px 16px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: 60px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== terms page ===== */
.terms { display: grid; gap: 22px; max-width: 860px; }
.terms-lang { padding: clamp(20px, 4vw, 36px); }
.terms-lang h1 { margin: 0 0 6px; font-size: 1.8rem; }
.terms-lang h2 { margin: 26px 0 8px; font-size: 1.1rem; color: var(--accent); }
.terms-lang p, .terms-lang li { color: var(--text); }
.terms-lang ul { margin: 0; padding-inline-start: 22px; display: grid; gap: 6px; }
.terms-lang b { color: #fff; }
.terms-lang[dir="ltr"] { text-align: left; }

/* ===== plan card (landing) ===== */
.plan { max-width: 520px; margin: 28px auto 0; text-align: center; border-color: var(--line-strong); box-shadow: 0 0 40px rgba(168, 85, 247, 0.18); }
.plan h2 { margin: 0 0 6px; font-size: 1.4rem; }
.plan-price { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin-bottom: 14px; }
.plan-price b { font-size: 2.8rem; font-weight: 900; color: #fff; text-shadow: var(--glow); }
.plan-price span { color: var(--muted); }
.plan-features { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; text-align: start; }
.plan-features li { display: flex; gap: 10px; align-items: flex-start; }
.plan-features li::before { content: "✓"; color: var(--green); font-weight: 900; flex: none; }
.plan-free { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.92rem; }

.code-box { font-family: ui-monospace, Consolas, monospace; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; direction: ltr; }

.plan-top { margin: 0 auto 22px; }
.patreon-box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: rgba(13, 11, 22, 0.7); border: 1px solid var(--line); }
.patreon-box .grow { flex: 1; min-width: 0; }

/* ===== image cropper ===== */
.crop-modal { width: min(560px, 100%); align-items: center; }
.crop-view { position: relative; overflow: hidden; margin: 0 auto; background: #111018; border: 1px solid var(--line-strong); border-radius: 8px; touch-action: none; cursor: grab; user-select: none; }
.crop-view:active { cursor: grabbing; }
.crop-view .crop-img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; pointer-events: none; user-select: none; }
.crop-zoom { width: 100%; justify-content: center; }
.crop-slider { flex: 1; max-width: 320px; accent-color: var(--accent); }
