* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary-color: #4a90e2;
  --secondary-color: #f5a623;
  --danger-color: #dc3545;
  --info-color: #17a2b8;
  --background-color: #f4f7f6;
  --container-bg: #ffffff;
  --text-color: #333;
  --text-muted: #6c757d;
  --border-color: #dee2e6;
  --input-border-color: #ced4da;
  --input-bg-color: #ffffff;
  --button-secondary-bg: #f8f9fa;
  --button-secondary-border: #ced4da;
  --button-secondary-text: #495057;
  --border-radius: 12px;
  --box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  --pointer-color: var(--secondary-color);
  --pointer-size: 35px;
  --hub-radius: 18%;
  --spin-button-text-color: #ffffff;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  background-color: var(--background-color);
  color: var(--text-color);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 20px;
  background-size: cover;
  background-position: center;
  transition: background-color 0.3s ease;
}

.main-container {
  display: flex;
  flex-wrap: wrap;
  gap: 25px;
  width: 100%;
  max-width: 1450px;
  justify-content: center;
}

.container {
  background-color: var(--container-bg);
  padding: 25px 30px;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-section {
  flex: 1 1 55%;
  min-width: 350px;
  max-width: 700px;
  position: relative;
  padding-top: 60px;
  padding-bottom: 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#controls-logo {
  display: block;
  max-width: 300px;
  height: auto;
  margin: 0 auto 15px auto;
  opacity: 0.85;
}

.controls-section {
  flex: 1 1 40%;
  min-width: 320px;
  max-width: 550px;
  align-self: flex-start;
}

.share-download-section {
  flex: 1 1 100%;
  flex-direction: row;
  justify-content: center;
  gap: 15px;
  margin-top: -10px;
  padding: 15px;
}

.wheel-section h1,
.wheel-section p {
  text-align: center;
  margin-bottom: 10px;
  color: var(--text-color);
}
.wheel-section h1 {
  font-size: 1.8em;
  font-weight: 600;
}
.wheel-section p {
  font-size: 1.05em;
  color: #555;
}
.wheel-section h1.hidden,
.wheel-section p.hidden {
  display: none;
}

.wheel-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  margin: 15px auto;
  display: flex;
  justify-content: center;
  align-items: center;
}
.wheel-wrapper.spinning-start {
  animation: spinStartPulse 0.4s cubic-bezier(0.215, 0.61, 0.355, 1);
}
@keyframes spinStartPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}
#pickerWheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

.wheel-pointer {
  position: absolute;
  top: 50%;
  left: calc(100% + 5px);
  transform: translateY(-50%);
  z-index: 10;
  width: 0;
  height: 0;
  border-top: calc(var(--pointer-size) / 2) solid transparent;
  border-bottom: calc(var(--pointer-size) / 2) solid transparent;
  border-right: var(--pointer-size) solid var(--pointer-color);
  filter: drop-shadow(3px 3px 5px rgba(0, 0, 0, 0.25));
  border-left: 3px solid transparent;
  transition: border-right-color 0.2s ease-out;
}
.wheel-pointer::before {
  content: "";
  position: absolute;
  top: calc(var(--pointer-size) / -2 + 2px);
  right: 2px;
  width: 0;
  height: 0;
  border-top: calc(var(--pointer-size) / 2 - 2px) solid transparent;
  border-bottom: calc(var(--pointer-size) / 2 - 2px) solid transparent;
  border-right: calc(var(--pointer-size) - 4px) solid rgba(255, 255, 255, 0.3);
}

@keyframes idlePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
  }
}

.spin-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  width: calc(var(--hub-radius, 18%) * 2 * 0.7);
  height: calc(var(--hub-radius, 18%) * 2 * 0.7);
  padding: 0;
  font-size: max(14px, calc(var(--hub-radius, 18%) * 0.7));
  font-weight: 700;
  color: var(--spin-button-text-color);
  line-height: 1.1;
  text-transform: uppercase;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  text-align: center;
  background-color: var(--primary-color);
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), inset 0 2px 3px rgba(255, 255, 255, 0.4);
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.25s ease, box-shadow 0.25s ease, filter 0.2s ease, border-color 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: idlePulse 1.8s alternate infinite ease-in-out;
  animation-play-state: running;
}
.spin-button:hover:not(:active) {
  animation-play-state: paused;
  filter: brightness(1.1);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%) scale(1.08);
  border-color: white;
}
.spin-button:active {
  animation-play-state: paused;
  transform: translate(-50%, -50%) scale(0.98);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2), inset 0 1px 3px rgba(0, 0, 0, 0.1);
  filter: brightness(0.95);
}
.wheel-wrapper.charging .spin-button {
  animation: none;
  transform: translate(-50%, -50%) scale(1);
}
.spin-button:disabled {
  animation: none;
  transform: translate(-50%, -50%);
  background-color: #cccccc !important;
  color: #888 !important;
  cursor: not-allowed;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  border-color: #bbb;
  filter: none;
}
.spin-button i {
  font-size: 1.3em;
}

#spin-power-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: calc(var(--hub-radius, 18%) * 2 * 0.7 + 10px);
  height: calc(var(--hub-radius, 18%) * 2 * 0.7 + 10px);
  border-radius: 50%;
  z-index: 10;
  pointer-events: none;
  background: rgba(60, 60, 60, 0.12);
  box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.05);
  opacity: 1;
  transition: background 0.1s linear, box-shadow 0.3s ease;
}
.wheel-wrapper.charging #spin-power-indicator {
  box-shadow: 0 0 18px 6px rgba(74, 144, 226, 0.55);
}

