:root {
  --bg: #0f1117;
  --bg-2: #151823;
  --panel: #1a1e2b;
  --panel-2: #222739;
  --line: #2b3146;
  --text: #e8eaf2;
  --muted: #9aa1b8;
  --faint: #6b7290;
  --accent: #7c6cf3;
  --accent-2: #9d90ff;
  --ok: #3ecf8e;
  --warn: #f5b84a;
  --bad: #f2555a;
  --gold: #f1c40f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 80% -10%, rgba(124, 108, 243, .12), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.hidden { display: none !important; }

/* ---------- felső sáv ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; background: rgba(15, 17, 23, .85); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.1rem; }
.brand:hover { text-decoration: none; }
.user-box { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); object-fit: cover; }

.app { max-width: 1240px; margin: 0 auto; padding: 28px 24px 120px; }

/* ---------- gombok, űrlap ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  padding: 9px 16px; border-radius: 10px; font: inherit; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: #2a3045; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #6b5ae8; }
.btn.danger { background: rgba(242, 85, 90, .12); border-color: rgba(242, 85, 90, .5); color: #ff8c90; }
.btn.danger:hover { background: rgba(242, 85, 90, .22); }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #1b1600; }
.btn.small { padding: 6px 11px; font-size: .86rem; }
.btn.large { padding: 13px 24px; font-size: 1.05rem; }
.btn.ghost { background: transparent; }

input[type=text], input[type=number], select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 10px; padding: 9px 12px; font: inherit;
}
textarea { min-height: 96px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(124, 108, 243, .6); outline-offset: 1px; border-color: var(--accent); }
input:disabled, select:disabled, textarea:disabled { opacity: .55; }

.switch { position: relative; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 99px; background: #394059; cursor: pointer; transition: background .15s;
}
.switch .slider::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s;
}
.switch input:checked + .slider { background: var(--ok); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: .5; cursor: not-allowed; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- kártyák ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.grid > .card { margin-top: 0; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px;
  font-size: .76rem; font-weight: 700; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line);
}
.badge.gold { background: rgba(241, 196, 15, .14); color: var(--gold); border-color: rgba(241, 196, 15, .4); }
.badge.ok { background: rgba(62, 207, 142, .12); color: var(--ok); border-color: rgba(62, 207, 142, .35); }
.badge.bad { background: rgba(242, 85, 90, .12); color: #ff8c90; border-color: rgba(242, 85, 90, .4); }
.badge.warn { background: rgba(245, 184, 74, .12); color: var(--warn); border-color: rgba(245, 184, 74, .4); }

/* ---------- belépés ---------- */
.hero { text-align: center; padding: 60px 20px 30px; max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 2.4rem; margin-bottom: .3em; }
.hero p { color: var(--muted); font-size: 1.1rem; }
.hero .row { justify-content: center; margin-top: 24px; }
.features { margin-top: 48px; }
.feature .ico { font-size: 1.6rem; }
.feature h3 { margin-top: 6px; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- szerverlista ---------- */
.guilds { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.guild-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 24px 18px; }
.guild-icon {
  width: 72px; height: 72px; border-radius: 22px; background: var(--panel-2); display: grid; place-items: center;
  font-weight: 800; font-size: 1.4rem; color: var(--muted); object-fit: cover;
}
.guild-card .name { font-weight: 700; word-break: break-word; }

/* ---------- szerver nézet ---------- */
.guild-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.guild-head .guild-icon { width: 56px; height: 56px; border-radius: 16px; font-size: 1.1rem; }
.layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start; }
.sidenav { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 2px; }
.sidenav a {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600;
}
.sidenav a:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.sidenav a.active { background: rgba(124, 108, 243, .16); color: #fff; }
.sidenav .sep { height: 1px; background: var(--line); margin: 8px 4px; }
.sidenav .ico { width: 22px; text-align: center; }

.section-head { margin-bottom: 16px; }
.section-head p { color: var(--muted); max-width: 760px; }
.notice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 16px;
  background: rgba(124, 108, 243, .1); border: 1px solid rgba(124, 108, 243, .35);
}
.notice.gold { background: rgba(241, 196, 15, .08); border-color: rgba(241, 196, 15, .35); }
.notice.bad { background: rgba(242, 85, 90, .1); border-color: rgba(242, 85, 90, .4); }
.notice .ico { font-size: 1.2rem; line-height: 1.3; }

/* ---------- mezők ---------- */
.fields { padding: 4px 0; }
.field { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; padding: 16px 20px; border-top: 1px solid var(--line); align-items: center; }
.field:first-child { border-top: 0; }
.field .label { font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.field .help { color: var(--muted); font-size: .86rem; margin-top: 2px; }
.field .control { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.field.wide { grid-template-columns: 1fr; }
.field.wide .control { justify-content: stretch; flex-direction: column; align-items: stretch; }
.field.dirty { background: rgba(124, 108, 243, .06); }
.field.error { background: rgba(242, 85, 90, .07); }
.field .err { color: #ff8c90; font-size: .85rem; margin-top: 4px; }
.num-wrap { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-end; }
.num-wrap input { max-width: 130px; text-align: right; }
.unit { color: var(--muted); font-size: .9rem; min-width: 34px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 99px; padding: 3px 6px 3px 11px; font-size: .86rem;
}
.chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 1rem; line-height: 1; padding: 0 4px; }
.chip button:hover { color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--faint); flex: none; }

/* ---------- mentés sáv ---------- */
.savebar {
  position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 140%); z-index: 30;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px 12px 20px; border-radius: 14px;
  background: #11131b; border: 1px solid var(--accent); box-shadow: var(--shadow); transition: transform .2s;
  max-width: calc(100vw - 24px); visibility: hidden;
}
.savebar.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------- áttekintés ---------- */
.score-card { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.ring {
  --p: 0; --c: var(--bad);
  width: 132px; height: 132px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #2a3045 0);
}
.ring::before { content: ""; grid-area: 1 / 1; width: 106px; height: 106px; border-radius: 50%; background: var(--panel); }
.ring .val { grid-area: 1 / 1; font-size: 2rem; font-weight: 800; z-index: 1; }
.ring .val small { font-size: .9rem; color: var(--muted); font-weight: 600; }
.stat { padding: 16px 18px; }
.stat .num { font-size: 1.7rem; font-weight: 800; }
.stat .lbl { color: var(--muted); font-size: .86rem; }
.checks { display: flex; flex-direction: column; }
.check { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); align-items: flex-start; }
.check:first-child { border-top: 0; }
.check .st { font-size: 1.1rem; line-height: 1.4; }
.check .body { flex: 1; min-width: 0; }
.check .body .t { font-weight: 600; }
.check .body .d { color: var(--muted); font-size: .88rem; }
.alert-banner {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: 14px; margin-bottom: 16px; flex-wrap: wrap;
  background: linear-gradient(90deg, rgba(242, 85, 90, .25), rgba(242, 85, 90, .08)); border: 1px solid rgba(242, 85, 90, .6);
}
.alert-banner.lock { background: linear-gradient(90deg, rgba(245, 184, 74, .22), rgba(245, 184, 74, .06)); border-color: rgba(245, 184, 74, .6); }

/* ---------- események ---------- */
.events { display: flex; flex-direction: column; }
.event { display: flex; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); }
.event:first-child { border-top: 0; }
.event .sev { width: 4px; border-radius: 4px; background: var(--faint); flex: none; }
.event .sev.low { background: var(--ok); }
.event .sev.medium { background: var(--warn); }
.event .sev.high { background: var(--bad); }
.event .sev.critical { background: #c0151b; }
.event .sev.info { background: var(--accent); }
.event .body { min-width: 0; flex: 1; }
.event .summary { word-break: break-word; }
.event .meta { color: var(--faint); font-size: .8rem; margin-top: 2px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: 10px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
table.list th { color: var(--muted); font-weight: 600; font-size: .85rem; border-top: 0; }

/* ---------- értesítések, ablak ---------- */
.toasts { position: fixed; right: 18px; top: 72px; z-index: 50; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  background: #11131b; border: 1px solid var(--line); border-left: 4px solid var(--ok); border-radius: 10px;
  padding: 12px 14px; box-shadow: var(--shadow); animation: slide .2s ease-out;
}
.toast.err { border-left-color: var(--bad); }
.toast ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); font-size: .88rem; }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 60; display: grid; place-items: center; padding: 18px; }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; width: min(520px, 100%); box-shadow: var(--shadow); }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.modal label.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-top: 8px; cursor: pointer; }
.modal label.opt input { margin-top: 4px; }

