:root {
  --bg-color: #0a0e1a;
  --text-color: #ffffff;
  --accent-color: #00f2ff;
  --accent-glow: rgba(0, 242, 255, 0.4);
  --secondary-bg: #141b2d;
  --muted-text: #8f9bb3;
  --border-color: #2e3a59;
  --font-family: 'Inter', sans-serif;
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ─── HEADER ─── */
.header {
  height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.header-inner {
  width: 100%;
  max-width: 1000px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-color);
  font-weight: 700;
  font-size: 1.2rem;
}

.logo-highlight {
  color: var(--accent-color);
}

.nav {
  display: flex;
  gap: 20px;
}

.nav-link {
  color: var(--muted-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
  display: flex;
  align-items: center;
}

.nav-link:hover {
  color: var(--text-color);
}

/* ─── MAIN CONTENT ─── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* justify-content: center; <-- Removed to allow natural flow */
  position: relative;
  padding: 40px 20px;
  /* Increased top/bottom padding */
  min-height: 600px;
  gap: 40px;
  /* Space between elements */
}

/* Sub-nav tabs */
.sub-nav {
  /* position: absolute; <-- Removed */
  /* top: 40px; <-- Removed */
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  /* Push down content below */
  z-index: 20;
  /* Ensure on top */
}

.sub-nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted-text);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.sub-nav-btn.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  border-color: rgba(255, 255, 255, 0.1);
}

.sub-nav-btn:hover:not(.active) {
  color: var(--text-color);
}

/* ─── GO BUTTON ─── */
.go-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 300px;
  /* margin: auto;  <-- Optional, to center vertically in available space if needed */
}

.go-btn {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid var(--accent-color);
  color: var(--text-color);
  font-size: 4rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 20px var(--accent-glow), inset 0 0 20px var(--accent-glow);
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

.go-btn::before {
  content: '';
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 242, 255, 0.3);
  animation: pulseRing 2s infinite;
}

.go-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 40px var(--accent-glow), inset 0 0 40px var(--accent-glow);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

@keyframes pulseRing {
  0% {
    transform: scale(0.95);
    opacity: 0.5;
  }

  100% {
    transform: scale(1.15);
    opacity: 0;
  }
}

/* ─── GAUGE ─── */
.gauge-container {
  position: relative;
  width: 320px;
  height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 20px 0;
  /* Add some margin */
}

.gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(120deg);
  /* 300° sweep: rotation = 90° + (60°/2) = 120° */
}

.gauge-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.1);
  stroke-width: 12;
  stroke-dasharray: 681;
  /* 300/360 × 2πr ≈ 681 */
  stroke-dashoffset: 0;
  stroke-linecap: round;
}

.gauge-progress {
  fill: none;
  stroke: var(--accent-color);
  stroke-width: 12;
  stroke-dasharray: 681;
  stroke-dashoffset: 681;
  /* Initially empty */
  stroke-linecap: round;
  filter: drop-shadow(0 0 8px var(--accent-glow));
  transition: stroke-dashoffset 0.1s linear;
}

.gauge-ticks {
  stroke: white;
  stroke-width: 2;
}

.gauge-needle {
  stroke: white;
  stroke-width: 4;
  stroke-linecap: round;
  transform-origin: 150px 150px;
  transition: transform 0.08s cubic-bezier(0.25, 0.1, 0.25, 1);
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.5));
}

/* Smoke canvas overlay */
#smokeCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 8;
}

.gauge-cap {
  fill: #fff;
}

.gauge-readout {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
}

