* {
  box-sizing: border-box;
}

:root {
  --bg: #0f1421;
  --panel: #151c2c;
  --panel-border: rgba(96, 165, 250, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #4fc3f7;
  --accent-strong: #3b82f6;
  --accent-soft: rgba(79, 195, 247, 0.18);
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.35);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.12), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

header,
.wrap,
footer {
  width: min(1180px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

header {
  padding: 40px 0 24px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: clamp(2rem, 5vw, 3rem);
  text-shadow: 0 0 20px rgba(79, 195, 247, 0.22);
}

header p {
  max-width: 760px;
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.top-actions {
  width: 100%;
  margin-bottom: 32px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  border-bottom: 1px solid rgba(191, 219, 254, 0.3);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.22);
}

.top-actions__inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  overflow: visible;
  white-space: nowrap;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: #f8fafc;
  font-size: 1.25rem;
  font-weight: 800;
  text-decoration: none;
}

.nav-brand__icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(219, 234, 254, 0.65);
  border-radius: 6px;
  color: #fbbf24;
  font-size: 1.25rem;
}

.nav-links {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px;
}

.simulations-menu {
  position: relative;
  flex: 0 0 auto;
}

.simulations-menu summary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 6px;
  color: rgba(248, 250, 252, 0.9);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.simulations-menu summary::-webkit-details-marker {
  display: none;
}

.simulations-menu summary::before {
  content: "\2630";
  margin-right: 8px;
  font-size: 1rem;
  line-height: 1;
}

.simulations-menu summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 8px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
}

.simulations-menu[open] summary,
.simulations-menu summary:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.simulations-menu__list {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 20;
  display: grid;
  min-width: 240px;
  padding: 8px;
  border: 1px solid rgba(191, 219, 254, 0.24);
  border-radius: 10px;
  background: #1d4ed8;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.35);
}

.simulations-menu__list a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  color: rgba(248, 250, 252, 0.9);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
}

.simulations-menu__list a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.cta-btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 12px 18px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  border-radius: 12px;
  background: linear-gradient(180deg, #4b8cf7, #3b82f6);
  color: #f8fafc;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(59, 130, 246, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cta-btn:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(59, 130, 246, 0.32);
}

.btn.secondary {
  background: linear-gradient(180deg, #334155, #1e293b);
}

.top-actions .cta-btn {
  flex-shrink: 0;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(248, 250, 252, 0.82);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  font-weight: 600;
  box-shadow: none;
}

.top-actions .cta-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  transform: none;
  box-shadow: none;
}

.wrap {
  padding-bottom: 32px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 24px;
  align-items: start;
}

.panel,
.card {
  background: rgba(21, 28, 44, 0.96);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.about-page {
  display: grid;
  gap: 24px;
}

.about-page .panel {
  margin: 0;
}

.about-page p,
.feature-list {
  color: #cbd5e1;
  line-height: 1.7;
}

.feature-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.donation-panel {
  border-color: rgba(79, 195, 247, 0.38);
  background: linear-gradient(135deg, rgba(21, 28, 44, 0.98), rgba(19, 44, 68, 0.92));
}

.donation-note {
  margin: 16px 0 0;
  color: #e0f2fe !important;
  font-weight: 700;
}

.about-contact {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.about-contact h2 {
  margin-bottom: 14px;
}

.about-contact p {
  margin-bottom: 8px;
}

.about-contact a {
  color: var(--accent);
}

.aside {
  display: grid;
  gap: 24px;
}

.row.col2,
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.platform-filter {
  display: grid;
  gap: 10px;
  margin-bottom: 6px;
}

.platform-filter__label {
  color: #cbd5e1;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.platform-filter__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.platform-btn {
  min-width: 108px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(96, 165, 250, 0.2);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  color: #dbeafe;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.platform-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(96, 165, 250, 0.42);
}

.platform-btn.is-active {
  background: linear-gradient(180deg, #4b8cf7, #3b82f6);
  border-color: rgba(147, 197, 253, 0.75);
  color: #f8fafc;
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.28);
}

label {
  display: block;
  margin-bottom: 8px;
  color: #cbd5e1;
  font-weight: 600;
}

select,
input[type="number"] {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: #0f172a;
  color: var(--text);
  outline: none;
}

select:focus,
input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.card {
  padding: 20px;
}

.stat + .stat {
  margin-top: 18px;
}

.summary-select {
  margin: 10px 0 8px;
}

.small {
  color: var(--muted);
  font-size: 0.92rem;
}

strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
  color: #f8fafc;
}

canvas {
  width: 100% !important;
  max-width: 100%;
}

footer {
  padding: 12px 0 36px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 920px) {
  .grid,
  .row.col2,
  .cards,
  .about-contact {
    grid-template-columns: 1fr;
  }

  header {
    padding-top: 32px;
  }
}

@media (max-width: 640px) {
  header,
  .wrap,
  footer {
    width: min(100% - 20px, 1180px);
  }

  .panel,
  .card {
    padding: 18px;
  }

  .top-actions__inner {
    width: min(100% - 20px, 1180px);
    gap: 10px;
  }

  .nav-brand span:not(.nav-brand__icon) {
    display: none;
  }

  .nav-links {
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .simulations-menu__list {
    position: fixed;
    top: 58px;
    left: 10px;
    right: 10px;
    min-width: 0;
  }

  .top-actions .cta-btn {
    flex: 0 0 auto;
    min-width: 0;
    width: auto;
    text-align: center;
  }
}
