*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'M PLUS 1p', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
    sans-serif;
  font-size: 15px;
  background: #1a1a1a;
  color: #ffffff;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  justify-content: center;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* スクロールバー（ダーク / ライト共通デザイン） */
html {
  scrollbar-width: thin;
  scrollbar-color: #4b5563 #020617; /* thumb / track */
}

/* WebKit系ブラウザ */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #020617;
  border-radius: 999px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #4b5563, #9ca3af);
  border-radius: 999px;
  border: 2px solid #020617;
  opacity: 0;
  transition: opacity 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9ca3af, #e5e7eb);
  opacity: 1;
}

/* スクロールが必要な場合のみスクロールバーを表示 */
body {
  overflow-y: auto;
  scrollbar-gutter: stable;
}

/* スクロール可能な場合のみスクロールバーを表示 */
body.scrollable ::-webkit-scrollbar-thumb {
  opacity: 0.3;
}

body.scrollable:hover ::-webkit-scrollbar-thumb {
  opacity: 1;
}

/* 微妙なスクロールバーを非表示（スクロールが必要でない場合） */
body:not(.scrollable) ::-webkit-scrollbar-thumb {
  opacity: 0 !important;
}

body:not(.scrollable) {
  scrollbar-width: none;
}

/* ライトモード用のスクロールバー調整 */
body.light-mode,
html.light-mode {
  scrollbar-color: #9ca3af #e5e7eb;
}

body.light-mode ::-webkit-scrollbar-track {
  background: #e5e7eb;
}

body.light-mode ::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #9ca3af, #4b5563);
  border-color: #e5e7eb;
}

/* スクロールに応じてふわっと表示される要素 */
.scroll-reveal {
  opacity: 0;
  transform: translateY(24px) scale(0.98);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}

.scroll-reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.scroll-reveal[data-reveal-delay="1"] {
  transition-delay: 0.05s;
}

.scroll-reveal[data-reveal-delay="2"] {
  transition-delay: 0.1s;
}

.scroll-reveal[data-reveal-delay="3"] {
  transition-delay: 0.15s;
}

.scroll-reveal[data-reveal-delay="4"] {
  transition-delay: 0.2s;
}

/* ホーム用コード背景アニメーション */
.home-code-background {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.04), transparent 55%);
}

.home-code-background .editor-wrapper {
  display: flex;
  height: 100vh;
  width: 100vw;
  font-family: 'JetBrains Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
  color: #d4d4d4;
}

.home-code-background .line-numbers {
  background-color: transparent;
  color: #555;
  padding: 24px 12px;
  text-align: right;
  user-select: none;
  min-width: 60px;
  font-size: 12px;
  line-height: 20px;
  overflow: hidden;
  white-space: pre;
  opacity: 0.45;
}

.home-code-background .code-area {
  flex: 1;
  background-color: transparent;
  padding: 24px 32px;
  font-size: 12px;
  line-height: 20px;
  white-space: pre;
  position: relative;
  tab-size: 4;
  -moz-tab-size: 4;
  overflow: hidden;
  opacity: 0.3;
}

.home-code-background .cursor {
  display: inline-block;
  width: 2px;
  height: 16px;
  background-color: #ffffff;
  animation: blink-home-bg 1s infinite;
  position: relative;
  top: 3px;
}

