:root {
  --bg-dark: #0c0d12;
  --bg-gradient: linear-gradient(135deg, #0c0d12 0%, #151825 100%);
  --card-bg: rgba(20, 23, 34, 0.7);
  --card-border: rgba(255, 255, 255, 0.08);
  --primary-green: #10b981;
  --primary-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --text-white: #ffffff;
  --text-muted: #64748b;
  --safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --safe-area-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Outfit', 'Noto Sans JP', sans-serif;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* --- App Header --- */
.app-header {
  height: calc(60px + var(--safe-area-top));
  padding: 0 20px;
  padding-top: var(--safe-area-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  background: rgba(12, 13, 18, 0.8);
  backdrop-filter: blur(10px);
  z-index: 1000;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo h1 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(to right, var(--primary-green), var(--primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-sync-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--card-border);
  cursor: pointer;
  transition: background 0.3s;
}

.header-sync-status:active {
  background: rgba(255, 255, 255, 0.1);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background: var(--primary-green);
  box-shadow: 0 0 8px var(--primary-green);
}

/* --- View Container --- */
.app-container {
  flex: 1;
  overflow: hidden;
  padding: 0;
  position: relative;
}

/* --- Navigation --- */
.app-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(65px + var(--safe-area-bottom));
  padding-bottom: var(--safe-area-bottom);
  background: rgba(20, 23, 34, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1000;
}

.nav-item {
  background: none;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: color 0.3s, transform 0.2s;
  width: 60px;
  height: 50px;
}

.nav-item-camera {
  position: relative;
  top: -15px;
  width: 64px;
  height: 64px;
}

.camera-btn-inner {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-purple) 100%);
  border-radius: 50%;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
  border: 4px solid var(--bg-dark);
  transition: transform 0.3s;
}

.nav-item-camera:active .camera-btn-inner {
  transform: scale(0.9);
}

.nav-item.active {
  color: var(--primary-green);
}

.nav-item.active .nav-icon {
  transform: scale(1.15);
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.3s;
}

.nav-icon svg {
  width: 24px;
  height: 24px;
  display: block;
}

.camera-btn-inner .nav-icon svg {
  width: 26px;
  height: 26px;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 500;
}

/* --- View Toggle Logic --- */
.app-view {
  display: none;
  animation: fadeIn 0.4s ease-out;
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: calc(110px + var(--safe-area-bottom)); /* 下部ナビゲーションと被らないための余白 */
  -webkit-overflow-scrolling: touch; /* iOSでの慣性スクロール */
}

#view-map.app-view {
  padding: 0 !important;
  overflow: hidden !important;
}

.app-view.active {
  display: block;
}

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

/* --- Typography & Global UI --- */
h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(to right, var(--text-white), #cbd5e1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.w-full { width: 100%; }
.hidden { display: none !important; }
.divider {
  border: none;
  border-top: 1px solid var(--card-border);
  margin: 15px 0;
}

/* Cards (Glassmorphism) */
.welcome-card, .metric-card, .simulator-card, .weight-card, .trainer-board-card, .form-card, .diagnostics-card, .condition-card, .analysis-result-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.btn {
  border: none;
  padding: 14px 24px;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.3s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-purple) 100%);
  color: var(--text-white);
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-white);
  border: 1px solid var(--card-border);
}

.btn:active {
  transform: scale(0.97);
}