.loading { display: grid; place-items: center; padding: 80px 0; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.perks { list-style: none; padding: 0; margin: 0; }
.perks li { padding: 9px 0; border-top: 1px solid var(--line); }
.perks li:first-child { border-top: 0; }
table.compare td:nth-child(2), table.compare td:nth-child(3), table.compare th:nth-child(2), table.compare th:nth-child(3) { text-align: center; }

/* ---------- mobil ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidenav { position: static; flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 6px; scrollbar-width: thin; }
  .sidenav a { white-space: nowrap; padding: 8px 12px; background: var(--panel); }
  .sidenav .sep { display: none; }
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field { grid-template-columns: 1fr; gap: 10px; }
  .field .control { justify-content: flex-start; }
  .num-wrap { justify-content: flex-start; }
}
@media (max-width: 560px) {
  .app { padding: 18px 14px 120px; }
  .topbar { padding: 10px 14px; }
  .grid.cols-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .user-box .uname { display: none; }
  .savebar { left: 12px; right: 12px; transform: translateY(140%); }
  .savebar.show { transform: none; visibility: visible; }
}

/* ---------- jogi oldalak ---------- */
.legal { max-width: 860px; }
.legal h2 { margin-top: 1.4em; font-size: 1.1rem; }
.legal ul { padding-left: 20px; color: var(--muted); }
.legal li { margin-bottom: 6px; }
.legal p { color: var(--muted); }
.footer-links { text-align: center; margin-top: 40px; color: var(--faint); font-size: .86rem; }
.footer-links a { color: var(--muted); margin: 0 8px; }

/* ---------- csomagok ---------- */
.launch-banner {
  display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: 14px; margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(124, 108, 243, .28), rgba(241, 196, 15, .12)); border: 1px solid rgba(157, 144, 255, .6);
}
.launch-banner .big { font-size: 1.8rem; }
.plans { margin-top: 16px; align-items: stretch; }
.plan { display: flex; flex-direction: column; gap: 10px; position: relative; }
.plan .perks { flex: 1; }
.plan .perks li { font-size: .92rem; color: var(--muted); }
.plan-name { font-weight: 800; font-size: 1.15rem; }
.price { font-size: 1.6rem; font-weight: 800; }
.plan.featured { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(241, 196, 15, .35), var(--shadow); }
.ribbon { position: absolute; top: -11px; right: 16px; background: var(--gold); color: #1b1600; font-weight: 800; font-size: .75rem; padding: 3px 10px; border-radius: 99px; }
.grid + .card, .card + .grid { margin-top: 16px; }

/* ---------- súgó ---------- */
.guide-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.guide-search { margin-bottom: 18px; max-width: 560px; }
.guide-section { scroll-margin-top: 80px; }
.guide-section + .guide-section { margin-top: 16px; }
.guide-section h2 { font-size: 1.3rem; }
.guide-section h3 { margin-top: 14px; font-size: 1rem; }
.guide-section .lead { color: var(--text); font-size: 1.02rem; }
.guide-section p { color: var(--muted); }
.guide-list, .guide-steps { padding-left: 22px; margin: 6px 0 12px; color: var(--muted); }
.guide-list li, .guide-steps li { margin-bottom: 7px; }
.guide-steps li::marker { color: var(--accent-2); font-weight: 800; }
.guide-table { overflow-x: auto; margin: 8px 0 14px; }
.guide-table td { color: var(--muted); font-size: .92rem; }
.guide-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.guide-section .notice { margin: 10px 0; }
.faq details { border-top: 1px solid var(--line); padding: 10px 0; }
.faq details:first-child { border-top: 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 8px 0 0; }
@media (max-width: 900px) { .guide-table td:first-child { white-space: normal; } }

/* ---------- üzemmód, varázsló ---------- */
.mode-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; border-radius: 14px; margin-bottom: 16px; border: 1px solid var(--line); background: var(--panel); }
.mode-banner.observe { border-color: rgba(124, 108, 243, .6); background: rgba(124, 108, 243, .1); }
.mode-banner.trial { border-color: rgba(62, 207, 142, .5); background: rgba(62, 207, 142, .08); }
.mode-banner.paused { border-color: rgba(245, 184, 74, .6); background: rgba(245, 184, 74, .1); }
.mode-banner.live { border-color: rgba(62, 207, 142, .4); }
.mode-banner .muted { flex: 1 1 320px; }
.event-tools { margin-top: 8px; }
.danger-zone { border-color: rgba(242, 85, 90, .45); }
.wizard-step { display: flex; gap: 16px; }
.wizard-step + .wizard-step { margin-top: 16px; }
.step-num { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 800; }
.step-body { flex: 1; min-width: 0; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opts label.opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.opts label.opt:hover { background: var(--panel-2); }
.opts label.opt.disabled { opacity: .5; cursor: not-allowed; }
.opts label.opt input { margin-top: 4px; }
.wizard-summary { margin-top: 16px; border-color: var(--accent); }
.wizard-preview li { color: var(--text); }

.hidden-file { display: none; }
