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

body {
  font-family: 'Yu Gothic', 'Hiragino Sans', 'Meiryo', sans-serif;
  background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
  color: #e0e0e0;
  overflow: hidden;
  height: 100vh;
}

#visualizer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.8;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

/* ヘッダー */
#header-title {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5),
               0 0 20px rgba(0, 212, 255, 0.3),
               0 0 30px rgba(0, 212, 255, 0.2);
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(0, 212, 255, 0.1) 20%,
    rgba(0, 212, 255, 0.15) 50%,
    rgba(0, 212, 255, 0.1) 80%,
    transparent 100%
  );
  padding: 15px 50px;
  border-radius: 30px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  backdrop-filter: blur(10px);
  z-index: 10;
  animation: headerGlow 3s ease-in-out infinite;
}

@keyframes headerGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3),
                0 0 20px rgba(0, 212, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5),
                0 0 40px rgba(0, 212, 255, 0.3);
  }
}

/* メインコンテンツ */
main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 40px;
  padding-top: 120px;
  gap: 20px;
}

/* タイマー表示 */
.timer {
  font-size: 8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #00d4ff;
  text-shadow: 0 0 30px rgba(0, 212, 255, 0.6),
               0 0 60px rgba(0, 212, 255, 0.3),
               0 0 100px rgba(0, 212, 255, 0.2);
  animation: fadeIn 1s ease-in;
  transition: all 0.3s ease;
}

.timer.urgent {
  font-size: 10rem;
  color: #ff6b6b;
  text-shadow: 0 0 40px rgba(255, 107, 107, 0.8);
}

.timer.blink {
  animation: blink 1s ease-in-out infinite;
}

.timer.event-start {
  font-size: 7rem;
  color: #51cf66;
  text-shadow: 0 0 40px rgba(81, 207, 102, 0.8);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 開始日時表示 */
.event-datetime {
  font-size: 1.3rem;
  font-weight: 600;
  color: #00d4ff;
  text-align: center;
  margin-top: 5px;
  margin-bottom: 10px;
  letter-spacing: 0.05em;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  transition: margin-top 0.3s ease, margin-bottom 0.3s ease;
}

/* タイマーが大きくなった時に上下の余白を調整して位置を固定 */
.timer.urgent + .event-datetime {
  margin-top: -25px;
  margin-bottom: -5px;
}

/* スライドエリア */
.slide-container {
  background: rgba(20, 20, 40, 0.7);
  backdrop-filter: blur(15px);
  border-radius: 20px;
  padding: 40px 60px;
  max-width: 800px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
              0 0 40px rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.slide-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
  transition: opacity 0.3s ease-in-out;
}

.slide-body {
  font-size: 1.5rem;
  line-height: 1.8;
  text-align: center;
  white-space: pre-line;
  transition: opacity 0.3s ease-in-out;
}

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

/* コントロールパネル */
.controls {
  background: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(10px);
  padding: 20px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
}

.control-group {
  display: flex;
  gap: 15px;
}

.bgm-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ボタン */
button {
  font-family: inherit;
  font-size: 1rem;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-primary {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: white;
  font-size: 1.2rem;
  padding: 15px 40px;
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-bgm {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  min-width: 100px;
}

.btn-bgm:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* 音量コントロール */
#bgm-volume {
  width: 150px;
  cursor: pointer;
}

#volume-display {
  font-size: 0.9rem;
  min-width: 45px;
  text-align: right;
}

/* フッターテキスト */
.footer-text {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
  color: #00d4ff;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.5),
               0 0 20px rgba(0, 212, 255, 0.3),
               0 0 30px rgba(0, 212, 255, 0.2);
  background: linear-gradient(90deg, 
    transparent 0%,
    rgba(0, 212, 255, 0.1) 20%,
    rgba(0, 212, 255, 0.15) 50%,
    rgba(0, 212, 255, 0.1) 80%,
    transparent 100%
  );
  padding: 15px 50px;
  border-radius: 30px;
  border: 1px solid rgba(0, 212, 255, 0.3);
  backdrop-filter: blur(10px);
  animation: footerGlow 3s ease-in-out infinite;
}

@keyframes footerGlow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3),
                0 0 20px rgba(0, 212, 255, 0.2);
  }
  50% {
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5),
                0 0 40px rgba(0, 212, 255, 0.3);
  }
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
  .timer {
    font-size: 6rem;
  }
  
  .timer.urgent {
    font-size: 7rem;
  }
  
  .slide-title {
    font-size: 2rem;
  }
  
  .slide-body {
    font-size: 1.2rem;
  }
}