.btn-circle {
  border: none;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  color: var(--text-white);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.btn-circle:active {
  transform: scale(0.92);
}

/* --- Home / Dashboard Elements --- */
.activity-summary-grid {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.main-metric {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.sub-metrics {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sub-metrics .metric-card {
  margin-bottom: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.metric-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.metric-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.metric-data {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.metric-data .metric-value {
  font-size: 1.5rem;
  font-weight: 700;
}

.metric-data .metric-unit {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* SVG Activity Ring */
.progress-ring-container {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-bar {
  transition: stroke-dashoffset 0.6s ease-out;
}

.progress-ring-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.progress-ring-text .metric-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.progress-ring-text .metric-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: -4px;
}

.goal-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Simulator Details */
.sim-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.sim-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.badge {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  font-size: 0.65rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 600;
}

.sim-desc {
  font-size: 0.75rem;
  margin-bottom: 12px;
}

.sim-controls {
  display: flex;
  gap: 10px;
}

.sim-controls .btn {
  flex: 1;
  padding: 10px;
  font-size: 0.75rem;
}

/* Trainer Board Card */
.trainer-board-card {
  padding: 18px;
}

.trainer-avatar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.trainer-avatar {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.trainer-info h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.personality-tag {
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary-purple);
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 6px;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
}

.trainer-speech-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 12px 16px;
  position: relative;
}

.trainer-speech-bubble p {
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.6;
}

/* --- Map View Elements --- */
#leaflet-map {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 1;
}

.map-overlay-header {
  position: absolute;
  top: 75px;
  left: 16px;
  right: 16px;
  z-index: 10;
}

.overlay-card {
  background: rgba(12, 13, 18, 0.3); /* 透過率70%(2026/7/14長屋様指示) */
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 14px 20px;
  backdrop-filter: blur(10px);
}

.overlay-stats {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.overlay-stats .label {
  font-size: 0.65rem;
  color: var(--text-muted);
  display: block;
}

.overlay-stats .value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-green);
}

.overlay-stats .separator {
  width: 1px;
  height: 25px;
  background: var(--card-border);
}

.map-overlay-controls {
  position: absolute;
  bottom: calc(85px + var(--safe-area-bottom));
  left: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#map-locate-btn {
  background: rgba(12, 13, 18, 0.85);
}

#map-tracking-btn {
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.85rem;
}

/* --- AI Meal Photo Elements --- */
.view-header {
  margin-bottom: 20px;
}

.view-header p {
  font-size: 0.8rem;
}

.photo-upload-container {
  height: 220px;
  border: 2px dashed var(--card-border);
  border-radius: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 16px;
  transition: border-color 0.3s, background 0.3s;
}

.photo-upload-container:active {
  border-color: var(--primary-purple);
  background: rgba(255, 255, 255, 0.05);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.upload-placeholder .upload-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.upload-placeholder h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.photo-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.meal-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.condition-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.condition-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-white);
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.chip.active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-green);
  border-color: var(--primary-green);
}

/* Analysis Results Dashboard */
.analysis-result-card {
  border-color: rgba(139, 92, 246, 0.2);
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.result-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.calorie-badge {
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary-green);
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
}

.pfc-container {
  margin: 15px 0;
}

.pfc-bar-total {
  height: 20px;
  background: #1e293b;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  font-size: 0.65rem;
  font-weight: 700;
  text-align: center;
  line-height: 20px;
  margin-bottom: 10px;
}

.pfc-segment {
  height: 100%;
}

.p-segment { background: var(--accent-blue); }
.f-segment { background: #eab308; }
.c-segment { background: var(--primary-purple); }

.pfc-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pfc-legend .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}

.p-dot { background: var(--accent-blue); }
.f-dot { background: #eab308; }
.c-dot { background: var(--primary-purple); }

.trainer-eval-container {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.trainer-eval-container .speech-bubble {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 14px;
  flex: 1;
}

.trainer-eval-container .speech-bubble h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.trainer-eval-container .speech-bubble p {
  font-size: 0.78rem;
  color: #f1f5f9;
  line-height: 1.5;
}

/* --- Ranking View Elements --- */
.tab-sub-nav {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  padding: 4px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.sub-tab {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.sub-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-white);
}

.ranking-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ranking-item {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 12px 18px;
  border-radius: 16px;
}

.ranking-badge {
  font-size: 1rem;
  font-weight: 700;
  width: 28px;
  color: var(--text-muted);
}

.ranking-item.rank-1 .ranking-badge { color: #f59e0b; font-size: 1.2rem; }
.ranking-item.rank-2 .ranking-badge { color: #cbd5e1; font-size: 1.15rem; }
.ranking-item.rank-3 .ranking-badge { color: #b45309; font-size: 1.1rem; }

.rank-avatar {
  font-size: 1.3rem;
  margin-right: 12px;
}

.rank-details {
  flex: 1;
}

.rank-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.rank-score {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rank-value-box {
  text-align: right;
}

.rank-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-green);
}

.rank-item.my-rank {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

/* --- My Page View Elements --- */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.3s;
}

.form-group input:focus {
  border-color: var(--primary-purple);
}

.diagnostics-card {
  border-color: rgba(16, 185, 129, 0.2);
  animation: slideUp 0.4s ease-out;
}

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

.diagnostics-summary {
  display: flex;
  gap: 16px;
  align-items: center;
}

.diagnostics-character-art {
  font-size: 3rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--card-border);
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diagnostics-text h4 {
  font-size: 1rem;
  font-weight: 700;
}

.highlight {
  color: var(--primary-green);
}

.highlight-group {
  color: var(--primary-purple);
  font-weight: 700;
}

.diag-desc {
  font-size: 0.78rem;
  margin-top: 6px;
  line-height: 1.5;
}

.trainer-setup-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  padding: 14px;
  border-radius: 16px;
}

.trainer-setup-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.trainer-setup-card .trainer-avatar-container {
  margin-bottom: 10px;
}

.trainer-intro-text {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-style: italic;
  line-height: 1.6;
  background: rgba(0, 0, 0, 0.2);
  padding: 10px 14px;
  border-radius: 10px;
}

/* --- GPS Pulse Animation Marker --- */
.gps-pulse-marker {
  position: relative;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-core {
  width: 12px;
  height: 12px;
  background: var(--primary-green);
  border: 2px solid var(--text-white);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--primary-green);
  z-index: 2;
}

.pulse-glow {
  position: absolute;
  width: 24px;
  height: 24px;
  background: rgba(16, 185, 129, 0.4);
  border-radius: 50%;
  animation: pulse 1.8s infinite ease-out;
  z-index: 1;
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 1;
  }
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* --- Music Workout View Elements --- */
.music-auth-card, .sensor-permission-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
}

.music-auth-info, .sensor-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.music-logo {
  font-size: 1.8rem;
}

.sensor-icon {
  font-size: 1.8rem;
  color: #f59e0b;
}

.music-auth-info h4, .sensor-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
}

.music-auth-info p, .sensor-info p {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Player Card */
.player-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.player-disc-area {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 16px;
}

.player-disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #2a2d3e 20%, #090a0f 60%, #1a1c29 100%);
  border: 8px solid rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  transition: transform 0.5s;
  animation: rotateDisc 20s linear infinite;
  animation-play-state: paused;
}

.player-disc.playing {
  animation-play-state: running;
}

@keyframes rotateDisc {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sync-combo-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 5;
  animation: scaleIn 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 20px var(--primary-purple);
}

@keyframes scaleIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.combo-count {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1;
}

.combo-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 1px;
}

.player-info h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.player-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.bpm-tag {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  display: inline-block;
}

/* Sync Meter */
.sync-meter-container {
  width: 100%;
  margin: 18px 0;
  text-align: left;
}

.sync-meter-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.sync-meter-header .sync-value {
  color: var(--primary-green);
  font-weight: 700;
}

.sync-meter-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.sync-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--primary-purple), var(--primary-green));
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.1, 0.8, 0.2, 1);
  box-shadow: 0 0 8px var(--primary-green);
}

