/* スタイルリセット */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background-color: #f4f9f4;
  color: #333;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

.container {
  max-width: 100%;
  padding: 20px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 30px;
}

.logo {
  margin: 0 auto;
  max-width: 180px;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.logo:hover {
  opacity: 0.8;
}

.logo:active {
  opacity: 0.6;
}

/* プログレスドット */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 15px auto;
}

.dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #e0e0e0;
  display: inline-block;
  transition: background-color 0.3s ease;
}

.dot.active {
  background-color: #e53935;
  box-shadow: 0 0 5px rgba(244, 3, 3, 0.5);
}

h2 {
  color: #2e7d32;
  font-size: 1.5rem;
  margin-bottom: 20px;
  text-align: center;
}

#ceremony-title {
  color: #000;
  font-size: 1.3rem;
  margin-bottom: 15px;
  padding: 10px 20px;
  border-radius: 5px;
  text-align: center;
  display: block;
}

.highlight {
  color: #e53935;
  font-weight: bold;
}

.welcome-message {
  color: #2e7d32;
  background-color: #e8f5e9;
  padding: 12px;
  border-radius: 5px;
  margin-bottom: 5px;
  text-align: center;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ログイン情報スタイル */
.congrats-text {
  text-align: center;
  margin-bottom: 15px;
  font-size: 1rem;
  line-height: 1.5;
}

.login-instruction {
  text-align: center;
  margin-bottom: 20px;
  font-size: 0.95rem;
  color: #555;
}

.login-info {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  padding: 15px;
  margin-bottom: 20px;
}

.login-field {
  display: flex;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.login-field:last-child {
  margin-bottom: 0;
}

.login-label {
  font-weight: bold;
  width: 100px;
}

.login-value {
  font-family: monospace;
  letter-spacing: 1px;
  background-color: #f1f1f1;
  padding: 2px 8px;
  border-radius: 3px;
  color: #333;
}

.password-dots {
  letter-spacing: 2px;
  color: #333;
}

.question-section,
.ceremony-section,
.success-section,
.portal-section {
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.question p {
  margin-bottom: 15px;
  font-size: 1rem;
}

#answer-form {
  margin-top: 20px;
}

input[type="text"] {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 1rem;
}

button {
  background-color: #2e7d32;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.3s;
  width: 100%;
}

button:hover {
  background-color: #1b5e20;
}

button:disabled {
  background-color: #9e9e9e;
  cursor: not-allowed;
}

#result-message {
  margin: 20px 0;
  padding: 10px;
  border-radius: 5px;
  text-align: center;
}

.success {
  background-color: #e8f5e9;
  color: #2e7d32;
}

.error {
  background-color: #ffebee;
  color: #c62828;
}

.hidden {
  display: none !important;
}

/* ドキュメントスタイル */
.document {
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  padding: 0;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-top: 5px;
}

.document-header {
  border-bottom: 1px solid #eee;
  padding: 15px;
  background-color: #f9f9f9;
}

.document-title {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.document-ref {
  font-size: 0.8rem;
  color: #666;
}

.document-content {
  padding: 15px;
}

.document-content p {
  margin-bottom: 10px;
  line-height: 1.7;
}

.document-footer {
  border-top: 1px solid #eee;
  padding: 15px;
  font-size: 0.8rem;
  text-align: right;
  color: #666;
}

.label {
  font-weight: bold;
  display: inline-block;
  width: 60px;
}

#day-of-week,
#company-name {
  display: inline;
  padding: 0;
  border: none;
  outline: none;
  background-color: transparent;
  border-bottom: none;
  min-width: 1.5em;
  text-align: center;
  color: inherit;
}

#day-of-week:focus,
#company-name:focus {
  border-bottom: none;
  color: inherit;
}

/* 新入社員ポータルのスタイル */
.portal-section {
  padding: 0;
  overflow: hidden;
}

.portal-section h2 {
  background-color: #2e7d32;
  color: white;
  margin: 0;
  padding: 15px;
  font-size: 1.2rem;
}

.portal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
}

.user-info {
  display: flex;
  align-items: center;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #e0e0e0;
  margin-right: 10px;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23999"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
  background-size: 60%;
  background-position: center;
  background-repeat: no-repeat;
}

