/* === Reset & Base === */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  background: #0a0a0a;
  color: #e0e0e0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
}

/* === Layout === */
body {
  max-width: 480px;
  margin: 0 auto;
  padding: 12px 16px 32px;
}

/* === Brand Header === */
.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 20px 0 16px;
}

.brand-logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #FF6B00;
}

.brand-sub {
  font-size: 13px;
  color: #666;
  font-weight: 400;
}

/* === Card === */
.card {
  background: #141414;
  border: 1px solid #222;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

/* === Data Grid === */
.data-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.data-item {
  background: #1a1a1a;
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.data-item.highlight {
  grid-column: 1 / -1;
  background: #1a1208;
  border: 1px solid #FF6B0033;
}

.data-label {
  font-size: 12px;
  color: #888;
  font-weight: 500;
}

.data-value {
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  min-width: 60px;
  text-align: right;
}

.data-item.highlight .data-value {
  color: #FF6B00;
  font-size: 20px;
}

/* === Dribble Count === */
.card-count {
  text-align: center;
}

.count-display {
  font-size: 64px;
  font-weight: 800;
  color: #FF6B00;
  line-height: 1;
  margin: 8px 0;
  font-variant-numeric: tabular-nums;
}

.count-status {
  font-size: 14px;
  color: #666;
}

.count-status.active {
  color: #4CAF50;
}

.count-status.paused {
  color: #FF9800;
}

/* === Controls === */
.btn-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.btn {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  opacity: 0.7;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-primary {
  background: #FF6B00;
  color: #fff;
}

.btn-secondary {
  background: #222;
  color: #aaa;
  border: 1px solid #333;
}

/* === Sliders === */
.slider-group {
  margin-bottom: 12px;
}

.slider-group:last-child {
  margin-bottom: 0;
}

.slider-group label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #888;
  margin-bottom: 6px;
}

.slider-group label span {
  color: #FF6B00;
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: #333;
  border-radius: 2px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF6B00;
  cursor: pointer;
  border: none;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #FF6B00;
  cursor: pointer;
  border: none;
}

/* === Peak List === */
.peak-list {
  max-height: 200px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.peak-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #1a1a1a;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.peak-item:last-child {
  border-bottom: none;
}

.peak-time {
  color: #666;
  min-width: 70px;
}

.peak-delta {
  color: #FF6B00;
  font-weight: 600;
}

.peak-mag {
  color: #888;
}

.peak-empty {
  color: #444;
  font-size: 13px;
  text-align: center;
  padding: 12px 0;
}

/* === Debug === */
.card-debug {
  border-color: #1a1a1a;
}

.debug-title {
  color: #444 !important;
}

.debug-info {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #555;
}

.debug-info b {
  color: #777;
  font-weight: 500;
}

/* === iOS Permission Button === */
#btn-ios-permission {
  margin: 40px 0;
}

/* === Peak flash animation (brief, minimal) === */
@keyframes peak-flash {
  0% { background-color: #FF6B0022; }
  100% { background-color: transparent; }
}

.peak-flash {
  animation: peak-flash 0.4s ease-out;
}

/* === Scrollbar === */
.peak-list::-webkit-scrollbar {
  width: 3px;
}

.peak-list::-webkit-scrollbar-track {
  background: transparent;
}

.peak-list::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 2px;
}