.bottom-controls {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}
.icon-button {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  color: #555;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.icon-button:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}

.top-left-icon-button {
  position: absolute;
  top: 15px;
  left: 15px;
  z-index: 5;
}

.sound-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  padding: 6px 12px;
  border-radius: 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.sound-control i {
  color: #555;
}
.sound-control input[type="range"] {
  width: 85px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.tabs {
  display: flex;
  margin-bottom: 25px;
  background-color: #eef1f5;
  border-radius: var(--border-radius);
  padding: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
}
.tab-button {
  padding: 10px 18px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.25em;
  color: var(--text-muted);
  border-radius: calc(var(--border-radius) - 4px);
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
  flex-grow: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
.tab-button:hover {
  color: var(--primary-color);
  background-color: rgba(0, 0, 0, 0.03);
}
.tab-button.active {
  background-color: var(--container-bg);
  color: var(--primary-color);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}
.tab-content {
  width: 100%;
}
.tab-pane {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}
.tab-pane.active {
  display: block;
}
.tab-pane-title {
  width: 100%;
  text-align: left;
  margin-bottom: 20px;
  font-size: 1.3em;
  color: var(--primary-color);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tab-pane-title i {
  color: inherit;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.button-primary,
.button-secondary,
.button-danger,
.button-info {
  padding: 10px 18px;
  font-size: 0.95em;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  line-height: 1.4;
}
.button-primary:active,
.button-secondary:active,
.button-danger:active,
.button-info:active {
  transform: scale(0.98);
}
.button-primary:disabled,
.button-secondary:disabled,
.button-danger:disabled,
.button-info:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.button-primary {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
.button-primary:hover:not(:disabled) {
  background-color: #3a7bd5;
  border-color: #3a7bd5;
}
.button-secondary {
  background-color: var(--button-secondary-bg);
  color: var(--button-secondary-text);
  border-color: var(--button-secondary-border);
}
.button-secondary:hover:not(:disabled) {
  background-color: #e9ecef;
  border-color: #adb5bd;
}
.button-danger {
  background-color: var(--danger-color);
  color: white;
  border-color: var(--danger-color);
}
.button-danger:hover:not(:disabled) {
  background-color: #c82333;
  border-color: #bd2130;
}
.button-info {
  background-color: var(--info-color);
  color: white;
  border-color: var(--info-color);
}
.button-info:hover:not(:disabled) {
  background-color: #138496;
  border-color: #117a8b;
}
.button-small {
  padding: 6px 12px;
  font-size: 0.85em;
  gap: 5px;
}
.button-small i {
  margin: 0;
}
.button-small:has(i):not(:has(span)) {
  padding: 6px 8px;
  min-width: auto;
}

.add-option-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.add-option-form input[type="text"] {
  flex-grow: 1;
  padding: 12px 15px;
  border: 1px solid var(--input-border-color);
  background-color: var(--input-bg-color);
  border-radius: 8px;
  font-size: 1em;
}
.add-option-form button {
  flex-shrink: 0;
}

.option-list::-webkit-scrollbar,
.result-list::-webkit-scrollbar {
  width: 8px;
}
.option-list::-webkit-scrollbar-track,
.result-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.option-list::-webkit-scrollbar-thumb,
.result-list::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 10px;
}
.option-list::-webkit-scrollbar-thumb:hover,
.result-list::-webkit-scrollbar-thumb:hover {
  background: #aaa;
}

.option-list {
  list-style: none;
  max-height: 45vh;
  min-height: 150px;
  overflow-y: auto;
  padding-right: 5px;
  margin-right: -5px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
}

.option-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-bottom: 1px solid #f0f0f0;
  background-color: var(--container-bg);
  border-radius: 6px;
  margin-bottom: 5px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  position: relative;
  transition: background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  overflow: visible;
  min-height: 38px;
}
.option-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}
.option-item:hover {
  background-color: #f8f9fa;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.option-item.dragging {
  opacity: 0.6;
  background: #e0f7ff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.option-item.hidden-in-wheel {
  opacity: 0.55;
  background-color: #f8f8f8;
  background-image: linear-gradient(45deg, #f0f0f0 25%, transparent 25%, transparent 50%, #f0f0f0 50%, #f0f0f0 75%, transparent 75%, transparent);
  background-size: 8px 8px;
}
.option-item.hidden-in-wheel > * {
  position: relative;
  z-index: 2;
}
.option-item.hidden-in-wheel .option-text {
  text-decoration: line-through;
  color: #999;
}
.option-item.hidden-in-wheel .option-color,
.option-item.hidden-in-wheel .weight-adjust,
.option-item.hidden-in-wheel .option-action,
.option-item.hidden-in-wheel .option-count i {
  filter: grayscale(80%);
  opacity: 0.7;
}
.drag-handle {
  cursor: grab;
  color: #ccc;
  padding: 0 4px;
  opacity: 0.8;
  transition: color 0.2s, opacity 0.2s;
  flex-shrink: 0;
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  margin-right: 2px;
}
.option-item:hover .drag-handle {
  color: #aaa;
  opacity: 1;
}
.drag-handle:active {
  cursor: grabbing;
}
.option-color {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  background-color: transparent;
  flex-shrink: 0;
  overflow: hidden;
  vertical-align: middle;
}
.option-color::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 50%;
}
.option-color::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.1);
}
.option-color::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.1);
}
.option-color:focus {
  outline: none;
}
.option-main-info {
  flex-grow: 1;
  flex-shrink: 1;
  min-width: 60px;
  display: flex;
  align-items: center;
  margin-right: 5px;
}
.option-text {
  padding: 4px 6px;
  cursor: text;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 0.98em;
  line-height: 1.4;
  background-color: transparent;
  position: relative;
  z-index: 2;
  width: 100%;
  display: block;
  word-break: break-word;
}
.option-text:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: #ffffff;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}
.option-details {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-left: auto;
  z-index: 2;
  background-color: #f8f9fa;
  padding: 2px 5px;
  border-radius: 15px;
  border: 1px solid #eee;
  height: 24px;
}
.weight-adjust {
  background-color: #e9ecef;
  border: 1px solid var(--input-border-color);
  color: var(--text-muted);
  font-weight: bold;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  line-height: 16px;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s, border-color 0.2s, transform 0.1s;
  padding: 0;
  font-size: 0.9em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.weight-adjust:hover {
  background-color: #dee2e6;
  border-color: #adb5bd;
}
.weight-adjust:active {
  transform: scale(0.9);
}
.weight-adjust:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background-color: #e9ecef;
  border-color: var(--input-border-color);
}
.option-weight-value {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--text-color);
  padding: 0 3px;
  min-width: 18px;
  text-align: center;
  line-height: 1;
}
.details-separator {
  width: 1px;
  height: 14px;
  background-color: #ddd;
  margin: 0 2px;
}
.option-count {
  font-size: 0.8em;
  color: var(--text-muted);
  min-width: auto;
  text-align: center;
  font-weight: 500;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.option-count i {
  font-size: 0.95em;
  line-height: 1;
  vertical-align: middle;
}
.option-count:empty {
  display: none;
}
.option-actions-container {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 4px;
  height: 26px;
  z-index: 5;
}
.option-actions-toggle {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 0;
  font-size: 1.05em;
  transition: color 0.2s, transform 0.1s, background-color 0.2s;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.option-actions-toggle:hover {
  color: var(--primary-color);
  background-color: #e9ecef;
}
.option-actions-toggle:active {
  transform: scale(0.9);
}
.option-actions-popup {
  display: none;
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--container-bg);
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  padding: 4px;
  z-index: 10;
  white-space: nowrap;
  margin-right: 6px;
  animation: fadeInPopup 0.15s ease-out;
}
.option-actions-popup.show {
  display: flex;
  gap: 3px;
}
@keyframes fadeInPopup {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}
.option-actions-popup .popup-action {
  background: none;
  border: 1px solid transparent;
  color: #888;
  cursor: pointer;
  padding: 0;
  font-size: 0.95em;
  transition: color 0.2s, transform 0.1s, background-color 0.2s;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.option-actions-popup .popup-action:hover {
  color: var(--primary-color);
  background-color: #e9ecef;
  border-color: #ddd;
}
.option-actions-popup .popup-action:active {
  transform: scale(0.9);
}
.option-actions-popup .popup-action.remove-option:hover,
.option-actions-popup .popup-action.remove-background:hover {
  color: var(--danger-color);
  background-color: #f8d7da;
  border-color: #f5c6cb;
}
.option-actions-popup .popup-action.remove-background {
  display: none;
}
.option-item.has-bg-image .option-actions-popup .popup-action.remove-background {
  display: inline-flex;
}
.option-actions-popup .popup-action.set-background i.fa-images {
  display: none;
}
.option-item.has-bg-image .option-actions-popup .popup-action.set-background i.fa-image {
  display: none;
}
.option-item.has-bg-image .option-actions-popup .popup-action.set-background i.fa-images {
  display: inline-block;
}

.option-bg-input {
  display: none;
}
.option-item .option-bg-overlay {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  z-index: 1;
  border-radius: 6px;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.option-item:hover .option-bg-overlay {
  opacity: 0.12;
}
.option-item.hidden-in-wheel .option-bg-overlay {
  display: none;
}

.option-list-controls,
.results-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
}

.result-list {
  list-style: none;
  max-height: 45vh;
  min-height: 150px;
  overflow-y: auto;
  padding-right: 8px;
  margin-right: -8px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px;
}
.result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 5px;
  border-bottom: 1px dashed #eee;
  font-size: 0.95em;
}
.result-item:last-child {
  border-bottom: none;
}
.result-color-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.result-text {
  flex-grow: 1;
  margin-right: 5px;
  word-break: break-word;
  line-height: 1.3;
}
.result-trophy-icon {
  font-size: 0.9em;
  flex-shrink: 0;
  line-height: 1;
  margin: 0 -2px 0 -4px;
}
.result-trophy-icon i {
  filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.1));
}
.result-item .timestamp {
  color: var(--text-muted);
  font-size: 0.8em;
  flex-shrink: 0;
  white-space: nowrap;
  margin-left: auto;
  display: inline;
}
.result-item button.delete-result {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  font-size: 1em;
  padding: 0 3px;
  transition: color 0.3s;
  flex-shrink: 0;
  margin-left: 5px;
  line-height: 1;
}
.result-item button.delete-result:hover {
  color: var(--danger-color);
}
.no-results {
  color: var(--text-muted);
  text-align: center;
  padding: 20px;
  font-style: italic;
}

