:root {
  --primary-color: #67f2e2;
  --primary-dark: #4dd5c5;
  --primary-light: #86f8eb;
  --accent-color: #ff7b54;
  --text-dark: #2a3746;
  --text-light: #ffffff;
  --background-light: #f8f9fa;
  --card-bg: #ffffff;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.2);
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
}

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

body.event-page {
  font-family: 'Noto Sans JP', sans-serif;
  color: var(--text-dark);
  background: linear-gradient(135deg, #f6f8f9 0%, #e5ebee 100%);
  min-height: 100vh;
  padding-bottom: 60px; /* フッターの高さ分の余白 */
  overflow-x: hidden;
}

/* ローディングインジケーター */
#loading-indicator {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 1000;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(103, 242, 226, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
  margin-bottom: var(--spacing-md);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ヘッダー */
.app-header {
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: var(--spacing-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-logo h1 {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: 1px;
  margin: 0;
}

.user-nav {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
}

.user-nav p {
  font-size: 0.9rem;
  margin: 0;
}

.logout-btn {
  background-color: transparent;
  color: var(--text-light);
  border: 1px solid var(--text-light);
  border-radius: var(--border-radius-sm);
  padding: 4px 12px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background-color: var(--text-light);
  color: var(--primary-color);
}

/* メインコンテンツ */
.app-main {
  padding: var(--spacing-md);
  max-width: 100%;
  margin: 0 auto;
}

/* チャレンジセクション */
.challenge-section {
  margin-bottom: var(--spacing-xl);
}

.challenge-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
  position: relative;
}

.challenge-title {
  color: var(--accent-color);
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.challenge-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

/* 卵のステージ */
.egg-stage {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--spacing-xl);
  position: relative;
  height: 340px;
  /* 卵エリアをタップしたときにズームしないように設定 */
  touch-action: manipulation;
}

.egg-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  /* 卵エリアをタップしたときにズームしないように設定 */
  touch-action: manipulation;
}

.egg-glow {
  position: absolute;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(103, 242, 226, 0.3) 0%, rgba(103, 242, 226, 0) 70%);
  border-radius: 50%;
  z-index: 1;
  animation: pulse 3s infinite alternate;
}

@keyframes pulse {
  from { transform: scale(0.9); opacity: 0.5; }
  to { transform: scale(1.1); opacity: 0.8; }
}

.egg-main-img {
  max-width: 300px;
  filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.15));
  transform-origin: center bottom;
  transition: transform var(--transition-normal);
  position: relative;
  z-index: 3;
  /* タップ時に強調表示 */
  transform: scale(1);
}

.egg-main-img.egg-shake {
  animation: egg-shake 0.3s linear;
}

@keyframes egg-shake {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(8deg); }
}

/* ステータス表示 */
.stats-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.stats-item {
  display: flex;
  align-items: center;
  background-color: var(--background-light);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.stats-item:hover {
  transform: translateY(-2px);
}

.stats-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: var(--spacing-md);
  flex-shrink: 0;
}

.goal-icon {
  background-color: var(--primary-color);
  position: relative;
}

.goal-icon::before {
  content: '🎯';
  font-size: 18px;
}

.current-icon {
  background-color: var(--accent-color);
  position: relative;
}

.current-icon::before {
  content: '🔥';
  font-size: 18px;
}

.remaining-icon {
  background-color: var(--warning-color);
  position: relative;
}

.remaining-icon::before {
  content: '⏱️';
  font-size: 18px;
}

.stats-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.stats-label {
  font-size: 0.8rem;
  color: #6c757d;
  margin-bottom: 2px;
}

.stats-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.stats-value.highlight {
  color: var(--accent-color);
  font-size: 1.4rem;
}

/* プログレスバー */
.progress-container {
  width: 100%;
  margin-bottom: var(--spacing-xl);
}

.progress-bar {
  width: 100%;
  height: 16px;
  background-color: #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  margin-bottom: var(--spacing-xs);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  transition: width var(--transition-slow);
  border-radius: 8px;
  width: 0%;
  box-shadow: 0 0 8px rgba(103, 242, 226, 0.5);
}

