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

:root {
  --bg: #0e0e0e;
  --surface: rgba(21, 21, 21, 0.88);
  --border: rgba(38, 38, 38, 0.9);
  --border-light: #333;
  --text: #e5e5e5;
  --text-muted: #737373;
  --text-dim: #525252;
  --accent: #ff4655;
  --accent-hover: #e63e4d;
  --radius: 4px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

html {
  font-size: 14px;
}

body {
  font-family: var(--font);
  background-color: var(--bg);
  background-image: url('http://pic.wzkws116.xyz/pic?img=ua');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* 暗色遮罩 */
.bg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 0;
  pointer-events: none;
}

/* 所有内容在遮罩之上 */
.header,
.main,
.footer {
  position: relative;
  z-index: 1;
}

/* ===== Header ===== */
.header {
  width: 100%;
  padding: 20px 16px 14px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 3px;
}

.header p {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 4px;
  margin-top: 4px;
}

/* ===== Main ===== */
.main {
  width: 100%;
  max-width: 1060px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  flex: 1;
}

/* ===== Controls ===== */
.controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.btn-spin {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 36px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--radius);
  letter-spacing: 2px;
  transition: background 150ms;
}

.btn-spin:hover {
  background: var(--accent-hover);
}

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

/* ===== Checkbox ===== */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
}

.checkbox-wrap input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-light);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 150ms, background 150ms;
  flex-shrink: 0;
}

.checkmark::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 1px;
  opacity: 0;
  transition: opacity 100ms;
}

.checkbox-wrap input:checked+.checkmark {
  border-color: var(--accent);
}

.checkbox-wrap input:checked+.checkmark::after {
  opacity: 1;
}

.checkbox-text {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Result ===== */
.result-section {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 2px;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.result-text.active {
  color: var(--text);
}

.result-text .hl {
  color: var(--accent);
  font-weight: 700;
}

.result-text .sep {
  color: var(--text-dim);
  margin: 0 4px;
}

/* ===== Wheels Grid ===== */
.wheels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
}

/* ===== Wheel Section ===== */
.wheel-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.wheel-section h2 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 3px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  padding: 1px 5px;
  letter-spacing: 0;
}

/* ===== Wheel ===== */
.wheel-wrapper {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pointer {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 12px solid var(--accent);
}

.wheel-rotator {
  width: 260px;
  height: 260px;
  transition: transform 3s cubic-bezier(0.12, 0.7, 0.12, 1);
  will-change: transform;
}

.wheel-rotator.no-transition {
  transition: none;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ===== Wheel Footer ===== */
.wheel-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.btn-single {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-light);
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 150ms, border-color 150ms;
  white-space: nowrap;
}

.btn-single:hover {
  border-color: var(--accent);
  color: var(--accent);
}

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

.wheel-result {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
}

.wheel-result.active {
  color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  width: 100%;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
  background: var(--surface);
}

.footer p {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 1px;
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .wheels {
    grid-template-columns: 1fr 1fr;
  }

  .wheel-section:first-child {
    grid-column: 1 / -1;
    justify-self: center;
    max-width: 340px;
  }
}

@media (max-width: 640px) {
  .wheels {
    grid-template-columns: 1fr;
  }

  .wheel-section:first-child {
    grid-column: auto;
    max-width: none;
  }

  .wheel-wrapper {
    width: 260px;
    height: 260px;
  }

  .wheel-rotator {
    width: 240px;
    height: 240px;
  }

  .controls {
    flex-direction: column;
    gap: 8px;
  }

  .result-section {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}