.settings-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.settings-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.settings-group h3 {
  margin-bottom: 18px;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.settings-group h3 i {
  color: var(--primary-color);
  font-size: 1em;
}

.setting-item {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.setting-item label {
  font-weight: 500;
  font-size: 0.95em;
  color: #444;
  display: block;
}
.setting-item input[type="text"],
.setting-item textarea,
.setting-item select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--input-border-color);
  background-color: var(--input-bg-color);
  border-radius: 8px;
  font-size: 0.95em;
}
.setting-item input[type="color"] {
  width: auto;
  max-width: 70px;
  height: 38px;
  padding: 4px;
  border: 1px solid var(--input-border-color);
  border-radius: 8px;
  vertical-align: middle;
  cursor: pointer;
}
.setting-item input[type="file"] {
  border: 1px solid var(--input-border-color);
  border-radius: 8px;
  font-size: 0.9em;
  padding: 8px 10px;
  flex-grow: 1;
  background-color: var(--input-bg-color);
  min-width: 0;
}
.setting-item input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: none;
  background: #eee;
  padding: 6px 12px;
  border-radius: 6px;
  color: #555;
  cursor: pointer;
  transition: background-color 0.2s ease-in-out;
}
.setting-item input[type="file"]::file-selector-button:hover {
  background-color: #ddd;
}
.setting-item textarea {
  resize: vertical;
  min-height: 60px;
}

