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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  display: flex;
  flex: 1;
  padding: 20px;
  gap: 30px;
  max-width: 1500px;
  margin: 0 auto;
  align-items: center;
}

.wheel-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wheel-container {
  position: relative;
  width: 850px;
  height: 850px;
}

#wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.pointer {
  position: absolute;
  top: 50%;
  right: -15px;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-right: 30px solid #333;
  filter: drop-shadow(2px 0 4px rgba(0, 0, 0, 0.3));
  z-index: 10;
}

.center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #ddd;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
  color: #333;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.center-btn:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

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

.sidebar {
  width: 380px;
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  height: 850px;
}

.logo {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 600;
  color: #333;
  z-index: 50;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
}

.logo-icon svg {
  width: 36px;
  height: 36px;
}

.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 15px;
  border-bottom: 1px solid #ddd;
}

.tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  font-size: 1rem;
  color: #888;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: #333;
}

.tab.active {
  color: #333;
  border-bottom-color: #4a90d9;
  font-weight: 500;
}

.tab-count {
  font-weight: normal;
  color: #aaa;
  font-size: 0.9em;
}

.tab-content {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.tab-content.active {
  display: flex;
}

.entries-textarea {
  flex: 1;
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  line-height: 1.6;
}

.entries-textarea:focus {
  outline: none;
  border-color: #aaa;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: #888;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item span:first-child {
  color: #888;
  font-size: 13px;
  margin-right: 10px;
}

.history-name {
  flex: 1;
  font-weight: 500;
}

.history-empty {
  color: #aaa;
  text-align: center;
  padding: 40px 20px;
}

.clear-history {
  margin-top: 10px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  color: #666;
  cursor: pointer;
  font-size: 13px;
}

.clear-history:hover {
  background: #f5f5f5;
}

.spin-time {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #eee;
}

.spin-time label {
  display: block;
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}

.time-options {
  display: flex;
  gap: 8px;
}

.time-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  transition: all 0.2s;
}

.time-btn:hover {
  border-color: #aaa;
}

.time-btn.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #fff;
}

.winner-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.winner-modal.show {
  opacity: 1;
  visibility: visible;
}

.winner-content {
  background: #fff;
  padding: 50px 70px;
  border-radius: 12px;
  text-align: center;
  transform: scale(0.8);
  transition: transform 0.3s;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.winner-modal.show .winner-content {
  transform: scale(1);
}

.winner-content h2 {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 15px;
}

.winner-name {
  font-size: 2.5rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 25px;
}

.winner-content button {
  padding: 12px 30px;
  border: none;
  border-radius: 6px;
  background: #4a90d9;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.winner-content button:hover {
  background: #3a7bc8;
}

.footer {
  padding: 12px 20px;
  background: #f8f8f8;
  border-top: 1px solid #eee;
  font-size: 13px;
  color: #666;
  text-align: center;
  margin-top: auto;
}

.footer a {
  color: #4a90d9;
  text-decoration: none;
}

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

.footer-privacy {
  margin-top: 4px;
  font-size: 12px;
  color: #999;
}

@media (max-width: 1200px) {
  .container {
    flex-direction: column;
    padding: 15px;
    padding-top: 60px;
    gap: 20px;
  }

  .wheel-container {
    width: 600px;
    height: 600px;
  }

  #wheel {
    width: 600px;
    height: 600px;
  }

  .sidebar {
    width: 100%;
    max-width: 600px;
    height: auto;
    min-height: 400px;
  }
}

@media (max-width: 650px) {
  .container {
    padding: 10px;
    padding-top: 50px;
    gap: 15px;
  }

  .wheel-container {
    width: calc(100vw - 20px);
    height: calc(100vw - 20px);
    max-width: 500px;
    max-height: 500px;
  }

  #wheel {
    width: 100%;
    height: 100%;
  }

  .sidebar {
    max-width: 100%;
    min-height: 350px;
    padding: 15px;
  }

  .logo {
    top: 10px;
    left: 10px;
    font-size: 1.1rem;
  }

  .logo-icon {
    width: 28px;
    height: 28px;
  }

  .logo-icon svg {
    width: 28px;
    height: 28px;
  }

  .center-btn {
    width: 60px;
    height: 60px;
    font-size: 10px;
  }

  .pointer {
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    border-right: 24px solid #333;
    right: -12px;
  }

  .winner-content {
    padding: 30px 40px;
  }

  .winner-name {
    font-size: 1.8rem;
  }

  .footer {
    padding: 10px 15px;
    font-size: 12px;
  }

  .footer-privacy {
    font-size: 11px;
  }
}
