:root {
  color-scheme: dark;
  --bg: #060811;
  --panel: rgba(12, 18, 30, 0.78);
  --panel-solid: #101827;
  --line: rgba(155, 180, 210, 0.2);
  --text: #eef6ff;
  --muted: #95a8bc;
  --cyan: #44d4ff;
  --green: #79f2b2;
  --amber: #f6c86e;
  --red: #ff7575;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(68, 212, 255, 0.18), transparent 26rem),
    radial-gradient(circle at 90% 80%, rgba(121, 242, 178, 0.1), transparent 28rem),
    var(--bg);
  color: var(--text);
  overflow: hidden;
}

button,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  min-height: 100vh;
}

.globe-stage {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

#globe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.brand {
  position: absolute;
  top: 28px;
  left: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(68, 212, 255, 0.5);
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan), rgba(68, 212, 255, 0.08) 58%, transparent 60%);
  box-shadow: 0 0 30px rgba(68, 212, 255, 0.55);
}

.brand-title {
  font-size: 18px;
  font-weight: 800;
}

.brand-subtitle {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.hud {
  position: absolute;
  left: 32px;
  bottom: 28px;
  display: flex;
  gap: 10px;
}

.hud div {
  min-width: 86px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: rgba(5, 10, 19, 0.58);
  backdrop-filter: blur(18px);
}

.hud span {
  display: block;
  font-size: 23px;
  font-weight: 800;
}

.hud small {
  color: var(--muted);
}

.control-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: 100vh;
  padding: 24px;
  border-left: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 20, 34, 0.92), rgba(8, 12, 22, 0.94));
  box-shadow: -28px 0 80px rgba(0, 0, 0, 0.3);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.status-badge {
  flex: none;
  padding: 7px 10px;
  border: 1px solid rgba(68, 212, 255, 0.28);
  color: var(--cyan);
  background: rgba(68, 212, 255, 0.08);
  font-size: 13px;
}

textarea {
  width: 100%;
  min-height: 190px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(3, 7, 14, 0.62);
  line-height: 1.5;
}

textarea:focus {
  border-color: rgba(68, 212, 255, 0.58);
  box-shadow: 0 0 0 3px rgba(68, 212, 255, 0.12);
}

.toolbar,
.result-actions {
  display: grid;
  grid-template-columns: 1fr 92px 92px;
  gap: 10px;
}

.result-actions {
  grid-template-columns: 1fr 1fr;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: rgba(68, 212, 255, 0.45);
  background: rgba(68, 212, 255, 0.11);
}

button:disabled {
  color: rgba(238, 246, 255, 0.42);
  cursor: not-allowed;
}

button.primary {
  border-color: rgba(68, 212, 255, 0.64);
  color: #02131d;
  background: linear-gradient(135deg, var(--cyan), var(--green));
  font-weight: 800;
}

.progress-wrap {
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--cyan), var(--green), var(--amber));
  transition: width 180ms ease;
}

.summary-panel {
  border: 1px solid var(--line);
  background: rgba(3, 7, 14, 0.42);
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(155, 180, 210, 0.13);
  color: #dff6ff;
  font-size: 13px;
  font-weight: 800;
}

.summary-head small {
  color: var(--muted);
  font-weight: 600;
}

.summary-body {
  display: grid;
  gap: 6px;
  max-height: 150px;
  overflow: auto;
  padding: 8px;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(155, 180, 210, 0.09);
}

.summary-place {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #edf8ff;
  font-size: 13px;
}

.summary-count {
  min-width: 34px;
  padding: 3px 7px;
  color: #061019;
  background: linear-gradient(135deg, var(--green), var(--cyan));
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.summary-empty {
  padding: 8px;
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  min-height: 0;
  flex: 1;
  overflow: auto;
  border: 1px solid var(--line);
  background: rgba(3, 7, 14, 0.38);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid rgba(155, 180, 210, 0.13);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--panel-solid);
  color: var(--muted);
  font-size: 12px;
}

td {
  color: #dcecff;
}

.ip-cell {
  font-weight: 750;
  color: #fff;
}

.muted {
  color: var(--muted);
}

.bad {
  color: var(--red);
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .globe-stage {
    min-height: 48vh;
  }

  .control-panel {
    height: auto;
    min-height: 52vh;
    border-left: 0;
    border-top: 1px solid var(--line);
  }
}
