@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
    --ink: #edf3fb;
    --muted: #98a8bb;
    --ground: #080d15;
    --panel: rgba(13, 20, 31, .9);
    --panel-2: rgba(20, 30, 45, .86);
    --line: rgba(150, 180, 214, .14);
    --line-strong: rgba(150, 180, 214, .28);
    --accent: #607a98;
    --accent-bright: #8ea7c2;
    --amber: #d6a05f;
    --red: #cf7276;
    --good: #72ad9a;
    --shadow: 0 22px 65px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
* { scrollbar-color: #39485d #101722; scrollbar-width: thin; }
html { color-scheme: dark; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(5, 9, 16, .44), rgba(7, 12, 20, .72)),
        radial-gradient(circle at 48% 10%, rgba(92, 126, 164, .08), transparent 38rem),
        url("minecraft-panel-background.png") center center / cover fixed no-repeat,
        var(--ground);
    font: 15px/1.5 "DM Sans", sans-serif;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .16;
    background-image:
        linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
}
::selection { color: #fff; background: rgba(113, 158, 211, .42); }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, .button {
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 11px;
    padding: 10px 16px;
    color: #f3f7fc;
    background: linear-gradient(180deg, #718aa7, var(--accent));
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(28, 47, 70, .2);
    transition: transform .16s ease, filter .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
button:hover:not(:disabled), .button:hover { transform: translateY(-1px); filter: brightness(1.06); box-shadow: 0 10px 24px rgba(39, 65, 94, .28); }
button:active:not(:disabled), .button:active { transform: translateY(1px) scale(.985); }
button:disabled { opacity: .42; cursor: not-allowed; }
button.secondary, .button.secondary { color: var(--ink); background: rgba(116, 145, 181, .09); border-color: var(--line); box-shadow: none; }
button.warn { background: linear-gradient(180deg, #e2b475, var(--amber)); }
button.danger { color: #18090b; background: linear-gradient(180deg, #df8589, var(--red)); }
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
input, select, textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 11px 12px;
    color: var(--ink);
    background: rgba(5, 10, 18, .72);
    outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(113, 158, 211, .72); box-shadow: 0 0 0 3px rgba(113, 158, 211, .12); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 600; }
textarea { min-height: 360px; resize: vertical; font: 13px/1.55 Consolas, monospace; }
h1, h2, h3 { margin: 0; font-family: "Space Grotesk", sans-serif; letter-spacing: -.025em; }
p { margin: 0; }
.shell { position: relative; z-index: 1; width: min(1500px, calc(100% - 36px)); margin: 0 auto; padding: 24px 0 48px; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 18px;
    margin-bottom: 22px; padding: 14px 16px;
    border: 1px solid var(--line); border-radius: 16px; background: rgba(8, 14, 24, .68); box-shadow: 0 14px 42px rgba(0,0,0,.2); backdrop-filter: blur(16px) saturate(115%);
}
.brand { display: flex; gap: 12px; align-items: center; text-decoration: none; }
.brand-mark {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    overflow: hidden; background: #1a251c;
    box-shadow: 0 8px 30px rgba(20, 33, 24, .28);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; }
.brand strong { display: block; font: 700 16px "Space Grotesk"; }
.brand span { color: var(--muted); font-size: 12px; }
.nav { display: flex; gap: 8px; flex-wrap: wrap; }
.nav a { padding: 9px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13px; }
.nav a:hover, .nav a.active { color: var(--ink); background: rgba(113, 158, 211, .11); }
.hero { display: grid; grid-template-columns: 1.4fr .6fr; gap: 18px; margin-bottom: 18px; }
.hero-copy, .status-hero, .card {
    border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, rgba(17, 26, 40, .83), rgba(11, 18, 29, .87)); box-shadow: var(--shadow); backdrop-filter: blur(14px) saturate(110%);
}
.hero-copy { padding: 28px; overflow: hidden; position: relative; }
.hero-copy::after {
    content: ""; position: absolute; width: 180px; height: 180px; right: -45px; bottom: -80px;
    border-radius: 35px; background: linear-gradient(145deg, rgba(113,158,211,.2), rgba(214,160,95,.08)); transform: rotate(25deg);
}
.eyebrow { margin-bottom: 9px; color: var(--accent-bright); font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.hero h1 { max-width: 760px; font-size: clamp(30px, 4vw, 54px); line-height: 1.02; }
.hero-copy > p:last-of-type { max-width: 700px; margin-top: 14px; color: var(--muted); }
.status-hero { padding: 24px; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.status-pill { display: inline-flex; align-items: center; gap: 9px; width: fit-content; padding: 8px 12px; border-radius: 999px; background: rgba(255,255,255,.055); font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 5px rgba(242,123,114,.1); }
.status-pill.online .dot { background: var(--good); box-shadow: 0 0 0 5px rgba(114,173,154,.11); }
.status-version { font: 600 22px "Space Grotesk"; }
.distribution-summary { display: flex; align-items: center; gap: 13px; }
.distribution-summary > img { width: 50px; height: 50px; border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.muted { color: var(--muted); }
.tiny { font-size: 12px; }
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.card { grid-column: span 4; padding: 20px; }
.card.wide { grid-column: span 8; }
.card.full { grid-column: 1 / -1; }
.card h2 { margin-bottom: 4px; font-size: 20px; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card-head p { color: var(--muted); font-size: 13px; }
.metric { margin-top: 16px; font: 700 34px "Space Grotesk"; }
.metric small { color: var(--muted); font-size: 13px; }
.meter { height: 8px; margin: 11px 0 15px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.06); }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); transition: width .35s ease; }
.facts { display: grid; gap: 9px; }
.fact { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); }
.fact strong { color: var(--ink); text-align: right; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 13px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.controls { margin-top: 16px; }
.console {
    height: 430px; overflow: auto; margin: 0; padding: 16px; border: 1px solid rgba(255,255,255,.07);
    border-radius: 12px; color: #cbd7e7; background: rgba(3, 7, 13, .94); white-space: pre-wrap; word-break: break-word;
    font: 12px/1.55 Consolas, monospace;
}
.console-command { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 10px; }
.addon-search { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.addon-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.addon {
    display: grid; grid-template-columns: 44px 1fr auto; gap: 11px; align-items: center;
    min-width: 0; overflow: hidden; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025);
}
.addon > div { min-width: 0; overflow: hidden; }
.addon img { width: 44px; height: 44px; border-radius: 9px; object-fit: cover; background: rgba(255,255,255,.05); }
.addon h3 { font-size: 14px; }
.addon p { overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.addon button { justify-self: end; white-space: nowrap; }
.notice { display: none; margin-bottom: 18px; padding: 13px 15px; border: 1px solid; border-radius: 12px; }
.notice.show { display: block; }
.notice.ok { color: #d9eaff; border-color: rgba(113,158,211,.36); background: rgba(113,158,211,.11); }
.notice.error { color: #ffd9d5; border-color: rgba(242,123,114,.35); background: rgba(242,123,114,.1); }
.modal { display: none; position: fixed; z-index: 50; inset: 0; place-items: center; padding: 20px; }
.modal.open { display: grid; }
.modal-backdrop { position: absolute; inset: 0; border: 0; border-radius: 0; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.modal-dialog { position: relative; width: min(440px, 100%); padding: 28px; text-align: center; border: 1px solid var(--line); border-radius: 18px; background: #111b2a; box-shadow: var(--shadow); animation: modalIn .25s ease both; }
.modal-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; color: #07111e; background: var(--accent); font: 800 30px "Space Grotesk"; }
.modal.error .modal-icon { background: var(--red); }
.modal.loading .modal-icon { color: transparent; background: transparent; border: 4px solid rgba(255,255,255,.12); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.modal h2 { margin-bottom: 7px; }
.modal p { margin-bottom: 18px; color: var(--muted); }
.modal-close { position: absolute; top: 10px; right: 10px; min-height: 34px; width: 34px; padding: 0; color: var(--muted); background: transparent; }
.login-page { display: grid; min-height: 100vh; place-items: center; padding: 24px; }
.login-card { position: relative; width: min(440px, 100%); padding: 32px; overflow: hidden; border: 1px solid var(--line-strong); border-radius: 20px; background: linear-gradient(180deg, rgba(17,26,40,.84), rgba(10,17,28,.89)); box-shadow: var(--shadow); backdrop-filter: blur(15px) saturate(110%); animation: rise .45s ease both; }
.login-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: linear-gradient(180deg, transparent, var(--accent), transparent); opacity: .75; }
.login-card .brand { margin-bottom: 28px; }
.login-card h1 { margin-bottom: 8px; font-size: 32px; }
.login-card > p { margin-bottom: 22px; color: var(--muted); }
.login-card form { display: grid; gap: 14px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; background: rgba(255,255,255,.025); }
td { font-size: 13px; }
tr:last-child td { border-bottom: 0; }
.page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin: 26px 0 18px; }
.page-title h1 { font-size: clamp(30px, 4vw, 48px); }
.page-title p { max-width: 720px; color: var(--muted); }
.manager-layout { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(0, 1.5fr); gap: 18px; }
.manager-panel { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(17,26,40,.83), rgba(11,18,29,.87)); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.manager-panel h2 { margin-bottom: 4px; font-size: 20px; }
.manager-panel > p { margin-bottom: 18px; color: var(--muted); font-size: 13px; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.breadcrumbs button { min-height: 32px; padding: 5px 9px; color: var(--muted); background: rgba(255,255,255,.04); border-color: var(--line); font-size: 12px; }
.file-list { display: grid; gap: 7px; min-height: 320px; }
.file-entry { display: grid; grid-template-columns: 32px minmax(0,1fr) auto auto; gap: 10px; align-items: center; padding: 10px 11px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.file-entry:hover { border-color: rgba(113,158,211,.38); background: rgba(113,158,211,.055); }
.file-entry .entry-name { overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.file-entry .entry-meta { color: var(--muted); font-size: 11px; white-space: nowrap; }
.file-entry button { min-height: 32px; padding: 5px 9px; }
.file-icon { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; color: var(--accent-bright); background: rgba(113,158,211,.1); font-size: 16px; }
.editor-empty { display: grid; min-height: 460px; place-items: center; color: var(--muted); text-align: center; }
.editor-wrap { display: none; }
.editor-wrap.show { display: block; }
.editor-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.editor-head strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.account-card { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(17,26,40,.83), rgba(11,18,29,.87)); box-shadow: var(--shadow); backdrop-filter: blur(14px); }
.account-card h2 { margin-bottom: 4px; font-size: 20px; }
.account-card > p { min-height: 40px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.account-list { display: grid; gap: 8px; margin-top: 16px; }
.account-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); }
.account-row strong, .account-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-row small { color: var(--muted); }
.account-row button { min-height: 32px; padding: 5px 9px; }
.credential-box { padding: 14px; border: 1px solid rgba(244,189,98,.25); border-radius: 12px; background: rgba(244,189,98,.08); text-align: left; }
.credential-box code { display: block; margin-top: 5px; color: var(--ink); word-break: break-all; }
.credential-box + .credential-box { margin-top: 8px; }
.players-toolbar {
    display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 10px;
    margin-bottom: 16px;
}
.players-summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.summary-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px;
    border: 1px solid var(--line); border-radius: 999px; color: var(--muted);
    background: rgba(255,255,255,.035); font-size: 13px; font-weight: 700;
}
.summary-chip strong { color: var(--ink); }
.player-name { display: flex; align-items: center; gap: 9px; font-weight: 700; }
.player-state {
    display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px;
    border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.045);
    font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.player-state.online { color: #d9f5eb; background: rgba(114,173,154,.14); }
.player-state.banned { color: #ffd9dc; background: rgba(207,114,118,.14); }
.role-badge { color: var(--accent-bright); font-weight: 800; }
.player-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.player-actions button { min-height: 32px; padding: 5px 9px; font-size: 12px; }
.reason-dialog { text-align: left; }
.reason-dialog .modal-icon { text-align: center; }
.reason-dialog textarea { min-height: 110px; margin: 8px 0 16px; font: inherit; }
.reason-dialog .row { justify-content: flex-end; }
.reset-dialog { text-align: left; }
.reset-dialog .modal-icon { text-align: center; }
.reset-dialog .row { justify-content: flex-end; margin-top: 16px; }
.reset-warning {
    padding: 13px 14px; border: 1px solid rgba(207,114,118,.32); border-radius: 11px;
    color: #ffdadd !important; background: rgba(207,114,118,.1);
}
.backup-list { display: grid; gap: 10px; }
.backup-row {
    display: grid; grid-template-columns: minmax(0,1.4fr) minmax(160px,.7fr) auto;
    gap: 14px; align-items: center; padding: 14px;
    border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025);
}
.backup-row strong, .backup-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backup-row small { margin-top: 3px; color: var(--muted); }
.backup-meta { color: var(--muted); font-size: 12px; }
.backup-actions { display: flex; gap: 8px; justify-content: flex-end; }
.backup-actions button { min-height: 36px; padding: 7px 11px; }
.operation-progress {
    height: 9px; margin: 16px 0 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.07);
}
.operation-progress span {
    display: block; width: 38%; height: 100%; border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-bright));
    animation: progressSweep 1.25s ease-in-out infinite;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes progressSweep {
    from { transform: translateX(-110%); }
    to { transform: translateX(265%); }
}
@media (max-width: 1050px) {
    .card, .card.wide { grid-column: span 6; }
    .hero { grid-template-columns: 1fr; }
    .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .shell { width: min(100% - 22px, 1500px); padding-top: 12px; }
    .topbar { align-items: flex-start; flex-direction: column; }
    .card, .card.wide { grid-column: 1 / -1; }
    .form-grid, .addon-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .addon { grid-template-columns: 40px 1fr; }
    .addon button { grid-column: 1 / -1; }
    .page-title { align-items: flex-start; flex-direction: column; }
    .manager-layout { grid-template-columns: 1fr; }
    .file-entry { grid-template-columns: 32px minmax(0,1fr) auto; }
    .file-entry .entry-meta { display: none; }
    .players-toolbar { grid-template-columns: 1fr; }
    .player-actions { min-width: 190px; }
    .backup-row { grid-template-columns: 1fr; }
    .backup-actions { justify-content: flex-start; }
}