.setting-item-input-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}
.setting-item-input-wrapper button {
  flex-shrink: 0;
}

#removeBgImageBtn {
  display: none;
}
.color-patterns {
  display: flex;
  gap: 10px;
  margin-top: 5px;
  flex-wrap: wrap;
}
.pattern-btn {
  width: 50px;
  height: 30px;
  border: 2px solid #eee;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.3s, transform 0.1s;
}
.pattern-btn:hover {
  border-color: var(--primary-color);
  transform: scale(1.05);
}
.pattern-btn:active {
  transform: scale(0.98);
}

.checkbox-item {
  flex-direction: row !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin: 0;
  accent-color: var(--primary-color);
  cursor: pointer;
}
.checkbox-item label {
  font-weight: normal;
  margin-bottom: 0;
  cursor: pointer;
}

.sound-option {
  display: grid;
  grid-template-columns: minmax(50px, auto) 1fr auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.sound-option label {
  grid-column: 1 / 2;
  text-align: right;
  margin-bottom: 0;
  font-size: 0.95em;
  color: #444;
  white-space: nowrap;
}
.sound-option select {
  grid-column: 2 / 3;
  width: 100%;
  margin-bottom: 0;
}
.test-sound-toggle {
  grid-column: 3 / 4;
  padding: 0;
  background: none;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--primary-color);
  font-size: 1.3em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background-color 0.2s;
}
.test-sound-toggle:hover {
  background-color: #f0f0f0;
}
.test-sound-toggle i.fa-stop-circle {
  color: var(--danger-color);
}

.io-description {
  background-color: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px 20px;
  margin-bottom: 25px;
  font-size: 0.9em;
  color: var(--text-muted);
}
.io-description p {
  margin-bottom: 10px;
  line-height: 1.5;
}
.io-description ul {
  margin-bottom: 10px;
  margin-left: 20px;
  list-style: disc;
}
.io-description code {
  background-color: #e0e0e0;
  padding: 2px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.95em;
  color: var(--text-color);
}
.io-description strong {
  color: var(--text-color);
}
.io-description em {
  color: #555;
}

.io-section {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px solid #f0f0f0;
}
.io-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}
.io-section h3 {
  margin-bottom: 15px;
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}
.io-section h3 i {
  color: var(--primary-color);
  font-size: 1em;
}
.input-description {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 15px;
}
#importExportTab button {
  margin-top: 5px;
}