.gauge-value {
  display: block;
  font-size: 4.5rem;
  font-weight: 800;
  line-height: 1;
  text-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.gauge-unit {
  font-size: 1rem;
  color: var(--accent-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.gauge-phase-label {
  position: absolute;
  bottom: -40px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--muted-text);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* Mini progress bar for phases */
.mini-progress {
  position: absolute;
  top: -20px;
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
}

.mini-progress-bar {
  height: 100%;
  background: var(--accent-color);
  width: 0%;
  transition: width 0.3s ease;
}

/* ─── RESULTS ─── */
.results {
  display: flex;
  gap: 40px;
  /* margin-top: 60px; <-- Removed, controlled by parent gap */
  /* margin-bottom: 60px; <-- Removed */
  margin: 20px 0;
}

.result-card {
  text-align: center;
  min-width: 140px;
  opacity: 0;
  transform: translateY(20px);
  animation: slideUp 0.5s forwards;
}

.result-card:nth-child(3) {
  animation-delay: 0.1s;
}

.result-card:nth-child(5) {
  animation-delay: 0.2s;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-icon {
  color: var(--muted-text);
  margin-bottom: 10px;
}

.ping-icon {
  color: #eebb00;
}

.download-icon,
.upload-icon {
  color: var(--accent-color);
}

.result-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted-text);
  margin-bottom: 5px;
}

.result-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.result-unit {
  font-size: 0.9rem;
  color: var(--muted-text);
  margin-top: 5px;
}

.result-divider {
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}

/* ─── ACTIONS ─── */
.actions {
  display: flex;
  gap: 20px;
  /* margin-top: 40px; */
  /* margin-bottom: 40px; */
  margin: 20px 0;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-color);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--text-color);
}

.share-btn {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

.share-btn:hover {
  background: var(--accent-color);
  color: #000;
}

.share-btn:hover {
  background: var(--accent-color);
  color: #000;
}

.mint-btn {
  color: #ffd700;
  border-color: #ffd700;
}

.mint-btn:hover {
  background: rgba(255, 215, 0, 0.2);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* ─── SERVER INFO ─── */
.server-info {
  margin-top: auto;
  /* Push to bottom if space allows */
  display: flex;
  gap: 40px;
  padding-top: 20px;
  padding-bottom: 20px;
  justify-content: center;
  width: 100%;
}

.server-detail {
  display: flex;
  align-items: center;
  gap: 12px;
}

.server-icon {
  color: var(--muted-text);
}

.server-text {
  display: flex;
  flex-direction: column;
}

.server-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-color);
}

.server-sub {
  font-size: 0.8rem;
  color: var(--muted-text);
}

/* ─── CONNECTIONS TOGGLE ─── */
.connections {
  /* position: absolute; <-- Removed */
  /* bottom: 120px; <-- Removed */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 10;
  margin-bottom: 20px;
  /* Space above server info */
}

.connections-label {
  font-size: 0.8rem;
  color: var(--muted-text);
  text-transform: uppercase;
}

.connections-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
}

.conn-option {
  font-size: 0.85rem;
  color: var(--muted-text);
  font-weight: 600;
}

.conn-option.active {
  color: var(--text-color);
}

.conn-switch {
  width: 40px;
  height: 20px;
  background: var(--accent-color);
  border-radius: 10px;
  position: relative;
  border: none;
  cursor: pointer;
}

.conn-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  /* Moves to right for 'Single' if real toggle, but we fake it */
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ─── FOOTER ─── */
.footer {
  padding: 40px 20px;
  background: #06080f;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--muted-text);
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

.footer-disclaimer {
  max-width: 600px;
  line-height: 1.5;
  opacity: 0.7;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  color: var(--muted-text);
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

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

/* ─── CONFETTI CANVAS ─── */
#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

/* ─── TOAST ─── */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 242, 255, 0.15);
  color: var(--accent-color);
  padding: 12px 24px;
  border-radius: 30px;
  border: 1px solid var(--accent-color);
  font-weight: 600;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
  z-index: 200;
  animation: fadeInOut 3s forwards;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translate(-50%, 20px);
  }

  10% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  90% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -20px);
  }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .results {
    flex-direction: column;
    gap: 20px;
    align-items: center;
    width: 100%;
  }

  .result-divider {
    width: 100%;
    height: 1px;
    display: none;
    /* Hide dividers on mobile stack */
  }

  .server-info {
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
  }

  .gauge-container {
    width: 280px;
    height: 280px;
  }

  .gauge-value {
    font-size: 3.5rem;
  }
}

/* ─── NEW PAGE SECTIONS ─── */
.view-section {
  width: 100%;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeIn 0.4s ease-out;
}

.view-section.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  text-align: center;
  background: linear-gradient(to right, #fff, var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.page-subtitle {
  color: var(--muted-text);
  margin-bottom: 40px;
  text-align: center;
  font-size: 1.1rem;
}

/* ─── APPS GRID ─── */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  width: 100%;
}

.app-card {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  padding: 20px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 15px;
  transition: transform 0.2s, border-color 0.2s;
}