@keyframes blink-home-bg {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.home-code-background .keyword { color: #569cd6; }
.home-code-background .string { color: #ce9178; }
.home-code-background .comment { color: #6a9955; font-style: italic; }
.home-code-background .function { color: #dcdcaa; }
.home-code-background .number { color: #b5cea8; }
.home-code-background .class-name { color: #4ec9b0; }
.home-code-background .property { color: #9cdcfe; }
.home-code-background .operator { color: #d4d4d4; }
.home-code-background .punctuation { color: #d4d4d4; }
.home-code-background .auto-complete { color: #6e6e6e; }

/* ライトモード */
body.light-mode {
  background: #f5f5f5;
  color: #1a1a1a;
}

body.light-mode .app {
  background: transparent;
}

body.light-mode .header h1,
body.light-mode .home-title,
body.light-mode .logo,
body.light-mode .app-typing .app-title h1,
body.light-mode .app-typing .course-name {
  color: #1a1a1a;
}

body.light-mode .home-header-btn {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.8);
  color: #1a1a1a;
}

body.light-mode .home-header-btn:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .auth-button {
  border-color: #4285f4;
  color: #4285f4;
}

body.light-mode .auth-button:hover {
  background: #4285f4;
  color: #ffffff;
}

body.light-mode .auth-user-button {
  background: linear-gradient(135deg, rgba(128, 128, 128, 0.1) 0%, rgba(100, 100, 100, 0.05) 100%);
  border-color: rgba(0, 0, 0, 0.15);
  color: #1a1a1a;
}


body.light-mode .auth-user-dropdown {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 250, 0.98) 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

body.light-mode .auth-user-dropdown-item {
  color: #1a1a1a;
}

body.light-mode .auth-user-dropdown-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .auth-user-dropdown-item:hover {
  background: rgba(66, 133, 244, 0.1);
}

body.light-mode .auth-user-dropdown-separator {
  background: rgba(0, 0, 0, 0.1);
}

body.light-mode .course-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .course-card:hover {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .course-card::before {
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc04, #ea4335);
}

body.light-mode .course-title {
  color: #1a1a1a;
}

body.light-mode .course-description {
  color: rgba(0, 0, 0, 0.75);
}

body.light-mode .course-description strong {
  color: rgba(0, 0, 0, 0.9);
}

body.light-mode .course-recommended {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .course-recommended strong {
  color: rgba(0, 0, 0, 0.85);
}

body.light-mode .course-tag {
  background: rgba(66, 133, 244, 0.1);
  border-color: rgba(66, 133, 244, 0.3);
  color: rgba(0, 0, 0, 0.8);
}

body.light-mode .course-label {
  background: rgba(106, 139, 251, 0.08);
  border-color: rgba(106, 139, 251, 0.2);
  color: #5A7FD8;
  backdrop-filter: blur(10px);
}

body.light-mode .course-link {
  color: #4285f4;
}

body.light-mode .course-card:hover .course-title {
  color: #1a1a1a !important;
  transform: none;
}

body.light-mode .course-card:hover .course-link {
  color: #4285f4;
  transform: none;
}

body.light-mode .home-footer {
  border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .home-footer-links a {
  color: #666666;
}

body.light-mode .home-footer-links a:hover {
  color: #1a1a1a;
}

body.light-mode .home-footer-copyright {
  color: #999999;
}

body.light-mode .editor,
body.light-mode .code-viewer {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

/* ライトモードでエディタのカーソルを黒色に */
body.light-mode .editor {
  caret-color: #1a1a1a;
}

body.light-mode .code-char {
  color: #999999;
  text-decoration: none !important;
  border-bottom: none !important;
}


/* ライトモードで正解文字を緑色で表示 */
body.light-mode .code-char.correct {
  color: #22c55e; /* 緑色 */
  background: transparent;
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ライトモードでミス文字を赤色で表示 */
body.light-mode .code-char.missed {
  color: #dc2626; /* より濃い赤色で視認性を向上 */
  background: transparent; /* 背景を削除してすっきりと */
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ライトモードで修正済み文字を表示（文字は通常色、背景で「直した位置」を示す） */
body.light-mode .code-char.fixed {
  color: #1a1a1a; /* 通常の文字色 */
  background: rgba(220, 38, 38, 0.08); /* より控えめな薄い赤の背景 */
  border-radius: 2px;
  text-decoration: none !important;
  border-bottom: none !important;
}

/* ライトモードでカーソルを黒色で表示 */
body.light-mode .code-char.cursor::before {
  background: #1a1a1a; /* 黒色 */
  display: none; /* カーソルの縦線を非表示 */
}

body.light-mode .status-bar,
body.light-mode .status-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .status-label {
  color: #666666;
}

body.light-mode .status-value {
  color: #1a1a1a;
}

body.light-mode .settings-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05) inset;
}

body.light-mode .settings-modal-header {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .settings-modal-header h2 {
  color: #1a1a1a;
}

body.light-mode .settings-modal-close {
  color: #1a1a1a;
}

body.light-mode .settings-section h3 {
  color: #1a1a1a;
}

body.light-mode .settings-description {
  color: #666666;
}

body.light-mode .settings-option {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.8);
  color: #1a1a1a;
}

body.light-mode .settings-option:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(0, 0, 0, 0.2);
}

body.light-mode .settings-option span {
  color: #1a1a1a;
}

body.light-mode .color-preset-card {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.8);
}

body.light-mode .color-preset-card:hover {
  border-color: rgba(66, 133, 244, 0.4);
  background: rgba(255, 255, 255, 1);
}

body.light-mode .color-preset-card.selected {
  border-color: #4285f4;
  background: rgba(66, 133, 244, 0.1);
}

body.light-mode .preset-name {
  color: #1a1a1a;
}

body.light-mode .settings-button-ghost {
  background: rgba(0, 0, 0, 0.05);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .settings-button-ghost:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* パネルタイトル */
body.light-mode .panel-title {
  color: #1a1a1a;
}

/* タイマーと精度表示 */
body.light-mode #timer,
body.light-mode #accuracy {
  color: #1a1a1a;
}

/* コントロール項目 */
body.light-mode .control-item {
  color: #1a1a1a;
}

body.light-mode .control-item select {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
}

/* プライマリーボタン */
body.light-mode .primary-button {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

body.light-mode .primary-button:hover {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.3);
}

/* メイン統計 */
body.light-mode .main-stat-label {
  color: rgba(0, 0, 0, 0.6);
}

body.light-mode .main-stat-value {
  color: #1a1a1a;
}

body.light-mode .main-stat:not(:last-child)::after {
  background: rgba(0, 0, 0, 0.2);
}

/* 結果メッセージ */
body.light-mode .result-message {
  color: #1a1a1a;
}

body.light-mode .result-message strong {
  color: #1a1a1a;
}

/* スタート状態カード */
body.light-mode .start-state-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

body.light-mode .start-state-title {
  color: #1a1a1a;
}

body.light-mode .start-state-main-text {
  color: #1a1a1a;
}

body.light-mode .start-state-toggle {
  border-color: rgba(0, 0, 0, 0.2);
  background: #ffffff;
}

/* スタート画面のモード選択ボタン */
body.light-mode .start-state-mode-btn {
  border-color: rgba(0, 0, 0, 0.2);
  background: #ffffff;
  color: #1a1a1a;
}

body.light-mode .start-state-mode-btn:hover {
  background: #f5f5f5;
}

body.light-mode .start-state-mode-btn.active {
  background: #1a1a1a;
  color: #ffffff;
  border-color: #1a1a1a;
}

/* スタート画面のモード説明 */
body.light-mode .start-state-mode-description {
  color: rgba(0, 0, 0, 0.7);
}

/* スタート画面のルールリスト */
body.light-mode .start-state-rules {
  color: rgba(0, 0, 0, 0.8);
}

/* スタート画面のホームリンク */
body.light-mode .start-state-home-link {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .start-state-home-link:hover {
  color: #1a1a1a;
  opacity: 1;
}

/* スタート画面の設定トグル */
body.light-mode .start-state-settings-toggle {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .start-state-settings-toggle:hover {
  color: #1a1a1a;
}

/* スタート画面の設定パネル */
body.light-mode .start-state-settings-panel {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

body.light-mode .start-state-settings-row label {
  color: #1a1a1a;
}

/* 結果カード */
body.light-mode .result-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

body.light-mode .result-course {
  color: #1a1a1a;
}

/* 結果詳細 */
body.light-mode .result-detail-item {
  background: #f9f9f9;
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

body.light-mode .result-detail-label {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .result-detail-value {
  color: #1a1a1a;
}

body.light-mode .result-detail-sub {
  color: rgba(0, 0, 0, 0.6);
}

body.light-mode .result-detail-title {
  color: #1a1a1a;
}

body.light-mode .result-detail-toggle {
  color: #1a1a1a;
}

/* レベル情報 */
body.light-mode .result-level-section {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .result-level-label {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .result-level-value {
  color: #4caf50;
}

body.light-mode .result-level-progress-bar {
  background: rgba(0, 0, 0, 0.1);
}

body.light-mode .result-level-progress-fill {
  background: linear-gradient(90deg, #4caf50 0%, #66bb6a 100%);
}

body.light-mode .result-level-progress-text {
  color: rgba(0, 0, 0, 0.6);
}

/* 結果統計 */
body.light-mode .result-stat-label {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .result-stat-value {
  color: #1a1a1a;
}

body.light-mode .result-rank-panel {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .result-rank-sub {
  color: rgba(0, 0, 0, 0.7);
}

/* 結果ボタン */
body.light-mode .result-button {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

body.light-mode .result-button:hover {
  background: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.3);
}

body.light-mode .result-button-primary {
  background: #4285f4;
  border-color: #4285f4;
  color: #ffffff;
}

body.light-mode .result-button-primary:hover {
  background: #5a9fff;
  border-color: #5a9fff;
}

/* 結果ホームリンク */
body.light-mode .result-home-link {
  color: #1a1a1a;
}

body.light-mode .result-footer-hint {
  color: rgba(0, 0, 0, 0.6);
}

/* リーダーボード */
body.light-mode .leaderboard-container {
  background: transparent;
  color: #1a1a1a;
}

body.light-mode .leaderboard-header h2 {
  color: #1a1a1a;
}

body.light-mode .leaderboard-table {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

body.light-mode .leaderboard-table th {
  background: #f5f5f5;
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .leaderboard-table td {
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

body.light-mode .leaderboard-table tr:hover {
  background: #f9f9f9;
}

body.light-mode .my-rank {
  background: rgba(66, 133, 244, 0.1) !important;
  color: #1a1a1a;
}

/* ライトモード時のフィルターエリア */
body.light-mode .leaderboard-filters {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .filter-group label {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .filter-group select {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #1a1a1a;
}

body.light-mode .filter-group select:hover {
  background: #f9f9f9;
  border-color: rgba(0, 0, 0, 0.25);
}

/* タブ */
body.light-mode .tab-button {
  color: rgba(0, 0, 0, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .tab-button.active {
  color: #1a1a1a;
  border-bottom-color: #4285f4;
}

/* エラーメッセージ */
body.light-mode .error {
  color: #d32f2f;
  background: rgba(211, 47, 47, 0.1);
  border-color: rgba(211, 47, 47, 0.2);
}

.app {
  width: 100%;
  max-width: 1400px;
  margin: 24px;
  padding: 20px 24px 16px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.app-home {
  margin: 24px auto;
}

.app-typing {
  margin: 0 auto;
  align-items: center;
  position: relative;
  max-width: 1400px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 140px 24px 60px; /* ヘッダーとフッターのスペースを確保（app-titleのスペースも含む） */
  box-sizing: border-box;
}

.app-typing .app-title {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  text-align: center;
  z-index: 100;
  pointer-events: none;
}

.app-typing .app-title h1 {
  margin: 0;
  font-size: 72px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-align: center;
  pointer-events: auto;
}

.app-typing .app-title h1 a {
  text-decoration: none;
  color: inherit;
  transition: opacity 0.3s ease;
}

.app-typing .app-title h1 a:hover {
  opacity: 0.8;
}

.app-typing .header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  flex-shrink: 0;
  z-index: 5;
}

.app-typing .course-name {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-align: center;
  font-weight: normal;
}

.app-typing .footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  flex-shrink: 0;
  z-index: 10; /* レポート送信ボタンが確実に表示されるように */
  display: flex !important; /* 確実に表示されるように */
  visibility: visible !important; /* 確実に表示されるように */
}

.header {
  padding-bottom: 24px;
  position: relative;
}

.home-header {
  border: none;
  background: transparent;
  padding-bottom: 0;
}

.home-header .home-header-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.home-lang-switcher {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: #e5e7eb;
}

.home-lang-label {
  opacity: 0.85;
}

.home-lang-select {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e5e7eb;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.home-lang-select:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(148, 163, 184, 0.8);
}

body.light-mode .home-lang-select {
  background: #ffffff;
  color: #111827;
  border-color: rgba(148, 163, 184, 0.6);
}

body.light-mode .home-lang-select:hover {
  border-color: rgba(148, 163, 184, 0.8);
}

body.light-mode .home-lang-label {
  color: #111827;
}

.home-header-buttons {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
  margin-bottom: 40px;
}

.home-header-level {
  margin-left: 0;
  margin-right: 0;
  font-size: 13px;
  opacity: 0.9;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 8px;
  flex-shrink: 0;
  order: -1;
}

/* 空の場合は非表示にしてレイアウトに影響しないようにする */
.home-header-level:empty {
  display: none !important;
  width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.light-mode .home-header-level {
  color: #1a1a1a;
}

body.light-mode .header-auth {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ホーム右上のレベル & 経験値バー */
.home-level-box {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 2px 8px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-width: 160px;
  transition: all 0.3s ease;
}

.home-level-box:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.1) inset,
    0 4px 12px rgba(0, 0, 0, 0.4);
}

.home-level-label {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: #ffffff;
}

.home-level-xp-bar {
  position: relative;
  width: 160px;
  height: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2) inset,
    0 1px 2px rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.home-level-xp-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  min-width: 3px;
  border-radius: inherit;
  background: #4caf50;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.home-level-xp-text {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.light-mode .home-level-box {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 250, 0.98) 100%);
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.05) inset,
    0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.light-mode .home-level-box:hover {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.15),
    0 0 0 1px rgba(0, 0, 0, 0.1) inset,
    0 4px 12px rgba(0, 0, 0, 0.1);
}

body.light-mode .home-level-label {
  color: #1a1a1a;
}

body.light-mode .home-level-xp-bar {
  background: rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.1) inset,
    0 1px 2px rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .home-level-xp-text {
  color: rgba(0, 0, 0, 0.8);
  text-shadow: none;
}

/* レベルアップ時のアニメーション */
.home-level-box.home-level-levelup {
  animation: home-level-up-bounce 0.8s ease-out;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.7),
    0 0 32px rgba(250, 204, 21, 0.9);
}

@keyframes home-level-up-bounce {
  0% {
    transform: scale(1);
  }
  20% {
    transform: scale(1.1);
  }
  40% {
    transform: scale(1.18);
  }
  60% {
    transform: scale(1.08);
  }
  80% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

.home-header-btn {
  padding: 12px 24px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(26, 26, 26, 0.8);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.home-header-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-2px);
}

.header-auth {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-end !important;
  gap: 12px !important;
  z-index: 10001 !important;
  background: rgba(26, 26, 26, 0.9);
  padding: 12px 20px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  min-width: fit-content;
  margin: 0 !important;
  transform: none !important;
  flex-wrap: nowrap !important;
}

/* レベル表示が空の場合（ログインボタンのみの場合）は中央配置 */
.header-auth:has(.home-header-level:empty),
.header-auth.has-empty-level {
  justify-content: center !important;
}

.auth-button {
  padding: 8px 16px;
  margin: 0;
  border: 1px solid #4285f4;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  background: transparent;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.auth-button-primary:hover {
  background: #4285f4;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.auth-button i {
  display: inline-block !important;
  margin-right: 6px;
  font-size: 14px;
  vertical-align: middle;
  opacity: 1 !important;
  visibility: visible !important;
}

.auth-user-menu {
  position: relative;
  display: none;
  flex-shrink: 0;
}

.auth-user-menu[style*="display: block"],
.auth-user-menu.active,
.auth-user-menu[style*="display: block"] {
  display: inline-flex !important;
  align-items: center;
  flex-shrink: 0;
}

.auth-user-button {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(128, 128, 128, 0.15) 0%, rgba(100, 100, 100, 0.05) 100%);
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: none;
  position: relative;
  overflow: visible;
  z-index: 10001;
}

.auth-user-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.auth-user-info {
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.3px;
  position: relative;
  z-index: 1;
}

body.light-mode .auth-user-info {
  color: #1a1a1a;
}

.auth-user-arrow {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  transition: transform 0.3s ease, color 0.3s ease;
  position: relative;
  z-index: 1;
}

body.light-mode .auth-user-arrow {
  color: rgba(0, 0, 0, 0.7);
}

.auth-user-menu.active .auth-user-arrow {
  transform: rotate(180deg);
  color: rgba(255, 255, 255, 1);
}

body.light-mode .auth-user-menu.active .auth-user-arrow {
  color: rgba(0, 0, 0, 1);
}

body.light-mode .auth-user-menu.active .auth-user-arrow {
  color: rgba(0, 0, 0, 1);
}

.auth-user-dropdown {
  position: fixed;
  top: auto;
  right: auto;
  min-width: 200px;
  background: linear-gradient(135deg, rgba(37, 37, 37, 0.98) 0%, rgba(30, 30, 30, 0.98) 100%);
  border: 1px solid rgba(66, 133, 244, 0.3);
  border-radius: 4px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 0 40px rgba(66, 133, 244, 0.1);
  z-index: 10002;
  overflow: hidden;
  display: none;
  animation: dropdownFadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 8px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  pointer-events: auto;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.auth-user-dropdown-item {
  padding: 14px 20px;
  color: #ffffff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  border-radius: 2px;
  margin: 2px 0;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 1;
}

.auth-user-dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #4285f4 0%, #5a9fff 100%);
  transform: scaleY(0);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 0 4px 4px 0;
}

.auth-user-dropdown-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.15) 0%, rgba(66, 133, 244, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.25s ease;
  border-radius: 10px;
}

.auth-user-dropdown-item:hover {
  background: rgba(66, 133, 244, 0.15);
  padding-left: 24px;
  transform: translateX(4px);
}

.auth-user-dropdown-item:hover::before {
  transform: scaleY(1);
}

.auth-user-dropdown-item:hover::after {
  opacity: 1;
}

.auth-user-dropdown-item:active {
  transform: translateX(2px);
  background: rgba(66, 133, 244, 0.2);
}

.auth-user-dropdown-item span {
  position: relative;
  z-index: 1;
}

.auth-user-dropdown-item i {
  position: relative;
  z-index: 1;
  margin-right: 10px;
  width: 16px;
  text-align: center;
  font-size: 14px;
  color: inherit;
}

.auth-user-dropdown-separator {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 6px 8px;
  border-radius: 1px;
}

@media (max-width: 768px) {
  .header-auth {
    position: fixed !important;
    top: 10px !important;
    right: 10px !important;
    left: auto !important;
    bottom: auto !important;
    justify-content: flex-end !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 8px !important;
    padding: 8px 12px;
    max-width: calc(100vw - 20px);
    z-index: 10001 !important;
    margin: 0 !important;
    transform: none !important;
    flex-wrap: nowrap !important;
  }
  .header {
    flex-direction: column;
    align-items: center;
  }
  .auth-user-dropdown {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
}

.header h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0.12em;
  text-align: center;
}

.logo {
  font-family: 'JetBrains Mono', Menlo, Monaco, Consolas, 'Courier New',
    monospace;
  font-weight: 700;
}

.logo a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.logo a:hover {
  opacity: 0.8;
  transform: scale(1.02);
}

.logo a:focus {
  outline: none !important;
  outline-offset: 0 !important;
}

/* 画像ロゴ用スタイル */
.logo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.logo-link:focus {
  outline: none !important;
  outline-offset: 0 !important;
}

.logo-image {
  display: block;
  height: 40px;
}

.home-title .logo-image {
  height: 56px;
}

.battle-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.battle-title-text {
  font-size: 18px;
}

/* ホームページ専用スタイル */
.home-title {
  font-size: 4em !important;
  font-weight: 700;
  text-align: center;
  margin: 40px 0 60px !important;
  color: #ffffff;
  letter-spacing: 0.05em;
}

.home-title a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.3s ease;
  display: inline-block;
}

.home-title a:hover {
  opacity: 0.8;
}

.home-title a:focus {
  outline: none !important;
  outline-offset: 0 !important;
}

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

.home-welcome-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0 40px;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.home-welcome-box {
  max-width: 1400px;
  width: 100%;
  padding: 32px 60px;
  background: #252525;
  border: 1px solid #444;
  border-radius: 16px;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.home-welcome-title {
  font-size: 1.8em;
  font-weight: 700;
  margin: 0 0 20px 0;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.home-welcome-text {
  font-size: 1em;
  line-height: 1.8;
  margin: 0 0 10px 0;
  color: #e0e0e0;
}

.home-welcome-buttons {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  justify-content: flex-end;
}

.home-welcome-btn {
  padding: 12px 24px;
  border: 1px solid #4285f4;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  text-decoration: none;
  font-size: 0.95em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-block;
  white-space: nowrap;
}

.home-welcome-btn:hover {
  background: #4285f4;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.home-footer {
  text-align: center;
  padding: 50px 20px;
  margin-top: auto;
  color: #ffffff;
  font-size: 0.95em;
  animation: fadeIn 1s ease-out 1.2s both;
  width: 100%;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.home-footer-links {
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.home-footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1em;
  font-weight: 400;
}

.home-footer-links a:hover {
  color: #ffffff;
}

.home-footer-x-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.home-footer-x-link svg {
  flex-shrink: 0;
}

.footer-separator {
  color: #666;
  width: 1px;
  height: 16px;
  background: #666;
  display: inline-block;
  margin: 0;
}

.home-footer-copyright {
  color: #999;
  font-size: 0.9em;
  margin-top: 16px;
  font-weight: 300;
}

/* ヒーローセクション */
.hero-section {
  max-width: 1200px;
  margin: 40px auto 40px;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
  position: relative;
}

@keyframes pulse {
  0%, 100% {
    opacity: 0.5;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 0.8;
    transform: translateX(-50%) scale(1.1);
  }
}

.hero-content {
  text-align: center;
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3.5em;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 16px;
  color: #ffffff;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-highlight {
  color: #60a5fa;
  display: inline-block;
  position: relative;
  font-size: 1.15em;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}


.hero-subtitle {
  font-size: 1.3em;
  line-height: 1.8;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.9);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero-cta {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-button {
  padding: 16px 32px;
  border-radius: 12px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: none;
  font-family: inherit;
}

.hero-button-primary {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 
    0 2px 8px rgba(59, 130, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.hero-button-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  transition: left 0.5s ease;
}

.hero-button-primary:hover::before {
  left: 100%;
}

.hero-button-primary:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 
    0 4px 12px rgba(59, 130, 246, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.hero-button-primary:active {
  transform: translateY(-1px) scale(1);
}

.hero-button-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
  position: relative;
  overflow: hidden;
}

.hero-button-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hero-button-secondary:hover::before {
  opacity: 1;
}

.hero-button-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 
    0 8px 24px rgba(255, 255, 255, 0.1),
    0 0 20px rgba(255, 255, 255, 0.05);
}

.hero-button-secondary:active {
  transform: translateY(-1px) scale(1);
}

.hero-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: nowrap;
  padding-top: 40px;
}

.hero-stat-item {
  text-align: center;
  position: relative;
  cursor: help;
  padding: 8px;
  margin: -8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.hero-stat-item:hover {
  background-color: rgba(66, 133, 244, 0.05);
}

.hero-stat-value {
  font-size: 2em;
  font-weight: 700;
  background: linear-gradient(135deg, #4285f4 0%, #5ba3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  transition: all 0.3s ease;
}

.hero-stat-item:hover .hero-stat-value {
  background: linear-gradient(135deg, #5ba3ff 0%, #4285f4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transform: scale(1.05);
}

.hero-stat-label {
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.7);
}

.hero-stat-tooltip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(26, 26, 26, 0.98);
  color: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.85em;
  line-height: 1.6;
  max-width: 300px;
  min-width: 200px;
  width: max-content;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease, transform 0.2s ease;
  z-index: 10000;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
  word-wrap: break-word;
  text-align: left;
}

.hero-stat-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 8px solid transparent;
  border-top-color: rgba(26, 26, 26, 0.98);
}

.hero-stat-item:hover .hero-stat-tooltip,
.hero-stat-item.tooltip-active .hero-stat-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* ヒーローバッジ */
.hero-badge {
  display: inline-block;
  margin-bottom: 16px;
  padding: 10px 24px;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.25) 0%, rgba(0, 191, 255, 0.2) 100%);
  border: 2px solid rgba(0, 191, 255, 1);
  border-radius: 999px;
  animation: fadeInDown 0.6s ease-out 0.1s both;
  box-shadow:
    0 0 25px rgba(0, 191, 255, 0.8),
    0 0 50px rgba(0, 191, 255, 0.4),
    0 4px 16px rgba(66, 133, 244, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}

.hero-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

.hero-badge-text {
  font-size: 0.95em;
  font-weight: 600;
  background: linear-gradient(135deg, #4285f4 0%, #5ba3ff 50%, #00d4ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  position: relative;
  z-index: 1;
  text-shadow: 
    0 0 12px rgba(0, 191, 255, 0.7),
    0 0 24px rgba(0, 191, 255, 0.4);
  filter: drop-shadow(0 0 10px rgba(0, 191, 255, 0.6)) drop-shadow(0 0 20px rgba(0, 191, 255, 0.3));
}

/* ヒーローキーポイント */
.hero-key-points {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 24px 0 32px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.7) 0%, rgba(30, 30, 30, 0.7) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}


.hero-key-point {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 250px;
}

.hero-key-point-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.hero-key-point-text {
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.hero-key-point-text strong {
  color: #4285f4;
  font-weight: 600;
}

.hero-title-line {
  display: inline-block;
  animation: fadeInLeft 0.8s ease-out 0.3s both;
  color: #ffffff;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* セクション共通スタイル */
.section-title {
  font-size: 2.5em;
  font-weight: 700;
  text-align: center;
  margin: 0 auto 16px;
  display: inline-block;
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  position: relative;
  filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.1));
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  transform: none;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, #4285f4, #34a853);
  border-radius: 2px;
  opacity: 0.8;
}

.section-subtitle {
  font-size: 1.1em;
  text-align: center;
  margin: 0 0 40px;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.7;
}

/* ターゲットセクション */
.target-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
  text-align: center;
}

/* Key-Syntaxの特徴セクション */
.features-section {
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(20, 20, 20, 0.95) 100%);
  padding: 4rem 2rem;
  border-radius: 16px;
}

.target-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.target-card {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(30, 30, 30, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.target-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(66, 133, 244, 0.1) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.target-card-icon {
  font-size: 3em;
  margin-bottom: 16px;
}

.target-card-title {
  font-size: 1.3em;
  font-weight: 600;
  margin: 0 0 12px;
  color: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.target-card-description {
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

/* comparison-summary 基本スタイル */
.comparison-summary {
  margin: 2rem auto;
  max-width: 700px;
  text-align: center;
  padding: 2rem 2rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  background: rgba(26, 26, 26, 0.5);
}

.comparison-summary h3 {
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.05em;
}

.comparison-summary p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #E5E7EB;
  margin: 0;
}

.comparison-summary p strong {
  color: #60A5FA;
  font-weight: 700;
}

/* ベネフィットセクション */
.benefits-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 0.6s both;
  text-align: center;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.benefit-item {
  background: linear-gradient(135deg, rgba(26, 26, 26, 0.9) 0%, rgba(30, 30, 30, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.benefit-item::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.benefit-item:hover::after {
  opacity: 1;
}

.benefit-item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(66, 133, 244, 0.6);
  box-shadow: 
    0 12px 32px rgba(66, 133, 244, 0.3),
    0 0 40px rgba(66, 133, 244, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(35, 35, 35, 0.95) 0%, rgba(40, 40, 40, 0.95) 100%);
}

.benefit-icon {
  font-size: 3em;
  margin-bottom: 16px;
}

.benefit-title {
  font-size: 1.2em;
  font-weight: 600;
  margin: 0 0 12px;
  color: #ffffff;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.benefit-item:hover .benefit-title {
  color: #ffffff;
  transform: translateY(-2px);
  text-shadow: 0 0 20px rgba(66, 133, 244, 0.5);
}

.benefit-description {
  font-size: 0.95em;
  line-height: 1.6;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

.benefit-description strong {
  color: #4285f4;
  font-weight: 600;
}

/* ベネフィット比較テーブル */
.benefits-comparison {
  margin-top: 60px;
  padding: 40px;
  background: rgba(26, 26, 26, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
}

.benefits-comparison-title {
  font-size: 1.5em;
  font-weight: 700;
  text-align: center;
  margin: 0 0 32px;
  color: #ffffff;
}

.comparison-table-container {
  position: relative;
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.95) 0%, rgba(30, 30, 30, 0.95) 100%);
  border-radius: 24px;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  backdrop-filter: blur(20px);
  margin-top: 30px;
  overflow-x: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease-out forwards;
}

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

.comparison-table-container:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 600px;
}

.comparison-table thead {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border-radius: 12px 12px 0 0;
}

.comparison-table th {
  padding: 20px 24px;
  text-align: center;
  vertical-align: middle;
  font-weight: 700;
  font-size: 1.05em;
  color: rgba(255, 255, 255, 0.95);
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.9em;
  position: relative;
}

.comparison-table th:first-child {
  border-radius: 12px 0 0 0;
}

.comparison-table th:last-child {
  border-radius: 0 12px 0 0;
}

.comparison-table th.comparison-category {
  text-align: left;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-transform: none;
  letter-spacing: normal;
  font-size: 1em;
}

.comparison-table th.comparison-method {
  text-align: center;
  vertical-align: middle;
}

.comparison-table tbody tr {
  transition: background-color 0.2s ease, transform 0.2s ease;
  opacity: 0;
  transform: translateX(-10px);
  animation: slideInRow 0.6s ease-out forwards;
}

@keyframes slideInRow {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.comparison-table tbody tr:nth-child(1) {
  animation-delay: 0.1s;
}

.comparison-table tbody tr:nth-child(2) {
  animation-delay: 0.2s;
}

.comparison-table tbody tr:nth-child(3) {
  animation-delay: 0.3s;
}

.comparison-table tbody tr:nth-child(4) {
  animation-delay: 0.4s;
}

.comparison-table tbody tr:nth-child(5) {
  animation-delay: 0.5s;
}

.comparison-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
  transform: scale(1.01);
}

.comparison-table tbody tr:last-child td:first-child {
  border-radius: 0 0 0 12px;
}

.comparison-table tbody tr:last-child td:last-child {
  border-radius: 0 0 12px 0;
}

.comparison-table td {
  padding: 24px 20px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.comparison-table td.comparison-label {
  text-align: left;
  vertical-align: middle;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
  padding-right: 40px;
  font-size: 0.95em;
  position: relative;
  padding-left: 32px;
  line-height: 1.5;
}

.comparison-table td.comparison-label::before {
  content: '○';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(79, 172, 254, 0.6);
  font-size: 0.8em;
  transition: all 0.2s ease;
  line-height: 1;
}

.comparison-table tbody tr:nth-child(1) td.comparison-label::before {
  content: '○';
}

.comparison-table tbody tr:nth-child(2) td.comparison-label::before {
  content: '✗';
}

.comparison-table tbody tr:nth-child(3) td.comparison-label::before {
  content: '△';
}

.comparison-table tbody tr:nth-child(4) td.comparison-label::before {
  content: '○';
}

.comparison-table tbody tr:nth-child(5) td.comparison-label::before {
  content: '✗';
}

.comparison-table tbody tr:hover td.comparison-label::before {
  color: rgba(79, 172, 254, 1);
  transform: translateX(3px) translateY(-50%);
}

.comparison-score {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 140px;
  height: 40px;
  padding: 0 8px;
  margin: 0 auto;
}

.comparison-score-bar {
  position: relative;
  width: 100%;
  height: 28px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.2) inset,
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
  transition: all 0.3s ease;
}

.comparison-table tbody tr:hover .comparison-score-bar {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.3) inset,
    0 1px 0 rgba(255, 255, 255, 0.15) inset,
    0 0 20px rgba(79, 172, 254, 0.2);
}

.comparison-score-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 14px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
  background-size: 200% 100%;
  animation: shimmer 3s infinite;
  width: 0 !important;
}

.comparison-table-container.animated .comparison-score-fill {
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.comparison-score-text {
  position: absolute;
  font-weight: 700;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.98);
  z-index: 2;
  text-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.5),
    0 0 8px rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.comparison-table tbody tr:hover .comparison-score-text {
  transform: scale(1.05);
  text-shadow: 
    0 1px 4px rgba(0, 0, 0, 0.6),
    0 0 12px rgba(255, 255, 255, 0.3);
}

.comparison-score[data-score="5"] .comparison-score-fill {
  width: 100%;
  background: linear-gradient(
    90deg,
    rgba(79, 172, 254, 1) 0%,
    rgba(96, 165, 250, 1) 50%,
    rgba(79, 172, 254, 1) 100%
  );
  box-shadow: 
    0 0 20px rgba(79, 172, 254, 0.6),
    0 0 40px rgba(79, 172, 254, 0.3),
    0 2px 8px rgba(79, 172, 254, 0.4) inset;
}

.comparison-score[data-score="4"] .comparison-score-fill {
  width: 80%;
  background: linear-gradient(
    90deg,
    rgba(79, 172, 254, 0.9) 0%,
    rgba(96, 165, 250, 0.9) 50%,
    rgba(79, 172, 254, 0.9) 100%
  );
  box-shadow: 
    0 0 15px rgba(79, 172, 254, 0.5),
    0 0 30px rgba(79, 172, 254, 0.2),
    0 2px 6px rgba(79, 172, 254, 0.3) inset;
}

.comparison-score[data-score="3"] .comparison-score-fill {
  width: 60%;
  background: linear-gradient(
    90deg,
    rgba(234, 179, 8, 0.9) 0%,
    rgba(250, 204, 21, 0.9) 50%,
    rgba(234, 179, 8, 0.9) 100%
  );
  box-shadow: 
    0 0 12px rgba(234, 179, 8, 0.5),
    0 0 25px rgba(234, 179, 8, 0.2),
    0 2px 6px rgba(234, 179, 8, 0.3) inset;
}

.comparison-score[data-score="2"] .comparison-score-fill {
  width: 40%;
  background: linear-gradient(
    90deg,
    rgba(234, 179, 8, 0.75) 0%,
    rgba(250, 204, 21, 0.75) 50%,
    rgba(234, 179, 8, 0.75) 100%
  );
  box-shadow: 
    0 0 8px rgba(234, 179, 8, 0.4),
    0 0 20px rgba(234, 179, 8, 0.15),
    0 2px 4px rgba(234, 179, 8, 0.25) inset;
}

.comparison-score[data-score="1"] .comparison-score-fill {
  width: 20%;
  background: linear-gradient(
    90deg,
    rgba(156, 163, 175, 0.7) 0%,
    rgba(209, 213, 219, 0.7) 50%,
    rgba(156, 163, 175, 0.7) 100%
  );
  box-shadow: 
    0 0 6px rgba(156, 163, 175, 0.3),
    0 0 15px rgba(156, 163, 175, 0.1),
    0 2px 4px rgba(156, 163, 175, 0.2) inset;
}

/* ライトモード対応 */
.light-mode .comparison-table-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 250, 250, 0.98) 100%);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.03) inset,
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.light-mode .comparison-table-container:hover {
  box-shadow: 
    0 24px 70px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.05) inset,
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.light-mode .comparison-table thead {
  background: linear-gradient(135deg, rgba(0, 0, 0, 0.04) 0%, rgba(0, 0, 0, 0.02) 100%);
}

.light-mode .comparison-table th {
  color: rgba(0, 0, 0, 0.85);
  border-bottom: 2px solid rgba(0, 0, 0, 0.12);
}

.light-mode .comparison-table th.comparison-category {
  color: rgba(0, 0, 0, 0.7);
}

.light-mode .comparison-table tbody tr:hover {
  background: rgba(0, 0, 0, 0.02);
}

.light-mode .comparison-table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.light-mode .comparison-table td.comparison-label {
  color: rgba(0, 0, 0, 0.8);
}

.light-mode .comparison-table td.comparison-label::before {
  color: rgba(79, 172, 254, 0.7);
}

.light-mode .comparison-table tbody tr:hover td.comparison-label::before {
  color: rgba(79, 172, 254, 1);
}

.light-mode .comparison-score-bar {
  background: rgba(0, 0, 0, 0.06);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.1) inset,
    0 1px 0 rgba(255, 255, 255, 0.5) inset;
}

.light-mode .comparison-table tbody tr:hover .comparison-score-bar {
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 
    0 2px 12px rgba(0, 0, 0, 0.15) inset,
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 0 20px rgba(79, 172, 254, 0.15);
}

.light-mode .comparison-score-text {
  color: rgba(0, 0, 0, 0.95);
  text-shadow: 
    0 1px 2px rgba(255, 255, 255, 0.8),
    0 0 4px rgba(255, 255, 255, 0.5);
}

.light-mode .comparison-score[data-score="5"] .comparison-score-fill {
  background: linear-gradient(90deg, rgba(79, 172, 254, 0.9) 0%, rgba(79, 172, 254, 0.6) 100%);
}

.light-mode .comparison-score[data-score="4"] .comparison-score-fill {
  background: linear-gradient(90deg, rgba(79, 172, 254, 0.75) 0%, rgba(79, 172, 254, 0.5) 100%);
}

.light-mode .comparison-score[data-score="3"] .comparison-score-fill {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.75) 0%, rgba(234, 179, 8, 0.5) 100%);
}

.light-mode .comparison-score[data-score="2"] .comparison-score-fill {
  background: linear-gradient(90deg, rgba(234, 179, 8, 0.6) 0%, rgba(234, 179, 8, 0.4) 100%);
}

.light-mode .comparison-score[data-score="1"] .comparison-score-fill {
  background: linear-gradient(90deg, rgba(156, 163, 175, 0.6) 0%, rgba(156, 163, 175, 0.4) 100%);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .comparison-table-container {
    padding: 24px 16px;
    border-radius: 20px;
  }
  
  .comparison-table {
    min-width: 500px;
  }
  
  .comparison-table th {
    padding: 16px 16px;
    font-size: 0.85em;
  }
  
  .comparison-table td {
    padding: 20px 16px;
    font-size: 0.9em;
  }
  
  .comparison-table td.comparison-label {
    padding-right: 24px;
    padding-left: 28px;
    font-size: 0.9em;
  }
  
  .comparison-score {
    min-width: 110px;
    height: 36px;
  }
  
  .comparison-score-bar {
    height: 24px;
  }
  
  .comparison-score-text {
    font-size: 0.8em;
  }
}

@media (max-width: 480px) {
  .comparison-table-container {
    padding: 20px 12px;
    border-radius: 16px;
  }
  
  .comparison-table {
    min-width: 450px;
  }
  
  .comparison-table th {
    padding: 14px 12px;
    font-size: 0.8em;
  }
  
  .comparison-table td {
    padding: 16px 12px;
    font-size: 0.85em;
  }
  
  .comparison-table td.comparison-label {
    padding-right: 20px;
    padding-left: 24px;
    font-size: 0.85em;
  }
  
  .comparison-score {
    min-width: 90px;
    height: 32px;
  }
  
  .comparison-score-bar {
    height: 20px;
  }
  
  .comparison-score-text {
    font-size: 0.75em;
  }
}


/* コースグループ */
.course-group {
  margin-bottom: 60px;
}

.course-group-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.8em;
  font-weight: 700;
  margin: 0 0 12px;
  color: #ffffff;
  flex-wrap: wrap;
}

.course-group-icon {
  font-size: 1.2em;
}

.course-group-badge {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.5em;
  font-weight: 600;
  margin-left: auto;
}

.course-group-badge-beginner {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #4caf50;
}

.course-group-badge-intermediate {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.4);
  color: #ffc107;
}

.course-group-badge-advanced {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #f44336;
}

.course-group-description {
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 24px;
  line-height: 1.6;
}

.course-grid-grouped {
  margin-top: 0 !important;
}

/* 難易度バッジ */
.course-difficulty-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.7em;
  font-weight: 600;
  z-index: 2;
}

.course-difficulty-beginner {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #4caf50;
}

.course-difficulty-intermediate {
  background: rgba(255, 193, 7, 0.2);
  border: 1px solid rgba(255, 193, 7, 0.4);
  color: #ffc107;
}

.course-difficulty-advanced {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #f44336;
}

.course-card {
  position: relative;
}

.course-card .course-description {
  font-size: 0.85em;
  margin: 8px 0 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

body.light-mode .course-group-title {
  color: #1a1a1a;
}

body.light-mode .course-group-description {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .course-card .course-description {
  color: rgba(0, 0, 0, 0.7);
}

/* ランキングプレビューセクション */
.leaderboard-preview-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 1s both;
  text-align: center;
}

.leaderboard-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 40px;
  align-items: center;
}

.leaderboard-preview-card {
  padding: 32px;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.2) 0%, rgba(66, 133, 244, 0.1) 100%);
  border: 2px solid rgba(66, 133, 244, 0.4);
  border-radius: 20px;
  text-align: center;
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.leaderboard-preview-card::before {
  display: none;
}

.leaderboard-preview-card:hover::before {
  display: none;
}


.leaderboard-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-preview-badge {
  font-size: 1.2em;
  font-weight: 700;
  color: #fbbf24;
}

.leaderboard-preview-score {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.8);
}

.leaderboard-preview-score strong {
  font-size: 1.2em;
  color: #4285f4;
  font-weight: 700;
}

body.light-mode .leaderboard-preview-score {
  color: rgba(0, 0, 0, 0.8);
}

body.light-mode .leaderboard-preview-score strong {
  color: #1a73e8;
}

.leaderboard-preview-name {
  font-size: 1.5em;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 16px;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.leaderboard-preview-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
}

.leaderboard-preview-stats span {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.leaderboard-preview-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.leaderboard-preview-note {
  font-size: 0.9em;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  margin: 0;
}

body.light-mode .leaderboard-preview-card {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
  border-color: rgba(66, 133, 244, 0.2);
}

body.light-mode .leaderboard-preview-name {
  color: #1a1a1a;
}

body.light-mode .leaderboard-preview-header {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .leaderboard-preview-stats,
body.light-mode .leaderboard-preview-note {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .leaderboard-preview-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 
    0 16px 40px rgba(0, 0, 0, 0.12),
    0 0 0 rgba(0, 0, 0, 0),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-mode .leaderboard-preview-card:hover::before {
  opacity: 0;
}

@media (max-width: 768px) {
  .leaderboard-preview {
    grid-template-columns: 1fr;
  }
  
  .leaderboard-preview-card {
    padding: 24px;
  }
}

/* 推奨コースセクション */
.recommended-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.recommended-header {
  text-align: center;
  margin-bottom: 40px;
}

.recommended-note {
  margin-top: 32px;
  padding: 20px 24px;
  background: rgba(66, 133, 244, 0.1);
  border: 1px solid rgba(66, 133, 244, 0.3);
  border-radius: 12px;
  text-align: center;
}

.recommended-note p {
  margin: 0;
  font-size: 0.95em;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
}

.recommended-note strong {
  color: #4285f4;
}

.recommended-note-link {
  color: #4285f4;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.recommended-note-link:hover {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
}

.recommended-course {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

/* 推奨コースカルーセル */
.recommended-carousel-wrapper {
  position: relative;
  margin: 40px auto 0;
  max-width: 100%;
  padding: 0 60px;
  overflow: hidden;
  border-radius: 20px;
}

.recommended-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 0 20px 0;
  border-radius: 20px;
  overflow-y: hidden;
}

.recommended-carousel::-webkit-scrollbar {
  display: none;
}

.recommended-carousel-item {
  flex: 0 0 calc(100% - 0px);
  min-width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  border-radius: 20px;
  overflow: hidden;
}

.recommended-carousel-item .course-card {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.recommended-carousel-item .course-card-featured {
  border-radius: 20px 20px 20px 20px !important;
  border-top-left-radius: 20px !important;
  border-top-right-radius: 20px !important;
  border-bottom-left-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
  overflow: hidden !important;
}

.recommended-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(26, 26, 26, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #ffffff;
  cursor: pointer;
  z-index: 100;
  pointer-events: auto;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  line-height: 1;
  text-align: center;
  padding: 0;
}

.recommended-carousel-nav:hover {
  background: rgba(26, 26, 26, 0.9);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%);
}

.recommended-carousel-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.recommended-carousel-prev {
  left: 10px;
  font-size: 0;
}

.recommended-carousel-prev::before {
  content: '\f104';
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-block;
  line-height: 1;
  font-size: 24px;
  color: #ffffff;
}

.recommended-carousel-next {
  right: 10px;
  font-size: 0;
}

.recommended-carousel-next::before {
  content: '\f105';
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-block;
  line-height: 1;
  font-size: 24px;
  color: #ffffff;
}

body.light-mode .recommended-carousel-nav {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

body.light-mode .recommended-carousel-nav::before {
  color: #1a1a1a;
}

body.light-mode .recommended-carousel-nav:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .recommended-carousel-wrapper {
    padding: 0 50px;
  }
  
  .recommended-carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .recommended-carousel-prev {
    left: 5px;
  }
  
  .recommended-carousel-next {
    right: 5px;
  }
}

/* やりたいことから選ぶセクション */
.purpose-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 1.2s both;
}

.purpose-header {
  text-align: center;
  margin-bottom: 40px;
}

.purpose-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.purpose-card {
  position: relative;
  padding: 32px 24px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(26, 26, 26, 0.95) 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  outline: none;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.4s ease,
    border-color 0.4s ease;
  font: inherit;
  min-height: 200px;
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.purpose-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc04, #ea4335);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.purpose-card:hover {
  transform: translateY(-8px);
  border-color: rgba(66, 133, 244, 0.5);
  background: linear-gradient(135deg, rgba(40, 40, 40, 0.95) 0%, rgba(35, 35, 35, 0.95) 100%);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.3),
    0 8px 16px rgba(66, 133, 244, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.purpose-card:hover::before {
  opacity: 1;
}

.purpose-icon {
  font-size: 3em;
  margin-bottom: 8px;
  line-height: 1;
}

.purpose-title {
  font-size: 1.2em;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  line-height: 1.4;
}

.purpose-description {
  font-size: 1em;
  color: #4285f4;
  font-weight: 600;
  margin: 0;
}

.purpose-card .course-link {
  margin-top: auto;
  color: #4285f4;
  font-weight: 600;
  font-size: 0.95em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.3s ease;
}

.purpose-card:hover .course-link {
  color: #5ba3ff;
  transform: translateX(4px);
}

/* ライトモード対応 */
body.light-mode .purpose-card {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .purpose-card:hover {
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.12),
    0 8px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

body.light-mode .purpose-card::before {
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc04, #ea4335);
}

body.light-mode .purpose-card:hover::before {
  opacity: 0;
}

body.light-mode .purpose-title {
  color: #1a1a1a;
}

body.light-mode .purpose-description {
  color: #4285f4;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  .purpose-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .purpose-card {
    padding: 28px 20px;
    min-height: 180px;
  }

  .purpose-icon {
    font-size: 2.5em;
  }

  .purpose-title {
    font-size: 1.1em;
  }

  .purpose-description {
    font-size: 0.95em;
  }
}

.course-features {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}

.course-feature-tag {
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.2) 0%, rgba(66, 133, 244, 0.1) 100%);
  border: 1px solid rgba(66, 133, 244, 0.4);
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  color: #5ba3ff;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
}

.course-card:hover .course-feature-tag {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.2) 0%, rgba(66, 133, 244, 0.1) 100%);
  border-color: rgba(66, 133, 244, 0.4);
  color: #5ba3ff;
  box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
  transform: none;
}

.course-card-featured {
  position: relative;
  max-width: 500px;
  width: 100%;
  border: 2px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 20px 20px 20px 20px !important;
  border-top-left-radius: 20px !important;
  border-top-right-radius: 20px !important;
  border-bottom-left-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
  overflow: hidden !important;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(26, 26, 26, 0.95) 100%) !important;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
}

.course-card-featured::before {
  opacity: 0 !important;
  height: 4px !important;
}

.course-card-featured:hover {
  border-color: rgba(66, 133, 244, 0.5) !important;
  border-radius: 20px 20px 20px 20px !important;
  border-top-left-radius: 20px !important;
  border-top-right-radius: 20px !important;
  border-bottom-left-radius: 20px !important;
  border-bottom-right-radius: 20px !important;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%) !important;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
}

.course-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  background: linear-gradient(135deg, #4285f4 0%, #5ba3ff 100%);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
  z-index: 2;
}


.course-description {
  font-size: 0.95em;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 8px 0 0;
}

/* コースセクション */
.courses-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 1s both;
  text-align: center;
}

.courses-section .section-title {
  text-align: center !important;
  margin-left: auto;
  margin-right: auto;
}

.courses-section .section-subtitle {
  text-align: center !important;
  margin-left: auto;
  margin-right: auto;
}

.courses-section .course-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 24px !important;
  margin: 40px auto 0 !important;
  padding: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  justify-content: center !important;
}

/* このサイトについてセクション */
.about-section {
  max-width: 1200px;
  margin: 40px auto 0;
  padding: 0 20px;
  animation: fadeInUp 0.8s ease-out 1.2s both;
}

.about-section .section-title {
  margin-bottom: 24px;
}

.about-title {
  font-size: 2.5em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: #ffffff;
  position: relative;
  padding-bottom: 20px;
  letter-spacing: 0.03em;
}

.about-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: #ffffff;
  border-radius: 2px;
}

.about-content {
  background: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  align-items: start;
}

.about-text {
  font-size: 1.1em;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 40px;
  text-align: center;
}

.about-text strong {
  color: #ffffff;
  font-weight: 600;
}

.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.about-feature {
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-radius: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  text-align: left;
  box-shadow: none;
}

.about-feature-icon {
  font-size: 2.5em;
  margin-bottom: 16px;
  display: block;
}

.about-feature:hover {
  /* ホバー時のアニメーションを無効化 */
  transform: none;
  padding-left: 20px;
  background: transparent;
}


.about-feature h3 {
  font-size: 1.15em;
  font-weight: 600;
  margin-top: 0;
  margin-bottom: 8px;
  color: #ffffff;
  transition: all 0.3s ease;
  line-height: 1.4;
  text-align: left;
}

.about-feature:hover h3 {
  color: #ffffff;
}

.about-feature p {
  font-size: 0.9em;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  text-align: left;
}

.about-feature-separator {
  display: none !important;
  grid-column: span 0;
  grid-row: span 0;
  height: 0;
  margin: 0;
  padding: 0;
}

/* ライトモード */
body.light-mode .about-title {
  color: #1a1a1a;
}

body.light-mode .about-title::after {
  background: #4285f4;
}

body.light-mode .about-content {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

body.light-mode .about-text {
  color: #333;
}

body.light-mode .about-feature {
  background: transparent;
  border: none;
  box-shadow: none;
}

body.light-mode .about-feature:hover {
  /* ホバー時のアニメーションを無効化 */
  transform: none;
  padding-left: 20px;
}

body.light-mode .about-feature h3 {
  color: #4285f4;
}

body.light-mode .about-feature:hover h3 {
  color: #1a1a1a !important;
}

body.light-mode .about-feature p {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .about-feature-separator {
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.1), transparent);
}

/* ライトモード対応 - 新規セクション */
body.light-mode .hero-title {
  color: #1a1a1a;
}

body.light-mode .hero-title-highlight {
  color: #4285f4;
  -webkit-text-fill-color: #4285f4;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
}

body.light-mode .hero-title-line {
  color: #1a1a1a;
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: #1a1a1a;
  background-clip: unset;
}

body.light-mode .hero-subtitle {
  color: rgba(0, 0, 0, 0.8);
}

body.light-mode .hero-button-secondary {
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

body.light-mode .hero-button-secondary:hover {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.3);
  color: #1a1a1a !important;
}


body.light-mode .hero-stat-value {
  color: #1a73e8;
}

body.light-mode .hero-stat-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

body.light-mode .hero-stat-item:hover .hero-stat-value {
  color: #1a1a1a;
}

body.light-mode .hero-stat-label {
  color: rgba(0, 0, 0, 0.6);
}

body.light-mode .hero-stat-tooltip {
  background: rgba(255, 255, 255, 0.98);
  color: #1a1a1a;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.1);
}

body.light-mode .hero-stat-tooltip::before {
  border-top-color: rgba(255, 255, 255, 0.98);
}

body.light-mode .hero-key-points {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .hero-key-point-text {
  color: rgba(0, 0, 0, 0.9);
}

body.light-mode .hero-key-point-text strong {
  color: #1a73e8;
}

body.light-mode .hero-badge {
  background: linear-gradient(135deg, rgba(26, 115, 232, 0.15) 0%, rgba(26, 115, 232, 0.08) 100%);
  border-color: rgba(26, 115, 232, 0.3);
}

body.light-mode .hero-badge-text {
  color: #1a73e8;
}

body.light-mode .comparison-table {
  background: transparent;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

body.light-mode .comparison-cell {
  background: #ffffff;
  color: rgba(0, 0, 0, 0.85);
  border-right-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .comparison-cell:last-child {
  border-right: none;
}

body.light-mode .comparison-row:not(.comparison-header) .comparison-cell:hover {
  background: #f8f9fa;
}

body.light-mode .comparison-header .comparison-cell {
  background: rgba(250, 250, 250, 0.98);
  color: #1a1a1a;
  border-left-color: rgba(0, 0, 0, 0.08);
  border-right-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(0, 0, 0, 0.12);
}

body.light-mode .benefits-comparison {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

body.light-mode .benefits-comparison-title {
  color: #1a1a1a;
}

body.light-mode .comparison-yes {
  color: #4caf50;
}

body.light-mode .comparison-no {
  color: #ef4444;
}

body.light-mode .comparison-partial {
  color: #fbbf24;
}

body.light-mode .target-card {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .target-card-title {
  color: #1a1a1a;
}

body.light-mode .target-card-description {
  color: rgba(0, 0, 0, 0.7);
}

/* ライトモード対応 - features-section */
body.light-mode .features-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 250, 0.95) 100%) !important;
}

/* ライトモード対応 - target-card-description内のstrongタグ */
body.light-mode .target-card-description strong {
  color: #1a73e8 !important;
}

/* ライトモード対応 - comparison-summary */
body.light-mode .comparison-summary {
  background: rgba(255, 255, 255, 0.95) !important;
  border-color: rgba(0, 0, 0, 0.15) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

body.light-mode .comparison-summary h3 {
  color: #1a1a1a !important;
}

body.light-mode .comparison-summary p {
  color: #2d2d2d !important;
}

body.light-mode .comparison-summary p strong {
  color: #1a73e8 !important;
  font-weight: 700;
}

body.light-mode .benefit-item {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .benefit-title {
  color: #1a1a1a;
}

body.light-mode .benefit-item:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 
    0 12px 32px rgba(0, 0, 0, 0.12),
    0 0 0 rgba(0, 0, 0, 0),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  background: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
}

body.light-mode .benefit-item:hover::after {
  opacity: 0;
}

body.light-mode .benefit-item:hover .benefit-title {
  color: #1a1a1a !important;
  text-shadow: none;
}

body.light-mode .benefit-description {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .benefit-description strong {
  color: #1a73e8;
}

body.light-mode .section-title {
  color: #1a1a1a;
  -webkit-text-fill-color: #1a1a1a;
  background: none;
  background-clip: initial;
  -webkit-background-clip: initial;
  filter: none;
}

body.light-mode .section-subtitle {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .course-card-featured {
  border-color: rgba(0, 0, 0, 0.1) !important;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%) !important;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.light-mode .course-card-featured:hover {
  border-color: rgba(0, 0, 0, 0.1) !important;
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%) !important;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.8) !important;
}

body.light-mode .course-description {
  color: rgba(0, 0, 0, 0.75);
}

body.light-mode .course-description strong {
  color: rgba(0, 0, 0, 0.9);
}

body.light-mode .course-recommended {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .course-recommended strong {
  color: rgba(0, 0, 0, 0.85);
}

body.light-mode .course-tag {
  background: rgba(66, 133, 244, 0.1);
  border-color: rgba(66, 133, 244, 0.3);
  color: rgba(0, 0, 0, 0.8);
}

body.light-mode .course-label {
  background: rgba(106, 139, 251, 0.08);
  border-color: rgba(106, 139, 251, 0.2);
  color: #5A7FD8;
  backdrop-filter: blur(10px);
}

body.light-mode .course-feature-tag {
  background: rgba(66, 133, 244, 0.1) !important;
  border-color: rgba(66, 133, 244, 0.4) !important;
  color: #4285f4 !important;
}

body.light-mode .recommended-note {
  background: rgba(66, 133, 244, 0.1);
  border-color: rgba(66, 133, 244, 0.3);
}

body.light-mode .recommended-note p {
  color: rgba(0, 0, 0, 0.8);
}

body.light-mode .recommended-note strong {
  color: #1a73e8;
}

body.light-mode .recommended-note-link {
  color: #1a73e8;
}

body.light-mode .recommended-note-link:hover {
  color: #4285f4;
  border-bottom-color: #4285f4;
}

/* レスポンシブ */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5em;
  }
  
  .hero-subtitle {
    font-size: 1.1em;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero-button {
    width: 100%;
    justify-content: center;
  }
  
  .hero-stats {
    gap: 32px;
    flex-wrap: wrap;
  }
  
  .hero-stat-tooltip {
    max-width: 240px;
    min-width: 180px;
    font-size: 0.8em;
    padding: 10px 14px;
    bottom: calc(100% + 8px);
  }
  
  .hero-key-points {
    flex-direction: column;
    gap: 16px;
  }
  
  .hero-key-point {
    min-width: 100%;
  }
  
  .benefits-comparison {
    padding: 24px 16px;
  }
  
  .comparison-table {
    grid-template-columns: 1fr;
    font-size: 0.85em;
  }
  
  .comparison-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }
  
  .comparison-cell {
    padding: 12px;
  }
  
  .comparison-header .comparison-cell {
    display: none;
  }
  
  .comparison-row:not(.comparison-header) .comparison-cell:first-child {
    background: rgba(66, 133, 244, 0.2);
    font-weight: 700;
    border-radius: 8px 8px 0 0;
  }
  
  .comparison-row:not(.comparison-header) .comparison-cell:not(:first-child) {
    border-radius: 0;
  }
  
  .comparison-row:not(.comparison-header) .comparison-cell:last-child {
    border-radius: 0 0 8px 8px;
  }
  
  .section-title {
    font-size: 2em;
  }
  
  .target-cards,
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  
  .recommended-course {
    margin-top: 24px;
  }
  
  .recommended-carousel-wrapper {
    padding: 0 50px;
  }
  
  .recommended-carousel-item {
    min-width: 100%;
  }
  
  .recommended-carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .recommended-carousel-prev {
    left: 5px;
  }
  
  .recommended-carousel-next {
    right: 5px;
  }
  
  .about-section {
    margin-top: 30px;
    padding: 0 16px;
  }

  .about-title {
    font-size: 2em;
    margin-bottom: 20px;
  }

  .about-content {
    padding: 20px;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .about-text {
    font-size: 1em;
    margin-bottom: 30px;
  }

  .about-features {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
  }

  .about-feature {
    padding: 14px 16px;
  }
  
  .about-feature:hover {
    padding-left: 20px;
  }

  .about-feature h3 {
    font-size: 1.2em;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2em;
  }
  
  .hero-subtitle {
    font-size: 1em;
  }
  
  .hero-stats {
    gap: 24px;
    flex-wrap: wrap;
  }
  
  .hero-stat-value {
    font-size: 1.5em;
  }
  
  .hero-stat-tooltip {
    max-width: 200px;
    min-width: 160px;
    font-size: 0.75em;
    padding: 8px 12px;
    bottom: calc(100% + 6px);
  }
  
  .section-title {
    font-size: 1.75em;
  }
  
  .hero-key-points {
    padding: 16px;
  }
  
  .hero-key-point {
    font-size: 0.85em;
  }
  
  .benefits-comparison {
    padding: 20px 12px;
  }
  
  .recommended-note {
    padding: 16px;
    font-size: 0.9em;
  }
  
  
  .course-card {
    padding: 24px 20px;
    min-height: 120px;
  }
  
  .course-title {
    font-size: 1.3em;
  }
  
  .course-description {
    font-size: 0.85em;
  }
}

.course-grid {
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.course-card {
  animation: fadeInScale 0.6s ease-out both;
}

.course-card:nth-child(1) { animation-delay: 0.6s; }
.course-card:nth-child(2) { animation-delay: 0.65s; }
.course-card:nth-child(3) { animation-delay: 0.7s; }
.course-card:nth-child(4) { animation-delay: 0.75s; }
.course-card:nth-child(5) { animation-delay: 0.8s; }
.course-card:nth-child(6) { animation-delay: 0.85s; }
.course-card:nth-child(7) { animation-delay: 0.9s; }
.course-card:nth-child(8) { animation-delay: 0.95s; }
.course-card:nth-child(9) { animation-delay: 1.0s; }
.course-card:nth-child(10) { animation-delay: 1.05s; }
.course-card:nth-child(11) { animation-delay: 1.1s; }
.course-card:nth-child(12) { animation-delay: 1.15s; }

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

body.courses-page {
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.4), transparent 45%), #050505;
  color: #f5f5f5;
}

body.courses-page .course-card {
  opacity: 1 !important;
  animation: none;
}

body.light-mode.courses-page {
  background: #f7f7f7;
  color: #111;
}

.app-courses {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.courses-header {
  padding-bottom: 0;
}

.courses-main {
  width: min(960px, 100% - 32px);
  margin: 0 auto 80px;
  flex: 1;
}

.courses-hero {
  margin-top: 60px;
  margin-bottom: 48px;
}

.courses-breadcrumb {
  font-size: 13px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 8px;
}

.courses-breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.courses-hero-title {
  font-size: clamp(2rem, 3vw, 2.6rem);
  margin-bottom: 16px;
}

.courses-hero-description {
  margin: 0 0 24px;
  line-height: 1.8;
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.85);
}

.courses-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.courses-login-tip {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 20px 24px;
  background: rgba(12, 12, 12, 0.75);
}

.courses-login-tip-title {
  font-weight: 600;
  margin-bottom: 6px;
}

.courses-login-tip ul {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

.courses-section-title {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.courses-section-subtitle {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.7);
}

.courses-grid .course-card {
  text-align: left;
}

.courses-grid .course-description {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 12px;
}

.courses-extra-section {
  margin-top: 64px;
}

.courses-extra-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.courses-extra-card {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(15, 15, 15, 0.8);
  line-height: 1.7;
}

.courses-footer {
  padding: 24px 16px 40px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.courses-footer-link {
  display: inline-block;
  margin: 0 12px;
  color: #9eff9e;
  text-decoration: none;
  font-weight: 600;
}

body.light-mode .courses-breadcrumb,
body.light-mode .courses-hero-description,
body.light-mode .courses-login-tip ul,
body.light-mode .courses-section-subtitle {
  color: rgba(26, 26, 26, 0.75);
}

body.light-mode .courses-login-tip,
body.light-mode .courses-extra-card {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .courses-footer {
  border-top-color: rgba(0, 0, 0, 0.08);
}

body.light-mode .courses-footer-link {
  color: #2563eb;
}

@media (max-width: 640px) {
  .courses-hero-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .courses-login-tip,
  .courses-extra-card {
    padding: 16px 18px;
  }
}


.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.control-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #cbd5f5;
}

.control-item select {
  padding: 4px 8px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-size: 13px;
}

.primary-button {
  margin-left: auto;
  padding: 6px 20px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  background: #242626;
  color: #ffffff;
  box-shadow: none;
  transition:
    transform 0.1s ease,
    box-shadow 0.1s ease,
    filter 0.15s ease;
}

.primary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: none;
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: none;
}

.primary-button.disabled {
  opacity: 0.45;
  cursor: default;
  filter: grayscale(0.2);
  box-shadow: none;
}

.status-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #242626;
  border: 1px solid #ffffff;
}

.status-item {
  min-width: 120px;
  padding: 6px 10px;
  border-radius: 10px;
  background: #242626;
  border: 1px solid #ffffff;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.status-label {
  font-size: 12px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.status-value {
  font-size: 22px;
  font-weight: 700;
}

#timer {
  color: #ffffff;
}

#accuracy {
  color: #ffffff;
}

.panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 100%;
}

.panel-title {
  font-size: 16px;
  margin: 0 0 4px;
  color: #ffffff;
}

.language-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.hidden {
  display: none !important;
}

.editor,
.code-viewer {
  flex: 1;
  min-height: 360px;
  border-radius: 14px;
  padding: 14px 18px;
  border: 1px solid #ffffff;
  background: #242626;
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas,
    'Liberation Mono', 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.7;
  color: #e5e7eb;
  resize: none;
  overflow: auto;
  tab-size: 2;
}

/* エディタのスクロールバー設定 */
.editor {
  /* 微妙なスクロールバーを非表示にする */
  scrollbar-width: thin;
  scrollbar-gutter: stable;
}

/* エディタのスクロールバー設定 */
.editor::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.editor::-webkit-scrollbar-track {
  background: transparent;
}

.editor::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.editor::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* スクロールが必要な場合のみスクロールバーを表示 */
.editor:not(:hover)::-webkit-scrollbar-thumb {
  background: transparent;
}

/* サンプルコードビューアーのスクロールバーを完全に非表示 */
.code-viewer {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE and Edge */
}

.code-viewer::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* プレイ画面ではエディタとサンプルコードの枠サイズを完全にそろえる */
.app-typing .editor,
.app-typing .code-viewer {
  height: 600px;
  min-height: 300px;
  max-height: 600px;
  flex: none;
  width: 100%;
  box-sizing: border-box;
}

@media (max-height: 900px) {
  .app-typing .editor,
  .app-typing .code-viewer {
    max-height: calc(100vh - 500px);
    height: auto;
  }
}

.editor {
  outline: none;
  caret-color: #ffffff;
}

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

.code-viewer {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
}

.code-viewer code {
  font-family: inherit;
  display: block;
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* サンプルコード内のシンタックスハイライトを無効化（正解/不正解の色は表示する） */
.code-viewer code .keyword,
.code-viewer code .string,
.code-viewer code .comment,
.code-viewer code .function,
.code-viewer code .number {
  color: inherit;
}

.code-progress {
  margin-top: 16px;
  height: 12px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid #ffffff;
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.app-typing .code-progress {
  display: none;
}

.code-progress-inner {
  display: block;
  height: 100%;
  width: 0%;
  background: #ffffff; /* 進捗部分を白で表示 */
  transition: width 0.15s ease-out;
}

/* ライトモードで進捗バーの色を黒に */
body.light-mode .code-progress-inner {
  background: #1a1a1a; /* 黒色 */
}

.code-char {
  position: relative;
  color: #6b7280; /* 未入力の文字は薄灰色 */
  text-decoration: none !important;
  border-bottom: none !important;
  text-underline-offset: 0 !important;
  text-underline-position: unset !important;
}

.code-char * {
  text-decoration: none !important;
  border-bottom: none !important;
}

.code-char::before,
.code-char::after {
  text-decoration: none !important;
  border-bottom: none !important;
}

.code-char.correct {
  color: #4caf50; /* 緑色 */
  background: transparent;
  text-decoration: none !important;
  border-bottom: none !important;
}


.code-char.cursor {
  position: relative;
}

.code-char.cursor::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  animation: blink 1s infinite;
  display: none; /* カーソルの縦線を非表示 */
}

/* 改行文字の場合は、改行マーカーの後にカーソルを表示 */
.code-char.cursor.newline-char::before {
  left: auto;
  right: -2px;
  display: none; /* カーソルの縦線を非表示 */
}

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

.code-char.missed {
  color: #ff6b6b; /* 赤色の文字 */
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  text-decoration: none !important;
  border-bottom: none !important;
}

.code-char.fixed {
  /* 修正済みの文字は通常の正解と同じ見た目にする（赤は使わない） */
  color: inherit;
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  text-decoration: none !important;
  border-bottom: none !important;
}

.code-char.fixed.space-char {
  color: inherit;
  background: transparent;
}

/* 改行ミスも記号は出さず、文字色だけで表現する */
.code-char.newline-missed {
  color: #ff6b6b; /* 赤色の文字 */
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  text-decoration: none !important;
  border-bottom: none !important;
}

/* 設定モーダル */
.settings-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.settings-modal-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #242626 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  max-width: 700px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: slideUp 0.3s ease-out;
}

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

.settings-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
}

.settings-modal-header h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.settings-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.settings-modal-close:hover {
  opacity: 0.7;
}

.settings-modal-body {
  padding: 32px;
}

.settings-group {
  margin-bottom: 48px;
}

.settings-group:last-child {
  margin-bottom: 0;
}

.settings-group-title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 12px;
}

body.light-mode .settings-group-title {
  color: #1a1a1a;
  border-bottom-color: rgba(0, 0, 0, 0.2);
}

.settings-section {
  margin-bottom: 32px;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.settings-description {
  margin: 0 0 20px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.5;
}

.settings-options {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.settings-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 12px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.2s ease;
}

.settings-option:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.settings-option input[type="radio"] {
  margin: 0;
  cursor: pointer;
}

.settings-option span {
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
}

.settings-option input[type="radio"]:checked + span {
  font-weight: 600;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}

.volume-slider {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4285f4;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-slider::-webkit-slider-thumb:hover {
  background: #5a9df5;
  transform: scale(1.1);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4285f4;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.volume-slider::-moz-range-thumb:hover {
  background: #5a9df5;
  transform: scale(1.1);
}

.volume-display {
  min-width: 50px;
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}

body.light-mode .volume-slider {
  background: rgba(0, 0, 0, 0.1);
}

body.light-mode .volume-display {
  color: #1a1a1a;
}

.color-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.color-preset-card {
  position: relative;
  padding: 16px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.color-preset-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.color-preset-card:hover {
  border-color: rgba(66, 133, 244, 0.4);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.color-preset-card:hover::before {
  opacity: 1;
}

.color-preset-card.selected {
  border-color: #4285f4;
  background: rgba(66, 133, 244, 0.15);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3), 0 4px 16px rgba(66, 133, 244, 0.2);
}

.color-preset-card.selected::before {
  opacity: 1;
}

.preset-colors {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.preset-color-sample {
  flex: 1;
  height: 50px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: transform 0.2s ease;
}

.color-preset-card:hover .preset-color-sample {
  transform: scale(1.05);
}

.preset-name {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  position: relative;
  z-index: 1;
}

.preset-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #4285f4;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 14px;
  font-weight: bold;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 2;
}

.preset-check::before {
  content: '';
  width: 8px;
  height: 12px;
  border: 2px solid #ffffff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  margin-top: -2px;
}

.color-preset-card.selected .preset-check {
  opacity: 1;
  transform: scale(1);
}

.settings-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-button {
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.settings-button-primary {
  background: linear-gradient(135deg, #4285f4 0%, #5a9fff 100%);
  color: #ffffff;
  border-color: #4285f4;
}

.settings-button-primary:hover {
  background: linear-gradient(135deg, #5a9fff 0%, #4285f4 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.settings-button-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.settings-button-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.app-typing .main {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 auto;
  min-height: 0;
  position: relative;
  max-width: 100%;
  align-self: center;
  width: 100%;
  flex-shrink: 0;
  max-height: calc(100vh - 400px);
  overflow: hidden;
}

.app-typing .panel-right {
  order: 1;
}

.app-typing .panel-left {
  order: 2;
}

.app-typing .panel-left,
.app-typing .panel-right {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.main-stats {
  display: flex;
  gap: 0;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
  pointer-events: none;
  z-index: 10;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
}

.main-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: none;
  padding: 0 32px;
  position: relative;
  min-width: 180px;
  align-items: center;
}

.main-stat:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
}

.main-stat-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  white-space: nowrap;
}

.main-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #ffffff;
  min-width: 120px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', 'Fira Code', Menlo, Monaco, Consolas, 'Courier New', monospace;
}

.app-typing {
  position: relative;
}

.app-typing .controls {
  display: none;
}

.app-typing .result-message.start-state {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 100% - 40px);
  margin: 0 auto;
  z-index: 20;
}

/* 結果画面もスタート画面と同様に中央配置にする */
.app-typing .result-message.result-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(720px, 100% - 40px);
  margin: 0 auto;
  z-index: 20;
}

.footer {
  margin-top: 10px;
  padding-top: 10px;
  border-top: none;
  display: flex !important; /* 確実に表示されるように */
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  visibility: visible !important; /* 確実に表示されるように */
}

.result-message {
  font-size: 15px;
  color: #ffffff;
}

.result-message strong {
  color: #ffffff;
}

.result-message.start-state {
  max-width: 780px;
  margin: 40px auto;
  padding: 0 16px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

.start-state-card {
  padding: 24px 32px;
  border-radius: 20px;
  border: 1px solid #ffffff;
  background: #242626;
  box-shadow: none;
  font-size: 15px;
  text-align: left;
}

.start-state-login-hint {
  margin-top: 16px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  background: rgba(12, 12, 12, 0.8);
  color: #f5f5f5;
  line-height: 1.6;
}

.start-state-login-hint-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.start-state-login-hint-text {
  margin: 0 0 12px;
  font-size: 13px;
  opacity: 0.9;
}

.start-state-login-button {
  display: inline-block;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.start-state-login-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: #9eff9e;
  text-decoration: none;
  font-weight: 600;
}

.start-state-login-link::after {
  content: "→";
  font-size: 12px;
  transition: transform 0.2s ease;
}

.start-state-login-link:hover::after {
  transform: translateX(2px);
}

body.light-mode .start-state-login-hint {
  background: rgba(255, 255, 255, 0.9);
  color: #1a1a1a;
  border-color: rgba(0, 0, 0, 0.07);
}

body.light-mode .start-state-login-link {
  color: #2563eb;
}

/* 結果画面 */
.result-screen {
  max-width: 780px;
  margin: 80px auto;
  padding: 0 16px;
}

.result-screen-animating {
  animation: resultScreenFadeIn 0.4s ease-out;
}

@keyframes resultScreenFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.result-card {
  padding: 32px 40px 28px;
  border-radius: 22px;
  border: 1px solid #ffffff;
  background: #242626;
}

.result-card-animating {
  animation: resultCardFadeIn 0.5s ease-out;
}

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

.result-course {
  margin: 0 0 32px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
}

.result-main-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 40px;
  margin-bottom: 28px;
}

/* レベル情報セクション */
.result-level-section {
  margin-bottom: 24px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.result-level-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.result-level-label {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
}

.result-level-value {
  font-size: 32px;
  font-weight: 700;
  color: #4caf50;
}

.result-level-progress {
  margin-top: 8px;
}

.result-level-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.result-level-progress-fill {
  height: 100%;
  background: #4caf50;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.result-level-progress-text {
  font-size: 11px;
  opacity: 0.8;
  text-align: center;
}

/* 詳細情報（WPM / CPM / Accuracy） */
.result-detail {
  margin-top: 4px;
  margin-bottom: 20px;
}

.result-detail-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 600;
  text-align: left;
}

.result-detail-toggle {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: opacity 0.2s ease;
}

.result-detail-toggle:hover {
  opacity: 0.8;
}

.result-detail-toggle-icon {
  font-size: 12px;
  transition: transform 0.2s ease;
  margin-left: 0;
}

.result-detail-content {
  margin-top: 12px;
}

.result-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-detail-item {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #ffffff;
  background: #242626;
}

.result-detail-label {
  font-size: 12px;
  opacity: 0.9;
  margin-bottom: 4px;
}

.result-detail-value {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 4px;
}

.result-detail-sub {
  font-size: 11px;
  opacity: 0.85;
}

.result-stat {
  flex: 1;
  text-align: center;
}

.result-stat-animating {
  animation: resultStatFadeIn 0.6s ease-out both;
}

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

.result-stat-label {
  font-size: 14px;
  margin-bottom: 8px;
}

.result-stat-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.result-stat-center .result-stat-value {
  font-size: 40px;
}

.result-buttons-row {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.result-rank-panel {
  margin-top: 8px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  text-align: center;
}

.result-rank-title {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 6px;
}

.result-rank-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-rank-panel .result-rank-value {
  font-size: 34px;
  font-weight: 700;
}

.result-rank-sub {
  font-size: 13px;
  opacity: 0.85;
}

.result-button {
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  border: 1px solid #ffffff;
  background: #242626;
  color: #ffffff;
  cursor: pointer;
}

.result-button-primary {
  font-weight: 600;
}

.twitter-share-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.result-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  opacity: 0.9;
}

.result-home-wrap {
  max-width: 780px;
  margin: 16px auto 0;
  padding: 0 16px;
  text-align: left;
}

.result-home-link {
  display: inline-block;
  font-size: 16px;
  font-weight: 500;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 0.2s ease;
}

.result-home-link::before {
  content: '← ';
  margin-right: 4px;
  font-weight: 600;
}

.result-home-link:hover {
  opacity: 0.7;
}

.result-footer-hint {
  text-align: right;
}

/* レポート送信ボタン（全ページ左下固定） */
.report-button {
  position: fixed;
  bottom: 20px;
  left: 20px;
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border: 2px solid #4285f4;
  background: linear-gradient(135deg, #4285f4 0%, #5a9fff 100%);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block !important;
  visibility: visible !important;
  z-index: 9999; /* 最前面に表示 */
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
  animation: reportButtonPulse 2s ease-in-out infinite;
}

.report-button::before {
  content: 'β ';
  font-weight: 700;
  margin-right: 4px;
}

.report-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.6);
  background: linear-gradient(135deg, #5a9fff 0%, #4285f4 100%);
  animation: none; /* ホバー時はアニメーションを停止 */
}

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

@keyframes reportButtonPulse {
  0%, 100% {
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
  }
  50% {
    box-shadow: 0 4px 20px rgba(66, 133, 244, 0.7);
  }
}

body.light-mode .report-button {
  border-color: #4285f4;
  background: linear-gradient(135deg, #4285f4 0%, #5a9fff 100%);
  color: #ffffff;
}

body.light-mode .report-button:hover {
  background: linear-gradient(135deg, #5a9fff 0%, #4285f4 100%);
}

.start-state-title {
  margin: 0 0 16px;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.start-state-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  justify-content: center;
}

.start-state-toggle {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid #ffffff;
  background: #242626;
  box-shadow: none;
  display: none; /* Space/Enterキーでスタート時に非表示 */
}

.start-state-main-text {
  font-size: 18px;
  font-weight: 600;
}

.start-state-main-text span {
  font-weight: 700;
}

.start-state-mode-select {
  margin-bottom: 16px;
}

.start-state-mode-label {
  display: block;
  font-size: 14px;
  color: #ffffff;
  margin-bottom: 8px;
  opacity: 0.9;
}

.start-state-mode-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.start-state-mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid #ffffff;
  border-radius: 8px;
  background: #242626;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.start-state-mode-btn:hover {
  background: #2a2c2c;
}

.start-state-mode-btn.active {
  background: #ffffff;
  color: #242626;
  font-weight: 600;
}

.start-state-mode-description {
  margin: 0;
  font-size: 12px;
  color: #ffffff;
  opacity: 0.8;
}

.start-state-tutorial {
  margin: 16px 0;
  padding: 16px;
  background: rgba(66, 133, 244, 0.1);
  border: 1px solid rgba(66, 133, 244, 0.3);
  border-radius: 12px;
}

.start-state-tutorial-title {
  font-size: 1em;
  font-weight: 700;
  margin: 0 0 12px;
  color: #ffffff;
}

.start-state-tutorial-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.start-state-tutorial-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.start-state-tutorial-icon {
  font-size: 1.5em;
  flex-shrink: 0;
}

.start-state-tutorial-text {
  font-size: 0.85em;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.start-state-tutorial-text strong {
  color: #4285f4;
  font-weight: 600;
}

.start-state-rules {
  margin: 16px 0 0;
  padding-left: 1.2em;
  font-size: 12px;
  line-height: 1.6;
  color: #ffffff;
}

@media (max-width: 768px) {
  .result-message.start-state {
    margin: 20px auto;
    max-height: calc(100vh - 40px);
  }
  
  .start-state-card {
    padding: 20px 24px;
  }
  
  .start-state-title {
    font-size: 20px;
    margin-bottom: 12px;
  }
  
  .start-state-tutorial-content {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .start-state-tutorial {
    margin: 12px 0;
    padding: 12px;
  }
  
  .start-state-tutorial-text {
    font-size: 0.8em;
  }
  
  .start-state-rules {
    font-size: 11px;
    margin-top: 12px;
  }
  
  .start-state-login-hint {
    margin-top: 12px;
    padding: 12px 16px;
  }
  
  .start-state-login-hint-title {
    font-size: 14px;
  }
  
  .start-state-login-hint-text {
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .result-message.start-state {
    margin: 10px auto;
    max-height: calc(100vh - 20px);
    padding: 0 12px;
  }
  
  .start-state-card {
    padding: 16px 20px;
  }

  .app-typing {
    padding: 80px 12px 60px;
  }

  .app-typing .editor,
  .app-typing .code-viewer {
    max-height: calc(100vh - 400px);
    min-height: 200px;
  }
  
  .start-state-title {
    font-size: 18px;
    margin-bottom: 10px;
  }
  
  .start-state-mode-select {
    margin-bottom: 12px;
  }
  
  .start-state-row {
    margin-bottom: 12px;
  }
  
  .start-state-main-text {
    font-size: 16px;
  }
  
  .start-state-tutorial {
    margin: 10px 0;
    padding: 10px;
  }
  
  .start-state-tutorial-title {
    font-size: 0.9em;
    margin-bottom: 10px;
  }
  
  .start-state-tutorial-content {
    gap: 8px;
  }
  
  .start-state-tutorial-text {
    font-size: 0.75em;
    line-height: 1.4;
  }
  
  .start-state-rules {
    font-size: 11px;
    margin-top: 10px;
    line-height: 1.5;
  }
  
  .start-state-login-hint {
    margin-top: 10px;
    padding: 10px 14px;
  }
  
  .start-state-login-hint-title {
    font-size: 13px;
    margin-bottom: 4px;
  }
  
  .start-state-login-hint-text {
    font-size: 11px;
    margin-bottom: 10px;
  }
  
  .start-state-footer {
    margin-top: 10px;
    flex-direction: column;
    gap: 12px;
  }
  
  .start-state-home-wrap,
  .start-state-settings-wrap {
    font-size: 16px;
    text-align: center;
  }
}

body.light-mode .start-state-tutorial {
  background: rgba(66, 133, 244, 0.05);
  border-color: rgba(66, 133, 244, 0.2);
}

body.light-mode .start-state-tutorial-title {
  color: #1a1a1a;
}

body.light-mode .start-state-tutorial-text {
  color: rgba(0, 0, 0, 0.8);
}

.start-state-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 12px;
  gap: 16px;
}

.start-state-home-wrap {
  text-align: left;
  font-size: 18px;
}

.start-state-home-link {
  display: inline-block;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  font-size: 18px;
  background: none;
  border: none;
  padding: 0;
  transition: opacity 0.2s ease;
}

.start-state-home-link::before {
  content: '← ';
  margin-right: 4px;
  font-weight: 600;
}

.start-state-home-link:hover {
  opacity: 0.7;
}

/* スタート画面の設定トグル */
.start-state-settings-wrap {
  text-align: right;
  font-size: 18px;
  position: relative;
}

.start-state-settings-toggle {
  display: inline-block;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
  font-size: 18px;
}

.start-state-settings-panel {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #ffffff;
  background: #242626;
  font-size: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  min-width: 600px;
  z-index: 1000;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  transform: none;
}

.start-state-settings-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.start-state-settings-row label {
  cursor: pointer;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .start-state-settings-panel {
    grid-template-columns: 1fr;
    min-width: auto;
    width: max-content;
    max-width: calc(100vw - 40px);
    right: 0;
    left: auto;
  }
  
  .start-state-settings-row label {
    white-space: normal;
  }
}


.hint {
  margin: 0;
  font-size: 11px;
  color: #ffffff;
  text-align: right;
}

/* ホーム（言語選択）画面 */

.app-home .main {
  margin-top: 16px;
}
.home-layout {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  padding: 0 20px;
  box-sizing: border-box;
}

.battle-mode-banner {
  margin-top: 24px;
  margin-bottom: 32px;
}

.battle-mode-link {
  display: block;
  padding: 24px 32px;
  border-radius: 20px;
  background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
  border: 2px solid #ffffff;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.battle-mode-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(59, 130, 246, 0.3);
}

.battle-mode-title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.battle-mode-description {
  margin: 0;
  font-size: 16px;
  opacity: 0.95;
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin: 40px auto 0;
  padding: 0 20px;
  max-width: 100%;
  width: 100%;
}

/* カルーセルスタイル */
.course-carousel-wrapper {
  position: relative;
  margin: 40px auto 0;
  max-width: 100%;
  padding: 0 60px;
  overflow: visible;
}

.course-carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 0 20px 0;
  position: relative;
  z-index: 1;
}

.course-carousel::-webkit-scrollbar {
  display: none;
}

.course-carousel-item {
  flex: 0 0 calc(33.333% - 16px);
  min-width: 350px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.course-carousel-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(26, 26, 26, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #ffffff;
  cursor: pointer;
  z-index: 1000;
  pointer-events: auto !important;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  line-height: 1;
  text-align: center;
  padding: 0;
}

.course-carousel-nav > * {
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
}

.course-carousel-nav:hover {
  background: rgba(40, 40, 40, 0.95);
  border-color: rgba(66, 133, 244, 0.5);
  transform: translateY(-50%) scale(1.1);
}

.course-carousel-nav:active {
  transform: translateY(-50%) scale(0.95);
}

.course-carousel-prev {
  left: 10px;
}

.course-carousel-prev::before {
  content: '\f104';
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-block;
  line-height: 1;
  font-size: 24px;
  color: #ffffff;
}

.course-carousel-prev {
  font-size: 0;
}

.course-carousel-next {
  right: 10px;
}

.course-carousel-next::before {
  content: '\f105';
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  display: inline-block;
  line-height: 1;
  font-size: 24px;
  color: #ffffff;
}

.course-carousel-next {
  font-size: 0;
}

body.light-mode .course-carousel-nav {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

body.light-mode .course-carousel-nav:hover {
  background: rgba(255, 255, 255, 1);
  border-color: rgba(66, 133, 244, 0.5);
}

body.light-mode .course-carousel-prev::before,
body.light-mode .course-carousel-next::before {
  color: #1a1a1a;
}

@media (max-width: 1200px) {
  .course-carousel-item {
    flex: 0 0 calc(50% - 12px);
    min-width: 300px;
  }
}

@media (max-width: 768px) {
  .course-carousel-wrapper {
    padding: 0 50px;
  }
  
  .course-carousel-item {
    flex: 0 0 calc(100% - 0px);
    min-width: 280px;
  }
  
  .course-carousel-nav {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
  
  .course-carousel-prev {
    left: 5px;
  }
  
  .course-carousel-next {
    right: 5px;
  }
}

.course-card {
  cursor: pointer;
  padding: 32px 28px;
  border-radius: 20px;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  border-bottom-left-radius: 20px;
  border-bottom-right-radius: 20px;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(26, 26, 26, 0.95) 100%);
  border: 2px solid rgba(255, 255, 255, 0.1);
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  color: inherit;
  outline: none;
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    background 0.4s ease,
    border-color 0.4s ease;
  font: inherit;
  opacity: 0;
  position: relative;
  overflow: hidden;
  min-height: 160px;
  z-index: 1;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.course-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #4285f4, #34a853, #fbbc04, #ea4335);
  opacity: 0;
  transition: opacity 0.4s ease;
}

.course-card:hover {
  transform: none;
  background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(25, 25, 25, 0.95) 100%);
  border-color: rgba(66, 133, 244, 0.5);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.course-card::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(66, 133, 244, 0.15) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.course-card:hover::after {
  opacity: 0;
}

.course-card:hover::before {
  opacity: 0;
}

.course-card:focus {
  outline: none !important;
  outline-offset: 0 !important;
}

.course-card:active {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.4),
    0 4px 8px rgba(66, 133, 244, 0.3);
}

/* すべてのボタンとフォーカス可能な要素のフォーカス時の枠線を削除 */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none !important;
  outline-offset: 0 !important;
}

.course-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  transition: all 0.4s ease;
  letter-spacing: 0.02em;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.course-card:hover .course-title {
  color: #ffffff;
  transform: none;
}

.course-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0 16px;
}

.course-description {
  margin: 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.7;
}

.course-description strong {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.course-recommended {
  margin: 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.7;
}

.course-recommended strong {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

.course-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.course-tag {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  background: rgba(66, 133, 244, 0.15);
  border: 1px solid rgba(66, 133, 244, 0.3);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.course-label {
  margin-top: 8px;
  display: inline-block;
  padding: 6px 14px;
  background: rgba(106, 139, 251, 0.12);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(106, 139, 251, 0.25);
  border-radius: 20px;
  font-size: 12px;
  color: #9BB5FF;
  font-weight: 500;
  font-style: normal;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.course-card-featured .course-label {
  border-radius: 20px !important;
  overflow: visible !important;
  margin-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  position: relative;
  z-index: 1;
}

.course-card-featured .course-content {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.course-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 15px;
  color: #4285f4;
  font-weight: 600;
  text-align: left;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
  padding: 8px 0;
}

.course-card:hover .course-link {
  color: #4285f4;
  transform: none;
}

.course-link-arrow {
  font-size: 18px;
  display: inline-block;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.course-card:hover .course-link-arrow {
  transform: none;
}

@media (max-width: 800px) {
  .course-grid {
    grid-template-columns: 1fr;
    padding: 0 10px;
  }
  
  .course-card {
    padding: 28px 24px;
    min-height: 140px;
  }
  
  .course-title {
    font-size: 20px;
  }
  
  .home-title {
    font-size: 2.5em !important;
    margin: 30px 0 40px !important;
  }
  
  .home-welcome-box {
    padding: 28px 24px;
    margin: 0 10px;
  }
  
  .home-welcome-title {
    font-size: 1.5em;
    margin-bottom: 16px;
  }
  
  .home-welcome-text {
    font-size: 0.95em;
    line-height: 1.7;
    margin-bottom: 8px;
  }
  
  .home-welcome-buttons {
    margin-top: 20px;
    flex-direction: column;
  }
  
  .home-welcome-btn {
    width: 100%;
    text-align: center;
  }
  
  .home-welcome-buttons {
    flex-direction: column;
  }
  
  .home-welcome-btn {
    width: 100%;
    text-align: center;
  }
  
  .hero-cta {
    flex-direction: column;
    align-items: stretch;
  }
  
  .hero-button {
    width: 100%;
    justify-content: center;
  }
  
  .target-cards,
  .benefits-grid {
    grid-template-columns: 1fr;
  }
  
  .about-features {
    grid-template-columns: 1fr;
  }
  
  .leaderboard-preview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app {
    margin: 12px;
    padding: 16px;
  }

  .main {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .hint {
    text-align: left;
  }

  .app-typing .app-title h1 {
    font-size: 56px;
  }
}

@media (max-width: 768px) {
  .app-typing .app-title {
    top: 10px;
  }

  .app-typing .app-title h1 {
    font-size: 48px;
  }

  .app-typing {
    padding: 100px 16px 60px;
  }

  .app-typing .editor,
  .app-typing .code-viewer {
    max-height: calc(100vh - 450px);
    min-height: 250px;
  }
}

/* ユーザー名入力モーダル */
.username-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease-out;
}

.username-modal-content {
  background: #252525;
  border: 1px solid #444;
  border-radius: 16px;
  padding: 32px;
  max-width: 500px;
  max-height: 90vh;
  width: 90%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: fadeInScale 0.3s ease-out;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.username-modal-title {
  margin: 0 0 12px 0;
  font-size: 1.5em;
  font-weight: 600;
  color: #ffffff;
}

.username-modal-description {
  margin: 0 0 20px 0;
  font-size: 0.9em;
  color: #d0d0d0;
  line-height: 1.6;
}

.username-modal-header {
  flex-shrink: 0;
}

.username-modal-scrollable {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  margin-bottom: 20px;
}

.username-modal-scrollable::-webkit-scrollbar {
  width: 8px;
}

.username-modal-scrollable::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.username-modal-scrollable::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

.username-modal-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.5);
}

#report-screenshot {
  margin-bottom: 12px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  color: #d0d0d0;
  text-align: center;
}

#report-screenshot img {
  max-width: 100%;
  max-height: 300px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid #333;
}

.username-modal-buttons {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.username-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #444;
  border-radius: 8px;
  background: #1a1a1a;
  color: #ffffff;
  font-size: 1em;
  margin-bottom: 20px;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.username-input:focus {
  outline: none;
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.username-modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.username-button {
  padding: 10px 24px;
  border: 1px solid #4285f4;
  border-radius: 8px;
  background: transparent;
  color: #ffffff;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.username-button-primary {
  background: #4285f4;
  border-color: #4285f4;
}

.username-button-primary:hover {
  background: #357ae8;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(66, 133, 244, 0.3);
}

.username-button:hover {
  background: #2a2a2a;
  border-color: #555;
}

/* ライトモード対応 */
body.light-mode .username-modal-content {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
}

body.light-mode .username-modal-title {
  color: #1a1a1a;
}

body.light-mode .username-modal-description {
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .username-modal-scrollable::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
}

body.light-mode .username-modal-scrollable::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

body.light-mode .username-modal-scrollable::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

body.light-mode #report-screenshot {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.7);
}

body.light-mode .username-modal-buttons {
  border-top-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .username-input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.2);
  color: #1a1a1a;
}

body.light-mode .username-input:focus {
  border-color: #4285f4;
  box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

body.light-mode .username-input::placeholder {
  color: rgba(0, 0, 0, 0.5);
}

body.light-mode .username-button {
  color: #4285f4;
  border-color: #4285f4;
}

body.light-mode .username-button:hover {
  background: rgba(66, 133, 244, 0.1);
  border-color: #4285f4;
}

body.light-mode .username-button-primary {
  background: #4285f4;
  color: #ffffff;
}

body.light-mode .username-button-primary:hover {
  background: #357ae8;
  color: #ffffff;
}

/* お知らせモーダルのライトモード対応 */
body.light-mode #announcements-close {
  color: #1a1a1a !important;
}

body.light-mode #announcements-close:hover {
  background: rgba(0, 0, 0, 0.1) !important;
}

body.light-mode #announcements-list [style*="color: #999"],
body.light-mode #announcements-list [style*="color:#999"] {
  color: rgba(0, 0, 0, 0.5) !important;
}

body.light-mode #announcements-list [style*="color: #fff"],
body.light-mode #announcements-list [style*="color:#fff"] {
  color: #1a1a1a !important;
}

body.light-mode #announcements-list [style*="color: #ccc"],
body.light-mode #announcements-list [style*="color:#ccc"] {
  color: rgba(0, 0, 0, 0.7) !important;
}

body.light-mode .username-modal-content [style*="color: #999"],
body.light-mode .username-modal-content [style*="color:#999"] {
  color: rgba(0, 0, 0, 0.5) !important;
}

body.light-mode .username-modal-content [style*="color: #e0e0e0"],
body.light-mode .username-modal-content [style*="color:#e0e0e0"] {
  color: rgba(0, 0, 0, 0.8) !important;
}

body.light-mode .announcement-item {
  border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

@media (max-width: 600px) {
  .username-modal-content {
    padding: 24px;
    max-height: 95vh;
  }

  .username-modal-title {
    font-size: 1.3em;
  }

  .username-modal-scrollable {
    max-height: calc(95vh - 200px);
  }
}

/* オンライン対戦モード */
.app-battle {
  position: relative;
}

.app-battle .header {
  position: relative;
  margin-bottom: 20px;
}

.app-battle .header-auth {
  position: fixed !important;
  top: 20px !important;
  right: 20px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 10001 !important;
  margin: 0 !important;
  transform: none !important;
}

.battle-header-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 16px;
}

.battle-score {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 18px;
  font-weight: 700;
}

.battle-score-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.battle-score-separator {
  font-size: 24px;
  color: #ffffff;
}

.battle-score-value {
  font-size: 24px;
  font-weight: 700;
  min-width: 30px;
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

.battle-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  border: 2px solid #ffffff;
  flex-shrink: 0;
}

.battle-avatar-me {
  background: #3b82f6;
  color: #ffffff;
}

.battle-avatar-opponent {
  background: #ef4444;
  color: #ffffff;
}

.battle-player-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.battle-main-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.battle-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 16px;
}

.battle-player {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #ffffff;
  background: #242626;
}

.battle-player-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.battle-player-name {
  font-size: 16px;
  font-weight: 600;
}

.battle-progress-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.battle-progress-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.battle-progress-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
  position: relative;
}

.battle-progress-fill {
  height: 100%;
  width: 0%;
  transition: width 0.2s ease-out;
  border-radius: 999px;
}

.battle-progress-fill-me {
  background: #3b82f6;
}

.battle-progress-fill-opponent {
  background: #ef4444;
}

.battle-main {
  margin-top: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  width: 100%;
  min-height: 0;
}

.battle-panel {
  position: relative;
}

.battle-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.battle-icons {
  display: flex;
  gap: 8px;
  align-items: center;
}

.battle-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  border: 2px solid #ffffff;
}

.battle-icon-me {
  background: #3b82f6;
  color: #ffffff;
}

.battle-icon-opponent {
  background: #ef4444;
  color: #ffffff;
}

.battle-code-progress {
  margin-top: 16px;
}

.battle-round-result {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  padding: 16px;
  border-radius: 12px;
  border: 2px solid #ffffff;
  background: #242626;
  animation: fadeInOut 2s ease-in-out;
}

.battle-win {
  color: #3b82f6;
  border-color: #3b82f6;
}

.battle-lose {
  color: #ef4444;
  border-color: #ef4444;
}

@keyframes fadeInOut {
  0%, 100% {
    opacity: 0;
  }
  10%, 90% {
    opacity: 1;
  }
}

.battle-final-result-container {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(600px, 100% - 40px);
  margin: 0 auto;
  z-index: 20;
}

.battle-final-result {
  padding: 40px;
  border-radius: 20px;
  border: 2px solid #ffffff;
  background: #242626;
  text-align: center;
}

.battle-final-title {
  margin: 0 0 32px;
  font-size: 32px;
  font-weight: 700;
}

.battle-final-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-bottom: 32px;
}

.battle-final-score-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.battle-final-score-item span {
  font-size: 48px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}

.battle-final-score-separator {
  font-size: 36px;
  font-weight: 700;
}

.battle-final-actions {
  margin-top: 24px;
}

@media (max-width: 900px) {
  .battle-header-info {
    flex-direction: column;
    align-items: flex-start;
  }

  .battle-players {
    grid-template-columns: 1fr;
  }

  .battle-main {
    grid-template-columns: 1fr;
  }
}

/* 対戦画面のパネルを横並びに */
.app-battle .battle-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.app-battle .panel-right {
  order: 1;
}

.app-battle .panel-left {
  order: 2;
}

/* 対戦画面のエディタとコードビューアの高さを統一 */
.app-battle .editor,
.app-battle .code-viewer {
  height: 560px;
  min-height: 560px;
  max-height: 560px;
  flex: none;
  width: 100%;
  box-sizing: border-box;
}

/* ローディング画面 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000000;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  animation: fadeIn 0.3s ease-out;
  opacity: 1;
}

.loading-overlay.hidden {
  display: none;
}

/* ローディング中はbodyとapp要素を非表示 */
body.loading .app {
  visibility: hidden;
}

body.loading {
  background: #000000;
  overflow: hidden;
}

.loading-content {
  text-align: center;
  color: #ffffff;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #4285f4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  margin: 0;
  font-size: 1.1em;
  color: #ffffff;
  font-weight: 500;
}

/* ライトテーマ時のローディング画面 */
html.light-mode .loading-overlay {
  background: #ffffff;
}

html.light-mode body.loading {
  background: #ffffff;
}

html.light-mode .loading-content {
  color: #1a1a1a;
}

html.light-mode .loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1);
  border-top-color: #4285f4;
}

