.tps-section {
  max-width: 800px;
  margin: 10px auto 0 auto;
  padding: 10px;
  background: #FAE9D5;
  border-radius: 18px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.74);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.tps-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.65), rgba(255,255,255,0) 40%);
  pointer-events: none;
  opacity: 0.55;
}

.tps-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 14, 22, 0.68);
  backdrop-filter: blur(8px);
  z-index: 30;
}

.tps-overlay-card {
  width: min(440px, calc(100% - 48px));
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 22px;
  padding: 22px 22px 20px;
  text-align: center;
  box-shadow: 0 28px 70px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
}

.tps-overlay-title {
  font-size: 2.1rem;
  font-weight: 900;
  color: #0d1020;
  letter-spacing: 0.01em;
}

.tps-overlay-subtitle {
  margin-top: 6px;
  font-size: 1.02rem;
  font-weight: 600;
  color: rgba(13, 16, 32, 0.75);
}

.tps-score-label {
  margin-top: 16px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(13, 16, 32, 0.55);
}

.tps-score-label-tight {
  margin-top: 12px;
}

.tps-score {
  margin-top: 6px;
  font-size: 4.1rem;
  font-weight: 900;
  line-height: 1;
  color: #0d1020;
}

.tps-score-small {
  font-size: 2.4rem;
  opacity: 0.9;
}

.tps-overlay-btn {
  margin-top: 18px;
  padding: 12px 42px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  background: linear-gradient(90deg, #111 0%, #2a2f4a 100%);
  box-shadow: 0 18px 44px rgba(0,0,0,0.22);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
  font-family: 'Poppins', sans-serif;
}

.tps-overlay-btn:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
  box-shadow: 0 22px 52px rgba(0,0,0,0.28);
}

.tps-overlay-btn:active {
  transform: translateY(0px) scale(0.99);
}

.tps-section .odd-hud {
  margin-bottom: 16px;
  width: 100%;
  position: relative;
  z-index: 1;
}

.tps-section .odd-hud .odd-stat {
  background: rgba(255, 255, 255, 0);
  border: none;
}

.tps-section .odd-hud .odd-stat-label {
  letter-spacing: 0.08em;
}

.time-meter {
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  overflow: hidden;
  margin-top: 10px;
}

.time-meter-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 10px;
  background: #7abf70;
  transition: transform 120ms linear;
}

.time-meter-fill[data-level="ok"] {
  filter: saturate(1.05);
}

.time-meter-fill[data-level="mid"] {
  filter: saturate(1.3);
}

.time-meter-fill[data-level="low"] {
  filter: saturate(1.6);
  animation: qmPulse 420ms ease-in-out infinite;
}

@keyframes qmPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.canvas-wrap {
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
  position: relative;
  z-index: 1;
}

#tps-canvas {
  width: 100%;
  height: 500px;
  display: block;
  touch-action: none;
}

/* Medium screens */
@media (max-width: 1000px) {
  .tps-section { max-width: 800px; margin: 10px auto 0 auto; padding: 10px 18px; }
  #tps-canvas { height: 500px; }
  .tps-overlay-card { padding: 14px 14px 14px; width: min(420px, calc(100% - 40px)); }
  .tps-overlay-title { font-size: 1.6rem; }
  .tps-overlay-subtitle { font-size: 1rem; }
  .tps-overlay-btn { padding: 12px 34px; font-size: 1rem; }
}

/* Larger small screens */
@media (max-width: 800px) {
  .tps-section { max-width: 600px; margin: 10px auto 0 auto; padding: 12px 16px; }
  #tps-canvas { height: 500px; }
  .tps-overlay-card { padding: 12px 12px 12px; width: min(380px, calc(100% - 32px)); }
  .tps-overlay-title { font-size: 1.4rem; }
  .tps-overlay-subtitle { font-size: 0.9rem; }
  .tps-overlay-btn { padding: 10px 30px; font-size: 0.95rem; }
  .tps-topbar {
    margin-bottom: 8px;
  }

  .tps-stat {
    width: min(360px, calc(100% - 12px));
    padding: 8px 10px;
    gap: 3px;
  }

  .tps-stat-label {
    font-size: 0.8rem;
    font-weight: 800;
  }

  .tps-stat-value {
    font-size: 1.2rem;
    font-weight: 900;
  }

  /* .time-meter {
    height: 10px;
    margin-top: 5px;
  } */
}

@media (max-width: 600px) {
  .tps-section {
      max-width: 90%;
      margin: 10px auto 0 auto;
      padding: 12px 14px;
  }
  #tps-canvas {
    height: 440px;
  }
  .tps-overlay-card { padding: 10px 10px 10px; width: min(360px, calc(100% - 32px)); }
  .tps-overlay-title { font-size: 1.2rem; }
  .tps-overlay-subtitle { font-size: 0.8rem; }
  .tps-overlay-btn { padding: 8px 25px; font-size: 0.8rem; }

  .tps-topbar {
    margin-bottom: 3px;
  }

  .tps-stat {
    width: min(360px, calc(100% - 12px));
    padding: 6px 8px;
    gap: 1px;
  }

  .tps-stat-label {
    font-size: 0.6rem;
    font-weight: 800;
  }

  .tps-stat-value {
    font-size: 1rem;
    font-weight: 900;
  }

  /* .time-meter {
    height: 8px;
    margin-top: 3px;
  } */
}
