/* ====================================
   JAPAN BOT MINI APP — main.css
   ==================================== */

:root {
  --background: #fdf6f0;
  --surface: #ffffff;
  --surface-hover: #f2ece6;
  --paper: var(--surface);
  --paper-2: var(--surface-hover);
  --surface-border: rgba(0,0,0,0.06);
  --overlay-bg: rgba(255,255,255,0.92);
  --overlay-border: rgba(0,0,0,0.08);
  --background-border: rgba(0,0,0,0.06);
  --background-soft: #faf3ee;
  --accent: #c0392b;
  --accent-soft: rgba(192,57,43,0.16);
  --accent-strong: #e74c3c;
  --text-main: #1a1a2e;
  --text-soft: #6b6b8a;
  --ink: #1a1a2e;
  --ink-soft: #2c2c54;
  --text-muted: #858595;
  --white: #ffffff;
  --red: #c0392b;
  --red-light: #e74c3c;
  --gold: #c9a84c;
  --gold-light: #f0d078;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-card: 0 8px 32px rgba(26,26,46,0.12);
  --shadow-btn: 0 4px 20px rgba(192,57,43,0.40);
}

:root.theme-dark, :root[data-theme='dark'] {
  --background: #101217;
  --surface: #1A1D24;
  --surface-hover: #232a34;
  --paper: var(--surface);
  --paper-2: var(--surface-hover);
  --background-border: #2A2F3A;
  --background-soft: rgba(255,255,255,0.06);
  --accent: #00C8FF;
  --accent-soft: rgba(0,200,255,0.18);
  --accent-strong: #66d6ff;
  --text-main: #F3F3F3;
  --text-soft: #C4C4C4;
  --ink: #F3F3F3;
  --ink-soft: #C4C4C4;
  --text-muted: #9AA0AD;
  --white: #FFFFFF;
  --overlay-bg: rgba(16,18,23,0.92);
  --overlay-border: rgba(255,255,255,0.08);
  --shadow-card: 0 18px 45px rgba(0,0,0,0.35);
  --shadow-btn: 0 10px 30px rgba(0,200,255,0.24);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', sans-serif;
  background: var(--background);
  color: var(--text-main);
  -webkit-font-smoothing: antialiased;
}

/* ── BACKGROUND ── */
.bg-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.bg-circle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.08;
}
.c1 {
  width: 420px; height: 420px;
  background: var(--red);
  top: -120px; right: -80px;
}
.c2 {
  width: 300px; height: 300px;
  background: var(--gold);
  bottom: -100px; left: -60px;
}
.c3 {
  width: 200px; height: 200px;
  background: var(--red-light);
  bottom: 30%; right: -40px;
}
.kanji-float {
  position: absolute;
  font-family: 'Noto Serif JP', serif;
  color: var(--red);
  opacity: 0.04;
  font-weight: 600;
  user-select: none;
  animation: floatKanji 12s ease-in-out infinite;
}
.k1 { font-size: 180px; top: 5%;  left: 5%;  animation-delay: 0s; }
.k2 { font-size: 120px; top: 50%; right: 8%; animation-delay: 2s; }
.k3 { font-size: 200px; bottom: 5%; left: 50%; animation-delay: 4s; }
.k4 { font-size: 100px; top: 30%;  left: 30%; animation-delay: 6s; }
.k5 { font-size: 140px; bottom: 20%; right: 30%; animation-delay: 1s; }

@keyframes floatKanji {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50%       { transform: translateY(-18px) rotate(3deg); }
}

/* ── SCREENS ── */
.screen {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  overflow-y: auto;
}
.screen.active {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

/* ── HOME SCREEN ── */
.home-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 40px 28px;
  text-align: center;
  gap: 0;
}

.flag-badge {
  font-size: 56px;
  margin-bottom: 8px;
  animation: popIn 0.6s cubic-bezier(0.34,1.56,0.64,1) 0.2s both;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.15));
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.jp-subtitle {
  font-family: 'Shippori Mincho', serif;
  font-size: 18px;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin-bottom: 12px;
  animation: fadeUp 0.5s ease 0.35s both;
}

.main-title {
  font-family: 'Shippori Mincho', serif;
  font-size: clamp(36px, 9vw, 52px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: 16px;
  animation: fadeUp 0.5s ease 0.45s both;
}

.tagline {
  font-size: 13px;
  font-weight: 300;
  color: var(--text-soft);
  letter-spacing: 0.05em;
  margin-bottom: 44px;
  animation: fadeUp 0.5s ease 0.55s both;
}

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

/* ── START BUTTON ── */
.btn-start {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 50px;
  padding: 0;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  box-shadow: var(--shadow-btn);
  animation: fadeUp 0.5s ease 0.65s both;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  min-width: 220px;
  margin-bottom: 44px;
}
.btn-start:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(192,57,43,0.30);
}
.btn-start:hover {
  background: var(--accent-strong);
}

