:root {
  --bg: #e8eef7;
  --ink: #101a2f;
  --muted: #526178;
  --line: #d3dced;
  --navy: #091760;
  --blue: #0f4ec6;
  --cyan: #0ca0d8;
  --panel: #ffffff;
  --panel-soft: #f7faff;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Noto Sans KR", "Pretendard", sans-serif;
  background:
    radial-gradient(circle at 0% 0%, #f8fbff 0, #eef3fb 38%, #e8eef7 100%),
    repeating-linear-gradient(120deg, rgba(8, 29, 74, 0.02), rgba(8, 29, 74, 0.02) 12px, transparent 12px, transparent 24px);
}

.site-header {
  background: linear-gradient(120deg, #06104a 0%, #0b2a8c 55%, #0a4b8e 100%);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
}
.brand-wrap { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: linear-gradient(150deg, #27c6d7, #0c69de);
}
.site-header h1 { margin: 0; font-size: 22px; }
.site-header p { margin: 2px 0 0; font-size: 12px; opacity: 0.9; }

.top-nav {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  background: #f3f7fd;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.nav-btn {
  border: 1px solid #cdd8ef;
  border-radius: 999px;
  background: #fff;
  color: #1d3568;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 700;
}
.nav-btn.active {
  color: #fff;
  background: linear-gradient(120deg, #0e4ecf, #0a84cf);
  border-color: transparent;
}

.portal-grid {
  max-width: 1360px;
  margin: 16px auto 28px;
  padding: 0 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(16, 36, 75, 0.07);
}
.main-panel { padding: 14px; }
.side-panel { padding: 12px; }
.hidden { display: none; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.section-head h2 { margin: 0; font-size: 20px; }
.inline-actions { display: flex; gap: 8px; }

.pill {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #dce8ff;
  color: #12387b;
}

button, input, select {
  border: 1px solid #ccdaee;
  border-radius: 10px;
  padding: 8px 10px;
  font: inherit;
}
button {
  background: linear-gradient(120deg, #0c39a8, #0e62d0);
  border: none;
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}
button.ghost {
  border: 1px solid #c8d6ee;
  background: #f3f7ff;
  color: #1d3d74;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th, .table td {
  text-align: left;
  border-bottom: 1px solid #edf2fb;
  padding: 8px 6px;
  vertical-align: top;
}
.table th { font-size: 12px; color: #566684; }

.list-cards { display: grid; gap: 10px; }
.card-item {
  border: 1px solid #d6e0f2;
  background: var(--panel-soft);
  border-radius: 12px;
  padding: 10px;
}
.card-title { font-weight: 700; margin-bottom: 4px; }
.card-meta { font-size: 12px; color: var(--muted); }

.players-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 10px;
}
.player-tile {
  border: 1px solid #d4dff3;
  border-radius: 12px;
  padding: 10px;
  background: linear-gradient(160deg, #ffffff, #f2f7ff);
}
.player-tile .name { font-weight: 700; }
.player-tile .meta { color: #516283; font-size: 12px; }

.sub-panel {
  border: 1px solid #d9e2f4;
  border-radius: 12px;
  padding: 10px;
  background: #f9fbff;
  margin-top: 12px;
}
.stack { display: grid; gap: 8px; }
.ops-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.terminal {
  margin-top: 8px;
  background: #081736;
  color: #d8e6ff;
  border-radius: 10px;
  padding: 10px;
  max-height: 380px;
  overflow: auto;
}
.small { font-size: 12px; color: #576684; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

hr { border: none; border-top: 1px solid #e4ebf8; margin: 12px 0; }

@media (max-width: 1080px) {
  .portal-grid { grid-template-columns: 1fr; }
  .ops-grid { grid-template-columns: 1fr; }
}
