*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #1a1a2e;
  --surface: #16213e;
  --surface-2: #0f3460;
  --accent: #e94560;
  --text: #eee;
  --text-muted: #999;
  --border: #2a2a4a;
  --input-bg: #0d1b2a;
  --radius: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Header / Toolbar */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  flex-shrink: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 1px;
  flex-shrink: 0;
}

.address-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

#url-input {
  flex: 1;
  min-width: 0;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

#url-input:focus {
  border-color: var(--accent);
}

#source-ip {
  width: 150px;
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
  outline: none;
}

#source-ip:focus {
  border-color: var(--accent);
}

#type-select, #dns-select, #custom-dns {
  padding: 8px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

#dns-select {
  min-width: 160px;
}

#custom-dns {
  width: 200px;
}

#go-btn {
  padding: 8px 20px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

#go-btn:hover {
  opacity: 0.85;
}

/* DNS Panel */
.dns-panel {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  flex-shrink: 0;
}

.dns-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.panel-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}

.dns-results {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
}

.dns-results .dns-entry {
  display: flex;
  gap: 6px;
}

.dns-results .dns-label {
  color: var(--text-muted);
}

.dns-results .dns-value {
  color: var(--text);
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, monospace;
}

.dns-results .dns-value.ips {
  color: var(--accent);
}

/* Main */
main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

#browse-frame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
}

.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 20px;
}

.landing h1 {
  font-size: 48px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 12px;
  letter-spacing: 2px;
}

.landing p {
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.6;
}

/* Loading overlay */
.loading {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 46, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  font-size: 14px;
  color: var(--text-muted);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility */
.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .address-bar {
    flex-wrap: wrap;
  }

  #url-input {
    width: 100%;
    flex: 1 1 100%;
  }

  #dns-select {
    flex: 1;
    min-width: 0;
  }

  #go-btn {
    padding: 8px 14px;
  }

  .landing h1 {
    font-size: 32px;
  }
}