.share-download-section button {
  padding: 10px 22px;
  font-size: 1em;
  border: 1px solid var(--primary-color);
  background: none;
  color: var(--primary-color);
  border-radius: 25px;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s, transform 0.1s;
}
.share-download-section button:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}
.share-download-section button:active {
  transform: translateY(0px) scale(0.98);
}
.share-download-section button i {
  margin-right: 8px;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  inset: 0;
  overflow-y: auto;
  background-color: rgba(0, 0, 0, 0.65);
  animation: fadeIn 0.3s ease;
  padding: 20px 0;
}
.modal-content {
  background-color: #fff;
  margin: 5vh auto;
  padding: 35px 30px 25px 30px;
  border: none;
  width: 90%;
  max-width: 480px;
  border-radius: var(--border-radius);
  text-align: center;
  position: relative;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 15px;
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  line-height: 1;
  padding: 5px;
}
.modal-close:hover,
.modal-close:focus {
  color: #555;
}
.modal-action-icon {
  background: none;
  border: none;
  color: #aaa;
  cursor: pointer;
  padding: 5px;
  font-size: 1.1em;
  line-height: 1;
  transition: color 0.2s ease;
}
.modal-action-icon:hover {
  color: var(--primary-color);
}
.modal-top-left-icon {
  position: absolute;
  top: 17px;
  left: 15px;
}
.modal-trophy-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 10px;
}
.modal-trophy {
  display: block;
  text-align: center;
  color: var(--secondary-color);
  line-height: 1;
  transition: color 0.3s ease;
}
.modal-trophy i {
  filter: drop-shadow(2px 3px 4px rgba(0, 0, 0, 0.1));
}
.modal-win-count-badge {
  position: absolute;
  top: -5px;
  right: -10px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  min-width: 24px;
  height: 24px;
  padding: 0 4px;
  font-size: 0.8em;
  font-weight: bold;
  line-height: 24px;
  text-align: center;
  border: 1px solid white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s ease, color 0.3s ease;
  z-index: 1;
}
.modal h2 {
  color: var(--primary-color);
  margin-bottom: 2px;
  font-size: 1.5em;
  transition: color 0.3s ease;
  word-wrap: break-word;
}
.modal-fun-message {
  font-size: 1em;
  font-style: italic;
  color: #777;
  margin-bottom: 10px;
  line-height: 1.3;
  min-height: 1.3em;
}
.modal-winner-info-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
  padding: 8px 12px;
  background-color: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #eee;
}
#winnerResult {
  font-size: 2.5em;
  font-weight: 700;
  color: var(--text-color);
  margin: 0;
  padding-top: 20px;
  padding-bottom: 20px;
  background-color: transparent;
  border: none;
  display: block;
  word-break: break-word;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  flex-grow: 1;
  text-align: center;
}
.modal-color-swatch {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #ccc;
  border: 1px solid rgba(0, 0, 0, 0.2);
  vertical-align: middle;
  transition: background-color 0.3s ease;
  flex-shrink: 0;
}
.modal-winner-info-bar .modal-action-icon {
  font-size: 1.3em;
  color: #888;
  flex-shrink: 0;
}
.modal-winner-info-bar .modal-action-icon:hover {
  color: var(--primary-color);
}
#modalCopyWinnerBtn i.fa-check {
  color: #28a745;
}
.modal-winner-visuals {
  margin-top: 8px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 25px;
}
.modal-option-image {
  display: none;
  max-width: 45px;
  max-height: 30px;
  border-radius: 4px;
  border: 1px solid #ddd;
  object-fit: cover;
  vertical-align: middle;
}
.modal-actions {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.modal-button {
  padding: 8px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #555;
  font-size: 0.95em;
  flex-grow: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 80px;
}
.modal-button:hover {
  border-color: #aaa;
  background-color: #f5f5f5;
  transform: translateY(-1px);
}
.modal-button:active {
  transform: scale(0.98);
}
.modal-button.modal-button-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  order: -1;
}
.modal-button.modal-button-primary:hover {
  background-color: #3a7bd5;
  border-color: #3a7bd5;
  color: white;
}
.modal-button.modal-button-more {
  min-width: 40px;
  padding: 8px 10px;
}
#modalCountBtn {
  border-color: #28a745;
  color: #28a745;
}
#modalCountBtn:hover {
  background-color: #28a745;
  color: white;
}
#modalDoneBtn {
  border-color: #6c757d;
  color: #6c757d;
}
#modalDoneBtn:hover {
  background-color: #6c757d;
  color: white;
}
.dropdown {
  position: relative;
  display: inline-block;
}
.dropdown-content {
  display: none;
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #ffffff;
  min-width: 160px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  z-index: 1001;
  overflow: hidden;
  margin-bottom: 5px;
  border: 1px solid #eee;
  animation: fadeInDropdown 0.2s ease-out;
}
.dropdown-content.show {
  display: block;
}
@keyframes fadeInDropdown {
  from {
    opacity: 0;
    transform: translate(-50%, 5px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}
.dropdown-item {
  color: #333;
  padding: 10px 15px;
  text-decoration: none;
  display: block;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-size: 0.9em;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.dropdown-item i {
  margin-right: 10px;
  color: #888;
  width: 1.2em;
  text-align: center;
}
.dropdown-item:hover {
  background-color: #f1f1f1;
}
.dropdown-item-danger {
  color: var(--danger-color);
}
.dropdown-item-danger:hover {
  background-color: #f8d7da;
}
.dropdown-item-danger i {
  color: var(--danger-color);
}
.dropdown-item:active {
  transform: scale(0.99);
}
.modal-timestamp {
  font-size: 0.8em;
  color: #999;
  margin-top: 15px;
  margin-bottom: 8px;
  text-align: center;
}
.modal-brand-logo {
  display: block;
  margin: 0 auto 5px auto;
  max-width: 300px;
  opacity: 0.7;
}
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1001;
}

.wheel-section:fullscreen,
.wheel-section:-webkit-full-screen,
.wheel-section:-moz-full-screen,
.wheel-section:-ms-fullscreen {
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--background-color);
}

.wheel-section:fullscreen .wheel-wrapper,
.wheel-section:-webkit-full-screen .wheel-wrapper,
.wheel-section:-moz-full-screen .wheel-wrapper,
.wheel-section:-ms-fullscreen .wheel-wrapper {
  flex-grow: 0;
  flex-shrink: 1;
  margin: 10px auto;
}

.wheel-section:fullscreen h1,
.wheel-section:fullscreen p {
  flex-shrink: 0;
  margin-bottom: 5px;
  max-width: 90%;
}

.wheel-section:fullscreen .top-left-icon-button {
  top: 15px;
  left: 15px;
}

.wheel-section:fullscreen .bottom-controls,
.wheel-section:-webkit-full-screen .bottom-controls,
.wheel-section:-moz-full-screen .bottom-controls,
.wheel-section:-ms-fullscreen .bottom-controls {
  position: absolute;
  bottom: 15px;
  left: 15px;
  right: 15px;
  width: auto;
  max-width: calc(100% - 30px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}

@media (max-width: 1200px) {
  .main-container {
    gap: 20px;
  }
  .wheel-section {
    min-width: 320px;
  }
  .controls-section {
    min-width: 300px;
  }
}
@media (max-width: 1024px) {
  .main-container {
    flex-direction: column;
    align-items: center;
    gap: 20px;
  }
  .wheel-section,
  .controls-section {
    flex-basis: auto;
    width: 95%;
    max-width: 650px;
  }
  .controls-section {
    align-self: center;
  }
  .share-download-section {
    width: 95%;
    max-width: 650px;
    margin-top: 0;
  }
  .wheel-section {
    padding-bottom: 65px;
  }
}
@media (max-width: 768px) {
  body {
    padding: 15px;
  }
  .container {
    padding: 20px;
  }
  .wheel-section {
    padding-top: 55px;
  }
  .top-left-icon-button {
    top: 10px;
    left: 10px;
    width: 38px;
    height: 38px;
  }
  .modal-content {
    width: 90%;
    margin: 10vh auto;
    padding: 30px 25px 20px 25px;
  }
  #winnerResult {
    font-size: 2.1em;
  }
  .modal-color-swatch {
    width: 20px;
    height: 20px;
  }
  .modal-winner-info-bar .modal-action-icon {
    font-size: 1.2em;
  }
  .modal h2 {
    font-size: 1.4em;
  }
  .setting-item:not(.checkbox-item):not(.sound-option) label {
    margin-bottom: 5px;
  }
  .setting-item input[type="color"] {
    width: 100%;
    max-width: none;
  }
  .setting-item-input-wrapper {
    width: 100%;
  }

  .sound-option {
    grid-template-columns: minmax(45px, auto) 1fr auto;
    gap: 8px;
  }
  .sound-option label {
    text-align: right;
  }

  .tabs {
    width: 100%;
    justify-content: space-around;
  }
  .tab-button {
    flex-grow: 1;
    text-align: center;
    font-size: 1.15em;
    padding: 8px 10px;
  }

  .spin-button {
    --hub-radius: 16%;
  }

  .option-actions-popup {
    right: 28px;
    left: auto;
    margin-right: 0;
    margin-left: 6px;
  }
  .result-item {
    font-size: 0.9em;
  }
  .result-item .timestamp {
    font-size: 0.75em;
  }
  #fullscreenBtn {
    display: none;
  }
}
@media (max-width: 480px) {
  body {
    padding: 10px;
  }
  .container {
    padding: 15px;
  }
  .wheel-section {
    padding-top: 50px;
  }
  .top-left-icon-button {
    top: 8px;
    left: 8px;
    width: 36px;
    height: 36px;
  }
  .wheel-wrapper {
    max-width: calc(100vw - 60px);
  }
  .wheel-pointer {
    --pointer-size: 30px;
    left: calc(100% + 3px);
  }
  .spin-button {
    --hub-radius: 18%;
  }
  .tab-button {
    font-size: 1em;
    padding: 8px;
  }
  .share-download-section button {
    font-size: 0.9em;
    padding: 9px 16px;
  }
  .modal-content {
    padding: 25px 20px 15px 20px;
    margin: 5vh auto;
  }
  .modal-top-left-icon {
    top: 12px;
    left: 12px;
    font-size: 1em;
  }
  .modal-close {
    top: 10px;
    right: 12px;
    font-size: 24px;
  }
  .modal-actions {
    gap: 6px;
  }
  .modal-button {
    padding: 7px 12px;
    font-size: 0.9em;
    min-width: 65px;
  }
  .modal-winner-info-bar {
    gap: 6px;
    padding: 6px 8px;
  }
  #winnerResult {
    font-size: 1.8em;
  }
  .modal-color-swatch {
    width: 18px;
    height: 18px;
  }
  .modal-winner-info-bar .modal-action-icon {
    font-size: 1.1em;
  }
  .modal h2 {
    font-size: 1.3em;
  }
  .modal-fun-message {
    font-size: 0.9em;
  }
  .modal-timestamp {
    font-size: 0.75em;
    margin-top: 12px;
  }
  .modal-brand-logo {
    max-width: 200px;
  }
  .modal-win-count-badge {
    width: auto;
    min-width: 22px;
    height: 22px;
    line-height: 22px;
    font-size: 0.75em;
    top: -4px;
    right: -8px;
  }
  .dropdown-content {
    min-width: 140px;
  }
  .dropdown-item {
    padding: 8px 12px;
    font-size: 0.85em;
  }
  .bottom-controls {
    bottom: 10px;
    left: 10px;
    right: 10px;
  }
  .icon-button {
    width: 38px;
    height: 38px;
  }
  .sound-control {
    padding: 5px 10px;
  }
  .sound-control input[type="range"] {
    width: 70px;
  }

  .sound-option {
    grid-template-columns: minmax(40px, auto) 1fr auto;
    gap: 5px;
  }
  .sound-option label {
    text-align: right;
  }

  .option-item {
    gap: 4px;
    padding: 4px 6px;
  }
  .option-main-info {
    min-width: 50px;
  }
  .option-details {
    padding: 1px 4px;
    height: 22px;
    gap: 3px;
  }
  .weight-adjust {
    width: 16px;
    height: 16px;
    line-height: 14px;
    font-size: 0.8em;
  }
  .option-weight-value {
    font-size: 0.8em;
    min-width: 14px;
  }
  .option-count {
    font-size: 0.75em;
    gap: 2px;
  }
  .option-count i {
    font-size: 0.9em;
  }
  .option-actions-container {
    margin-left: 2px;
    height: 24px;
  }
  .option-actions-toggle {
    width: 24px;
    height: 24px;
    font-size: 1em;
  }
  .option-actions-popup {
    right: 26px;
  }
  .result-item {
    gap: 5px;
    font-size: 0.85em;
  }
  .result-color-swatch {
    width: 12px;
    height: 12px;
  }
  .result-item .timestamp {
    display: inline;
    font-size: 0.7em;
    white-space: nowrap;
    margin-left: 4px;
  }
  .results-controls {
    justify-content: space-between;
  }
  .results-controls button {
    padding: 8px 10px;
    font-size: 0.85em;
  }
  .io-section .setting-item {
    flex-direction: column;
    align-items: stretch;
  }
}

*:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 2px;
  border-radius: 4px;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
}
button:focus,
select:focus,
input:focus,
textarea:focus,
[contenteditable]:focus {
  outline: none;
}
.option-text:focus-visible {
  border-color: var(--primary-color);
  box-shadow: none;
}
.option-color:focus-visible {
  outline: 3px solid var(--primary-color);
  outline-offset: 1px;
  box-shadow: none;
}
button:focus-visible,
select:focus-visible,
input[type="range"]:focus-visible,
input[type="checkbox"]:focus-visible,
a:focus-visible,
.test-sound-toggle:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.4);
  outline-offset: 1px;
}
.spin-button:focus-visible {
  outline: none;
  animation-play-state: paused;
  box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.7), 0 4px 10px rgba(0, 0, 0, 0.2), inset 0 2px 3px rgba(255, 255, 255, 0.4);
}
input[type="text"]:focus-visible,
input[type="file"]:focus-visible,
input[type="color"]:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}
.options-subtabs {
  display: flex;
  margin-bottom: 15px;
  background-color: #f0f4f8;
  border-radius: 8px;
  padding: 4px;
  flex-wrap: wrap;
  gap: 4px;
}

.options-subtab-button {
  padding: 7px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9em;
  color: var(--text-muted);
  border-radius: 6px;
  transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
  flex-shrink: 0;
  flex-grow: 1;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.options-subtab-button:hover {
  color: var(--primary-color);
  background-color: rgba(0, 0, 0, 0.04);
}

.options-subtab-button.active {
  background-color: var(--container-bg);
  color: var(--primary-color);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  font-weight: 500;
}

.options-subtab-content {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-color);
}