html.light-mode .loading-text {
  color: #1a1a1a;
}

/* モバイル警告 */
.mobile-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  padding: 20px;
}

.mobile-warning-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #242626 100%);
  border: 2px solid rgba(255, 193, 7, 0.4);
  border-radius: 20px;
  padding: 32px;
  max-width: 500px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.mobile-warning-icon {
  font-size: 3em;
  margin-bottom: 16px;
}

.mobile-warning-content h3 {
  font-size: 1.5em;
  font-weight: 700;
  margin: 0 0 16px;
  color: #ffffff;
}

.mobile-warning-content p {
  font-size: 1em;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 24px;
}

.mobile-warning-button {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  background: #4285f4;
  color: #ffffff;
  border: none;
  transition: all 0.3s ease;
}

.mobile-warning-button:hover {
  background: #5a9fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

body.light-mode .mobile-warning-content {
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  border-color: rgba(255, 193, 7, 0.3);
}

body.light-mode .mobile-warning-content h3 {
  color: #1a1a1a;
}

body.light-mode .mobile-warning-content p {
  color: rgba(0, 0, 0, 0.8);
}

@media (min-width: 769px) {
  .mobile-warning {
    display: none !important;
  }
}

/* オンボーディングモーダル */
.onboarding-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  animation: fadeIn 0.3s ease-out;
  padding: 20px;
}

