/* TapTV speedtest — shell matches FAQ / site default */

.speedtest-page {
  flex: 1;
}

.speedtest-hero {
  position: relative;
  overflow: hidden;
  padding: 3.75rem 0 1rem;
  color: #fff;
}

.speedtest-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(33, 150, 243, 0.38), transparent 58%),
    linear-gradient(155deg, #0b1220 0%, #0d3b7a 42%, rgba(21, 101, 192, 0.5) 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 48%, transparent 100%);
}

body.light-theme .speedtest-hero-bg {
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(33, 150, 243, 0.16), transparent 58%),
    linear-gradient(155deg, #ffffff 0%, #e3f2fd 42%, rgba(187, 222, 251, 0.45) 72%, transparent 100%);
}

body.light-theme .speedtest-hero {
  color: #1a237e;
}

.speedtest-hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.speedtest-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.95rem;
  margin-bottom: 1rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

body.light-theme .speedtest-hero-badge {
  background: rgba(21, 101, 192, 0.08);
  border-color: rgba(21, 101, 192, 0.15);
  color: #1565c0;
}

.speedtest-hero-title {
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.speedtest-hero-lead {
  font-size: 1.05rem;
  opacity: 0.88;
  margin: 0 auto;
  max-width: 36rem;
}

body.light-theme .speedtest-hero-lead {
  color: #455a64;
  opacity: 1;
}

.speedtest-content {
  padding: 1.5rem 0 3.5rem;
}

.speedtest-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: rgba(30, 30, 30, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

body.light-theme .speedtest-card {
  background: #fff;
  border-color: rgba(21, 101, 192, 0.12);
  box-shadow: 0 12px 36px rgba(21, 101, 192, 0.08);
}

.speedtest-card .card-body {
  padding: 1.75rem 1.25rem 2rem;
  text-align: center;
}

#loading {
  background-color: transparent;
  color: inherit;
  text-align: center;
  padding: 1.5rem 0;
}

span.loadCircle {
  display: inline-block;
  width: 2em;
  height: 2em;
  vertical-align: middle;
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAP1BMVEUAAAB2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZ2dnZyFzwnAAAAFHRSTlMAEvRFvX406baecwbf0casimhSHyiwmqgAAADpSURBVHja7dbJbQMxAENRahnN5lkc//5rDRAkDeRgHszXgACJoKiIiIiIiIiIiIiIiIiIiIj4HHspsrpAVhdVVguzrA4OWc10WcEqpwKbnBo0OU1Q5NSpsoJFTgOecrrdEag85DRgktNqfoEdTjnd7hrEHMEJvmRUYJbTYk5Agy6nau6Abp5Cm7mDBtRdPi9gyKdU7w4p1fsLvyqs8hl4z9/w3n/Hmr9WoQ65lAU4d7lMYOz//QboRR5jBZibLMZdAR6O/Vfa1PlxNr3XdS3HzK/HVPRu/KnLs8iAOh993VpRRERERMT/fAN60wwWaVyWwAAAAABJRU5ErkJggg==');
  background-size: 2em 2em;
  margin-right: 0.5em;
  animation: speedtest-spin 0.6s linear infinite;
}

@keyframes speedtest-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(359deg); }
}

#startStopBtn {
  display: inline-block;
  margin: 0.25rem auto 0;
  color: #1565c0;
  background-color: transparent;
  border: 2px solid #1565c0;
  border-radius: 0.65rem;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
  width: 10.5rem;
  height: 3.2rem;
  line-height: 3rem;
  cursor: pointer;
  user-select: none;
}

#startStopBtn:hover {
  box-shadow: 0 0 0 0.2rem rgba(21, 101, 192, 0.18);
  background: rgba(21, 101, 192, 0.08);
}

#startStopBtn.running {
  background-color: #c62828;
  border-color: #c62828;
  color: #fff;
}

#startStopBtn.running:hover {
  box-shadow: 0 0 0 0.2rem rgba(198, 40, 40, 0.2);
}

#startStopBtn:before {
  content: "Начать";
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
}

#startStopBtn.running:before {
  content: "Отменить";
}

#serverArea {
  margin-top: 1em;
  color: inherit;
  opacity: 0.9;
}

#server {
  font-size: 1em;
  padding: 0.35em 0.65em;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}

body.light-theme #server {
  border-color: rgba(21, 101, 192, 0.22);
  background: #f5f9ff;
}

#test {
  margin-top: 1.5em;
  margin-bottom: 1.25em;
}

div.testArea {
  display: inline-block;
  width: 16em;
  height: 12.5em;
  position: relative;
  box-sizing: border-box;
}

div.testArea2 {
  display: inline-block;
  width: 14em;
  height: 7em;
  position: relative;
  box-sizing: border-box;
  text-align: center;
}

div.testArea div.testName,
div.testArea2 div.testName {
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(224, 224, 224, 0.72);
}

body.light-theme div.testArea div.testName,
body.light-theme div.testArea2 div.testName {
  color: #546e7a;
}

div.testArea div.testName {
  position: absolute;
  top: 0.1em;
  left: 0;
  width: 100%;
  z-index: 9;
}

div.testArea2 div.testName {
  display: block;
  text-align: center;
}

div.testArea div.meterText {
  position: absolute;
  bottom: 1.55em;
  left: 0;
  width: 100%;
  font-size: 2.4em;
  font-weight: 800;
  z-index: 9;
}

div.testArea2 div.meterText {
  display: inline-block;
  font-size: 2.4em;
  font-weight: 800;
}

div.meterText:empty:before {
  content: "0.00";
}

div.testArea div.unit {
  position: absolute;
  bottom: 2em;
  left: 0;
  width: 100%;
  z-index: 9;
  color: rgba(224, 224, 224, 0.55);
}