.options-subtab-pane {
  display: none;
  animation: fadeIn 0.4s ease-in-out;
}

.options-subtab-pane.active {
  display: block;
}

.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--primary-color);
  font-size: 0.95em;
  margin-top: 15px;
  padding: 8px;
  background-color: #e7f3ff;
  border-radius: 6px;
}

.rate-limit-message {
  color: var(--danger-color);
  font-size: 0.9em;
  font-weight: 500;
  margin-top: 10px;
  padding: 8px;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
  text-align: center;
}

#presetInputSubTab .setting-item {
  margin-bottom: 15px;
}
#presetInputSubTab button {
  margin-top: 5px;
}

.options-subtab-pane .input-description {
  font-size: 0.9em;
  color: var(--text-muted);
  margin-bottom: 15px;
}

#manualInputSubTab .add-option-form {
  margin-bottom: 15px;
}
#manualInputSubTab .option-list {
  margin-bottom: 15px;
}
#manualInputSubTab .option-list-controls {
  margin-top: 15px;
  padding-top: 15px;
  border-top: none;
}

@keyframes wheelPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wheelShrinkFade {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.97);
    opacity: 0.9;
  }
}

@keyframes wheelRearrange {
  0% {
    transform: rotate(0deg) scale(1);
    filter: brightness(100%);
  }
  50% {
    transform: rotate(8deg) scale(1.02);
    filter: brightness(105%);
  }
  100% {
    transform: rotate(0deg) scale(1);
    filter: brightness(100%);
  }
}

@keyframes wheelChange {
  0% {
    transform: scale(1);
    filter: saturate(100%);
  }
  50% {
    transform: scale(1.02);
    filter: saturate(110%);
  }
  100% {
    transform: scale(1);
    filter: saturate(100%);
  }
}

@keyframes wheelClear {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

@keyframes wheelLoad {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  40% {
    opacity: 0;
    transform: scale(0.95);
  }
  60% {
    opacity: 0;
    transform: scale(0.95);
  } /* Brief pause */
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.wheel-wrapper.animate-pop {
  animation: wheelPop 0.3s ease-out 1;
}
.wheel-wrapper.animate-shrink-fade {
  animation: wheelShrinkFade 0.3s ease-in-out 1;
}
.wheel-wrapper.animate-rearrange {
  animation: wheelRearrange 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55) 1; /* Overshoot effect */
}
.wheel-wrapper.animate-change {
  animation: wheelChange 0.3s ease-in-out 1;
}
.wheel-wrapper.animate-clear {
  animation: wheelClear 0.4s ease-in 1;
}
.wheel-wrapper.animate-load {
  animation: wheelLoad 0.6s ease-in-out 1;
}

.wheel-wrapper {
  transform-origin: center center;
  will-change: transform, opacity, filter;
}

/* ======================================= */
/* SEO Content Section & Page Footer Styles */
/* ======================================= */

/* --- SEO Content Section Styles --- */
.seo-content-section {
  flex: 1 1 100%; /* Allow it to take full width space */
  width: 100%;
  max-width: 900px; /* Control max width for readability */
  margin: 20px auto 30px auto; /* Center it and add vertical space */
  padding: 30px 40px; /* Inner spacing */
  text-align: left; /* Ensure text aligns left */
  background-color: var(--container-bg); /* Match container background */
  border-radius: var(--border-radius); /* Match container border-radius */
  box-shadow: var(--box-shadow); /* Match container shadow */
}

.seo-content-section h2 {
  color: var(--primary-color);
  margin-top: 15px; /* Space above h2, except the first one */
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--primary-color); /* Accent border */
  font-size: 1.6em;
  font-weight: 600;
}
.seo-content-section h2:first-of-type {
  margin-top: 0; /* No top margin for the very first h2 */
}