.onboarding-modal-content {
  background: linear-gradient(135deg, #1a1a1a 0%, #242626 100%);
  border: 2px solid rgba(66, 133, 244, 0.4);
  border-radius: 24px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: slideUp 0.4s ease-out;
}

.onboarding-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
}

.onboarding-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
}

.onboarding-modal-close {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 32px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
  opacity: 0.7;
}

.onboarding-modal-close:hover {
  opacity: 1;
}

.onboarding-modal-body {
  padding: 40px 32px;
  min-height: 300px;
}

.onboarding-step {
  display: none;
  text-align: center;
  animation: fadeIn 0.4s ease-out;
}

.onboarding-step.active {
  display: block;
}

.onboarding-icon {
  font-size: 4em;
  margin-bottom: 24px;
  animation: bounce 1s ease-in-out infinite;
}

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

.onboarding-step h3 {
  font-size: 1.5em;
  font-weight: 700;
  margin: 0 0 16px;
  color: #ffffff;
}

.onboarding-step p {
  font-size: 1em;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 24px;
}

.onboarding-step strong {
  color: #4285f4;
  font-weight: 600;
}

.onboarding-action {
  margin-top: 32px;
}

.onboarding-button {
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  border: none;
  font-family: inherit;
}

.onboarding-button-primary {
  background: #4285f4;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.onboarding-button-primary:hover {
  background: #5a9fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.onboarding-button-secondary {
  background: transparent;
  color: #ffffff;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.onboarding-button-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
}

