/*
Theme Name: c
Theme URI: https://create-craft.jp/
Author: KoTa
Description: シンプルでスタイリッシュなクイズカテゴリ一覧のテーマ
Version: 1.0
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&display=swap');

/* 以下に先ほどの <style> 内のCSSをすべて貼り付け */
:root {
  --primary-color: #646ce0; /* 青紫（SlateBlue） */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
}

html, body {
  height: 100%;
}

body {
  background-color: #fff;
  color: #222;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.site-content {
  flex: 1 0 auto;
  width: 100%;
  padding: 0 1.5rem;
}

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

header h1 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
}

nav a {
  margin-left: 1.5rem;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s ease;
}

nav a:not(.note-button)::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 0;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

nav a:not(.note-button):hover {
  color: var(--primary-color);
}

nav a:not(.note-button):hover::after {
  width: 100%;
}

.note-button-container {
  text-align: left;
  margin: 1.5rem 0;
}

.note-button {
  background-color: #41c9b4;
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  display: inline-block;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.note-button:hover {
  background-color: #37b3a0;
  transform: translateY(-2px);
}

.note-button:active {
  transform: translateY(0);
}

.note-button-large {
  padding: 0.8rem 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
}

.section {
  padding: 2rem;
}

.section h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  border-left: 4px solid var(--primary-color);
  padding-left: 0.5rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

.category-card {
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 1rem;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
  text-align: center;
  cursor: pointer;
  transform: translateY(0);
  text-decoration: none;
  color: inherit;
  display: block;
}

.category-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transform: translateY(-4px);
}

.category-card h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
  position: relative;
}

.category-card p {
  font-size: 0.9rem;
  color: #666;
}

footer {
  flex-shrink: 0;
  text-align: center;
  padding: 2rem;
  font-size: 0.875rem;
  color: #999;
  background-color: #fff;
  border-top: 1px solid #eee;
  margin-top: auto;
}
  .category-card h3::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -4px;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease, left 0.3s ease;
}

.category-card:hover h3::after {
  width: 60%;
  left: 20%;
}

.category-card-free {
  border: 2px solid var(--primary-color);
  position: relative;
  background: linear-gradient(to bottom right, #fff, #f8f9ff);
}

.category-card-free h3 {
  color: var(--primary-color);
  font-size: 1.2rem;
}

.free-label {
  position: absolute;
  top: -10px;
  right: 10px;
  background-color: var(--primary-color);
  color: white;
  padding: 2px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#quiz-container, #result-container, #start-container { display: none; }
#quiz-container { margin: auto; max-width: 500px; }
.option-button {
  display: inline-block;
  margin: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  cursor: pointer;
  border: 1px solid #ccc;
  border-radius: 5px;
  background-color: #f0f0f0;
}
.input-box {
  margin: 1rem auto;
  padding: 0.5rem;
  width: 300px;
  font-size: 1.2rem;
}
.shake {
  animation: shake 0.4s;
}
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}
.wrong { border: 2px solid red; background-color: #ffe6e6; }
#progressCanvas { display: block; margin: 40px auto 0 auto; }
#result-container {
  max-width: 600px;
  margin: 3rem auto;
  text-align: center;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
#result-container h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  border: none;
  padding: 0;
}
#result-container #score {
  font-size: 1.4rem;
  line-height: 1.8;
  margin-bottom: 2rem;
  color: #444;
}
#result-container #wrongList {
  text-align: left;
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  font-size: 1.1rem;
}
#result-container #wrongList h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  font-size: 1.3rem;
}
#result-container #wrongList div {
  margin-bottom: 0.8rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #eee;
}
#result-container #wrongList div:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
#result-container button {
  font-size: 1.1rem;
  padding: 0.8rem 1.5rem;
  margin: 0.5rem;
  background-color: #fff;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}
#result-container button:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}
#result-container button:active {
  transform: translateY(0);
}
.submit-button {
  font-size: 1.1rem;
  margin-left: 1rem;
  padding: 0.5rem 1rem;
  border: 1px solid #6a5acd;
  background-color: #f8f6ff;
  color: #6a5acd;
  border-radius: 5px;
  cursor: pointer;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 15px;
}