.progress-label {
  text-align: right;
  font-size: 0.8rem;
  color: #6c757d;
}

/* カウントボタン */
.count-button {
  background: linear-gradient(145deg, #ff7b54, #ff9978);
  color: var(--text-light);
  border: none;
  border-radius: 50px;
  padding: 16px 32px;
  font-size: 1.3rem;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 
    0 10px 20px rgba(255, 123, 84, 0.3),
    0 6px 0 #e56a47,
    inset 0 2px 10px rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-top: 15px;
  z-index: 4;
  touch-action: manipulation;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  width: 85%;
  max-width: 320px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transform: translateY(0);
}

.count-button::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 80%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.8s ease, transform 0.5s ease;
}

.count-button:hover {
  transform: translateY(-3px);
  box-shadow: 
    0 15px 25px rgba(255, 123, 84, 0.4),
    0 8px 0 #e56a47,
    inset 0 2px 10px rgba(255, 255, 255, 0.4);
}

.count-button:hover::after {
  opacity: 0.8;
  transform: scale(1);
}

.count-button:active {
  transform: translateY(3px);
  box-shadow: 
    0 5px 10px rgba(255, 123, 84, 0.2),
    0 3px 0 #e56a47,
    inset 0 2px 8px rgba(255, 255, 255, 0.3);
}

.count-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0) 80%);
  transition: left 0.5s;
}

.btn-icon {
  font-size: 1.5rem;
  position: relative;
  z-index: 5;
  animation: pulse-icon 1.5s infinite alternate;
  transform-origin: center;
  display: inline-block;
  margin-left: 5px;
}

@keyframes pulse-icon {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}

/* 情報セクション */
.info-section {
  margin-bottom: var(--spacing-xl);
}

.info-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--spacing-xl);
  overflow: hidden;
}

.info-title {
  color: var(--text-dark);
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--spacing-lg);
  position: relative;
}

.info-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
}

.info-content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.info-item {
  display: flex;
  align-items: flex-start;
  gap: var(--spacing-md);
}

.info-icon {
  font-size: 1.8rem;
  background-color: rgba(103, 242, 226, 0.2);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}

.info-item p {
  font-size: 0.95rem;
  line-height: 1.5;
  flex: 1;
}

/* ナビゲーション */
.app-navigation {
  margin-top: var(--spacing-xl);
  display: flex;
  justify-content: center;
}

/* 複数カウントボタン */
.multi-count-buttons {
  display: flex;
  justify-content: center;
  gap: var(--spacing-md);
  margin-top: var(--spacing-md);
  width: 100%;
  max-width: 300px;
}

.count-multi-button {
  flex: 1;
  background-color: var(--primary-dark);
  color: var(--text-light);
  border: none;
  border-radius: var(--border-radius-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: 1rem;
  font-weight: 700;
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.count-multi-button:hover,
.count-multi-button:active {
  background-color: var(--primary-color);
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.count-multi-button:active {
  transform: translateY(2px);
}

.count-multi-button:focus {
  outline: none;
}

.count-multi-button .btn-text {
  position: relative;
  z-index: 2;
}

.home-button {
  background-color: var(--primary-color);
  color: var(--text-dark);
  border: none;
  border-radius: var(--border-radius-md);
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
}

.home-button:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.home-button:active {
  transform: translateY(1px);
  box-shadow: var(--shadow-sm);
}

/* フッター */
.app-footer {
  background-color: var(--text-dark);
  color: var(--text-light);
  text-align: center;
  padding: var(--spacing-md);
  position: fixed;
  bottom: 0;
  width: 100%;
  font-size: 0.8rem;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* メディアクエリ */
@media (min-width: 768px) {
  .stats-container {
    flex-direction: row;
    flex-wrap: wrap;
    gap: var(--spacing-md);
  }
  
  .stats-item {
    flex: 1;
    min-width: 30%;
  }
  
  .info-content {
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .info-item {
    flex: 1;
    min-width: 40%;
  }
}

/* アニメーション */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
