:root {
  --bg: #14171c;
  --surface: #1a1e25;
  --surface-2: #20242d;
  --border: #2a2f3a;
  --text: #e8eaed;
  --muted: #8b93a1;
  --accent: #5eb8a0;
  --accent-dim: #3f7d6c;
  --promo: #e0a458;
  --danger: #c1666b;
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

:root[data-theme="light"] {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eceef2;
  --border: #dcdfe5;
  --text: #1b1f27;
  --muted: #6b7280;
  --accent: #2f9c81;
  --accent-dim: #bfe6da;
  --promo: #b8791f;
  --danger: #c1666b;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; margin: 0 0 .5em; letter-spacing: -0.01em; }

/* header - un singur rand: logo in stanga, meniu pill + toggle + CTA in dreapta */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 68px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; color: var(--accent); }
.brand-logo { height: 30px; width: auto; display: block; }

/* meniu pill, cu efect de blur/glass la hover si pe pagina curenta */
.main-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px; }
.main-nav a { color: var(--muted); font-size: .85rem; padding: 7px 15px; border-radius: 999px; border: 1px solid transparent; }
.main-nav a:hover, .main-nav a.active {
  color: var(--text);
  text-decoration: none;
  border-color: var(--accent);
  background: rgba(94,184,160,.18);
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.main-nav a.active { font-weight: 600; }
.nav-cta { color: #0d1310 !important; font-weight: 600; }
.theme-toggle { background: transparent; border: 1px solid var(--border); color: var(--text); border-radius: 999px; width: 34px; height: 34px; cursor: pointer; font-size: .95rem; line-height: 1; }
.theme-toggle:hover { border-color: var(--accent); }
.footer-links { float: right; }
.footer-links a { color: var(--muted); }

.page { padding: 36px 20px 60px; }

/* flash */
.flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 18px; font-size: .9rem; border: 1px solid var(--border); }
.flash-error { border-color: var(--danger); color: var(--danger); }
.flash-success { border-color: var(--accent); color: var(--accent); }
.flash-info { color: var(--muted); }

/* anunturi administrative pe prima pagina */
.announcement { padding: 11px 16px; border-radius: 6px; margin-bottom: 10px; font-size: .88rem; border: 1px solid; line-height: 1.5; }
.announcement-info { border-color: #4f8fd1; color: #4f8fd1; background: rgba(79,143,209,.08); }
.announcement-success { border-color: var(--accent); color: var(--accent); background: rgba(94,184,160,.08); }
.announcement-warning { border-color: var(--promo); color: var(--promo); background: rgba(224,164,88,.08); }

/* navigatie admin, lipita sus la scroll */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px; background: rgba(26,30,37,.75); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 999px; padding: 6px; margin-bottom: 22px; position: sticky; top: 12px; z-index: 30; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.admin-nav a { padding: 7px 15px; border-radius: 999px; font-size: .84rem; color: var(--muted); border: 1px solid transparent; }
.admin-nav a:hover {
  color: var(--text); text-decoration: none; border-color: var(--accent);
  background: rgba(94,184,160,.18);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}
.admin-nav a.active {
  background: rgba(94,184,160,.3);
  background: color-mix(in srgb, var(--accent) 32%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text); font-weight: 600; border-color: var(--accent);
}

/* stats strip */
.stats-strip { display: flex; justify-content: center; gap: 14px; padding: 18px 0 28px; border-bottom: 1px solid var(--border); margin-bottom: 22px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 12px 26px; }
.stat .num { font-family: var(--font-mono); font-size: 1.5rem; font-weight: 600; color: var(--accent); }
.stat .label { color: var(--muted); font-size: .78rem; }
.stat:nth-child(2) .num { color: #4f8fd1; }
.stat:nth-child(3) .num { color: #d1704f; }

/* servere pe joc (pastile colorate) */
.game-stats-row { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-bottom: 32px; }
.game-stat-pill { display: flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 7px 16px 7px 8px; font-size: .84rem; }
.game-stat-pill span { color: var(--muted); }
.game-stat-pill b { font-family: var(--font-mono); }

/* server recomandat (spotlight) */
.spotlight { display: block; border-radius: 10px; padding: 22px 24px; margin-bottom: 26px; text-decoration: none !important; color: #f2f3f5; position: relative; overflow: hidden; border: 1px solid var(--border); }
.spotlight-tag { display: inline-block; background: rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,.35); border-radius: 3px; padding: 2px 9px; font-size: .68rem; letter-spacing: .05em; font-weight: 700; margin-bottom: 10px; }
.spotlight-name { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; display: flex; align-items: center; gap: 10px; text-shadow: 0 1px 4px rgba(0,0,0,.5); }
.spotlight-meta { margin-top: 8px; font-family: var(--font-mono); font-size: .88rem; opacity: .92; text-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* server table (folosit generic in admin/cont, fara latimi fixe) */
.server-table { width: 100%; border-collapse: collapse; margin-bottom: 30px; }
.server-table th { text-align: left; font-size: .78rem; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.server-table td { padding: 12px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.server-table tr:hover td { background: var(--surface); }

/* lista publica de servere (index.php, servers.php) - coloane fixe: status, joc, nume, ip, jucatori, voturi, connect */
/* coloanele scurte (status/icon/ip/jucatori/voturi/connect) se restrang la continutul lor
   (trucul width:1% + nowrap intr-un tabel cu layout auto), iar coloana Server primeste tot ce ramane */
.server-table.list-view th:nth-child(1), .server-table.list-view td:nth-child(1),
.server-table.list-view th:nth-child(2), .server-table.list-view td:nth-child(2),
.server-table.list-view th:nth-child(4), .server-table.list-view td:nth-child(4),
.server-table.list-view th:nth-child(5), .server-table.list-view td:nth-child(5),
.server-table.list-view th:nth-child(6), .server-table.list-view td:nth-child(6),
.server-table.list-view th:nth-child(7), .server-table.list-view td:nth-child(7) {
  width: 1%;
  white-space: nowrap;
}
.server-table.list-view .server-name { overflow: hidden; }
.server-table.list-view .server-name-line a { min-width: 0; }
.server-name { font-weight: 600; color: var(--text); }
.server-name a { color: var(--text); }
.server-name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; row-gap: 4px; }
.server-name-line a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.server-meta { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mono { font-family: var(--font-mono); font-size: .88rem; color: var(--muted); }
.players-col { font-family: var(--font-mono); }
.promo-badge { display: inline-block; align-self: flex-start; flex: 0 0 auto; background: rgba(224,164,88,.12); color: var(--promo); border: 1px solid var(--promo); font-size: .68rem; padding: 1px 6px; border-radius: 3px; vertical-align: middle; white-space: nowrap; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-on { background: var(--accent); }
.dot-off { background: var(--danger); }

/* buttons */
.btn { display: inline-block; padding: 9px 16px; border-radius: 4px; background: var(--accent); color: #0d1310; font-weight: 600; font-size: .88rem; border: none; cursor: pointer; font-family: var(--font-body); transition: transform .1s ease, box-shadow .15s ease, background .15s ease; }
.btn:hover { filter: brightness(1.12); text-decoration: none; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-outline:hover { background: var(--surface-2); box-shadow: 0 4px 10px rgba(0,0,0,.2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.12); box-shadow: 0 4px 10px rgba(193,102,107,.35); }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* forms */
.form-box { max-width: 420px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 28px; }
.form-box.wide { max-width: 640px; }
label { display: block; font-size: .82rem; color: var(--muted); margin: 14px 0 5px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 4px; color: var(--text); font-family: var(--font-body); font-size: .92rem;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-dim); border-color: var(--accent); }
.form-actions { margin-top: 22px; }
.field-error { color: var(--danger); font-size: .8rem; margin-top: 4px; }

/* server detail */
.server-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.server-hero h1 { font-size: 1.6rem; display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.ip-line { font-family: var(--font-mono); color: var(--muted); font-size: .95rem; }
.server-added-by { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin: 24px 0; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 14px 16px; }
.info-card .num { font-family: var(--font-mono); font-size: 1.3rem; font-weight: 600; }
.info-card .label { color: var(--muted); font-size: .78rem; margin-top: 2px; }

/* grafice simple (uptime / jucatori) */
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 20px 0 26px; max-width: 620px; }
.chart-box h3 { font-family: var(--font-display); font-size: .82rem; margin: 0 0 8px; color: var(--muted); }
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 52px; border-bottom: 1px solid var(--border); padding-bottom: 3px; }
.chart-bar { flex: 1; background: var(--accent); opacity: .85; border-radius: 2px 2px 0 0; min-width: 3px; transition: opacity .15s; }
.chart-bar:hover { opacity: 1; }
.chart-bar-blue { background: #4f8fd1; }

table.player-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
table.player-table th { text-align: left; color: var(--muted); font-size: .76rem; font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--border); }
table.player-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-family: var(--font-mono); font-size: .86rem; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 34px 0 12px; }
.section-title h2 { font-size: 1.05rem; }

.tag-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tag-filters a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: .82rem; color: var(--muted); }
.tag-filters a.active { background: var(--accent); color: #0d1310; border-color: var(--accent); font-weight: 600; }
.tag-filters a:hover { text-decoration: none; border-color: var(--accent); }

.empty-state { color: var(--muted); padding: 40px 0; text-align: center; border: 1px dashed var(--border); border-radius: 6px; }

.site-footer { border-top: 1px solid var(--border); margin-top: 60px; padding: 22px 0; color: var(--muted); font-size: .82rem; overflow: hidden; }

/* VIP highlight */
tr.row-vip td { background: rgba(224,164,88,.07); }
tr.row-vip td:first-child { box-shadow: inset 3px 0 0 var(--promo); }
tr.row-vip:hover td { background: rgba(224,164,88,.13); }

/* game icon + flag */
.game-icon { vertical-align: middle; border-radius: 4px; }
.flag { font-size: .95rem; }

/* copy IP */
.ip-copy { cursor: pointer; }
.ip-copy:hover { color: var(--text); text-decoration: underline dotted; }
.copy-icon { opacity: .7; vertical-align: -1px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: var(--surface-2); border: 1px solid var(--accent); color: var(--text);
  padding: 10px 18px; border-radius: 6px; font-size: .86rem; opacity: 0; transition: opacity .2s, transform .2s;
  z-index: 999; box-shadow: 0 6px 18px rgba(0,0,0,.25);
}
.toast-show { opacity: 1; transform: translate(-50%, 0); }

/* badges */
.badge { display: inline-block; align-self: flex-start; flex: 0 0 auto; font-size: .66rem; padding: 1px 6px; border-radius: 3px; vertical-align: middle; border: 1px solid; white-space: nowrap; }
.badge-new { color: var(--accent); border-color: var(--accent); background: rgba(94,184,160,.1); }
.badge-popular { color: #d1704f; border-color: #d1704f; background: rgba(209,112,79,.1); }
.badge-month { color: var(--promo); border-color: var(--promo); background: rgba(224,164,88,.1); }

/* 3-column list layout: filtre (stanga) / lista (centru) / widget-uri (dreapta) */
.list-layout { display: flex; align-items: flex-start; gap: 22px; }
.filters-col { width: 240px; flex-shrink: 0; }
.list-col { flex: 1; min-width: 0; }
.widgets-col { width: 280px; flex-shrink: 0; }

/* filter bar - stivuit pe verticala */
.filter-bar { display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; position: sticky; top: 16px; }
.filter-bar .filter-field { display: flex; flex-direction: column; gap: 5px; }
.filter-bar .filter-field label { margin: 0; }
.filter-bar select, .filter-bar input[type=text] { width: 100%; margin: 0; }
.filter-bar .filter-actions { display: flex; gap: 8px; }
.filter-bar .filter-actions .btn, .filter-bar .filter-actions a { flex: 1; text-align: center; }

/* widget-uri din dreapta (top servere, promovate, linkuri) */
.widget-box { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; margin-bottom: 18px; }
.widget-box h3 { font-family: var(--font-display); font-size: .92rem; margin: 0 0 12px; }
.widget-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.widget-list li { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.widget-rank { color: var(--muted); font-family: var(--font-mono); font-size: .78rem; width: 16px; flex-shrink: 0; }
.widget-list a { color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.widget-list .widget-meta { color: var(--muted); font-size: .76rem; font-family: var(--font-mono); flex-shrink: 0; }
.widget-empty { color: var(--muted); font-size: .82rem; }
.widget-links a { display: block; padding: 2px 0; }

@media (max-width: 960px) {
  .list-layout { flex-direction: column; }
  .filters-col, .widgets-col { width: 100%; position: static; }
  .filter-bar { position: static; }
}

/* pagina cu formular + reclama laterala (ex: adauga server) - blocul intreg centrat pe pagina */
.page-with-sidebar { display: flex; justify-content: center; align-items: flex-start; gap: 22px; }
.page-with-sidebar .page-main { margin: 0; flex: 0 1 640px; min-width: 0; }
.page-with-sidebar .page-sidebar { width: 280px; flex-shrink: 0; }
@media (max-width: 900px) {
  .page-with-sidebar { flex-direction: column; align-items: stretch; }
  .page-with-sidebar .page-main { flex-basis: auto; }
  .page-with-sidebar .page-sidebar { width: 100%; }
}

/* view toggle (grid / lista) */
.view-toggle { display: flex; gap: 6px; margin-bottom: 16px; }
.view-toggle button { background: var(--surface); border: 1px solid var(--border); color: var(--muted); border-radius: 4px; width: 34px; height: 34px; cursor: pointer; font-size: 1rem; }
.view-toggle button.active { color: var(--text); border-color: var(--accent); background: var(--surface-2); }
#serverListView[data-view="grid"] .view-list-only { display: none; }
#serverListView[data-view="list"] .view-grid-only { display: none; }

/* server card grid */
.server-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-bottom: 30px; }
.server-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, box-shadow .15s ease; }
.server-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(0,0,0,.35); }
.server-card.card-vip { border-color: var(--promo); box-shadow: 0 0 0 1px var(--promo); }
.card-thumb { position: relative; display: block; height: 96px; padding: 10px 12px; color: #e8eaed; text-decoration: none !important; }
.card-status { position: absolute; top: 10px; left: 12px; font-size: .72rem; background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 3px; display: flex; align-items: center; }
.card-flag { position: absolute; top: 10px; right: 12px; font-size: 1rem; }
.card-map { position: absolute; bottom: 8px; left: 12px; font-family: var(--font-mono); font-size: .78rem; background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 3px; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; }
.card-title { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.card-title a { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { color: var(--muted); font-size: .78rem; }
.card-row { display: flex; justify-content: space-between; align-items: center; font-size: .82rem; margin-top: 2px; }
.slots-badge { font-family: var(--font-mono); font-size: .76rem; padding: 2px 7px; border-radius: 3px; border: 1px solid; }
.slots-free { color: var(--accent); border-color: var(--accent); background: rgba(94,184,160,.1); }
.slots-full { color: var(--danger); border-color: var(--danger); background: rgba(193,102,107,.1); }
.card-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.card-footer { display: flex; justify-content: center; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.card-connect { width: 100%; text-align: center; padding: 8px 12px; font-size: .84rem; }

/* ad slots */
.ad-slot { display: flex; justify-content: center; margin: 18px 0; }
.ad-slot img { max-width: 468px; width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--border); }
.ad-top { margin-top: 0; }

/* comments */
.comment-list { display: flex; flex-direction: column; gap: 20px; margin: 20px 0 32px; }
.comment-item { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; }
.comment-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.comment-author { font-weight: 600; }
.comment-time { color: var(--muted); font-size: .76rem; margin-left: 8px; }
.comment-body { white-space: pre-wrap; word-break: break-word; line-height: 1.7; }
.comment-delete { color: var(--danger); font-size: .76rem; background: none; border: none; cursor: pointer; padding: 0; font-family: var(--font-body); }
.comment-form { margin-top: 8px; }
.comment-form textarea { min-height: 100px; line-height: 1.6; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.banner-embed { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-family: var(--font-mono); font-size: .8rem; word-break: break-all; margin-top: 6px; }

@media (max-width: 640px) {
  .server-table thead { display: none; }
  .server-table, .server-table tbody, .server-table tr, .server-table td { display: block; width: 100%; }
  .server-table tr { border-bottom: 1px solid var(--border); padding: 10px 0; }
  .server-table td { border: none; padding: 3px 0; }

  .header-top { flex-wrap: wrap; height: auto; padding: 12px 0; row-gap: 10px; }
  .header-right { flex-wrap: wrap; row-gap: 8px; }
  .main-nav { flex-wrap: wrap; border-radius: 16px; }
}
