/* Wheel-specific styles - inherits from main site style.css */
.wheel-container {
  text-align: center;
  padding: 1rem;
}

.wheel-container h1 {
  margin-top: 0;
  margin-bottom: 2rem;
}

/* Wheel-specific styles */
.wheel-container * { box-sizing: border-box; }

.wheel-container {
  font-family: system-ui, Arial, sans-serif;
  background: #111;
  color: #f5f5f5;
  text-align: center;
  padding: 2rem 1rem;
  border-radius: 15px;
}

.wheel-container h1 { margin-top: 0; font-weight: 600; }

.wheel-container #wheel-stage {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  padding: 0 1rem;
}

.wheel-container .winners-panel {
  width: 100%;
  max-width: 500px;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 2rem;
  transition: opacity 0.3s ease;
}

.wheel-container .winners-panel[aria-hidden="true"] {
  display: none;
}

.wheel-container .winner-announcement {
  display: none;
  position: absolute;
  top: 250px;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(135deg, #4caf50, #2e7d32);
  color: white;
  text-align: center;
  padding: 20px 30px;
  border-radius: 20px;
  font-size: 24px;
  font-weight: bold;
  box-shadow: 0 12px 40px rgba(76, 175, 80, 0.4);
  z-index: 1000;
  animation: winner-glow 2s ease-in-out infinite alternate;
  border: 4px solid #ffffff;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  min-width: 300px;
  max-width: 450px;
  word-break: keep-all;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.4;
  white-space: pre-wrap;
}

@keyframes winner-glow {
  from { box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); }
  to { box-shadow: 0 4px 20px rgba(76, 175, 80, 0.6); }
}

.wheel-container .winners-panel h3 {
  margin: 0 0 1rem 0;
  font-size: 1.1rem;
  color: #fff;
  text-align: center;
}

.wheel-container .winners-panel ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.4rem;
}

.wheel-container .winners-panel li {
  background: #2a2a2a;
  color: #fff;
  padding: 0.5rem 0.6rem;
  border-radius: 4px;
  font-size: 0.85rem;
  border-left: 3px solid #4caf50;
  display: flex;
  align-items: flex-start;
  position: relative;
  min-height: 2rem;
}

.wheel-container .winners-panel li .winner-number {
  background: #4caf50;
  color: #000;
  font-weight: bold;
  font-size: 0.7rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  margin-top: 0.1rem;
  min-width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

.wheel-container .winners-panel li .winner-name {
  flex: 1;
  word-break: break-word;
  line-height: 1.2;
}

.wheel-container .winners-panel .empty-message {
  color: #666;
  font-style: italic;
  text-align: center;
  padding: 1rem 0;
  border: none !important;
  background: transparent !important;
}

.wheel-container #wheel-container {
  position: relative;
  width: 500px;
  max-width: 100%;
  margin: 1rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.wheel-container #confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.wheel-container #wheel {
  width: 100%;
  height: auto;
  border-radius: 50%;
  box-shadow: 0 0 0 6px #222, 0 0 12px rgba(0,0,0,0.6), inset 0 0 20px rgba(0,0,0,0.5);
  background: #222;
}

.wheel-container #pointer {
  position: absolute;
  top: -18px; /* above wheel */
  left: 50%;
  transform: translateX(-50%); /* no rotation */
  width: 0;
  height: 0;
  border-left: 18px solid transparent;
  border-right: 18px solid transparent;
  border-top: 28px solid #ffeb3b; /* naturally points downward */
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6));
}

.wheel-container #controls { 
  margin: 1rem 0; 
  text-align: center;
  width: 100%;
}

.wheel-container #auto-controls {
  margin: 0.5rem 0;
  text-align: center;
  font-size: 0.9rem;
}

.wheel-container #auto-controls label {
  color: #ddd;
  cursor: pointer;
}

.wheel-container #auto-controls input[type="checkbox"] {
  margin-right: 0.5rem;
}
.wheel-container #controls button {
  background: linear-gradient(#444,#222);
  color: #fff;
  border: 1px solid #555;
  padding: 0.75rem 1.25rem;
  margin: 0 0.5rem 0.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .25s, transform .15s;
}
.wheel-container #controls button:hover:not(:disabled) { background: linear-gradient(#555,#333); }
.wheel-container #controls button:active:not(:disabled) { transform: scale(.96); }
.wheel-container #controls button:disabled { opacity: .4; cursor: not-allowed; }

#result {
  font-size: 1.4rem;
  font-weight: 600;
  min-height: 2.2rem;
  margin-top: .5rem;
}


/* Steal animation overlay */
#steal-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 80;
}

.wheel-container .steal-label {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: center center;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: .35rem .6rem;
  border-radius: 6px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(0,0,0,0.6);
  white-space: nowrap;
}

/* simple shake class for the wheel-stage during steal */
.wheel-container .shake {
  animation: steal-shake 550ms cubic-bezier(.36,.07,.19,.97);
}
@keyframes steal-shake {
  0% { transform: translateY(0); }
  20% { transform: translateY(-6px) rotate(-1deg); }
  40% { transform: translateY(4px) rotate(1deg); }
  60% { transform: translateY(-3px) rotate(-0.6deg); }
  80% { transform: translateY(2px) rotate(0.4deg); }
  100% { transform: translateY(0); }
}