.fever-indicator {
  margin-top: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #ff3366;
  text-align: center;
  letter-spacing: 0.5px;
  text-shadow: 0 0 8px rgba(255, 51, 102, 0.6);
  animation: feverBlink 1s infinite alternate;
}

@keyframes feverBlink {
  0% { opacity: 0.5; transform: scale(0.98); }
  100% { opacity: 1; transform: scale(1.02); }
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 10px;
}

/* Playlist Cards */
.workout-playlist-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.workout-playlist-card h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.playlist-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s;
}

.playlist-item:active {
  background: rgba(255, 255, 255, 0.05);
}

.playlist-item.active {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.25);
}

.playlist-icon {
  font-size: 1.5rem;
}

.playlist-details h4 {
  font-size: 0.8rem;
  font-weight: 600;
}

.playlist-details p {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Intensity Indicator */
.intensity-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 14px 18px;
  margin-bottom: 16px;
}

.intensity-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.intensity-header span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.intensity-header .intensity-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-green);
}

.intensity-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Device Sync Health Panel Style */
.health-sync-panel {
  background: rgba(16, 185, 129, 0.03);
  border: 1px dashed rgba(16, 185, 129, 0.2);
  border-radius: 16px;
  padding: 14px 18px;
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.health-sync-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary-green);
}

.health-sync-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.health-sync-link {
  font-size: 0.7rem;
  color: var(--primary-purple);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  margin-top: 2px;
}

.health-sync-link:hover {
  text-decoration: underline;
}

/* --- Sensor Pulse Animation --- */
.active-pulse {
  animation: statusPulse 0.8s infinite alternate !important;
}

@keyframes statusPulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.35);
    box-shadow: 0 0 12px rgba(16, 185, 129, 1);
    opacity: 1;
  }
}

/* Label Buttons styling check */
label.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  user-select: none;
}
label.btn:active {
  transform: scale(0.98);
}

