/* ==========================================================================
   Variables - ちょこポイ テーマカラー & フォント
   ========================================================================== */
:root {
  /* Colors - プレミアム・ショコラ & シャンパンゴールド */
  --color-primary: #3D261C;      /* 深みのあるカカオブラウン */
  --color-primary-light: #5C4A40;
  --color-secondary: #FF8E9E;    /* プレミアムローズ（甘すぎない大人色） */
  --color-accent: #D4AF37;       /* シャンパンゴールド */
  --color-accent-soft: #E8C07D;
  
  --color-background: #FDFBFA;   /* 非常に薄いベージュホワイト */
  --color-card-bg: rgba(255, 255, 255, 0.85);
  
  --color-text-main: #2D1B14;    /* エスプレッソブラウン */
  --color-text-muted: #8E7C72;   /* ソフトなブラウン */
  --color-border: rgba(61, 38, 28, 0.08);
  
  --color-success: #66BB6A;
  --color-warning: #FFA726;
  --color-danger: #EF5350;

  /* Typography - モダンな Outfit (英数字) + 親しみやすい Zen Maru (日本語) */
  --font-family-base: 'Outfit', 'Zen Maru Gothic', 'Inter', -apple-system, sans-serif;
  --font-family-heading: 'Outfit', 'Zen Maru Gothic', sans-serif;

  /* Glassmorphism Logic */
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-blur: blur(12px);
  --glass-shadow: 0 8px 32px 0 rgba(45, 27, 20, 0.08);

  /* Layout & Spacing */
  --border-radius-sm: 10px;
  --border-radius-md: 20px;
  --border-radius-lg: 30px;
  --border-radius-pill: 100px;

  --spacing-xs: 6px;
  --spacing-sm: 12px;
  --spacing-md: 20px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;

  /* Shadows - 洗練された奥行き */
  --shadow-sm: 0 2px 10px rgba(45, 27, 20, 0.03);
  --shadow-md: 0 10px 30px rgba(45, 27, 20, 0.06);
  --shadow-lg: 0 20px 50px rgba(45, 27, 20, 0.1);
  --shadow-hover: 0 15px 40px rgba(45, 27, 20, 0.12);
}

/* ==========================================================================
   Reset & Base Styles
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family-base);
  background-color: var(--color-background);
  color: var(--color-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-primary-dark);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* ==========================================================================
   Layout 
   ========================================================================== */
.app-container {
  max-width: 800px;
  /* モバイルファースト〜タブレットを意識した幅 */
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--color-background);
  position: relative;
  box-shadow: var(--shadow-md);
}

.main-content {
  flex: 1;
  padding: var(--spacing-md);
  padding-bottom: 80px;
  /* 下部ナビゲーションのスペース */
}

/* ==========================================================================
   Header Navbar
   ========================================================================== */
.top-header {
  background-color: var(--color-card-bg);
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--color-border);
}

.logo-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
}

.app-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: 0.5px;
}

.app-subtitle {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: -4px;
}

/* ==========================================================================
   Bottom Navigation Bar (App-like feel)
   ========================================================================== */
.bottom-nav {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 760px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  display: flex;
  justify-content: space-around;
  padding: var(--spacing-sm) var(--spacing-md);
  box-shadow: var(--glass-shadow);
  border: 1px solid var(--glass-border);
  z-index: 1000;
  border-radius: var(--border-radius-pill);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--color-text-muted);
  font-size: 0.75rem;
  padding: var(--spacing-xs) var(--spacing-sm);
  transition: all 0.3s ease;
}

.nav-item.active {
  color: var(--color-primary);
  font-weight: 700;
}

.nav-item i {
  font-size: 1.25rem;
  margin-bottom: 2px;
}

/* ==========================================================================
   Components 
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--border-radius-pill);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  text-align: center;
  gap: 8px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  box-shadow: 0 8px 20px rgba(61, 38, 28, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  box-shadow: 0 12px 28px rgba(61, 38, 28, 0.35);
  transform: translateY(-2px);
}

/* Cards */
.card {
  background: var(--color-card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-md);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-md);
  border: 1px solid var(--glass-border);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

.card:hover {
  transform: translateY(-5px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--color-accent-soft);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

/* Badges & Pills */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: var(--border-radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
}

.badge-category {
  background-color: var(--color-background);
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

.badge-highlight {
  background: linear-gradient(135deg, var(--color-secondary), #FF9A9E);
  color: #fff;
  box-shadow: 0 2px 6px rgba(255, 179, 186, 0.4);
}

/* Typography Helpers */
.text-h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.text-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.text-h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xs);
}

.text-body {
  font-size: 0.95rem;
  color: var(--color-text-main);
}

.text-small {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.text-center {
  text-align: center;
}

/* Utils */
.flex-row {
  display: flex;
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: var(--spacing-sm);
}

.gap-md {
  gap: var(--spacing-md);
}

.mt-sm {
  margin-top: var(--spacing-sm);
}

.mt-md {
  margin-top: var(--spacing-md);
}

.mb-sm {
  margin-bottom: var(--spacing-sm);
}

.mb-md {
  margin-bottom: var(--spacing-md);
}

/* Icons (using FontAwesome class names as convention) */
.icon {
  font-family: 'FontAwesome';
  font-style: normal;
}

/* Ranking Cards Special Styling */
.ranking-card {
  position: relative;
  overflow: hidden;
}

.ranking-card.rank-1 {
  background: linear-gradient(135deg, #FFFDF5 0%, #FFF9E6 100%);
  border: 1.5px solid #FFD700;
  box-shadow: 0 10px 30px rgba(255, 215, 0, 0.15);
}
.ranking-card.rank-1::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,215,0,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.ranking-card.rank-2 {
  background: linear-gradient(135deg, #F9F9F9 0%, #F5F5F5 100%);
  border: 1.5px solid #C0C0C0;
}

.ranking-card.rank-3 {
  background: linear-gradient(135deg, #FFF9F5 0%, #FDF5EF 100%);
  border: 1.5px solid #CD7F32;
}

.ranking-card.rank-1 .rank-badge { font-size: 1.8rem; filter: drop-shadow(0 0 8px rgba(255,215,0,0.5)); }

/* Responsive adjustments */
@media (max-width: 600px) {
  .app-container {
    box-shadow: none;
    /* モバイルでは影をなくして画面いっぱいにする */
  }
}