:root {
  --bg: #0a0d0b;
  --surface: rgba(20, 25, 21, 0.92);
  --surface-2: #191f1a;
  --line: rgba(220, 235, 218, 0.12);
  --text: #edf3e9;
  --muted: #98a496;
  --green: #9dff62;
  --green-2: #5cce3b;
  --danger: #ff706b;
  --amber: #f0c56a;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 18% 16%, #1d3520 0, transparent 29%),
    var(--bg);
  background-size: 32px 32px, 32px 32px, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:disabled { opacity: .45; cursor: not-allowed !important; }
.hidden { display: none !important; }
body.drawer-open { overflow: hidden; }
.ambient { position: fixed; border-radius: 50%; filter: blur(110px); pointer-events: none; opacity: .14; }
.ambient-one { width: 360px; height: 360px; background: var(--green); right: -140px; top: 12%; }
.ambient-two { width: 260px; height: 260px; background: #df9b39; left: 12%; bottom: -180px; }
.shell { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 64px; position: relative; z-index: 1; }

.topbar { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; gap: 12px; letter-spacing: .12em; }
.brand-mark { display: grid; place-items: center; width: 39px; height: 39px; color: #0a1209; background: var(--green); box-shadow: 6px 6px 0 #31562b; font-weight: 950; font-size: 22px; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { margin-top: 3px; color: var(--muted); font-size: 8px; letter-spacing: .25em; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.ghost-link, .ghost-button { color: var(--muted); border: 1px solid var(--line); background: rgba(13,17,14,.6); padding: 10px 14px; text-decoration: none; cursor: pointer; transition: .2s ease; }
.ghost-link:hover, .ghost-button:hover { color: var(--text); border-color: rgba(157,255,98,.4); }

.auth-layout { min-height: calc(100vh - 120px); display: flex; align-items: center; justify-content: center; padding: 72px 4vw; }
.eyebrow { color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .22em; margin: 0 0 14px; }
.dashboard-heading h1 { margin: 0; letter-spacing: -.055em; line-height: .96; font-size: clamp(48px, 7vw, 88px); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(157,255,98,.09); }

.auth-card, .panel, .stat-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.auth-card { width: min(100%, 460px); padding: clamp(28px, 4vw, 48px); position: relative; }
.auth-card::before { content: ""; position: absolute; left: -1px; top: -1px; width: 56px; height: 3px; background: var(--green); }
.auth-card h2, .panel h2 { font-size: 27px; letter-spacing: -.03em; margin: 0 0 8px; }
.muted { color: var(--muted); line-height: 1.55; margin: 0 0 25px; }
label { display: block; margin: 18px 0 8px; color: #c5cec2; font-size: 12px; font-weight: 700; }
input { width: 100%; height: 50px; padding: 0 15px; color: var(--text); background: #0d110e; border: 1px solid #30382f; outline: 0; transition: .2s ease; }
input:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(157,255,98,.09); }
.primary-button { width: 100%; min-height: 52px; margin-top: 22px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between; border: 0; color: #0d140b; background: var(--green); font-weight: 850; cursor: pointer; box-shadow: 6px 6px 0 #31562b; transition: transform .16s ease, box-shadow .16s ease; }
.primary-button:hover { transform: translate(-2px,-2px); box-shadow: 8px 8px 0 #31562b; }
.primary-button:disabled { opacity: .5; cursor: wait; }
.error-message { margin: 20px 0 0; padding: 12px; color: #ffc1bd; background: rgba(255,112,107,.1); border-left: 3px solid var(--danger); font-size: 13px; }

.dashboard { padding-top: 58px; }
.dashboard-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 40px; }
.dashboard-heading h1 { font-size: clamp(42px, 6vw, 70px); }
.admin-chip { display: flex; align-items: center; gap: 12px; padding: 11px 15px; border: 1px solid var(--line); color: #d4dcd1; background: rgba(17,22,18,.7); font-size: 13px; }
.online-dot { width: 7px; height: 7px; }
.stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.stat-card { min-height: 155px; padding: 24px; box-shadow: none; }
.stat-card.accent { border-color: rgba(157,255,98,.36); background: linear-gradient(135deg, rgba(55,90,45,.58), var(--surface)); }
.stat-card small { color: var(--muted); letter-spacing: .14em; font-size: 10px; font-weight: 750; }
.stat-card strong { display: block; margin: 10px 0 0; font-size: 53px; line-height: 1; letter-spacing: -.06em; }
.stat-card span { color: var(--muted); font-size: 12px; }
.content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; margin-top: 16px; align-items: start; }
.panel { padding: 26px; box-shadow: none; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 19px; }
.panel-heading .eyebrow { margin-bottom: 8px; }
.icon-button { width: 38px; height: 38px; color: var(--text); background: #111612; border: 1px solid var(--line); cursor: pointer; font-size: 19px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { padding: 12px 10px; color: #778175; font-size: 9px; letter-spacing: .13em; text-align: left; border-bottom: 1px solid var(--line); }
td { padding: 16px 10px; border-bottom: 1px solid rgba(220,235,218,.07); color: #c9d2c6; white-space: nowrap; }
.player-cell { color: var(--text); font-weight: 750; }
.player-cell small { color: var(--green); margin-left: 7px; font-size: 9px; }
.player-link { padding: 0; color: var(--text); background: none; border: 0; border-bottom: 1px solid transparent; font-weight: 800; cursor: pointer; }
.player-link:hover { color: var(--green); border-color: rgba(157,255,98,.45); }
.status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; background: #222922; color: #aeb8ac; font-size: 10px; }
.status.good { color: #bdffa1; background: rgba(91,173,59,.15); }
.status.warn { color: #ffe0a0; background: rgba(240,197,106,.13); }
.actions { display: flex; justify-content: flex-end; gap: 6px; }
.action-button { border: 1px solid var(--line); background: #151a16; color: #bac3b7; padding: 7px 9px; cursor: pointer; font-size: 11px; }
.action-button:hover { color: white; border-color: #596556; }
.action-button.danger:hover { color: #ffaaa6; border-color: rgba(255,112,107,.5); }
.empty { padding: 35px; text-align: center; color: var(--muted); }
.invite-panel code { color: var(--green); }
.invite-flow { display: flex; gap: 13px; align-items: center; margin-top: 20px; }
.invite-flow > span { width: 31px; height: 31px; flex: 0 0 auto; display: grid; place-items: center; color: var(--green); border: 1px solid rgba(157,255,98,.28); font-size: 11px; }
.invite-flow p, .invite-flow strong, .invite-flow small { display: block; margin: 0; }
.invite-flow strong { font-size: 12px; }
.invite-flow small { color: var(--muted); margin-top: 3px; }
.toast { position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 14px 18px; color: #10200d; background: var(--green); box-shadow: var(--shadow); font-weight: 700; font-size: 13px; }
.toast.error { color: white; background: var(--danger); }

.player-overlay { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: flex-end; background: rgba(3,6,4,.74); backdrop-filter: blur(7px); }
.player-drawer { width: min(820px, 96vw); height: 100vh; overflow-y: auto; padding: 34px; color: var(--text); background: #0d110e; border-left: 1px solid rgba(157,255,98,.22); box-shadow: -30px 0 90px rgba(0,0,0,.55); }
.drawer-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding-bottom: 25px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; font-size: clamp(34px, 5vw, 53px); letter-spacing: -.055em; }
.drawer-close { width: 44px; height: 44px; flex: 0 0 auto; color: #c8d1c5; background: #151a16; border: 1px solid var(--line); cursor: pointer; font-size: 28px; line-height: 1; }
.player-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.drawer-loading, .drawer-empty { margin: 34px 0; padding: 30px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); text-align: center; }
.state-strip { display: grid; grid-template-columns: 1fr 1.55fr .8fr 1.1fr; margin-top: 20px; border: 1px solid var(--line); background: #111612; }
.state-strip > div { min-width: 0; padding: 17px; border-right: 1px solid var(--line); }
.state-strip > div:last-child { border-right: 0; }
.state-strip small, .state-strip strong { display: block; }
.state-strip small { margin-bottom: 7px; color: #778175; font-size: 9px; letter-spacing: .12em; }
.state-strip strong { overflow: hidden; text-overflow: ellipsis; font-size: 15px; white-space: nowrap; }
.state-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 0 6px; font-size: 11px; }
.map-button { flex: 0 0 auto; color: var(--green); text-decoration: none; }
.map-button:hover { text-decoration: underline; }
.drawer-section { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.drawer-section h3 { margin: 0; font-size: 23px; letter-spacing: -.025em; }
.drawer-section .eyebrow { margin-bottom: 6px; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.inventory-tabs { display: flex; gap: 7px; margin: 18px 0 12px; }
.inventory-tabs button { padding: 8px 11px; color: var(--muted); background: #141915; border: 1px solid var(--line); cursor: pointer; font-size: 11px; }
.inventory-tabs button.active { color: #12200e; background: var(--green); border-color: var(--green); }
.inventory-grid { display: grid; gap: 5px; }
.storage-grid, .ender-grid { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.armor-grid { max-width: 420px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.inventory-slot { position: relative; min-width: 0; aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; background: #111612; border: 1px solid #283026; box-shadow: inset 0 0 0 2px rgba(255,255,255,.015); }
.inventory-slot.filled { background: linear-gradient(145deg, #20281f, #151a16); border-color: #3d493a; }
.minecraft-item-icon { width: min(52%, 38px); height: min(52%, 38px); object-fit: contain; image-rendering: pixelated; filter: drop-shadow(2px 3px 2px rgba(0,0,0,.55)); }
.inventory-slot .item-symbol { color: var(--green); font-size: clamp(16px, 3vw, 25px); font-weight: 500; }
.inventory-slot span { position: absolute; left: 4px; right: 4px; bottom: 4px; overflow: hidden; color: #aeb8ac; font-size: 7px; line-height: 1; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.inventory-slot small { position: absolute; top: 4px; right: 5px; color: white; font-size: 10px; font-weight: 800; text-shadow: 0 1px 2px black; }
.management-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 17px; }
.inline-form, .snapshot-action { padding: 16px; background: #111612; border: 1px solid var(--line); }
.inline-form label { margin: 0 0 9px; }
.inline-form > div { display: flex; }
.inline-form input { min-width: 0; }
.inline-form button, .snapshot-action button { padding: 0 14px; color: #10200d; background: var(--green); border: 0; cursor: pointer; font-weight: 800; }
.inline-form small, .snapshot-action small { display: block; margin-top: 9px; color: var(--muted); font-size: 10px; }
.snapshot-action { display: flex; flex-direction: column; align-items: flex-start; }
.snapshot-action > span { color: #c5cec2; font-size: 12px; font-weight: 700; }
.snapshot-action button { min-height: 42px; margin-top: 10px; }
.count-chip { min-width: 31px; padding: 6px 9px; color: var(--green); background: rgba(157,255,98,.09); border: 1px solid rgba(157,255,98,.2); text-align: center; font-size: 11px; }
.snapshot-list { display: grid; gap: 7px; margin-top: 17px; }
.snapshot-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 14px; color: var(--text); background: #111612; border: 1px solid var(--line); text-align: left; cursor: pointer; }
.snapshot-row:hover, .snapshot-row.selected { border-color: rgba(157,255,98,.42); background: #172016; }
.snapshot-row span, .snapshot-row strong, .snapshot-row small { display: block; }
.snapshot-row small { margin-top: 4px; color: var(--muted); font-size: 10px; }
.snapshot-stats { flex: 0 0 auto; color: #b9c4b6; font-size: 11px; }
.snapshot-empty { margin: 0; padding: 20px; text-align: center; }
.snapshot-preview { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 12px; padding: 14px; background: rgba(240,197,106,.08); border: 1px solid rgba(240,197,106,.25); }
.snapshot-preview strong, .snapshot-preview span { display: block; }
.snapshot-preview span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.danger-button { flex: 0 0 auto; padding: 10px 13px; color: #ffd2d0; background: rgba(255,112,107,.1); border: 1px solid rgba(255,112,107,.42); cursor: pointer; }
.danger-button:hover { color: white; background: rgba(255,112,107,.2); }

@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .auth-layout { padding: 55px 0; }
  .invite-panel { order: -1; }
}
@media (max-width: 650px) {
  .shell { width: min(100% - 24px, 1220px); }
  .topbar { height: 72px; }
  .ghost-link { display: none; }
  .stats-grid { grid-template-columns: 1fr; }
  .dashboard-heading { align-items: flex-start; gap: 24px; flex-direction: column; }
  .panel { padding: 19px; }
  .stat-card { min-height: 125px; }
  .stat-card strong { font-size: 43px; }
  .player-drawer { width: 100vw; padding: 22px 14px 38px; }
  .state-strip { grid-template-columns: 1fr 1fr; }
  .state-strip > div:nth-child(2) { border-right: 0; }
  .state-strip > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .management-grid { grid-template-columns: 1fr; }
  .inventory-grid { gap: 3px; }
  .inventory-slot span { display: none; }
  .snapshot-row, .snapshot-preview { align-items: flex-start; flex-direction: column; }
}