.user-details {
  font-size: 0.9rem;
}

.user-name {
  font-weight: bold;
  margin-bottom: 2px;
}

.user-position {
  color: #666;
  font-size: 0.8rem;
}

.notifications {
  position: relative;
}

.notification-count {
  display: inline-block;
  background-color: #e53935;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  text-align: center;
  line-height: 20px;
  font-size: 0.7rem;
}

.portal-menu {
  display: flex;
  border-bottom: 1px solid #eee;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.portal-menu::-webkit-scrollbar {
  display: none;
}

.menu-item {
  flex: 1;
  min-width: 70px;
  text-align: center;
  padding: 10px;
  font-size: 0.8rem;
  color: #666;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.menu-item.active {
  color: #2e7d32;
  border-bottom-color: #2e7d32;
}

.icon {
  display: block;
  width: 24px;
  height: 24px;
  margin: 0 auto 5px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.icon-home {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232e7d32"><path d="M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z"/></svg>');
}

.icon-schedule {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M19 3h-1V1h-2v2H8V1H6v2H5c-1.11 0-1.99.9-1.99 2L3 19c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V8h14v11zM7 10h5v5H7z"/></svg>');
}

.icon-documents {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm2 16H8v-2h8v2zm0-4H8v-2h8v2zm-3-5V3.5L18.5 9H13z"/></svg>');
}

.icon-contact {
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23666"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
}

.portal-content {
  padding: 15px;
  max-height: 60vh;
  overflow-y: auto;
}

.welcome-card,
.announcement-card,
.task-card {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
  overflow: hidden;
}

.welcome-card {
  padding: 15px;
  background-color: #e8f5e9;
  border-left: 4px solid #2e7d32;
}

.welcome-card h3 {
  color: #2e7d32;
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border-bottom: 1px solid #eee;
}

.card-header h3 {
  font-size: 1rem;
  color: #333;
}

.date {
  font-size: 0.8rem;
  color: #666;
}

.card-content {
  padding: 15px;
}

.announcement {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.announcement:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.announcement h4 {
  font-size: 0.95rem;
  margin-bottom: 5px;
}

.announcement p {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 8px;
}

.action-link {
  display: inline-block;
  color: #2e7d32;
  font-size: 0.8rem;
  text-decoration: none;
}

.task-list {
  padding: 15px;
}

.task {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 10px;
  border-bottom: 1px solid #f5f5f5;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.task:hover {
  background-color: #f5f5f5;
}

.task:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.task input[type="checkbox"] {
  margin-right: 10px;
}

.task label {
  font-size: 0.9rem;
  flex: 1;
  cursor: pointer;
}

.due-date {
  font-size: 0.75rem;
  color: #e53935;
}

.task .important-task {
  color: #e53935;
  font-weight: bold;
}

/* スマホ最適化 */
@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  h2 {
    font-size: 1.3rem;
  }

  .question-section,
  .ceremony-section,
  .success-section {
    padding: 15px;
  }

  button {
    padding: 12px 15px;
  }

  .document-content {
    padding: 12px;
  }

  .label {
    width: 50px;
    font-size: 0.85rem;
  }

  #ceremony-title {
    font-size: 1.2rem;
    padding: 8px 16px;
  }

  .welcome-message {
    font-size: 0.9rem;
    padding: 10px;
  }

  .dot {
    width: 12px;
    height: 12px;
  }

  .portal-content {
    max-height: 65vh;
  }

  .login-field {
    flex-direction: column;
  }

  .login-label {
    width: 100%;
    margin-bottom: 5px;
  }
}

