:root {
    --orange:    #FA9549;
    --orange-dk: #c96e28;
    --orange-gl: #ffb97a;
    --blue:      #4fa3c8;
    --blue-dk:   #1e4d66;
    --teal:      #2ec4b6;
    --bg:        #0a0c0e;
    --bg2:       #111416;
    --bg3:       #181c20;
    --panel:     #141820;
    --border:    #1e2530;
    --border-hl: #2a3545;
    --text:      #c8d0d8;
    --text-dim:  #5a6475;
    --green:     #4ade80;
    --yellow:    #facc15;
    --red:       #f87171;
    --font-hud:  'Orbitron', monospace;
    --font-data: 'Share Tech Mono', monospace;
    --font-body: 'Exo 2', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ── Scan-line overlay ── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0,0,0,.15) 2px,
        rgba(0,0,0,.15) 4px
    );
    pointer-events: none;
    z-index: 999;
}

/* ── Grid background ── */
body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(250,149,73,.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(250,149,73,.03) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

.wrapper {
    position: relative;
    z-index: 1;
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

/* ── HEADER ── */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 12px;
}

.logo-block {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ficsit-logo {
    width: 48px;
    height: 48px;
    position: relative;
    flex-shrink: 0;
}

.ficsit-logo svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 8px rgba(250,149,73,.6));
    animation: pulse-logo 3s ease-in-out infinite;
}

@keyframes pulse-logo {
    0%,100% { filter: drop-shadow(0 0 6px rgba(250,149,73,.5)); }
    50%      { filter: drop-shadow(0 0 18px rgba(250,149,73,.9)); }
}

.header-titles h1 {
    font-family: var(--font-hud);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: .12em;
    color: var(--orange);
    text-shadow: 0 0 20px rgba(250,149,73,.4);
    line-height: 1;
}

.header-titles p {
    font-family: var(--font-data);
    font-size: 11px;
    color: var(--text-dim);
    letter-spacing: .2em;
    margin-top: 4px;
}

.header-meta {
    text-align: right;
    font-family: var(--font-data);
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.8;
}

.header-meta .status-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}
.status-dot.online  { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2s ease-in-out infinite; }
.status-dot.offline { background: var(--red);   box-shadow: 0 0 8px var(--red); }

@keyframes blink {
    0%,100% { opacity: 1; }
    50%      { opacity: .4; }
}

/* ── ERROR BANNER ── */
.error-banner {
    background: rgba(248,113,113,.1);
    border: 1px solid rgba(248,113,113,.4);
    color: var(--red);
    padding: 12px 16px;
    font-family: var(--font-data);
    font-size: 13px;
    margin-bottom: 24px;
    clip-path: polygon(0 0,calc(100% - 12px) 0,100% 12px,100% 100%,0 100%);
}

/* ── PANELS ── */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    position: relative;
    padding: 20px;
    transition: border-color .2s;
}

.panel:hover { border-color: var(--border-hl); }

/* corner cuts */
.panel::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 14px; height: 14px;
    background: var(--bg);
    clip-path: polygon(100% 0,0 0,100% 100%);
}
.panel::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 10px; height: 10px;
    background: var(--bg);
    clip-path: polygon(0 0,0 100%,100% 100%);
}

.panel-label {
    font-family: var(--font-hud);
    font-size: 9px;
    letter-spacing: .25em;
    color: var(--orange);
    text-transform: uppercase;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.panel-label::before {
    content: '';
    display: inline-block;
    width: 3px; height: 14px;
    background: var(--orange);
    flex-shrink: 0;
}

/* ── STATUS HERO ── */
.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

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

.panel-status {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    background: linear-gradient(135deg, var(--panel) 0%, rgba(250,149,73,.07) 100%);
    border-color: rgba(250,149,73,.25);
}

.server-name-big {
    font-family: var(--font-hud);
    font-size: clamp(16px, 3vw, 26px);
    font-weight: 700;
    color: #fff;
    letter-spacing: .08em;
    text-shadow: 0 0 30px rgba(250,149,73,.3);
}

.badge {
    font-family: var(--font-hud);
    font-size: 11px;
    letter-spacing: .15em;
    padding: 6px 14px;
    border: 1px solid;
    text-transform: uppercase;
    position: relative;
    clip-path: polygon(8px 0,100% 0,calc(100% - 8px) 100%,0 100%);
}

.badge.running { color: var(--green);  border-color: var(--green);  background: rgba(74,222,128,.1); }
.badge.paused  { color: var(--yellow); border-color: var(--yellow); background: rgba(250,204,21,.1); }
.badge.idle    { color: var(--text-dim); border-color: var(--text-dim); background: rgba(90,100,117,.1); }

/* ── STAT CARDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    background: var(--bg3);
    border: 1px solid var(--border);
    padding: 16px;
    position: relative;
    overflow: hidden;
    transition: transform .15s, border-color .15s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: var(--orange-dk);
}

.stat-card::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--orange) 0%, transparent 100%);
    opacity: .5;
}

.stat-icon {
    font-size: 22px;
    margin-bottom: 8px;
    display: block;
}

.stat-value {
    font-family: var(--font-hud);
    font-size: 28px;
    font-weight: 900;
    color: var(--orange);
    line-height: 1;
    text-shadow: 0 0 20px rgba(250,149,73,.35);
}

.stat-value.alt { color: var(--blue); text-shadow: 0 0 20px rgba(79,163,200,.35); }
.stat-value.good { color: var(--green); text-shadow: 0 0 20px rgba(74,222,128,.35); }

.stat-label {
    font-family: var(--font-data);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: .15em;
    text-transform: uppercase;
    margin-top: 4px;
}

/* ── PROGRESS BARS ── */
.bar-wrap {
    margin-top: 10px;
}

.bar-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-data);
    font-size: 11px;
    color: var(--text-dim);
    margin-bottom: 5px;
}