/* --- Healthcare Sync Toast Notification --- */
.health-toast-container {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 350px;
  z-index: 9999;
  transition: top 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.health-toast-container.show {
  top: calc(16px + var(--safe-area-top));
}

.health-toast-content {
  background: rgba(20, 23, 34, 0.95);
  border: 1.5px solid var(--primary-green);
  border-radius: 20px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 30px rgba(16, 185, 129, 0.25);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.health-toast-icon {
  font-size: 1.6rem;
  color: var(--primary-green);
}

/* --- Leaflet Map Custom Style & Animation --- */
.map-floating-text {
  position: absolute;
  z-index: 9999;
  color: #10b981;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.9), 0 0 2px #000;
  pointer-events: none;
  animation: floatUpAndOut 1.5s cubic-bezier(0.19, 1, 0.22, 1) forwards;
  transform: translate(-50%, -50%);
}

@keyframes floatUpAndOut {
  0% {
    transform: translate(-50%, -50%) translateY(0);
    opacity: 1;
    scale: 0.8;
  }
  20% {
    scale: 1.25;
  }
  100% {
    transform: translate(-50%, -50%) translateY(-75px);
    opacity: 0;
    scale: 1.0;
  }
}

.map-tile-fadein {
  animation: tileFadeIn 0.8s ease-out forwards;
}

@keyframes tileFadeIn {
  0% {
    fill-opacity: 0;
    stroke-opacity: 0;
  }
  100% {
    fill-opacity: 0.35;
    stroke-opacity: 1;
  }
}

/* --- Pulse Glow Animation for Wake Lock & GPS Marker --- */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
    opacity: 0.8;
  }
  50% {
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.8);
    opacity: 1;
  }
  100% {
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
    opacity: 0.8;
  }
}

.pulse-glow {
  animation: pulse-glow 2s infinite;
}

/* --- GPS Pulse Marker for Leaflet --- */
.gps-pulse-marker {
  position: relative;
  width: 24px !important;
  height: 24px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid #fff;
  z-index: 2;
  box-shadow: 0 0 6px rgba(59, 130, 246, 0.8);
}

.pulse-glow-circle {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.35);
  animation: pulseGlowCircle 1.8s infinite ease-out;
  z-index: 1;
}

@keyframes pulseGlowCircle {
  0% {
    transform: scale(0.6);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* Custom Inline Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #111318;
  border: 1px solid var(--card-border);
  border-radius: 24px;
  width: 90%;
  max-width: 380px;
  padding: 30px 24px;
  box-sizing: border-box;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.show .modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.modal-close-btn:hover {
  color: #fff;
}

.account-item-inline:hover {
  background: rgba(255,255,255,0.08) !important;
  border-color: #3b82f6 !important;
}

/* Toggle Switch Styles */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: 0.3s;
  border-radius: 24px;
  border: 1px solid var(--card-border);
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--primary-green);
}

input:checked + .slider-round:before {
  transform: translateX(20px);
}

/* Custom Range Input (BPM Slider) Styles */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  height: 6px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary-green);
  cursor: pointer;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.5);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.2);
}

/* Troubleshooting detail tags custom styling */
details summary::-webkit-details-marker {
  display: none;
}
details summary {
  list-style: none;
}

/* --- Meal History Section --- */
.meal-history-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
}

.meal-history-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-white);
  margin-bottom: 12px;
  opacity: 0.9;
}

.meal-history-card {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.07);
}

.meal-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.meal-history-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-white);
}

.meal-history-cal {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary-green);
}

.meal-history-meta {
  display: flex;
  gap: 10px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.meal-history-date {
  margin-left: auto;
  color: var(--text-muted);
}


/* Weight Tracking Card */
.weight-stats-row {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.weight-stat {
  flex: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 14px;
}

.weight-stat-label {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 2px;
}

.weight-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
}

.weight-chart-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  margin-bottom: 14px;
}

.weight-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  pointer-events: none;
}

.weight-input-row {
  display: flex;
  gap: 10px;
}

.weight-input-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.weight-input-row input:focus {
  border-color: var(--primary-green);
}

.weight-input-row .btn {
  padding: 10px 18px;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* ===== Onboarding (初回起動チュートリアル) ===== */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: var(--bg-dark);
  background-image: var(--bg-gradient);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(28px + var(--safe-area-top)) 24px calc(28px + var(--safe-area-bottom));
  overflow-y: auto;
}

.ob-step {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: fadeIn 0.45s ease-out;
}

.ob-logo {
  font-size: 3.2rem;
  margin-bottom: 12px;
}

.ob-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(to right, var(--primary-green), var(--primary-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.ob-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}

.ob-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 22px;
}