/* スマホ最適化のさらなる改善 */
@media (max-width: 768px) {
  body {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
  }

  .training-modal {
    width: 95%;
    max-height: 90vh;
  }

  .modal-content {
    max-height: calc(90vh - 60px);
    padding: 15px;
  }

  .piece-icon {
    font-size: 24px;
  }

  .pipe-piece {
    width: 70px;
    height: 70px;
  }

  .visual-piece {
    width: 70px;
    height: 70px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .piece-tooltip {
    font-size: 10px;
  }

  .puzzle-pieces,
  .puzzle-solution {
    padding: 8px;
    gap: 8px;
  }

  .step-content p {
    font-size: 0.9rem;
  }

  .step-progress .progress-text {
    font-size: 0.85rem;
  }
}

/* パズルコンテナの高さを確保 */
.puzzle-container {
  margin-bottom: 20px;
  min-height: 240px;
}

/* 研修ページスタイル */
.training-section {
  background-color: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.training-content {
  margin-top: 20px;
}

.training-content p {
  margin-bottom: 15px;
  font-size: 1rem;
}

.training-progress {
  margin-top: 30px;
  padding: 15px;
  background-color: #f5f5f5;
  border-radius: 5px;
}

.progress-bar {
  height: 10px;
  background-color: #e0e0e0;
  border-radius: 5px;
  margin-bottom: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: #2e7d32;
  border-radius: 5px;
  transition: width 1.5s ease-in-out;
}

.progress-text {
  font-size: 0.9rem;
  color: #555;
  text-align: center;
}

.completed-tasks {
  color: #4caf50;
  font-size: 0.9rem;
  text-align: center;
  padding: 15px 0;
}

.back-to-portal-btn {
  display: block;
  margin-top: 20px;
  background-color: #ff9500;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s;
}

.back-to-portal-btn:hover {
  background-color: #ff7d00;
}

/* 研修再受講ボタン */
#retake-training-btn {
  display: block;
  margin: 15px auto 0;
  background-color: #4cd964;
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#retake-training-btn:hover {
  background-color: #3cb054;
}

#retake-training-btn.hidden {
  display: none;
}

/* 研修一覧スタイル */
.training-list {
  margin: 20px 0;
}

.training-item {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  background-color: #f9f9f9;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: 1px solid #e0e0e0;
}

.training-item:hover {
  background-color: #f0f0f0;
}

.training-icon {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 15px;
  overflow: hidden;
}

.training-icon img {
  width: 100%;
  height: 100%;
}

.training-info {
  flex: 1;
}

.training-info h3 {
  margin-bottom: 5px;
  color: #2e7d32;
  font-size: 1.1rem;
}

.training-info p {
  color: #666;
  font-size: 0.9rem;
}

.training-notification {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  background-color: #e53935;
  border-radius: 50%;
  display: block;
}

.training-notification.hidden {
  display: none;
}

/* 既存のトレーニングコンテンツスタイルの調整 */
.training-content {
  margin-top: 20px;
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  border: 1px solid #e0e0e0;
}

.training-content h3 {
  color: #2e7d32;
  margin-bottom: 15px;
  font-size: 1.2rem;
}

.start-training-btn {
  background-color: #2e7d32;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.3s;
  margin-top: 10px;
  margin-left: auto;
  white-space: nowrap;
}

.start-training-btn:hover {
  background-color: #1b5e20;
}

/* 研修タブのスタイル調整 */
.training-list-tab {
  margin-top: 10px;
}

.training-list-tab h3 {
  margin-bottom: 10px;
  color: #2e7d32;
  font-size: 1.2rem;
}

/* 通知のスタイル調整 */
.notification-count.hidden {
  display: none;
}

/* ポータルコンテンツのスタイル */
.portal-content {
  margin-top: 20px;
}

/* フッター注釈 */
.footer-note {
  color: #757575;
  font-size: 10px;
  text-align: center;
  margin-top: 30px;
  padding: 10px 20px;
  line-height: 1.4;
}

/* VISUAL AI研修モーダル */
.training-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  background-color: #101820;
  border-radius: 12px;
  z-index: 1001;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.visual-ai-interface {
  color: #e0e0e0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: #1a242f;
  border-bottom: 1px solid #2a3744;
  flex-shrink: 0;
}

.modal-title {
  font-family: "SF Pro Display", sans-serif;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 1px;
  color: #4cd964;
}

.close-btn {
  color: #9e9e9e;
  font-size: 1.5rem;
  cursor: pointer;
  width: 25px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.close-btn:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.1);
}

.modal-content {
  padding: 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  max-height: calc(85vh - 60px);
}

/* ステップインジケータ */
.step-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 25px;
  position: relative;
}

.step-indicator:after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #2a3744;
  transform: translateY(-50%);
  z-index: 1;
}

