:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --bg: #0f172a;
  --panel-bg: #1e293b;
  --text: #f8fafc;
  --text-muted: #94a3b8;
  --border: #334155;
  --input-bg: #0f172a;
  --pointer-color: #6366f1;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease;
}

.wtw-wheel-wrapper:fullscreen,
.wtw-wheel-wrapper:-webkit-full-screen {
  background: #000;
}

.wtw-wheel-wrapper.is-fullscreen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.wtw-wheel-wrapper.is-fullscreen h1,
.wtw-wheel-wrapper.is-fullscreen #optionsPanel,
.wtw-wheel-wrapper.is-fullscreen .config-bar,
.wtw-wheel-wrapper.is-fullscreen #pageTitle {
  display: none !important;
}

.wtw-wheel-wrapper.is-fullscreen .container,
.wtw-wheel-wrapper.is-fullscreen .wcontainer {
  padding: 0;
  max-width: none;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wtw-wheel-wrapper.is-fullscreen .wheel-row {
  margin: 0;
  gap: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wtw-wheel-wrapper.is-fullscreen .wheel-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.wtw-wheel-wrapper.is-fullscreen .wheel-container {
  width: min(85vh, 85vw);
  height: min(85vh, 85vw);
  max-width: none;
  max-height: none;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wtw-wheel-wrapper.is-fullscreen #canvas {
  border: none;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.exit-fullscreen-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid var(--border);
  padding: 10px 15px;
  border-radius: 8px;
  cursor: pointer;
  z-index: 2000;
  display: none;
  backdrop-filter: blur(5px);
}

.wtw-wheel-wrapper.is-fullscreen .exit-fullscreen-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.exit-fullscreen-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

h1 {
  margin-bottom: 40px;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #818cf8, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.container {
  display: flex;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1300px;
  width: 100%;
  align-items: flex-start;
}

.modal-footer button {
  padding: 6px 15px;
  border-radius: 6px;
}

.wheel-row {
  width: 100%;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  flex-direction: row-reverse;
  gap: 80px;
  align-items: center;
}

.wheel-area {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-container {
  position: relative;
  width: 550px;
  height: 550px;
  margin-bottom: 30px;
  margin-right: 20px;
  /* Gap between wheel and right menu */
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 50%;
  padding: 10px;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

#canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  /* border: 10px solid var(--panel-bg); */
  transition: transform cubic-bezier(0.1, 0, 0, 1);
}

#spinBtn {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  border: none;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-weight: 800;
  z-index: 20;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  outline: none;
  letter-spacing: 0.05em;
  font-size: 1rem;
}

#spinBtn:hover {
  transform: scale(1.1);
  background: #fff;
}

#spinBtn:active {
  transform: scale(0.9);
}

.pointer {
  position: absolute;
  right: -35px;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 50px;
  background: var(--pointer-color);
  clip-path: polygon(100% 0%, 0% 50%, 100% 100%, 80% 50%);
  z-index: 30;
  filter: drop-shadow(-5px 5px 10px rgba(0, 0, 0, 0.5));
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.pointer::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg,
      rgba(255, 255, 255, 0.3) 0%,
      rgba(0, 0, 0, 0.2) 100%);
  clip-path: inherit;
  pointer-events: none;
}

.panel {
  background: var(--panel-bg);
  padding: 24px;
  border-radius: 20px;
  border: 1px solid var(--border);
  width: 320px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  position: relative;
  transition: opacity 0.3s ease;
}

/* Panel Header Styling */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.hide-btn {
  background: none !important;
  border: none !important;
  color: var(--text-muted) !important;
  cursor: pointer;
  font-size: 0.8rem !important;
  padding: 2px 8px !important;
  width: auto !important;
  margin: 0 !important;
  text-decoration: underline;
}

.hide-btn:hover {
  color: white !important;
}

/* Panel Chevron Toggle Button */
.panel-chevron-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid var(--border) !important;
  color: var(--text-muted) !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  padding: 0 !important;
  border-radius: 6px !important;
  cursor: pointer;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem !important;
  margin: 0 8px 0 0 !important;
  transition: background 0.2s, color 0.2s !important;
  flex-shrink: 0;
}

.panel-chevron-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  color: white !important;
}

/* Collapsed panel — fully hidden */
.panel.panel-collapsed {
  display: none !important;
}