.wheel-container #editorPanel h2 { margin: 0 0 .5rem; font-size: 1.2rem; }
.wheel-container #editorPanel h3 { 
  margin: 1rem 0 0.5rem 0; 
  font-size: 1rem; 
  color: #ddd;
}
.wheel-container #editorPanel textarea {
  width: 100%;
  background: #1d1d1d;
  border: 1px solid #333;
  color: #fff;
  border-radius: 6px;
  padding: .75rem .85rem;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  resize: vertical;
  line-height: 1.35;
}
.wheel-container #editorPanel textarea:focus { outline: 2px solid #4caf50; }
.wheel-container .editor-actions { margin-top: .5rem; display: flex; flex-direction: column; gap: .5rem; }
.wheel-container .editor-actions button { 
  width: 100%; 
  background: linear-gradient(#444,#222);
  color: #fff;
  border: 1px solid #555;
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background .25s, transform .15s;
}
.wheel-container .editor-actions button:hover:not(:disabled) { background: linear-gradient(#555,#333); }
.wheel-container .editor-actions button:active:not(:disabled) { transform: scale(.96); }



.wheel-container .link-display {
  margin-top: 1rem;
  padding: 1rem;
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  position: relative;
  z-index: 10;
}

.wheel-container .link-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.wheel-container .link-display h4 {
  margin: 0;
  color: #4caf50;
  font-size: 1rem;
}

.wheel-container .link-display .close-btn {
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
}

.wheel-container .link-display .close-btn:hover {
  background: #444;
  color: #fff;
}

.wheel-container .link-display textarea {
  width: 100%;
  background: #1d1d1d;
  border: 1px solid #555;
  color: #fff;
  border-radius: 4px;
  padding: 0.5rem;
  font-family: ui-monospace, Consolas, 'Courier New', monospace;
  font-size: 0.9rem;
  resize: vertical;
}

.wheel-container .link-display small {
  color: #aaa;
  font-style: italic;
}

.wheel-container .option-row { margin-top: .5rem; color: #ddd; }
.wheel-container .option-row label { font-size: .95rem; cursor: pointer; }
.wheel-container .option-row input[type="checkbox"] { margin-right: .5rem; transform: translateY(1px); }

.wheel-container .option-row input[type="text"] {
  flex: 1;
  background: #1d1d1d;
  border: 1px solid #555;
  color: #fff;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.wheel-container .option-row input[type="text"]:focus {
  outline: 2px solid #4caf50;
  border-color: #4caf50;
}

/* Side panel */
.wheel-container .side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: #181818;
  box-shadow: -4px 0 12px rgba(0,0,0,0.4);
  border-left: 1px solid #252525;
  padding: 1rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  transform: translateX(100%);
  transition: transform .4s cubic-bezier(.65,.05,.36,1), opacity .35s ease;
  opacity: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}
.wheel-container .side-panel.open {
  transform: translateX(0);
  opacity: 1;
}
.panel-header { display:flex; justify-content: space-between; align-items:center; }
.panel-header h2 { font-size:1.15rem; margin:0; }
.close-btn {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: .25rem .4rem;
  border-radius: 4px;
}
.close-btn:hover { background:#222; color:#fff; }



@media (max-width: 780px) {
  .wheel-container .side-panel { width: 80%; max-width: 420px; }
  
  .wheel-container .editor-actions button {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
  }
  
  .wheel-container .link-display {
    padding: 0.75rem;
  }
  
  .wheel-container .link-display textarea {
    font-size: 0.8rem;
  }
}

/* On very small screens reduce wheel size (just scale canvas container) */
@media (max-width: 600px) {
  .wheel-container #wheel-container { width: 360px; }
  
  .wheel-container .winner-announcement {
    top: 140px;
    padding: 15px 20px;
    font-size: 20px;
    border-radius: 15px;
    min-width: 240px;
    max-width: 340px;
  }
  
  .wheel-container .winners-panel {
    max-width: 360px;
  }
  
  .wheel-container .winners-panel ul {
    grid-template-columns: 1fr;
  }
  
  .wheel-container .side-panel {
    width: 90%;
    max-width: none;
    padding: 0.75rem 0.75rem 1.5rem;
    gap: 0.5rem;
  }
  
  .wheel-container .editor-actions button {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .wheel-container .hint {
    font-size: 0.8rem;
    margin-bottom: 1rem;
  }
  
  .wheel-container .link-display {
    margin-bottom: 1rem;
  }
}

.hint { font-size: .85rem; opacity: .65; max-width: 650px; margin: 1.5rem auto 0; }

@media (prefers-color-scheme: light) {
  .wheel-container { background: #fafafa; color: #222; }
  .wheel-container #wheel { box-shadow: 0 0 0 6px #ddd, 0 0 12px rgba(0,0,0,0.15), inset 0 0 20px rgba(0,0,0,0.15); }
  .wheel-container #pointer { filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3)); }
  .wheel-container #controls button { background: linear-gradient(#ededed,#cfcfcf); color: #111; border-color: #bbb; }
  .wheel-container #controls button:hover:not(:disabled) { background: linear-gradient(#fff,#ddd); }
}