.step {
  position: relative;
  width: 32%;
  text-align: center;
  font-size: 0.9rem;
  color: #9e9e9e;
  z-index: 2;
  padding-top: 25px;
}

.step:before {
  content: attr(data-step);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 24px;
  background-color: #2a3744;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #e0e0e0;
  transition: all 0.3s ease;
}

.step.active {
  color: #4cd964;
}

.step.active:before {
  background-color: #4cd964;
  color: #101820;
}

.step.completed:before {
  background-color: #4cd964;
  color: #101820;
}

/* ステップコンテンツ */
.step-content {
  background-color: #1a242f;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.step-content h3 {
  color: #4cd964;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.step-content p {
  color: #e0e0e0;
  margin-bottom: 20px;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ゲームエリア */
.game-area {
  position: relative;
  width: 100%;
  background-color: #101820;
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid #2a3744;
  overflow: hidden;
  padding: 15px;
  min-height: 300px;
}

/* お絵描き要素 */
.canvas-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.model-container,
.draw-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px;
  color: #9e9e9e;
  font-size: 0.8rem;
}

.model-canvas,
.draw-canvas {
  margin-top: 8px;
  border-radius: 5px;
  background-color: #1a242f;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.clear-button,
.submit-button {
  padding: 8px 16px;
  margin: 0 5px;
  border-radius: 20px;
  border: none;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-button {
  background-color: #555;
  color: #fff;
  margin-top: 10px;
}

.submit-button {
  background-color: #ff9500;
  color: #101820;
}

.clear-button:hover {
  background-color: #666;
}

.submit-button:hover {
  background-color: #ffaa33;
}

/* 波形コンテナ */
.wave-container {
  height: 150px;
  background-color: #101820;
  border-radius: 8px;
  border: 1px solid #2a3744;
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

#waveCanvas {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
}

/* ステッププログレス */
.step-progress {
  text-align: center;
  color: #9e9e9e;
  font-size: 0.9rem;
}

/* 完了ステップ */
.score {
  font-size: 1.5rem;
  font-weight: bold;
  color: #4cd964;
}

.score-container {
  background-color: #1a2430;
  border-radius: 8px;
  padding: 15px 15px 15px 0;
  margin: 15px 0;
}

.training-time {
  color: #4cd964;
  font-weight: bold;
  font-size: 1.5rem;
}

.score-comment {
  color: #555;
  font-size: 0.95rem;
  text-align: center;
  margin-top: 10px;
}

.banzai-text {
  color: #ff2d55;
  font-weight: bold;
  display: block;
  margin-top: 5px;
}

.bow-message {
  color: #ff9500;
  font-size: 0.95rem;
  font-weight: 500;
  margin: 20px 0;
  padding: 15px;
  text-align: center;
  border: 1px dashed #ff9500;
  border-radius: 8px;
}

#complete-training {
  display: block;
  margin: 20px auto 0;
  background-color: #4cd964;
  color: #101820;
  font-weight: bold;
  padding: 12px 30px;
  border-radius: 30px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  width: auto;
}

#complete-training.bow-active {
  background-color: #ff2d55;
}

#complete-training.bow-active::before {
  content: "次に進む";
}

#complete-training::before {
  content: "研修を終了する";
}

.button-container {
  position: relative;
  width: 100%;
  height: 100%;
}

#complete-training span {
  opacity: 0;
  position: absolute;
}

@keyframes bounce {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
  75% {
    transform: translateY(-5px);
  }
  100% {
    transform: translateY(0);
  }
}

#complete-training.bounce {
  animation: bounce 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 次に進むボタンがアクティブな状態で色を変更 */
#complete-training.bow-active ~ .modal-content .step.active:before,
#complete-training.bow-active ~ .modal-content .step.completed:before {
  background-color: #ff2d55;
}

#complete-training.bow-active ~ .modal-content .step:before {
  background-color: #ff2d55;
  color: #101820;
}

#complete-training.bow-active ~ .modal-content .step {
  color: #ff2d55;
}

#complete-training.bow-active ~ .modal-content h3 {
  color: #ff2d55;
}

#complete-training.bow-active ~ .modal-content .modal-title {
  color: #ff2d55;
}

#complete-training.bow-active ~ .step-content .step-progress .progress-text {
  color: #ff2d55;
}

