#refresh-rate-tester-container {
  --rrt-bg: #ffffff;
  --rrt-card: #f8f9fb;
  --rrt-border: #e5e7eb;
  --rrt-text: #1f2937;
  --rrt-muted: #6b7280;
  --rrt-primary: #3b82f6;
  --rrt-primary-dark: #2563eb;
  --rrt-accent: #10b981;
  --rrt-accent-dark: #059669;
  --rrt-warn: #f59e0b;
  --rrt-danger: #ef4444;
  --rrt-danger-dark: #dc2626;
  --rrt-purple: #8b5cf6;
  --rrt-purple-dark: #7c3aed;
  --rrt-radius: 16px;
  --rrt-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  --rrt-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
}

#refresh-rate-tester-container * {
  box-sizing: border-box;
}

#refresh-rate-tester-container {
  background: var(--rrt-bg);
  color: var(--rrt-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
}

.rrt-main {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px;
}

.rrt-header {
  margin-bottom: 28px;
  text-align: center;
}

.rrt-header h1 {
  margin: 0 0 12px 0;
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--rrt-text);
}

.rrt-subtle {
  color: var(--rrt-muted);
  font-size: 15px;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.rrt-card {
  background: var(--rrt-card);
  border: 1px solid var(--rrt-border);
  border-radius: var(--rrt-radius);
  box-shadow: var(--rrt-shadow);
  padding: 28px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
  margin-bottom: 20px;
}

.rrt-card:hover {
  box-shadow: var(--rrt-shadow-hover);
}

.rrt-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--rrt-accent), var(--rrt-primary), var(--rrt-purple));
  opacity: 0.6;
}

.rrt-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.rrt-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rrt-control label {
  font-size: 14px;
  font-weight: 500;
  color: var(--rrt-muted);
}

#refresh-rate-tester-container select,
#refresh-rate-tester-container button,
#refresh-rate-tester-container input[type="number"] {
  appearance: none;
  border: 1px solid var(--rrt-border);
  background: white;
  color: var(--rrt-text);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 14px;
  transition: all .2s ease;
  cursor: pointer;
}

#refresh-rate-tester-container select:focus,
#refresh-rate-tester-container button:focus,
#refresh-rate-tester-container input[type="number"]:focus {
  outline: none;
  border-color: var(--rrt-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

#refresh-rate-tester-container select:hover,
#refresh-rate-tester-container input[type="number"]:hover {
  border-color: var(--rrt-primary);
  background: var(--rrt-card);
}

.rrt-btn,
.rrt-btn-secondary,
.rrt-btn-success,
.rrt-btn-danger {
  border: none;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  padding: 10px 16px;
}

.rrt-btn {
  background: linear-gradient(135deg, var(--rrt-primary) 0%, var(--rrt-primary-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.rrt-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.rrt-btn:hover::before {
  left: 100%;
}

.rrt-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.rrt-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

.rrt-btn-secondary {
  background: linear-gradient(135deg, var(--rrt-purple) 0%, var(--rrt-purple-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

.rrt-btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.rrt-btn-secondary:hover::before {
  left: 100%;
}

.rrt-btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.rrt-btn-secondary:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.3);
}

.rrt-btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.rrt-btn-success {
  background: linear-gradient(135deg, var(--rrt-accent) 0%, var(--rrt-accent-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.rrt-btn-success::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.rrt-btn-success:hover::before {
  left: 100%;
}

.rrt-btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.rrt-btn-success:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.rrt-btn-success:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.rrt-btn-success:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.rrt-btn-danger {
  background: linear-gradient(135deg, var(--rrt-danger) 0%, var(--rrt-danger-dark) 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.rrt-btn-danger::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.rrt-btn-danger:hover::before {
  left: 100%;
}

.rrt-btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.rrt-btn-danger:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.3);
}

.rrt-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 720px) {
  .rrt-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.rrt-stat {
  border: 1px solid var(--rrt-border);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(139, 92, 246, 0.04) 100%);
  transition: all 0.3s ease;
}

.rrt-stat:hover {
  border-color: var(--rrt-primary);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(59, 130, 246, 0.15);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.rrt-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--rrt-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.rrt-stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--rrt-text);
}

.rrt-hz {
  color: var(--rrt-accent);
}

.rrt-progress {
  position: relative;
  height: 8px;
  background: var(--rrt-card);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rrt-border);
}

.rrt-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, var(--rrt-accent), var(--rrt-primary));
  transition: width .2s ease;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.rrt-canvas-wrap {
  border: 1px solid var(--rrt-border);
  border-radius: 12px;
  padding: 14px;
  background: white;
  transition: all 0.3s ease;
}

.rrt-canvas-wrap:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

#refresh-rate-tester-container canvas {
  width: 100%;
  display: block;
  border-radius: 8px;
  background: white;
}

#graph {
  height: 140px;
}

#playground {
  height: 220px;
}

.rrt-hint {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(16, 185, 129, 0.05) 100%);
  border: 1px solid var(--rrt-border);
  border-radius: 12px;
  padding: 18px;
  color: var(--rrt-muted);
  font-size: 14px;
  line-height: 1.6;
}

.rrt-hint strong {
  color: var(--rrt-text);
  font-weight: 600;
}

.rrt-pill {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid var(--rrt-border);
  background: var(--rrt-card);
  font-size: 12px;
  font-weight: 500;
  color: var(--rrt-muted);
}

.rrt-pill-warn {
  border-color: rgba(245, 158, 11, 0.3);
  color: #b45309;
  background: rgba(245, 158, 11, 0.08);
}

.rrt-footer {
  margin-top: 24px;
  color: var(--rrt-muted);
  font-size: 13px;
  text-align: center;
}

.rrt-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#refresh-rate-tester-container input[type="number"] {
  width: 100px;
}