.ob-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
  text-align: left;
}

.ob-form label {
  font-size: 0.75rem;
  color: #cbd5e1;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.ob-form input {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 13px 16px;
  color: #fff;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
}

.ob-form input:focus {
  border-color: var(--primary-green);
}

.ob-btn-primary {
  width: 100%;
  padding: 15px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-purple));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.3);
}

.ob-btn-secondary {
  width: 100%;
  padding: 13px;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
}

.ob-btn-primary:active, .ob-btn-secondary:active {
  transform: scale(0.98);
}

.ob-trainer-reveal {
  width: 100%;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 22px;
  backdrop-filter: blur(16px);
  animation: fadeIn 0.6s ease-out;
}

.ob-trainer-avatar {
  font-size: 3rem;
  margin-bottom: 8px;
}

.ob-trainer-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 4px;
}

.ob-trainer-msg {
  font-size: 0.8rem;
  color: #cbd5e1;
  line-height: 1.7;
}

.ob-status {
  font-size: 0.8rem;
  color: var(--primary-green);
  min-height: 1.4em;
  margin-bottom: 14px;
  line-height: 1.6;
}

.ob-progress {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 26px;
}

.ob-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transition: background 0.3s, transform 0.3s;
}

.ob-dot.active {
  background: var(--primary-green);
  transform: scale(1.25);
}

.ob-btn-primary:disabled {
  opacity: 0.45;
  box-shadow: none;
  cursor: not-allowed;
}

.ob-gender-group {
  display: flex;
  gap: 10px;
}

.ob-gender-btn {
  flex: 1;
  padding: 12px 0;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.ob-gender-btn.active {
  color: #fff;
  border-color: var(--primary-green);
  background: rgba(16, 185, 129, 0.15);
}

/* App footer credit (all scrollable views) */
.app-view::after {
  content: "Produced by Delicious Notes Inc.";
  display: block;
  text-align: center;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(100, 116, 139, 0.55);
  padding: 20px 0 4px;
}

#view-map.app-view::after { content: none; }


/* MAP画面グラフィックイコライザー（音楽再生中のみ表示） */
#map-eq {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 16px;
  background: rgba(10, 12, 20, 0.3); /* 透過率70%: 背景の地図がうっすら見える(2026/7/14長屋様指示) */
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
#map-eq.hidden { display: none; }
#map-eq-canvas { width: 100%; height: 52px; display: block; }
#map-eq-row { display: flex; align-items: center; gap: 8px; }
#map-eq-title {
  text-align: center;
  font-size: 0.68rem;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-mini-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: #fff; font-size: 0.8rem;
  display: flex; align-items: center; justify-content: center;
}

/* 音楽画面 ビジュアライザーカード */
#music-eq-canvas { width: 100%; height: 150px; display: block; border-radius: 12px; background: rgba(0,0,0,0.25); }
#eq-song-line {
  margin-top: 8px; text-align: center;
  font-size: 0.72rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#eq-style-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.eq-chip {
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.04);
  color: var(--text-muted); font-size: 0.62rem; font-weight: 600;
}
.eq-chip.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-purple));
}
#eq-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.eq-ctl { width: 40px; height: 40px; font-size: 0.95rem; }
.eq-ctl-main {
  width: 58px; height: 58px; font-size: 1.5rem;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-purple));
  border: none;
}

/* 体重グラフ期間タブ */
#weight-range-tabs { display: flex; gap: 5px; margin-bottom: 10px; }
.wr-tab {
  flex: 1; padding: 6px 0; border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.03);
  color: var(--text-muted); font-size: 0.66rem; font-weight: 700;
}
.wr-tab.active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--primary-green), var(--primary-purple));
}

#eq-freq-line {
  margin-top: 4px; text-align: center;
  font-size: 0.6rem; font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}


/* フローティング・トレーナー（全画面常駐） */
#floating-trainer {
  position: fixed;
  right: 14px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
#floating-trainer.hidden { display: none; }
#floating-trainer-btn {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2px solid transparent;
  background:
    linear-gradient(rgba(15,18,30,0.92), rgba(15,18,30,0.92)) padding-box,
    linear-gradient(135deg, var(--primary-green), var(--primary-purple)) border-box;
  font-size: 1.7rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
  animation: trainer-bob 3.2s ease-in-out infinite;
}
@keyframes trainer-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
#floating-trainer-bubble {
  max-width: 210px;
  background: rgba(15,18,30,0.95);
  border: 1px solid var(--primary-green);
  border-radius: 14px 14px 4px 14px;
  padding: 9px 12px;
  font-size: 0.68rem;
  line-height: 1.5;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.45);
}
#floating-trainer-bubble.hidden { display: none; }
/* マップ画面では塗り旅ボタンと重ならないよう上へ退避 */
body[data-view="map"] #floating-trainer { bottom: calc(160px + env(safe-area-inset-bottom)); }
/* 食事(カメラ)画面は撮影の邪魔をしない位置 */
body[data-view="meal"] #floating-trainer { bottom: calc(150px + env(safe-area-inset-bottom)); }