/* 拡張研修モード用のスタイル */
.extended-training-mode {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #101820;
  z-index: 2000;
  color: #fff;
  overflow: auto;
}

.extended-training-header {
  background-color: #1a242f;
  padding: 15px;
  border-bottom: 1px solid #2a3744;
}

.extended-training-title {
  color: #ff2d55;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
}

.extended-training-content {
  padding: 20px;
}

.extended-training-section {
  background-color: #1a242f;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
}

.extended-training-section h3 {
  color: #ff2d55;
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.extended-training-section p {
  margin-bottom: 10px;
  line-height: 1.6;
}

.extended-training-controls {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.extended-training-button {
  background-color: #ff2d55;
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 30px;
  cursor: pointer;
  font-weight: bold;
  margin: 0 10px;
  width: auto;
}

.extended-training-button:hover {
  background-color: #e6194b;
}

/* 研修前の案内モーダルのスタイル */
.pre-training-guide {
  padding: 20px;
  text-align: center;
}

.pre-training-guide h3 {
  color: #4cd964;
  margin-bottom: 20px;
  font-size: 1.4rem;
}

.pre-training-instruction {
  font-size: 1.1rem;
  margin-bottom: 30px;
  line-height: 1.6;
  color: #fff;
  font-weight: 500;
}

.phone-icon {
  display: flex;
  justify-content: center;
  margin: 30px 0;
}

.phone-stand-illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  height: 120px;
  margin: 20px 0;
}

.phone-device {
  width: 40px;
  height: 80px;
  background-color: #1a242f;
  border: 2px solid #4cd964;
  border-radius: 5px;
  position: relative;
  z-index: 2;
}

.phone-hand {
  position: absolute;
  bottom: -10px;
  width: 70px;
  height: 60px;
  background-color: #f5d0c5;
  border-radius: 15px 15px 5px 5px;
  z-index: 1;
  transform: translateY(30px);
  clip-path: polygon(0% 0%, 100% 0%, 90% 100%, 10% 100%);
}

.phone-hand::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 10px;
  background-color: #f5d0c5;
  border-radius: 0 0 10px 10px;
}