.onboarding-modal-footer {
  padding: 24px 32px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.onboarding-progress {
  margin-bottom: 20px;
}

.onboarding-progress-bar {
  width: calc(100% + 64px);
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
  margin-left: -32px;
  margin-right: -32px;
}

.onboarding-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #4285f4 0%, #34d399 100%);
  border-radius: 999px;
  transition: width 0.3s ease;
  width: 100%;
}

.onboarding-progress-text {
  text-align: center;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.7);
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.onboarding-nav-button {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.onboarding-nav-button:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

.onboarding-nav-button-primary {
  background: #4285f4;
  border-color: #4285f4;
  margin-left: auto;
}

.onboarding-nav-button-primary:hover {
  background: #5a9fff;
  border-color: #5a9fff;
}

body.light-mode .onboarding-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
  border-color: rgba(66, 133, 244, 0.3);
}

body.light-mode .onboarding-modal-header {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .onboarding-modal-header h2,
body.light-mode .onboarding-step h3 {
  color: #1a1a1a;
}

body.light-mode .onboarding-step p {
  color: rgba(0, 0, 0, 0.8);
}

body.light-mode .onboarding-modal-close {
  color: #1a1a1a;
}

body.light-mode .onboarding-progress-bar {
  background: rgba(0, 0, 0, 0.1);
}

body.light-mode .onboarding-nav-button {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1a1a1a;
}

body.light-mode .onboarding-nav-button:hover {
  background: rgba(0, 0, 0, 0.1);
}

@media (max-width: 640px) {
  .onboarding-modal-content {
    max-width: 100%;
    border-radius: 16px;
  }
  
  .onboarding-modal-header {
    padding: 20px 24px;
  }
  
  .onboarding-modal-body {
    padding: 32px 24px;
  }
  
  .onboarding-step h3 {
    font-size: 1.3em;
  }
  
  .onboarding-icon {
    font-size: 3em;
  }
}