/* ============================================================
   リズムゲーム v2 HUD（rhythm_game_ux_spec.md 2026/7/14）
   ============================================================ */
#beat-ring {
  position: relative;
  width: 180px; height: 180px;
  border-radius: 50%;
  border: 3px solid var(--primary-green, #10b981);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.25) inset, 0 0 18px rgba(16, 185, 129, 0.18);
  transition: border-color 0.3s;
}
#beat-ring.beat-pulse { animation: beatPulse 0.24s ease-out; }
#beat-ring.beat-pulse-strong { animation: beatPulseStrong 0.26s ease-out; }
@keyframes beatPulse { 0% { transform: scale(1); } 40% { transform: scale(1.08); } 100% { transform: scale(1); } }
@keyframes beatPulseStrong {
  0% { transform: scale(1); box-shadow: 0 0 24px rgba(16,185,129,0.25) inset, 0 0 18px rgba(16,185,129,0.2); }
  40% { transform: scale(1.18); box-shadow: 0 0 34px rgba(16,185,129,0.5) inset, 0 0 34px rgba(16,185,129,0.5); }
  100% { transform: scale(1); }
}
#beat-ring.fever-ring {
  border-color: #ffd166;
  box-shadow: 0 0 30px rgba(255, 209, 102, 0.5) inset, 0 0 34px rgba(245, 158, 11, 0.5);
}
#combo-giant {
  font-size: 4.2rem; font-weight: 800; color: #fff; line-height: 1;
  text-shadow: 0 0 22px rgba(16, 185, 129, 0.6);
}
#beat-ring.fever-ring #combo-giant { text-shadow: 0 0 26px rgba(255, 209, 102, 0.85); }
#combo-giant.combo-bounce { animation: comboBounce 0.12s ease-out; }
@keyframes comboBounce { 0% { transform: scale(1.15); } 100% { transform: scale(1); } }
#combo-guide { position: absolute; bottom: 34px; font-size: 0.68rem; color: var(--text-muted); }
#judge-float { position: relative; height: 34px; margin-top: 6px; display: flex; gap: 10px; align-items: flex-end; }
.judge-item { animation: judgeRise 0.6s ease-out forwards; font-weight: 800; }
.judge-perfect { color: #ffd166; font-size: 1.15rem; text-shadow: 0 0 14px rgba(255,209,102,0.8); }
.judge-good { color: var(--primary-green, #10b981); font-size: 1rem; }
.judge-miss { color: #94a3b8; font-size: 0.85rem; animation: judgeSink 0.6s ease-out forwards; }
@keyframes judgeRise { 0% { opacity: 0; transform: translateY(14px); } 25% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
@keyframes judgeSink { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(10px); } }

/* トレーナー演出（ショップ装飾） */
#floating-trainer-btn.fx-sparkle { box-shadow: 0 0 16px rgba(255, 255, 255, 0.75), 0 0 30px rgba(167, 139, 250, 0.6); animation: fxTwinkle 1.6s ease-in-out infinite; }
@keyframes fxTwinkle { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.45); } }
#floating-trainer-btn.fx-confetti::after { content: "🎊"; position: absolute; top: -10px; right: -6px; font-size: 1rem; animation: fxBob 1.2s ease-in-out infinite; }
#floating-trainer-btn.fx-spotlight { box-shadow: 0 -18px 40px 6px rgba(255, 255, 224, 0.4), 0 0 14px rgba(255,255,255,0.5); }
#floating-trainer-btn.fx-flame { box-shadow: 0 0 18px rgba(245, 158, 11, 0.85), 0 0 36px rgba(239, 68, 68, 0.55); animation: fxTwinkle 0.9s ease-in-out infinite; }
#floating-trainer-btn.fx-crown::after { content: "👑"; position: absolute; top: -14px; left: 50%; transform: translateX(-50%); font-size: 1.05rem; animation: fxBob 1.6s ease-in-out infinite; }
@keyframes fxBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