.start-modal-btn {
  background-color: #4cd964;
  color: #101820;
  font-weight: bold;
  padding: 15px 30px;
  border-radius: 30px;
  margin-top: 20px;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.start-modal-btn:hover {
  background-color: #3ab953;
  transform: translateY(-2px);
}

/* パズルコンテナ */
.puzzle-container {
  margin-bottom: 20px;
  min-height: 240px;
}

.puzzle-pieces {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  min-height: 80px;
  padding: 10px;
  background-color: #101820;
  border-radius: 8px;
  border: 1px solid #2a3744;
}

.puzzle-solution {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 80px;
  padding: 10px;
  background-color: #0a1016;
  border-radius: 8px;
  border: 1px dashed #4cd964;
  position: relative;
}

.puzzle-solution::before {
  content: "ここに並べ替え";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #4cd964;
  opacity: 0.5;
  font-size: 14px;
  pointer-events: none;
}

.puzzle-solution:not(:empty)::before {
  display: none;
}

.puzzle-piece {
  padding: 10px 15px;
  background-color: #1a242f;
  border: 1px solid #2a3744;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #e0e0e0;
  user-select: none;
}

.visual-piece {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  width: 80px;
  height: 80px;
}

.piece-icon {
  font-size: 30px;
  margin-bottom: 8px;
}

.piece-tooltip {
  font-size: 12px;
  text-align: center;
}

.puzzle-piece:hover {
  background-color: #233040;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.puzzle-piece.dragging {
  opacity: 0.5;
}

.puzzle-piece.completed {
  background-color: #2a5d3e;
  border-color: #4cd964;
}

.puzzle-solution .puzzle-piece {
  margin: 0;
}

.puzzle-check-btn {
  display: block;
  margin: 10px auto;
  background-color: #ff9500;
  color: #101820;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: bold;
}

.puzzle-check-btn:hover {
  background-color: #ffaa33;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  10%,
  30%,
  50%,
  70%,
  90% {
    transform: translateX(-5px);
  }
  20%,
  40%,
  60%,
  80% {
    transform: translateX(5px);
  }
}

.puzzle-solution.shake {
  animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* パイプラインパズルのスタイル */
.pipe-piece {
  background-color: #1a242f;
  border: 1px solid #2a3744;
  position: relative;
  transition: all 0.3s ease;
}

.pipe-piece .piece-icon {
  font-size: 24px;
  font-family: monospace;
  font-weight: bold;
  color: #9e9e9e;
  text-align: center;
}

.pipe-piece.connected {
  border-color: #4cd964;
}

.pipe-piece.connected .piece-icon {
  color: #4cd964;
}

.pipe-piece.not-connected {
  border-color: #ff3b30;
}

.pipe-piece.not-connected .piece-icon {
  color: #ff3b30;
}

.pipe-piece.completed {
  background-color: rgba(76, 217, 100, 0.2);
  border-color: #4cd964;
}

.pipe-piece.completed .piece-icon {
  color: #4cd964;
}

/* パイプの接続を視覚的に表現 */
.pipe-left::before,
.pipe-right::after,
.pipe-top::before,
.pipe-bottom::after {
  content: "";
  position: absolute;
  background-color: #9e9e9e;
  z-index: 5;
}

.pipe-left-right::before,
.pipe-left-right::after,
.pipe-left-right-bottom::before,
.pipe-left-right-bottom::after,
.pipe-right-top::after {
  content: "";
  position: absolute;
  background-color: #9e9e9e;
}

/* 左接続 */
.pipe-left::before {
  width: 10px;
  height: 4px;
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
}

/* 右接続 */
.pipe-right::after {
  width: 10px;
  height: 4px;
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
}

/* 左右接続 */
.pipe-left-right::before {
  width: 10px;
  height: 4px;
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
}

.pipe-left-right::after {
  width: 10px;
  height: 4px;
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
}

/* 左右下接続 */
.pipe-left-right-bottom::before {
  width: 10px;
  height: 4px;
  top: 50%;
  left: -5px;
  transform: translateY(-50%);
}

.pipe-left-right-bottom::after {
  width: 10px;
  height: 4px;
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
}

/* 右上接続 */
.pipe-right-top::after {
  width: 10px;
  height: 4px;
  top: 50%;
  right: -5px;
  transform: translateY(-50%);
}

/* 接続状態のスタイル */
.connected::before,
.connected::after {
  background-color: #4cd964 !important;
}

.not-connected::before,
.not-connected::after {
  background-color: #ff3b30 !important;
}

.piece-tooltip {
  font-size: 12px;
  text-align: center;
}

.puzzle-piece:hover {
  background-color: #233040;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* 医薬品製造プロセスパズルのスタイル */
.process-piece {
  width: 60px;
  height: 70px;
  background-color: #1a242f;
  border: 1px solid #2a3744;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 5px;
}

.process-piece .piece-icon {
  font-size: 28px;
  margin-bottom: 5px;
}

.process-piece .piece-tooltip {
  font-size: 12px;
  color: #e0e0e0;
  text-align: center;
}

.process-piece.connected {
  border-color: #4cd964;
  background-color: rgba(76, 217, 100, 0.1);
}

.process-piece.not-connected {
  border-color: #ff3b30;
  background-color: rgba(255, 59, 48, 0.1);
}

/* プロセスの接続を視覚的に表現（右向き矢印） */
.process-right::after,
.process-left-right::after {
  content: "→";
  position: absolute;
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  color: #9e9e9e;
  font-size: 18px;
  z-index: 10;
}

/* 接続状態のスタイル */
.connected.process-right::after,
.connected.process-left-right::after {
  color: #4cd964 !important;
}

.not-connected.process-right::after,
.not-connected.process-left-right::after {
  color: #ff3b30 !important;
}

/* パズルコンテナのレイアウト改善 */
.puzzle-pieces,
.puzzle-solution {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  min-height: 100px;
}

/* モバイル対応 */
@media (max-width: 768px) {
  .process-piece {
    width: 60px;
    height: 60px;
  }

  .process-piece .piece-icon {
    font-size: 24px;
  }

  .puzzle-pieces,
  .puzzle-solution {
    gap: 15px;
  }

  .process-right::after,
  .process-left-right::after {
    right: -12px;
    font-size: 16px;
  }
}