.language-panel,
.theme-panel {
  display: flex;
  justify-content: center;
  position: relative;
  width: 100%;
  margin-bottom: 20px;
}

.btn-language,
.btn-theme {
  background: var(--surface);
  color: var(--text-main);
  border: 1px solid var(--background-border);
  border-radius: 999px;
  font-size: 14px;
  padding: 12px 18px;
  cursor: pointer;
  min-width: 160px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-language:hover,
.btn-theme:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.language-menu,
.theme-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  width: min(220px, calc(100% - 32px));
  background: var(--surface);
  border-radius: 18px;
  padding: 8px;
  margin-top: 12px;
  border: 1px solid var(--background-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.language-menu.open,
.theme-menu.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.language-menu button,
.theme-menu button {
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  color: var(--text-main);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.language-menu button:hover,
.theme-menu button:hover {
  background: var(--background-soft);
}

.theme-menu button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 28px;
}
.btn-icon {
  font-family: 'Noto Serif JP', serif;
  font-size: 20px;
  line-height: 1;
}

/* ── STATS ROW ── */
.stats-row {
  display: flex;
  align-items: center;
  gap: 14px;
  animation: fadeUp 0.5s ease 0.75s both;
}
.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.stat-num {
  font-family: 'Shippori Mincho', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--accent);
}
.stat-lbl {
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 300;
}
.stat-divider {
  color: var(--text-soft);
  font-size: 20px;
  margin-top: -6px;
}

/* ── MENU HEADER ── */
.menu-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 20px 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--background-border);
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
}
.btn-back {
  background: none;
  border: 1.5px solid var(--background-border);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.btn-back:active { background: var(--paper-2); }
.menu-title {
  font-family: 'Shippori Mincho', serif;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}
.jp-accent {
  font-size: 14px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 6px;
  padding: 2px 8px;
  letter-spacing: 0.1em;
}

/* ── SECTIONS GRID ── */
.sections-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 16px 16px 32px;
}

/* ── SECTION CARD ── */
.section-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--background-border);
  animation: fadeUp 0.4s ease both;
}
.section-card:nth-child(1) { animation-delay: 0.05s; }
.section-card:nth-child(2) { animation-delay: 0.10s; }
.section-card:nth-child(3) { animation-delay: 0.15s; }
.section-card:nth-child(4) { animation-delay: 0.20s; }
.section-card:nth-child(5) { animation-delay: 0.25s; }
.section-card:nth-child(6) { animation-delay: 0.30s; }

.section-card:active {
  transform: scale(0.96);
  box-shadow: 0 2px 10px rgba(26,26,46,0.08);
}
.section-card.locked { opacity: 0.6; cursor: not-allowed; }

.card-top {
  background: var(--card-color, #c0392b);
  display: flex;
  align-items: center;
  justify-content: center;
  height: 90px;
  position: relative;
  overflow: hidden;
}
.card-top::before {
  content: '';
  position: absolute;
  width: 110px; height: 110px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
  top: -30px; right: -20px;
}
.card-jp {
  font-family: 'Noto Serif JP', serif;
  font-size: 48px;
  color: rgba(255,255,255,0.92);
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  z-index: 1;
}
.card-body {
  padding: 12px 12px 14px;
}
.card-title {
  font-weight: 500;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--text-main);
}
.card-desc {
  font-size: 11px;
  color: var(--text-soft);
  line-height: 1.4;
  margin-bottom: 8px;
  font-weight: 300;
}
.card-tag {
  font-size: 10px;
  background: var(--background-soft);
  border-radius: 20px;
  padding: 2px 8px;
  color: var(--text-soft);
  display: inline-block;
}
.card-tag.coming {
  background: rgba(201,168,76,0.15);
  color: var(--gold);
}

/* ── SECTION PLACEHOLDER ── */
.section-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  padding: 60px 28px;
  text-align: center;
  gap: 16px;
}
.placeholder-icon {
  font-family: 'Noto Serif JP', serif;
  font-size: 80px;
  color: var(--accent);
  opacity: 0.75;
}
.placeholder-text {
  font-family: 'Shippori Mincho', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--text-main);
}
.placeholder-hint {
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
  font-weight: 300;
  max-width: 280px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  color: var(--text-main);
  font-size: 13px;
  border-radius: 24px;
  padding: 10px 22px;
  white-space: nowrap;
  z-index: 999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 4px; }