.bar-track {
    height: 6px;
    background: var(--bg);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--orange-dk), var(--orange-gl));
    position: relative;
    transition: width .6s ease;
}

.bar-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 6px;
    background: white;
    opacity: .8;
    filter: blur(2px);
}

/* ── DETAIL GRID ── */
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 16px;
}

.detail-table {
    width: 100%;
    border-collapse: collapse;
}

.detail-table tr {
    border-bottom: 1px solid var(--border);
}

.detail-table tr:last-child { border-bottom: none; }

.detail-table td {
    padding: 9px 0;
    font-size: 13px;
    vertical-align: middle;
}

.detail-table td:first-child {
    color: var(--text-dim);
    font-family: var(--font-data);
    font-size: 11px;
    letter-spacing: .1em;
    text-transform: uppercase;
    width: 50%;
}

.detail-table td:last-child {
    color: var(--text);
    font-family: var(--font-data);
    font-size: 13px;
    text-align: right;
}

.val-orange { color: var(--orange) !important; }
.val-blue   { color: var(--blue)   !important; }
.val-green  { color: var(--green)  !important; }

/* ── TIER BAR ── */
.tier-bar {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.tier-pip {
    flex: 1;
    height: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    position: relative;
    clip-path: polygon(4px 0,100% 0,calc(100% - 4px) 100%,0 100%);
    transition: background .3s;
}

.tier-pip.active {
    background: linear-gradient(90deg, var(--orange-dk), var(--orange-gl));
    border-color: var(--orange);
}

/* ── TICK GAUGE ── */
.tick-gauge {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    height: 40px;
    margin-top: 8px;
}

.tick-bar {
    flex: 1;
    background: var(--bg);
    border: 1px solid var(--border);
    min-height: 4px;
    border-radius: 1px;
    transition: background .3s;
}

/* ── FOOTER ── */
footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

footer span {
    font-family: var(--font-data);
    font-size: 10px;
    color: var(--text-dim);
    letter-spacing: .12em;
}

footer a {
    color: var(--orange);
    text-decoration: none;
}

/* ── ANIMATIONS ── */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.panel, .stat-card {
    animation: fade-in .4s ease both;
}

.stat-card:nth-child(1) { animation-delay: .05s; }
.stat-card:nth-child(2) { animation-delay: .10s; }
.stat-card:nth-child(3) { animation-delay: .15s; }
.stat-card:nth-child(4) { animation-delay: .20s; }
.stat-card:nth-child(5) { animation-delay: .25s; }
.stat-card:nth-child(6) { animation-delay: .30s; }

/* ── SEPARATOR ── */
.sep {
    border: none;
    border-top: 1px solid var(--border);
    margin: 16px 0;
}

/* ── glitch on hover for server name ── */
.server-name-big:hover {
    animation: glitch .3s ease;
}

@keyframes glitch {
    0%   { text-shadow:  2px 0 var(--orange), -2px 0 var(--blue); }
    25%  { text-shadow: -2px 0 var(--orange),  2px 0 var(--blue); }
    50%  { text-shadow:  2px 2px var(--teal),  0 0 0; }
    100% { text-shadow: 0 0 30px rgba(250,149,73,.3); }
}

/* refresh btn */
.refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-hud);
    font-size: 9px;
    letter-spacing: .2em;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid var(--border);
    padding: 6px 12px;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    clip-path: polygon(6px 0,100% 0,calc(100% - 6px) 100%,0 100%);
    transition: color .2s, border-color .2s;
}

.refresh-btn:hover {
    color: var(--orange);
    border-color: var(--orange);
}

/* ── RESPONSIVE ── */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .panel { padding: 14px; }
    .stat-value { font-size: 22px; }
}