div.testArea2 div.unit {
  display: inline-block;
  color: rgba(224, 224, 224, 0.55);
}

body.light-theme div.testArea div.unit,
body.light-theme div.testArea2 div.unit {
  color: #78909c;
}

div.testArea canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

div.testGroup {
  display: block;
  margin: 0 auto;
}

#ipArea {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.speedtest-verdict {
  margin: 1.5rem auto 0.5rem;
  max-width: 36rem;
  text-align: left;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.22);
}

body.light-theme .speedtest-verdict {
  background: #f5f9ff;
  border-color: rgba(21, 101, 192, 0.14);
}

.speedtest-verdict.is-ok {
  border-color: rgba(46, 125, 50, 0.45);
  box-shadow: 0 0 0 1px rgba(46, 125, 50, 0.12);
}

.speedtest-verdict.is-warn {
  border-color: rgba(245, 124, 0, 0.45);
}

.speedtest-verdict.is-bad {
  border-color: rgba(198, 40, 40, 0.5);
}

.speedtest-verdict-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  margin-bottom: 0.65rem;
  background: rgba(21, 101, 192, 0.18);
  color: #90caf9;
}

.speedtest-verdict.is-ok .speedtest-verdict-badge {
  background: rgba(46, 125, 50, 0.2);
  color: #81c784;
}

.speedtest-verdict.is-warn .speedtest-verdict-badge {
  background: rgba(245, 124, 0, 0.18);
  color: #ffb74d;
}

.speedtest-verdict.is-bad .speedtest-verdict-badge {
  background: rgba(198, 40, 40, 0.2);
  color: #ef9a9a;
}

body.light-theme .speedtest-verdict-badge {
  color: #1565c0;
  background: rgba(21, 101, 192, 0.1);
}

body.light-theme .speedtest-verdict.is-ok .speedtest-verdict-badge {
  color: #2e7d32;
  background: rgba(46, 125, 50, 0.12);
}

body.light-theme .speedtest-verdict.is-warn .speedtest-verdict-badge {
  color: #ef6c00;
  background: rgba(245, 124, 0, 0.12);
}

body.light-theme .speedtest-verdict.is-bad .speedtest-verdict-badge {
  color: #c62828;
  background: rgba(198, 40, 40, 0.1);
}

.speedtest-verdict-title {
  margin: 0 0 0.35rem;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.25;
}

.speedtest-verdict-lead {
  margin: 0 0 1rem;
  opacity: 0.88;
  font-size: 0.98rem;
}

.speedtest-verdict-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.speedtest-verdict-item {
  padding: 0.7rem 0.8rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

body.light-theme .speedtest-verdict-item {
  background: #fff;
  border-color: rgba(21, 101, 192, 0.1);
}

.speedtest-verdict-item.is-wide {
  grid-column: 1 / -1;
}

.speedtest-verdict-item.is-jitter {
  border-color: rgba(239, 83, 80, 0.35);
}

.speedtest-verdict-item span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.7;
  margin-bottom: 0.2rem;
}

.speedtest-verdict-item strong {
  font-size: 1.2rem;
  font-weight: 800;
}

.speedtest-verdict-item small {
  font-size: 0.75rem;
  font-weight: 700;
  opacity: 0.7;
}

.speedtest-verdict-notes {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
  line-height: 1.45;
  opacity: 0.9;
}

.speedtest-verdict-notes li + li {
  margin-top: 0.35rem;
}

@media (max-width: 40em) {
  .speedtest-verdict-grid {
    grid-template-columns: 1fr;
  }
}

#shareArea {
  width: 95%;
  max-width: 40em;
  margin: 2em auto 0;
  text-align: left;
}

#shareArea > * {
  display: block;
  width: 100%;
  height: auto;
  margin: 0.35em 0;
}

#shareArea h3 {
  font-size: 1.15rem;
  font-weight: 800;
}

#resultsURL {
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: inherit;
  padding: 0.55rem 0.75rem;
}

body.light-theme #resultsURL {
  border-color: rgba(21, 101, 192, 0.2);
  background: #f5f9ff;
}

body.light-theme #resultsImg {
  filter: none;
}

body:not(.light-theme) #resultsImg {
  filter: invert(1);
}

#privacyPolicy {
  position: fixed;
  top: 2em;
  bottom: 2em;
  left: 2em;
  right: 2em;
  overflow-y: auto;
  box-shadow: 0 0 3em 1em rgba(0, 0, 0, 0.55);
  z-index: 999999;
  text-align: left;
  background-color: #1e1e1e;
  color: #e0e0e0;
  padding: 1.25em;
  border-radius: 0.75rem;
}

body.light-theme #privacyPolicy {
  background-color: #fff;
  color: #333;
}

a.privacy {
  text-align: center;
  font-size: 0.85em;
  color: #90a4ae;
  padding: 0 3em;
}

div.closePrivacyPolicy {
  width: 100%;
  text-align: center;
}

div.closePrivacyPolicy a.privacy {
  padding: 1em 3em;
  color: #1565c0;
  font-weight: 700;
}

div.visible {
  animation: speedtest-fade-in 0.4s;
  display: block;
}

div.hidden {
  animation: speedtest-fade-out 0.4s;
  display: none;
}

@keyframes speedtest-fade-in {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes speedtest-fade-out {
  0% {
    display: block;
    opacity: 1;
  }
  100% {
    display: block;
    opacity: 0;
  }
}

@media all and (max-width: 40em) {
  .speedtest-card .card-body {
    padding: 1.25rem 0.75rem 1.75rem;
  }

  div.testArea {
    width: 100%;
    max-width: 16em;
  }

  div.testArea2 {
    width: 48%;
    min-width: 8.5em;
  }
}
