/* ==========================================================================
   CustomScreens Dashboard — Ultra-Clean Zero-Lag Neo-Claymorphism System
   Soft-sculpted matte clay surfaces · Crisp dual bevels · 60fps zero-blur scroll
   ========================================================================== */
:root {
  --bg: #0f111c;
  --bg-deep: #090b12;
  --clay-surface: linear-gradient(145deg, #1d2134 0%, #151827 100%);
  --clay-card: linear-gradient(145deg, #242940 0%, #1a1e30 100%);
  --clay-btn: linear-gradient(145deg, #2b314d 0%, #1e2236 100%);
  --clay-btn-hover: linear-gradient(145deg, #333a5b 0%, #242940 100%);
  --clay-well: #101320;
  --panel: #191d2e;
  --panel-solid: #191d2e;
  --panel-2: #21263b;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f2fa;
  --muted: #9ba0be;
  --dim: #686d8c;
  --amber: #ffbe55;
  --pink: #ff6492;
  --violet: #9366f9;
  --cyan: #38e8ff;
  --green: #3ce696;
  --red: #ff6270;
  --grad: linear-gradient(130deg, #ffbe55 0%, #ff6492 52%, #9366f9 100%);
  --radius-lg: 22px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  /* Optimized Neo-Claymorphic Shadows (Zero compositor lag) */
  --clay-shadow:
    0 14px 28px rgba(4, 5, 11, 0.65),
    inset 1.5px 2px 3px rgba(255, 255, 255, 0.11),
    inset -2px -3px 6px rgba(5, 6, 14, 0.55);

  --clay-card-shadow:
    0 8px 18px rgba(4, 5, 11, 0.5),
    inset 1.5px 1.5px 2px rgba(255, 255, 255, 0.12),
    inset -1.5px -3px 5px rgba(5, 6, 14, 0.48);

  --clay-btn-shadow:
    0 4px 10px rgba(4, 5, 11, 0.48),
    inset 1px 1.5px 2px rgba(255, 255, 255, 0.15),
    inset -1.5px -2.5px 4px rgba(5, 6, 14, 0.45);

  --clay-primary-shadow:
    0 6px 16px rgba(255, 100, 146, 0.42),
    inset 1.5px 2px 3px rgba(255, 255, 255, 0.45),
    inset -2px -3px 6px rgba(84, 15, 48, 0.5);

  --clay-well-shadow:
    inset 3px 4px 8px rgba(4, 5, 11, 0.78),
    0 1px 0 rgba(255, 255, 255, 0.06);

  --font: "Geist", system-ui, -apple-system, Segoe UI, sans-serif;
  --display: "Syne", var(--font);
  --mono: "Geist Mono", ui-monospace, Consolas, monospace;
  --mc: var(--font);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.45, 0.64, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background-color: #090b12;
  background-image:
    radial-gradient(circle at 16% 14%, rgba(56, 232, 255, 0.14) 0%, transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(255, 190, 85, 0.14) 0%, transparent 45%),
    linear-gradient(180deg, rgba(9, 11, 18, 0.72) 0%, rgba(11, 14, 24, 0.86) 55%, rgba(8, 10, 17, 0.94) 100%),
    url('/bg-ancient.jpg');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  color: var(--text);
  font: 13.5px/1.45 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.hidden { display: none !important; }
code, .mono { font-family: var(--mono); }
code {
  background: var(--clay-well);
  padding: 2px 7px;
  border-radius: 7px;
  font-size: 0.92em;
  box-shadow: inset 1px 2px 4px rgba(0, 0, 0, 0.6);
  color: #ffd485;
}
.display { font-family: var(--display); letter-spacing: -0.02em; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.tiny { font-size: 11.5px; }
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap { gap: 8px; }
.gap-lg { gap: 14px; }
.grow { flex: 1; min-width: 0; }
.wrap, .flex-wrap { flex-wrap: wrap; }
.h3 { font-size: 15px; margin: 0; font-weight: 700; }
.error-text { color: var(--red); min-height: 1.2em; margin: 8px 0 0; }

/* --------------------------------------------------------------- Neo-Clay Panels */
.glass {
  background: var(--clay-surface);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--clay-shadow);
}

/* --------------------------------------------------------------- Recessed Clay Controls */
.input, select.input, textarea.input {
  background: var(--clay-well);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font: inherit;
  outline: none;
  box-shadow: var(--clay-well-shadow);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
  min-width: 0;
}
.input:focus, select.input:focus, textarea.input:focus {
  border-color: rgba(255, 100, 146, 0.65);
  box-shadow:
    inset 3px 4px 8px rgba(4, 5, 11, 0.85),
    0 0 0 2.5px rgba(255, 100, 146, 0.22);
}
.input.mono, .rich { font-family: var(--mono); font-size: 12.5px; }
select.input {
  appearance: none;
  padding-right: 28px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
select.input option { background: #161928; color: var(--text); }
textarea.input { resize: vertical; min-height: 70px; }
.input.invalid { border-color: var(--red); }

/* --------------------------------------------------------------- Tactile 3D Clay Buttons */
.btn {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--clay-btn);
  color: var(--text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font: 600 12.5px var(--font);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--clay-btn-shadow);
  transition: transform .12s var(--ease), background .15s var(--ease), filter .12s;
}
.btn:hover {
  background: var(--clay-btn-hover);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
  box-shadow: inset 2px 3px 6px rgba(4, 5, 11, 0.7);
}
.btn:focus-visible, .tab:focus-visible, .seg-btn:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}
.btn.primary {
  background: var(--grad);
  border-color: rgba(255, 255, 255, 0.28);
  color: #190a14;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  box-shadow: var(--clay-primary-shadow);
}
.btn.primary:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
.btn.ghost {
  background: rgba(40, 46, 72, 0.5);
  border-color: rgba(255, 255, 255, 0.08);
}
.btn.ghost:hover {
  background: var(--clay-btn-hover);
}
.btn.danger {
  background: linear-gradient(145deg, #47212c, #31151e);
  color: #ffc2c8;
  border-color: rgba(255, 98, 112, 0.38);
}
.btn.danger:hover {
  background: linear-gradient(145deg, #592736, #3d1925);
}
.btn.small { padding: 5px 10px; font-size: 11.5px; border-radius: 10px; }
.btn.icon { padding: 7px 11px; font-size: 14px; line-height: 1; border-radius: 11px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* --------------------------------------------------------------- Sculpted Clay Toggle Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 40px;
  height: 22px;
  border-radius: 22px;
  background: var(--clay-well);
  box-shadow: var(--clay-well-shadow);
  position: relative;
  transition: background .2s var(--ease);
  flex: none;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffffff, #cfd4e8);
  box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.55);
  transition: transform .22s var(--spring);
}
.switch input:checked + .track {
  background: var(--grad);
}
.switch input:checked + .track::after { transform: translateX(18px); }

/* --------------------------------------------------------------- Live Sync Status Pill */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 700 11px var(--mono);
  padding: 5px 11px;
  border-radius: 999px;
  letter-spacing: 0.02em;
  user-select: none;
  box-shadow: var(--clay-btn-shadow);
}
.sync-pill.ok {
  background: linear-gradient(145deg, #163d31, #0f2921);
  color: #5ef5b4;
  border: 1px solid rgba(60, 230, 150, 0.35);
}
.sync-pill.sync {
  background: linear-gradient(145deg, #3f3218, #2b210e);
  color: #ffd166;
  border: 1px solid rgba(255, 190, 85, 0.4);
}
.sync-pill.warn {
  background: linear-gradient(145deg, #422c16, #2d1d0d);
  color: #ffbe55;
  border: 1px solid rgba(255, 190, 85, 0.45);
}
.sync-pill.error {
  background: linear-gradient(145deg, #451b24, #2e1118);
  color: #ff8590;
  border: 1px solid rgba(255, 98, 112, 0.45);
}

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hint { font-size: 11.5px; color: var(--dim); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* --------------------------------------------------------------- Login */
.login { height: 100%; display: grid; place-items: center; padding: 20px; }
.login-card { width: min(500px, 100%); padding: 38px; text-align: center; }
.login-card h1 { font-size: 38px; margin: 14px 0 6px; }
.login-card form { margin-top: 20px; }

/* --------------------------------------------------------------- App Shell & Topbar */
.app { height: 100%; display: flex; flex-direction: column; padding: 12px; gap: 12px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 9px 16px; gap: 14px; }
.brand { display: flex; align-items: center; gap: 11px; }
.brand-name { font-size: 19px; font-weight: 800; line-height: 1.1; }
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--grad);
  position: relative;
  box-shadow: var(--clay-primary-shadow);
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px 7px;
  border-radius: 3px;
  background: repeating-linear-gradient(#120c1c 0 3px, transparent 3px 6px);
  opacity: .85;
}
.brand-mark.big { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto; }
.brand-mark.big::after { inset: 16px 13px; background: repeating-linear-gradient(#120c1c 0 6px, transparent 6px 11px); }

.tabs {
  display: flex;
  gap: 5px;
  background: var(--clay-well);
  padding: 4px;
  border-radius: 14px;
  box-shadow: var(--clay-well-shadow);
}
.tab {
  background: none;
  border: 0;
  color: var(--muted);
  font: 600 12.5px var(--font);
  padding: 7px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text);
  background: var(--clay-btn);
  box-shadow: var(--clay-btn-shadow);
}

.workspace { flex: 1; min-height: 0; }
.tab-panel { height: 100%; }
.screens-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 390px;
  gap: 12px;
  height: 100%;
}

/* --------------------------------------------------------------- Sidebar Clay Tree View */
.sidebar { padding: 12px; display: flex; flex-direction: column; gap: 9px; min-height: 0; }
.screen-list {
  list-style: none;
  margin: 0;
  padding: 7px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--clay-well);
  border-radius: 14px;
  box-shadow: var(--clay-well-shadow);
}

.tree-section-header {
  font: 700 10px var(--mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 7px 6px 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  margin-top: 5px;
  user-select: none;
}
.tree-section-header:first-child { border-top: 0; margin-top: 0; padding-top: 2px; }

.tree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  padding-left: calc(7px + var(--depth, 0) * 13px);
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  user-select: none;
}
.tree-node:hover { background: rgba(255, 255, 255, 0.05); }
.tree-node.active {
  background: linear-gradient(145deg, #2d2546, #211b36);
  border-color: rgba(255, 100, 146, 0.45);
  box-shadow: var(--clay-btn-shadow);
}
.tree-node.screen-node { font-weight: 600; }
.tree-node.btn-node { font-size: 12px; }

.tree-toggle {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  border-radius: 6px;
  font-size: 10px;
  flex: none;
}
.tree-toggle:hover { color: var(--text); background: rgba(255, 255, 255, 0.12); }
.tree-toggle.open { color: var(--amber); }
.tree-toggle.leaf { opacity: .25; pointer-events: none; font-size: 8px; background: transparent; }

.tree-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex: none;
}

.tree-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tree-title { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); line-height: 1.2; }
.tree-sub { font-size: 10px; color: var(--muted); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }

.tree-badges { display: flex; align-items: center; gap: 4px; flex: none; }
.badge {
  font: 700 9.5px var(--mono);
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  flex: none;
}
.badge.esc { background: var(--grad); color: #1a0c14; font-weight: 800; }
.badge.submenu { background: rgba(147, 102, 249, 0.22); color: #d5c7ff; border: 1px solid rgba(147, 102, 249, 0.4); }
.badge.return { background: rgba(255, 255, 255, 0.06); color: var(--muted); }
.badge.warn { background: rgba(255, 98, 112, .22); color: #ffbec4; }
.badge.ok { background: rgba(60, 230, 150, 0.18); color: #5ef5b4; border: 1px solid rgba(60, 230, 150, 0.35); }

.tree-add-btn {
  width: 20px;
  height: 20px;
  border-radius: 7px;
  background: var(--clay-btn);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  opacity: .55;
  flex: none;
}
.tree-node:hover .tree-add-btn { opacity: 1; }
.tree-add-btn:hover { background: var(--grad); color: #140b12; border-color: transparent; }

.tree-empty {
  padding: 4px 6px 4px calc(24px + var(--depth, 0) * 13px);
  font-size: 11px;
  color: var(--dim);
  font-style: italic;
}

.load-errors { display: flex; flex-direction: column; gap: 5px; max-height: 25%; overflow: auto; }
.load-errors .err { font-size: 11px; color: #ffbec4; background: rgba(255,98,112,0.12); border: 1px solid rgba(255,98,112,0.3); padding: 6px 9px; border-radius: 10px; }

/* --------------------------------------------------------------- Clean Organized Clay Editor */
.editor { padding: 0; overflow-y: auto; overflow-x: hidden; min-height: 0; display: flex; flex-direction: column; }
.editor-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 16px;
  background: #1b1f32;
  border-bottom: 1px solid var(--line-strong);
  box-shadow: 0 6px 16px rgba(4, 5, 11, 0.45);
}
.editor-head-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-head h2 { margin: 0; font-size: 18px; }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); }

.editor-subnav {
  display: flex;
  gap: 5px;
  background: var(--clay-well);
  padding: 4px;
  border-radius: 11px;
  box-shadow: var(--clay-well-shadow);
  overflow-x: auto;
}
.subnav-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  font: 600 11.5px var(--font);
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.subnav-btn:hover { color: var(--text); }
.subnav-btn.active {
  background: var(--clay-btn);
  color: var(--text);
  box-shadow: var(--clay-btn-shadow);
}

.editor-body { padding: 14px 16px 24px; display: flex; flex-direction: column; gap: 14px; }

.card {
  background: var(--clay-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--clay-card-shadow);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.card-head h3 { margin: 0; font: 700 14px var(--display); letter-spacing: .01em; }
.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty h2 { font-size: 24px; color: var(--text); }

.type-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }
.type-opt {
  text-align: left;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--clay-btn);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  box-shadow: var(--clay-btn-shadow);
}
.type-opt:hover { background: var(--clay-btn-hover); }
.type-opt.active {
  border-color: rgba(255, 100, 146, 0.65);
  background: linear-gradient(145deg, #35243e, #24192e);
  box-shadow: 0 0 0 2px rgba(255, 100, 146, 0.25);
}
.type-opt b { display: block; font-family: var(--display); font-size: 13px; margin-bottom: 2px; }
.type-opt span { font-size: 11px; color: var(--muted); }

.list-row { display: flex; gap: 6px; align-items: center; }
.list-row .handle { color: var(--dim); font-size: 11.5px; width: 18px; text-align: center; font-family: var(--mono); }

/* --------------------------------------------------------------- Compact Collapsible Accordion Button Cards */
.btn-card {
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: linear-gradient(145deg, #1b1f32, #141726);
  box-shadow: var(--clay-well-shadow);
  overflow: hidden;
}
.btn-card.expanded {
  border-color: rgba(147, 102, 249, 0.45);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}
.btn-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.02);
}
.btn-card-head:hover { background: rgba(255, 255, 255, 0.05); }
.btn-card-head .num {
  font: 700 10.5px var(--mono);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 7px;
  border-radius: 6px;
}
.btn-card-summary {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-card-summary img {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  object-fit: contain;
  flex: none;
}
.btn-card-body {
  padding: 12px 14px 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.btn-card.collapsed .btn-card-body { display: none; }

.action-kinds { display: flex; flex-wrap: wrap; gap: 5px; }
.kind {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: var(--clay-btn);
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 999px;
  font: 600 11px var(--font);
  cursor: pointer;
}
.kind:hover { color: var(--text); }
.kind.active {
  color: #190a14;
  background: var(--grad);
  border-color: rgba(255, 255, 255, 0.3);
  font-weight: 700;
}
.lines { display: flex; flex-direction: column; gap: 6px; }
.line-row { display: grid; grid-template-columns: 145px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
details.more > summary { cursor: pointer; color: var(--muted); font-size: 11.5px; list-style: none; font-weight: 600; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more > .grid-3, details.more > .grid-2 { margin-top: 8px; }

/* --------------------------------------------------------------- Auto-Whitelist & Anti-VPN Security Tab */
.security-layout {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-right: 4px;
  padding-bottom: 32px;
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}
.kpi-card {
  background: var(--clay-surface);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--clay-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-card .kpi-label { font: 700 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-card .kpi-val { font: 800 26px var(--display); color: var(--text); line-height: 1.15; }
.kpi-card .kpi-sub { font-size: 11.5px; color: var(--dim); }

.sec-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 14px;
  align-items: start;
}

.sim-result-box {
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--clay-well);
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.sim-result-box.approved {
  background: rgba(60, 230, 150, 0.11);
  border-color: rgba(60, 230, 150, 0.45);
  color: #82f9c5;
}
.sim-result-box.rejected {
  background: rgba(255, 98, 112, 0.12);
  border-color: rgba(255, 98, 112, 0.45);
  color: #ffb3ba;
}
.sim-emoji {
  font-size: 26px;
  line-height: 1;
  flex: none;
}

.sec-table-wrap {
  background: var(--clay-well);
  border-radius: 14px;
  box-shadow: var(--clay-well-shadow);
  overflow-x: auto;
  max-height: 360px;
  overflow-y: auto;
}
.sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.sec-table th {
  position: sticky;
  top: 0;
  background: #141829;
  color: var(--muted);
  font: 700 10.5px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-strong);
}
.sec-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.sec-table tr:hover td { background: rgba(255, 255, 255, 0.03); }

.audit-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--clay-well);
  padding: 10px;
  border-radius: 14px;
  box-shadow: var(--clay-well-shadow);
}
.audit-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--muted);
  font-size: 12px;
}
.audit-item.ok { border-left-color: var(--green); }
.audit-item.bad { border-left-color: var(--red); }

/* --------------------------------------------------------------- Rich-Text Clay Toolbar */
.rich-toolbar {
  position: fixed;
  z-index: 50;
  padding: 9px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  max-width: 560px;
  background: #22273e;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  box-shadow: var(--clay-shadow);
}
.swatch {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .25);
  cursor: pointer;
  padding: 0;
}
.swatch:hover { transform: scale(1.15); }
.tb-sep { width: 1px; height: 18px; background: var(--line-strong); margin: 0 2px; }
.tb-btn {
  background: var(--clay-btn);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  font: 600 11.5px var(--font);
  cursor: pointer;
}
.tb-btn:hover { background: var(--clay-btn-hover); }
.tb-btn.fx { background: var(--grad); color: #170c13; border: 0; font-weight: 700; }
input[type="color"].pick {
  width: 26px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--clay-well);
  cursor: pointer;
}

/* --------------------------------------------------------------- Live Preview / Minecraft Stage */
.preview-pane { padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 0; overflow: auto; }
.pane-head { display: flex; align-items: center; justify-content: space-between; }
.seg {
  display: flex;
  background: var(--clay-well);
  border-radius: 11px;
  padding: 3px;
  box-shadow: var(--clay-well-shadow);
  gap: 3px;
}
.seg-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font: 600 11.5px var(--font);
  padding: 5px 11px;
  border-radius: 8px;
  cursor: pointer;
}
.seg-btn.active {
  background: var(--clay-btn);
  color: var(--text);
  box-shadow: var(--clay-btn-shadow);
}
.mc-stage {
  --px: 2px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  min-height: 420px;
  background:
    linear-gradient(rgba(0,0,0,.55), rgba(0,0,0,.55)),
    repeating-conic-gradient(#3b2a1a 0 25%, #4a3522 0 50%) 0 0 / 32px 32px;
  box-shadow: inset 3px 4px 10px rgba(0, 0, 0, 0.85);
  border: 2px solid rgba(0, 0, 0, 0.6);
  image-rendering: pixelated;
  font-family: var(--mc);
  font-size: 15px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px 20px;
  gap: 8px;
}
.mc-stage.pause-bg { background: linear-gradient(rgba(0,0,0,.45), rgba(0,0,0,.45)), linear-gradient(#5f8fd6, #9fc6ff 55%, #5b8d3b 55%, #4a7a2e); }
.mc-title { text-align: center; margin: 6px 0 4px; line-height: 1.3; }
.mc-body { text-align: center; white-space: pre-wrap; line-height: 1.35; max-width: 100%; }
.mc-grid { display: grid; gap: 4px 8px; justify-content: center; }
.mc-grid .mc-btn.full-span, .mc-btn.full-span {
  grid-column: 1 / -1;
  justify-self: center;
  width: 306px !important;
  max-width: 100%;
}
.mc-btn {
  position: relative;
  height: 40px;
  min-width: 60px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #6f6f6f;
  color: #fff;
  border: 2px solid #000;
  box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -4px 0 #555;
  font-family: var(--mc);
  font-size: 14.5px;
  font-weight: 500;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mc-btn:hover { border-color: #fff; background: #7f86b8; box-shadow: inset 2px 2px 0 #bec6ff, inset -2px -4px 0 #59609a; }
.mc-btn .tip { display: none; }
.mc-btn:hover .tip {
  display: block;
  position: absolute;
  left: 50%;
  top: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(16, 0, 16, .94);
  border: 2px solid #2b0b60;
  outline: 1px solid #120018;
  padding: 5px 8px;
  white-space: pre-wrap;
  min-width: 120px;
  max-width: 260px;
  text-align: left;
  pointer-events: none;
}
.mc-footer { margin-top: auto; display: flex; gap: 8px; justify-content: center; padding-top: 10px; }
.mc-input { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.mc-text { width: 200px; height: 40px; background: #000; border: 2px solid #a0a0a0; }
.mc-check { display: flex; gap: 6px; align-items: center; }
.mc-check i { width: 17px; height: 17px; background: #000; border: 2px solid #a0a0a0; display: inline-block; }
.mc-slider { width: 200px; height: 40px; background: #3a3a3a; border: 2px solid #000; display: flex; align-items: center; justify-content: center; position: relative; }
.mc-sprite {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  vertical-align: -0.22em;
  image-rendering: pixelated;
  object-fit: contain;
  margin-right: 4px;
  filter: drop-shadow(1px 1px 0 rgba(0,0,0,.45));
}
.mc-btn .mc-sprite { margin-right: 5px; }
.mc-head { width: 1.25em; height: 1.25em; vertical-align: -0.22em; image-rendering: pixelated; margin-right: 4px; }
.pause-col { display: flex; flex-direction: column; gap: 6px; width: 300px; margin-top: 10px; }
.pause-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pause-col .mc-btn { width: 100%; }
.pause-col .mc-btn.custom {
  font-size: 15.5px;
  font-weight: 500;
  box-shadow: inset 2px 2px 0 #a9a9a9, inset -2px -4px 0 #555, 0 0 0 2px rgba(255, 181, 71, .85);
}
.preview-errors { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.preview-errors li { font-size: 12px; color: #ffbec4; background: rgba(255,98,112,.12); border: 1px solid rgba(255,98,112,.3); border-radius: 10px; padding: 7px 10px; }

/* --------------------------------------------------------------- Settings & Help */
.settings { height: 100%; overflow: auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; align-content: start; padding-bottom: 40px; }
.settings .card { background: var(--clay-surface); box-shadow: var(--clay-shadow); }
.kv-row { display: grid; grid-template-columns: 140px minmax(0,1fr) auto auto; gap: 7px; align-items: center; }
.pill-ok { color: var(--green); font-weight: 700; }
.pill-no { color: var(--amber); font-weight: 700; }
.help { height: 100%; overflow: auto; padding: 24px 28px; }
.help h2 { font-size: 20px; margin: 22px 0 8px; }
.help h2:first-child { margin-top: 0; }
.help table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; }
.help td, .help th { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.help th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }

/* --------------------------------------------------------------- Clay Modal & Toast */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(6, 7, 14, .75);
  display: grid;
  place-items: center;
  padding: 20px;
}
.modal {
  width: min(650px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  background: #1a1e30;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  box-shadow: var(--clay-shadow);
}
.modal-head { padding: 15px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.modal-head h3 { margin: 0; font: 700 17px var(--display); }
.modal-body { padding: 16px 20px; overflow: auto; display: flex; flex-direction: column; gap: 13px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

.cmd-group h4 { margin: 8px 0 6px; font: 700 12px var(--display); color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.cmd-item { display: flex; gap: 10px; align-items: center; padding: 7px 10px; border-radius: 10px; cursor: pointer; }
.cmd-item:hover { background: rgba(255, 255, 255, .07); }
.cmd-item b { font-family: var(--mono); font-weight: 600; }
.cmd-item span { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: #20253b;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 4px solid var(--green);
  padding: 10px 15px;
  border-radius: 12px;
  box-shadow: var(--clay-shadow);
  max-width: 400px;
}
.toast.error { border-left-color: var(--red); }
.toast.warn { border-left-color: var(--amber); }

@keyframes card-flash {
  0% { outline: 2px solid var(--pink); }
  100% { outline: 2px solid transparent; }
}
.highlight-card { animation: card-flash 1.4s var(--ease) both !important; }

.mc-btn.has-glow {
  border-color: var(--btn-glow, #ffd700);
  box-shadow: inset 2px 2px 0 rgba(255, 255, 255, 0.4), inset -2px -4px 0 rgba(0, 0, 0, 0.5), 0 0 10px var(--btn-glow, rgba(255, 215, 0, 0.65));
}

.mc-serif, [data-font="uniform"], [data-font="minecraft:uniform"], .font-times {
  font-family: "Times New Roman", Times, "Noto Serif", Georgia, serif !important;
  font-weight: 500 !important;
  font-size: 1.15em;
  letter-spacing: 0.03em;
}

/* --------------------------------------------------------------- Picture / Texture Library Picker */
.item-picker-tabs {
  display: flex;
  gap: 5px;
  background: var(--clay-well);
  padding: 4px;
  border-radius: 12px;
  box-shadow: var(--clay-well-shadow);
  overflow-x: auto;
}
.item-tab-btn {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 8px;
  font: 600 11.5px var(--font);
  cursor: pointer;
  white-space: nowrap;
}
.item-tab-btn:hover { color: var(--text); }
.item-tab-btn.active {
  color: #190a14;
  background: var(--grad);
  font-weight: 700;
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  padding: 9px;
  background: var(--clay-well);
  border-radius: 14px;
  box-shadow: var(--clay-well-shadow);
}
.item-cell {
  background: var(--clay-btn);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 11px;
  padding: 8px 4px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.item-cell:hover {
  background: var(--clay-btn-hover);
  border-color: rgba(255, 190, 85, 0.55);
}
.item-cell img {
  width: 30px;
  height: 30px;
  image-rendering: pixelated;
  object-fit: contain;
}
.item-cell .name {
  font: 10px var(--font);
  color: var(--text);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* --------------------------------------------------------------- Upload Dropzone & Custom Gallery */
.upload-dropzone {
  border: 2px dashed rgba(255, 190, 85, 0.45);
  border-radius: 16px;
  padding: 22px 16px;
  text-align: center;
  background: var(--clay-well);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.upload-dropzone:hover, .upload-dropzone.dragover {
  border-color: var(--amber);
  background: rgba(255, 190, 85, 0.07);
}
.upload-dropzone input[type="file"] { display: none; }
.upload-icon { font-size: 26px; color: var(--amber); }
.custom-pic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 10px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  background: var(--clay-well);
  border-radius: 14px;
}
.custom-pic-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 8px 6px;
  background: var(--clay-btn);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  cursor: pointer;
  text-align: center;
}
.custom-pic-card img { width: 38px; height: 38px; object-fit: contain; image-rendering: pixelated; }
.custom-pic-card .pic-name { font-size: 10.5px; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* --------------------------------------------------------------- Recipe Studio (3x3 Crafting Grid) */
.recipe-bench {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 16px;
  background: var(--clay-well);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
}
.recipe-grid-3x3 {
  display: grid;
  grid-template-columns: repeat(3, 44px);
  grid-template-rows: repeat(3, 44px);
  gap: 4px;
  background: #2b2b2b;
  padding: 6px;
  border: 2px solid #1a1a1a;
  border-radius: 8px;
}
.recipe-slot {
  width: 44px;
  height: 44px;
  background: #8b8b8b;
  border: 2px solid #373737;
  border-right-color: #fff;
  border-bottom-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.recipe-slot img { width: 30px; height: 30px; image-rendering: pixelated; object-fit: contain; }
.recipe-arrow { font-size: 28px; color: var(--amber); user-select: none; }
.recipe-result-box { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.recipe-result-slot {
  width: 54px;
  height: 54px;
  background: #8b8b8b;
  border: 2px solid #373737;
  border-right-color: #fff;
  border-bottom-color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.recipe-result-slot img { width: 38px; height: 38px; image-rendering: pixelated; object-fit: contain; }

/* --------------------------------------------------------------- Dual-Morphism Discord Auth Gateway & SMP Hub */
.auth-gateway {
  display: grid;
  grid-template-columns: minmax(340px, 520px) minmax(300px, 380px);
  gap: 22px;
  max-width: 940px;
  width: 100%;
  align-items: stretch;
}
.clay-glass {
  background: linear-gradient(155deg, rgba(35, 41, 68, 0.88), rgba(19, 22, 38, 0.94));
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  box-shadow:
    0 24px 54px rgba(3, 4, 10, 0.72),
    inset 0 2px 3px rgba(255, 255, 255, 0.18),
    inset 0 -4px 10px rgba(4, 5, 14, 0.65);
}
.discord-auth-card {
  padding: 28px 30px;
  border-color: rgba(138, 112, 255, 0.35);
}
.admin-auth-card {
  padding: 26px 26px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font: 700 10.5px var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.discord-pill {
  background: rgba(88, 101, 242, 0.22);
  color: #a5b4fc;
  border: 1px solid rgba(88, 101, 242, 0.45);
}
.admin-pill {
  background: rgba(246, 193, 92, 0.16);
  color: var(--amber);
  border: 1px solid rgba(246, 193, 92, 0.38);
  align-self: flex-start;
}
.discord-btn {
  background: linear-gradient(145deg, #6d78ff, #4f59d9);
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 8px 20px rgba(88, 101, 242, 0.42),
    inset 0 2px 2px rgba(255, 255, 255, 0.32),
    inset 0 -3px 6px rgba(23, 27, 84, 0.55);
}
.discord-btn:hover {
  background: linear-gradient(145deg, #7c86ff, #5865f2);
  transform: translateY(-1px);
}
.field-label {
  font: 600 11.5px var(--font);
  color: #cbd5e1;
}
.code-input {
  font-size: 20px;
  letter-spacing: 0.32em;
  text-align: center;
  font-weight: 700;
  color: #a5b4fc;
}
.matched-account-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 15px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(60, 230, 150, 0.13), rgba(26, 33, 56, 0.9));
  border: 1px solid rgba(60, 230, 150, 0.38);
  box-shadow: var(--clay-well-shadow);
}
.matched-account-card img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  image-rendering: pixelated;
  border: 2px solid rgba(60, 230, 150, 0.55);
}
.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0;
  color: var(--dim);
  font: 700 10px var(--mono);
  letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.09);
}
.server-quick-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--clay-well);
  border: 1px solid rgba(255, 255, 255, 0.07);
  margin-top: 10px;
}

/* Topbar Identity Pill */
.identity-pill {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 11px 4px 6px;
  border-radius: 999px;
  background: var(--clay-btn);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--clay-btn-shadow);
}
.identity-pill img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  image-rendering: pixelated;
}
.identity-pill .ign {
  font: 700 12.5px var(--font);
  color: var(--text);
}
.identity-pill .sub {
  font: 500 10.5px var(--mono);
  color: var(--muted);
}

/* SMP Hero & Player Profile Clay-Glass Banner */
.smp-hero-banner {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 18px;
  padding: 22px 24px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 12% 20%, rgba(138, 112, 255, 0.28), transparent 55%),
    radial-gradient(circle at 88% 80%, rgba(60, 230, 150, 0.18), transparent 55%),
    linear-gradient(150deg, #1e233a, #131626);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--clay-card-shadow);
}
.player-id-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(14, 17, 29, 0.72);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(138, 112, 255, 0.32);
  box-shadow: var(--clay-well-shadow);
}
.player-id-card img.mc-body {
  width: 58px;
  height: 96px;
  object-fit: contain;
  image-rendering: pixelated;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
}

/* Concept & Rule Cards Grid */
.concepts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 14px;
}
.concept-card {
  background: var(--clay-card);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--clay-card-shadow);
  transition: transform 0.16s ease, border-color 0.16s ease;
}
.concept-card:hover {
  transform: translateY(-2px);
  border-color: rgba(138, 112, 255, 0.45);
}
.concept-highlights {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  color: #cbd5e1;
  font-size: 12.5px;
}

/* Custom Recipes Showcase Workbench */
.recipes-showcase-layout {
  display: grid;
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.workbench-stage {
  background: linear-gradient(155deg, #21263d, #151829);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 20px;
  box-shadow: var(--clay-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.mc-crafting-grid {
  display: grid;
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(3, 62px);
  gap: 6px;
  background: #2b2d38;
  padding: 10px;
  border-radius: 14px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--clay-well-shadow);
}
.mc-craft-slot {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  background: linear-gradient(145deg, #1c2033, #131624);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.65);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  position: relative;
}
.mc-craft-slot img {
  width: 34px;
  height: 34px;
  image-rendering: pixelated;
  object-fit: contain;
}
.mc-craft-slot .slot-lbl {
  font-size: 9px;
  color: var(--muted);
  max-width: 54px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recipe-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.recipe-select-card {
  background: var(--clay-btn);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--clay-btn-shadow);
  transition: transform 0.14s ease, border-color 0.14s ease;
}
.recipe-select-card:hover, .recipe-select-card.active {
  border-color: rgba(168, 85, 247, 0.65);
  background: linear-gradient(145deg, #2d2546, #1d1930);
  transform: translateY(-2px);
}
.recipe-select-card img {
  width: 42px;
  height: 42px;
  image-rendering: pixelated;
  object-fit: contain;
}

/* Leaderboard Podium */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.podium-card {
  background: var(--clay-card);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 18px 20px;
  box-shadow: var(--clay-card-shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.podium-card.rank-1 { border-color: rgba(246, 193, 92, 0.6); background: linear-gradient(150deg, rgba(246, 193, 92, 0.14), #181c2e); }
.podium-card.rank-2 { border-color: rgba(148, 163, 184, 0.5); }
.podium-card.rank-3 { border-color: rgba(217, 119, 6, 0.5); }

/* Ancient SMP Rune Brand Logo */
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(56, 232, 255, 0.35));
  flex: none;
}
.brand-logo.big {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 6px 16px rgba(56, 232, 255, 0.45));
}
.brand-logo.hero-emblem {
  width: 64px;
  height: 64px;
  filter: drop-shadow(0 6px 16px rgba(56, 232, 255, 0.45));
}

/* Server Management Panel (Console + File Manager + 24GB RAM Telemetry) */
.panel-split-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.05fr) minmax(460px, 1.25fr);
  gap: 16px;
  align-items: start;
}
.console-terminal {
  background: #070910;
  border: 1px solid rgba(56, 232, 255, 0.2);
  border-radius: 14px;
  padding: 12px 14px;
  height: 430px;
  overflow-y: auto;
  font: 12px/1.5 var(--mono);
  color: #dbeafe;
  box-shadow: inset 0 4px 14px rgba(0, 0, 0, 0.85);
  white-space: pre-wrap;
  word-break: break-word;
}
.console-line {
  padding: 1px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.025);
}
.console-line.warn { color: #fde047; }
.console-line.err { color: #fca5a5; font-weight: 600; }
.console-line.ok { color: #6ee7b7; }
.resource-meter {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: rgba(9, 11, 18, 0.85);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: 6px;
}
.resource-meter > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3ce696, #38e8ff, #ffbe55);
  transition: width 0.3s ease;
}
.file-path-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--clay-well);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font: 600 12px var(--mono);
  color: #38e8ff;
}
.file-table-wrap {
  max-height: 430px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 14, 24, 0.72);
}
.code-editor-area {
  width: 100%;
  min-height: 420px;
  font: 12.5px/1.5 var(--mono);
  background: #080a12 !important;
  color: #f1f5f9 !important;
  tab-size: 2;
}

@media (max-width: 1250px) {
  .screens-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .preview-pane { grid-column: 1 / -1; }
  .sec-grid, .auth-gateway, .smp-hero-banner, .recipes-showcase-layout, .panel-split-grid { grid-template-columns: 1fr; }
  body { overflow: auto; }
  .app { height: auto; min-height: 100%; }
}
@media (max-width: 760px) {
  .screens-layout { grid-template-columns: 1fr; }
  .topbar { flex-wrap: wrap; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .type-picker { grid-template-columns: 1fr; }
  .settings { grid-template-columns: 1fr; }
}