@media (max-width: 768px) {
  .timer {
    font-size: 4rem;
  }
  
  .slide-container {
    padding: 30px 40px;
  }
  
  .controls {
    flex-direction: column;
    gap: 15px;
  }
  
  .control-group,
  .bgm-controls {
    width: 100%;
    justify-content: center;
  }
}

/* 設定ボタン */
.settings-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: #00d4ff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  padding: 0;
}

.settings-btn:hover {
  background: rgba(0, 212, 255, 0.3);
  transform: rotate(90deg);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.settings-btn svg {
  width: 24px;
  height: 24px;
}

/* 音声ON/OFFボタン */
.sound-toggle-btn {
  position: fixed;
  top: 20px;
  right: 80px;
  z-index: 1000;
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: #00d4ff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  padding: 0;
}

.sound-toggle-btn:hover {
  background: rgba(0, 212, 255, 0.3);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.sound-toggle-btn.muted {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
}

.sound-toggle-btn.muted:hover {
  background: rgba(255, 107, 107, 0.3);
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.5);
}

.sound-toggle-btn svg {
  width: 24px;
  height: 24px;
}

/* トースト通知 */
.toast {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.95) 0%, rgba(0, 150, 200, 0.95) 100%);
  color: white;
  padding: 16px 32px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4);
  font-size: 1rem;
  font-weight: 500;
  z-index: 3000;
  transition: bottom 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  border: 1px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
}

.toast.show {
  bottom: 40px;
}

.toast.error {
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.95) 0%, rgba(220, 50, 50, 0.95) 100%);
  box-shadow: 0 8px 32px rgba(255, 107, 107, 0.4);
}

.toast.success {
  background: linear-gradient(135deg, rgba(81, 207, 102, 0.95) 0%, rgba(50, 180, 70, 0.95) 100%);
  box-shadow: 0 8px 32px rgba(81, 207, 102, 0.4);
}

/* 確認ダイアログ */
.confirm-dialog {
  display: none;
  position: fixed;
  z-index: 3500;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  align-items: center;
  justify-content: center;
}

.confirm-dialog.show {
  display: flex;
}

.confirm-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 15px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 10px 50px rgba(0, 212, 255, 0.3);
  border: 1px solid rgba(0, 212, 255, 0.3);
  animation: confirmSlideIn 0.3s ease-out;
}

@keyframes confirmSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.confirm-content p {
  color: #e0e0e0;
  font-size: 1.1rem;
  margin-bottom: 25px;
  text-align: center;
  line-height: 1.6;
}

.confirm-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.confirm-buttons button {
  flex: 1;
  padding: 12px 24px;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  font-weight: 600;
}

.confirm-buttons .btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #e0e0e0;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.confirm-buttons .btn-secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.confirm-buttons .btn-primary {
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  color: white;
}

.confirm-buttons .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 15px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0, 212, 255, 0.3);
  border: 1px solid rgba(0, 212, 255, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px 30px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 212, 255, 0.05);
}

.modal-header h2 {
  margin: 0;
  color: #00d4ff;
  font-size: 1.8rem;
}

.close-btn {
  background: none;
  border: none;
  color: #00d4ff;
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: rgba(0, 212, 255, 0.2);
  transform: rotate(90deg);
}