.category-section {
  padding: 3rem 0;
}

.category-header {
  margin-bottom: 3rem;
  text-align: center;
}

.category-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.category-description {
  font-size: 1.1rem;
  color: #666;
  max-width: 600px;
  margin: 0 auto;
}

.quiz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.quiz-card {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.quiz-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.quiz-card a {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.quiz-thumbnail {
  position: relative;
  padding-top: 56.25%; /* 16:9のアスペクト比 */
  overflow: hidden;
  background: #f5f5f5;
}

.quiz-thumbnail img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.quiz-card:hover .quiz-thumbnail img {
  transform: scale(1.05);
}

.quiz-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.quiz-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  color: var(--primary-color);
  line-height: 1.4;
}

.quiz-content p {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 1rem;
  line-height: 1.6;
  flex-grow: 1;
}

.quiz-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #888;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

.quiz-meta span {
  display: flex;
  align-items: center;
}

.quiz-meta span::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  opacity: 0.7;
}

.no-quizzes {
  text-align: center;
  color: #666;
  font-size: 1.1rem;
  grid-column: 1 / -1;
  padding: 2rem;
}

/* パスワード入力フォームのスタイル */
#password-container {
  max-width: 400px;
  margin: 3rem auto;
  text-align: center;
  padding: 2rem;
  background: #f8f9fa;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

#password-container h2 {
  font-size: 1.5rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  border: none;
  padding: 0;
}

#passwordInput {
  width: 100%;
  padding: 1rem;
  font-size: 1.1rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 1rem;
  transition: border-color 0.3s ease;
}

#passwordInput:focus {
  outline: none;
  border-color: var(--primary-color);
}

#password-container button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#password-container button:hover {
  background-color: #5158c7;
  transform: translateY(-2px);
}

#password-container button:active {
  transform: translateY(0);
}

#passwordError {
  margin-top: 1rem;
  color: #dc3545;
  font-size: 0.95rem;
}

#start-container {
  max-width: 600px;
  margin: 3rem auto;
  text-align: center;
  padding: 2rem;
}

#start-container h1 {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

#start-container p {
  font-size: 1.1rem;
  color: #666;
  margin-bottom: 2rem;
}

#start-buttons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  max-width: 500px;
  margin: 0 auto;
}

@media (max-width: 480px) {
  #start-buttons {
    grid-template-columns: repeat(2, 1fr);
  }
}

#start-buttons button {
  padding: 0.8rem 1.5rem;
  font-size: 1.1rem;
  background-color: #fff;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

#start-buttons button:hover {
  background-color: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
}

#start-buttons button:active {
  transform: translateY(0);
}

.site-title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.site-subtitle {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-left: 2px;
}

.option-button.wrong {
  background-color: #f8d7da;
  border-color: #f5c6cb;
}

.free-badge {
  display: inline-block;
  background-color: var(--primary-color);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.story-badge {
  display: inline-block;
  background-color: #ff8c00;
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.story-start-btn {
  background-color: #ff8c00;
  color: white;
  border: none;
  padding: 0.8rem 2rem;
  font-size: 1.1rem;
  border-radius: 8px;
  margin-top: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.story-start-btn:hover {
  background-color: #e67e00;
  transform: translateY(-2px);
}

.story-context {
  background-color: #f9f9f9;
  padding: 1rem;
  border-left: 4px solid #ff8c00;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  line-height: 1.6;
}

.explanation-text {
  background-color: #f0f8ff;
  padding: 1rem;
  border-radius: 6px;
  margin-top: 1.5rem;
  border-left: 4px solid #4682b4;
}

.next-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.next-button:hover {
  background-color: #5158c7;
  transform: translateY(-2px);
}

.options-reference {
  background-color: #f8f9fa;
  padding: 1rem;
  border-radius: 6px;
  border: 1px dashed #ddd;
  margin: 1rem 0;
  font-size: 0.95rem;
  color: #666;
}