.seo-content-section h3 {
  color: #333; /* Slightly darker heading color */
  margin-top: 25px;
  margin-bottom: 12px;
  font-size: 1.3em;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.seo-content-section h3 i {
  color: var(--secondary-color); /* Use secondary color for icons */
  font-size: 0.9em;
  line-height: 1;
  flex-shrink: 0;
  width: 1.2em; /* Ensure consistent icon spacing */
  text-align: center;
}

.seo-content-section h4 {
  color: #444;
  margin-top: 25px;
  margin-bottom: 10px;
  font-size: 1.15em;
  font-weight: 600;
  border-left: 4px solid var(--info-color); /* Add a distinct marker */
  padding-left: 10px;
}

.seo-content-section p {
  margin-bottom: 18px;
  line-height: 1.7;
  color: #444;
  text-align: left; /* Explicitly left-align paragraphs */
}

.seo-content-section ul {
  list-style: disc;
  margin-left: 25px;
  margin-bottom: 20px;
  padding-left: 5px; /* Add slight indent */
}

/* Style nested lists differently if needed */
.seo-content-section ul ul {
  list-style: circle;
  margin-top: 10px;
  margin-bottom: 10px;
  margin-left: 20px; /* Further indent nested list */
}

.seo-content-section li {
  margin-bottom: 10px;
  line-height: 1.65;
  color: #444;
}

.seo-content-section code {
  background-color: #e9ecef;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace;
  font-size: 0.9em;
  color: #333;
  border: 1px solid #dee2e6;
}

.seo-content-section strong {
  font-weight: 600;
  color: #222;
}

.seo-content-section em {
  font-style: italic;
  color: #555; /* Slightly different color for emphasis */
}

.use-case-group {
  margin-bottom: 25px;
  padding-left: 15px;
  border-left: 3px solid var(--secondary-color); /* Visual grouping */
}

.use-case-group h3 {
  margin-top: 0; /* No top margin inside the group */
  margin-bottom: 8px;
}

/* --- Page Footer Styles --- */
.page-footer {
  flex: 1 1 100%; /* Ensure it takes full width */
  width: 100%;
  max-width: 900px; /* Match SEO section width or adjust */
  margin: 20px auto 30px auto; /* Spacing */
  padding: 25px 30px;
  text-align: center; /* Center align footer content */
  background-color: #f8f9fa; /* Slightly different background */
  border-top: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: none; /* Optional: remove shadow for footer */
}

.page-footer h3 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.3em;
  font-weight: 600;
}

.page-footer p {
  color: #555;
  margin-bottom: 10px;
  line-height: 1.6;
  font-size: 0.95em;
}

.page-footer .contact-info {
  font-size: 1em;
  margin-top: 15px;
  margin-bottom: 15px;
  display: flex; /* Align icon and text */
  align-items: center;
  justify-content: center; /* Center items */
  gap: 8px; /* Space between icon and text */
}

.page-footer .contact-info i {
  color: var(--primary-color);
  font-size: 1.1em;
}

.page-footer .contact-info a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: text-decoration 0.2s ease;
}

.page-footer .contact-info a:hover {
  text-decoration: underline;
}

.page-footer .footer-note {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-top: 15px;
  margin-bottom: 0;
}

/* --- Responsive Adjustments for SEO Content & Footer --- */
@media (max-width: 768px) {
  .seo-content-section,
  .page-footer {
    padding: 25px 20px; /* Reduce padding on smaller screens */
  }
  .seo-content-section h2 {
    font-size: 1.4em;
  }
  .seo-content-section h3 {
    font-size: 1.2em;
  }
  .seo-content-section h4 {
    font-size: 1.1em;
  }
  .seo-content-section p,
  .seo-content-section li {
    font-size: 0.95em;
    line-height: 1.6;
  }
  .seo-content-section ul {
    margin-left: 20px;
  }

  .page-footer {
    font-size: 0.98em; /* Slightly smaller base font for footer */
  }
  .page-footer h3 {
    font-size: 1.2em;
  }
  .page-footer p {
    font-size: 0.9em;
  }
  .page-footer .contact-info {
    font-size: 0.95em;
  }
  .page-footer .footer-note {
    font-size: 0.8em;
  }
}

@media (max-width: 480px) {
  .seo-content-section,
  .page-footer {
    padding: 20px 15px;
  }
  .seo-content-section h2 {
    font-size: 1.3em;
  }
  .seo-content-section h3 {
    font-size: 1.1em;
  }
  .seo-content-section h4 {
    font-size: 1.05em;
  }
  .seo-content-section p,
  .seo-content-section li {
    font-size: 0.92em;
  }
  .use-case-group {
    padding-left: 10px;
    border-left-width: 2px;
  }

  .page-footer {
    padding: 15px;
  }
  .page-footer h3 {
    font-size: 1.1em;
  }
  .page-footer p {
    font-size: 0.85em;
  }
  .page-footer .contact-info {
    font-size: 0.9em;
    flex-direction: column; /* Stack on very small screens */
    gap: 5px;
  }
  .page-footer .footer-note {
    font-size: 0.8em;
  }
}