.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* フォーム */
.form-section {
  margin-bottom: 30px;
}

.form-section h3 {
  color: #00d4ff;
  font-size: 1.3rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0, 212, 255, 0.2);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #e0e0e0;
  font-size: 0.95rem;
  font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="time"],
.form-group textarea {
  width: 100%;
  padding: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  color: #e0e0e0;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #00d4ff;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.form-group input[type="date"],
.form-group input[type="time"] {
  color-scheme: dark;
}

.btn-auto {
  width: 100%;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: #00d4ff;
  padding: 10px;
  margin-top: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.btn-auto:hover {
  background: rgba(0, 212, 255, 0.2);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* スライダー */
.slider {
  width: 100%;
  height: 8px;
  border-radius: 5px;
  background: linear-gradient(to right, 
    rgba(0, 212, 255, 0.3) 0%, 
    rgba(0, 212, 255, 0.6) 50%, 
    rgba(0, 212, 255, 0.3) 100%);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  margin: 15px 0;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  transition: all 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

.slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
  transition: all 0.3s ease;
}

.slider::-moz-range-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.8);
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #888;
  margin-top: -10px;
}

/* スライドアイテム */
.slide-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.slide-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.slide-item-header h4 {
  color: #00d4ff;
  font-size: 1rem;
  margin: 0;
}

.btn-remove {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
  padding: 5px 12px;
  font-size: 0.9rem;
}

.btn-remove:hover {
  background: rgba(255, 107, 107, 0.3);
}

.btn-add {
  width: 100%;
  background: rgba(0, 212, 255, 0.1);
  border: 1px dashed rgba(0, 212, 255, 0.5);
  color: #00d4ff;
  padding: 12px;
  margin-top: 10px;
}

.btn-add:hover {
  background: rgba(0, 212, 255, 0.2);
  border-style: solid;
}

/* ファイルアップロードエリア */
.file-upload-area {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-upload-area input[type="file"] {
  padding: 8px;
  background: rgba(0, 212, 255, 0.1);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: 8px;
  color: #e0e0e0;
  cursor: pointer;
}

.file-upload-area input[type="file"]::file-selector-button {
  background: rgba(0, 212, 255, 0.2);
  border: 1px solid rgba(0, 212, 255, 0.5);
  color: #00d4ff;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
  transition: all 0.3s ease;
}

.file-upload-area input[type="file"]::file-selector-button:hover {
  background: rgba(0, 212, 255, 0.3);
}

.file-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 6px;
  font-size: 0.9rem;
}

.btn-reset-file {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid rgba(255, 107, 107, 0.5);
  color: #ff6b6b;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-reset-file:hover {
  background: rgba(255, 107, 107, 0.3);
}

/* モーダルフッター */
.modal-footer {
  padding: 20px 30px;
  border-top: 1px solid rgba(0, 212, 255, 0.2);
  background: rgba(0, 212, 255, 0.03);
  flex-shrink: 0;
}

/* フォームアクション */
.form-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
}

.form-actions button {
  padding: 12px 30px;
  font-size: 1rem;
}

/* レスポンシブ対応（モーダル用） */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: 15px 20px;
  }
  
  .modal-body {
    padding: 20px;
  }
  
  .modal-footer {
    padding: 15px 20px;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .form-actions button {
    width: 100%;
  }
}

/* Powered by フッター */
.powered-by-footer {
  position: fixed;
  bottom: 10px;
  right: 20px;
  z-index: 100;
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.powered-by-footer:hover {
  opacity: 1;
}

.footer-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 20px;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.footer-link:hover {
  background: rgba(0, 0, 0, 0.5);
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
}

.footer-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

@media (max-width: 768px) {
  .powered-by-footer {
    bottom: 15px;
  }
  
  .footer-link {
    font-size: 0.7rem;
    padding: 6px 12px;
  }
  
  .footer-logo {
    width: 16px;
    height: 16px;
  }
}