.app-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color);
}

.app-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: white;
  flex-shrink: 0;
}

.app-info {
  flex: 1;
}

.app-info h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.app-info p {
  font-size: 0.8rem;
  color: var(--muted-text);
  line-height: 1.3;
}

.app-download-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--accent-color);
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  min-width: 80px;
}

.app-download-btn:hover {
  background: var(--accent-color);
  color: #000;
}

.app-download-btn.installed {
  background: transparent;
  color: var(--muted-text);
  cursor: default;
}

/* ─── DATA CHARTS ─── */
.charts-container {
  display: flex;
  flex-direction: column;
  gap: 30px;
  width: 100%;
}

.chart-box {
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  padding: 24px;
  border-radius: 16px;
}

.chart-box h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--text-color);
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.bar-label {
  width: 100px;
  font-size: 0.9rem;
  color: var(--muted-text);
  text-align: right;
}

.bar-track {
  flex: 1;
  height: 12px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
}

/* ─── PHASE 2: POLISH & JUICE ─── */

/* View Transitions */
.view-section {
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
  transform: translateY(0);
}

.view-section.fade-out {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* Screen Shake */
@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }

  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }

  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }

  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }

  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }

  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }

  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }

  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }

  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }

  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }

  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

.shake {
  animation: shake 0.5s;
  animation-iteration-count: infinite;
}

.shake-intense {
  animation: shake 0.2s;
  animation-iteration-count: infinite;
}

.bar-fill {
  height: 100%;
  background: #444;
  border-radius: 6px;
  position: relative;
}

.bar-fill.highlight {
  background: var(--accent-color);
  box-shadow: 0 0 10px var(--accent-glow);
}

.bar-value {
  width: 80px;
  font-size: 0.9rem;
  font-weight: 600;
}

.metric-big {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.metric-val {
  font-size: 4rem;
  font-weight: 800;
  color: var(--accent-color);
  line-height: 1;
  text-shadow: 0 0 20px var(--accent-glow);
}

.metric-unit {
  font-size: 1.5rem;
  color: var(--muted-text);
  font-weight: 600;
}

.metric-desc {
  color: var(--muted-text);
  font-size: 0.9rem;
}

/* ─── ABOUT PAGE ─── */
.about-content {
  width: 100%;
  text-align: left;
}

.about-intro {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 40px;
  color: var(--text-color);
}

.about-content h2 {
  font-size: 1.5rem;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.team-member {
  background: var(--secondary-bg);
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--border-color);
}

.member-avatar {
  font-size: 3rem;
  margin-bottom: 10px;
}

.team-member h3 {
  font-size: 1rem;
  margin-bottom: 5px;
}

.team-member p {
  font-size: 0.8rem;
  color: var(--muted-text);
}

.contact-form-fake {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.contact-form-fake input {
  flex: 1;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--muted-text);
  font-family: inherit;
}

.contact-btn {
  background: var(--accent-color);
  color: #000;
  border: none;
  padding: 0 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s;
}


.contact-btn:active {
  transform: scale(0.95);
}

/* ─── SETTINGS PANEL ─── */
.settings-panel {
  width: 100%;
  max-width: 400px;
  background: var(--secondary-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  margin: 20px 0;
  animation: fadeIn 0.3s ease;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.setting-text {
  display: flex;
  flex-direction: column;
}

.setting-title {
  font-weight: 700;
  font-size: 1rem;
}

.setting-desc {
  font-size: 0.8rem;
  color: var(--muted-text);
  margin-top: 4px;
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: .4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--accent-color);
}

input:focus+.slider {
  box-shadow: 0 0 1px var(--accent-color);
}

input:checked+.slider:before {
  transform: translateX(22px);
}

/* ─── LUDICROUS MODE ─── */
body.mode-ludicrous {
  --accent-color: #ff0000;
  --accent-glow: rgba(255, 0, 0, 0.6);
  background-color: #1a0505;
}

body.mode-ludicrous .go-btn {
  animation: pulseAggressive 1s infinite;
  border-color: #ff0000;
}

body.mode-ludicrous .gauge-progress {
  stroke: #ff0000 !important;
}

@keyframes pulseAggressive {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.7);
  }

  70% {
    transform: scale(1.1);
    box-shadow: 0 0 20px 20px rgba(255, 0, 0, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}