/* Floating restore button — fixed pill on the right edge */
.panel-restore-btn {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text-muted);
  width: 32px;
  height: 56px;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.4);
  transition: background 0.2s, color 0.2s, width 0.2s;
  z-index: 200;
}

.panel-restore-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  width: 40px;
}

/* Floating Toggle Buttons (legacy — kept for compatibility) */
.show-panel-btn {
  position: fixed;
  bottom: 20px;
  background: var(--panel-bg);
  color: white;
  border: 1px solid var(--border);
  padding: 10px 20px;
  border-radius: 30px;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: none;
  font-weight: 600;
}

.tab-headers {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
}

.tab-btn {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: 0.2s;
  border-radius: 8px;
  font-size: 0.9rem;
}

.tab-btn.active {
  color: white;
  background-color: var(--primary-hover);
}

.input-group {
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

input,
select {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: white;
  outline: none;
  transition: border 0.2s;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

.panel button {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--primary-hover);
  border: 2px solid var(--primary-hover);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 0px;
  transition: all 0.2s;
}

.panel button:hover {
  background: var(--primary-hover);
  color: white;
}

.secondary-btn {
  background: var(--border) !important;
  color: var(--text) !important;
}

.list-container {
  overflow-y: auto;
  margin-bottom: 10px;
  padding-right: 5px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg);
  margin-bottom: 8px;
  padding: 10px 12px;
  font-size: 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.del-btn {
  width: auto !important;
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  padding: 4px 8px !important;
  margin: 0 !important;
  font-size: 1.2rem;
}

.del-btn:hover {
  background: #ef4444 !important;
  color: white !important;
}

.tools {
  display: flex;
  justify-content: center;
}

.config-bar {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  background: var(--panel-bg);
  padding: 10px 20px;
  border-radius: 50px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.config-bar button {
  background: transparent;
  border: none;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.config-bar button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--primary);
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.1);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--panel-bg);
  padding: 0;
  border-radius: 24px;
  text-align: left;
  max-width: 600px;
  width: 95%;
  max-height: 90vh;
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex-grow: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.pannel-2 .tab-content.active {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

@keyframes popIn {
  from {
    transform: translateY(20px) scale(0.9);
    opacity: 0;
  }

  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-content .winner-name {
  font-size: 3rem;
  font-weight: 900;
  margin: 20px 0;
  color: #fff;
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.audio-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 5px;
}

.options-textarea {
  width: 100%;
  height: 300px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: white;
  padding: 15px;
  font-family: "Inter", monospace;
  font-size: 1rem;
  resize: none;
  outline: none;
  line-height: 1.6;
}

.options-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.tab-content {
  display: none;
  animation: fadeIn 0.2s ease;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.switch-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 15px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border);
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked+.slider {
  background-color: var(--primary);
}

input:checked+.slider:before {
  transform: translateX(24px);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 0.9rem;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.slice-colors-list {
  margin-top: 10px;
  max-height: 250px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.slice-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.slice-color-row span {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.slice-color-row input[type="color"] {
  width: 40px;
  height: 30px;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.slice-image-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.slice-image-row span {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-grow: 1;
}

.slice-image-preview {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  background: var(--input-bg);
  border: 1px solid var(--border);
}

.slice-image-upload-btn {
  background: var(--primary) !important;
  color: white !important;
  border: none !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 0.75rem !important;
  width: auto !important;
  margin: 0 !important;
}

.slice-image-remove-btn {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #ef4444 !important;
  border: none !important;
  padding: 4px 8px !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  font-size: 0.75rem !important;
  width: auto !important;
  margin: 0 !important;
}

@media screen and (max-width: 1024px) {
  .wheel-row {
    flex-direction: column-reverse;
    gap: 30px;
  }

  .tools {
    flex-wrap: wrap;
    padding: 0 20px;
    justify-content: center;
  }

  .wheel-container {
    max-width: 550px !important;
    max-height: 550px !important;
    width: calc(100% - 40px);
    height: auto;
  }

  .panel,
  .config-bar {
    width: 250px !important;
  }

  .config-bar {
    flex-wrap: wrap;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    border-radius: 15px !important;
  }

  .config-bar button:nth-child(5) {
    grid-column: 1/3;
  }
}