/* ============================================================
   100Excel — Top Page CSS (v5)
   v5 changes:
     - 行番号削除
     - 列番号を画面上部に移動
     - ビルを手前に移動（より大きく、地平線から離す）
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

:root {
  --excel-green:    #1d6f42;
  --excel-green-l:  #21a366;
  --excel-green-ll: #6dba8e;
  --excel-green-d:  #155a35;
  --excel-green-soft: #e8f0e8;

  --paper:          #ffffff;
  --cream:          #fafaf5;
  --cream-warm:     #f5efe0;
  --ink:            #2c2c2c;
  --ink-soft:       #6b6b6b;
  --ink-mute:       #a0a0a0;
  --line:           #e8e4dc;

  --sky-blue:       #b8d4e3;
  --warm-orange:    #e8a062;
  --soft-yellow:    #f5d76e;
  --moon-yellow:    #ffe49a;
  --aviation-red:   #e63d2e;
  --balloon-red:    #d87a6e;

  --ground:         #d5e0c8;
  --ground-line:    rgba(29, 111, 66, 0.18);
  --header-bg:      #f3f3f3;   /* 実際のExcelの列ヘッダー色（薄いグレー） */
  --header-text:    #595959;   /* Excel風のグレー文字 */
  --header-line:    #d4d4d4;   /* Excel風のセル罫線 */

  --sky-top:        #cfe3e8;
  --sky-mid:        #e8edd5;
  --sky-bottom:     #f5efe0;
  --sky-glow:       #ffffff;

  --font-jp:        "Zen Maru Gothic", "Noto Sans JP", -apple-system, sans-serif;
  --font-mono:      "DM Mono", "SFMono-Regular", monospace;
}

/* 時間帯テーマ */
[data-time="morning"] {
  --sky-top:    #c8d8e0;
  --sky-mid:    #f0e0c8;
  --sky-bottom: #fcf5e5;
  --sky-glow:   #fff5d8;
}
[data-time="day"] {
  --sky-top:    #b5d4e3;
  --sky-mid:    #dde8e0;
  --sky-bottom: #fafaf5;
  --sky-glow:   #ffffff;
}
[data-time="evening"] {
  --sky-top:    #d87a55;
  --sky-mid:    #f5b878;
  --sky-bottom: #fae0c0;
  --sky-glow:   #fff5e8;
}
[data-time="night"] {
  --sky-top:    #0d1628;
  --sky-mid:    #1f2a45;
  --sky-bottom: #3d4860;
  --sky-glow:   #f5efe0;
}

html, body { width: 100%; min-height: 100vh; }

body {
  font-family: var(--font-jp);
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt";
}

.stage {
  position: relative;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 26px;
  overflow: hidden;
}

/* ============================================================
   ★ 画面トップの列ヘッダー（v5新規）
   ============================================================ */
.col-headers-top {
  position: absolute;
  top: 0;
  left: 0; right: 0;
  height: 26px;
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  display: flex;
  z-index: 9;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--header-text);
  letter-spacing: 0.1em;
  transition: background 2.5s ease, color 2.5s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.col-headers-top span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--header-line);
  opacity: 0.8;
  min-width: 36px;
  font-weight: 500;
}
[data-time="night"] .col-headers-top {
  background: #0e1626;
  color: #8b95a8;
  border-bottom: none;
  box-shadow: none;
}
[data-time="night"] .col-headers-top span {
  border-right-color: rgba(255, 255, 255, 0.06);
  opacity: 0.7;
}

/* 空 */
.sky {
  position: absolute;
  top: 26px; left: 0;
  width: 100%;
  height: calc(82% - 26px);
  background: linear-gradient(180deg,
    var(--sky-top) 0%,
    var(--sky-mid) 60%,
    var(--sky-bottom) 100%);
  transition: background 2.5s ease;
  z-index: 0;
}

/* 太陽/月 */
.celestial {
  position: absolute;
  top: 12%;
  right: 12%;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  z-index: 1;
  transition: all 2.5s ease;
}
[data-time="day"] .celestial {
  background: #ffffff;
  box-shadow: 0 0 40px rgba(255, 255, 240, 0.7), 0 0 80px rgba(255, 255, 240, 0.3);
}
[data-time="morning"] .celestial {
  background: #fff5d8;
  box-shadow: 0 0 30px rgba(255, 245, 216, 0.5), 0 0 60px rgba(255, 245, 216, 0.25);
  opacity: 0.75;
}
[data-time="morning"] .celestial::before {
  content: "";
  position: absolute;
  top: 8px; right: 10px;
  width: 64px; height: 64px;
  background: rgba(240, 224, 200, 0.6);
  border-radius: 50%;
}
[data-time="evening"] .celestial {
  width: 70px; height: 70px;
  background: #ffffff;
  box-shadow: 0 0 25px rgba(255, 255, 255, 0.5);
  opacity: 0.9;
}
[data-time="evening"] .celestial::before {
  content: "";
  position: absolute;
  top: 8px; right: 10px;
  width: 54px; height: 54px;
  background: rgba(216, 184, 120, 0.4);
  border-radius: 50%;
}
[data-time="night"] .celestial {
  width: 76px; height: 76px;
  background: var(--moon-yellow);
  box-shadow: 0 0 35px rgba(255, 228, 154, 0.4), 0 0 70px rgba(255, 228, 154, 0.2);
}
[data-time="night"] .celestial::before {
  content: "";
  position: absolute;
  top: 9px; right: 9px;
  width: 58px; height: 58px;
  background: rgba(220, 195, 130, 0.5);
  border-radius: 50%;
}

/* 雲 */
@keyframes drift {
  from { transform: translateX(-200px); }
  to   { transform: translateX(calc(100vw + 200px)); }
}
.cloud {
  position: absolute;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 100px;
  filter: blur(0.5px);
  z-index: 1;
  transition: background 2.5s ease, opacity 2.5s ease;
}
.cloud-1 { top: 14%; width: 120px; height: 28px; animation: drift 90s linear infinite;       opacity: 0.7;  }
.cloud-2 { top: 22%; width: 90px;  height: 22px; animation: drift 120s linear infinite -40s; opacity: 0.6;  }
.cloud-3 { top: 8%;  width: 140px; height: 32px; animation: drift 110s linear infinite -70s; opacity: 0.65; }
[data-time="night"]   .cloud { display: none; }
[data-time="evening"] .cloud { background: rgba(255, 200, 160, 0.85); opacity: 0.8; }

/* 星 */
.stars {
  position: absolute;
  top: 26px; left: 0;
  width: 100%; height: 82%;
  opacity: 0;
  transition: opacity 2.5s ease;
  pointer-events: none;
  z-index: 1;
}
[data-time="night"] .stars { opacity: 1; }
@keyframes twinkle {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 1; }
}
.star {
  position: absolute;
  background: #f5efe0;
  border-radius: 50%;
  animation: twinkle 3s ease-in-out infinite;
}

/* 気球（手前: 飛行機より前） */
@keyframes float-up {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
.balloon {
  position: absolute;
  z-index: 3;
  animation: float-up 6s ease-in-out infinite;
}
.balloon-1 { top: 16%; left: 18%; width: 64px; }
.balloon-2 { top: 28%; right: 38%; width: 48px; animation-delay: -2s; animation-duration: 7s; }
.balloon svg { width: 100%; height: auto; }
[data-time="night"] .balloon { display: none; }

/* 飛行機（奥: 気球より後ろを通る） */
@keyframes fly {
  0%   { transform: translateX(-200px) translateY(0); opacity: 0; }
  3%   { opacity: 1; }
  97%  { opacity: 1; }
  100% { transform: translateX(calc(100vw + 200px)) translateY(-30px); opacity: 0; }
}
.airplane {
  position: absolute;
  top: 19%;
  left: 0;
  width: 56px;
  z-index: 2;
  opacity: 0;
  animation: fly 60s linear infinite;
  animation-delay: 3s;
}
.airplane svg { width: 100%; height: auto; }
[data-time="night"] .airplane { opacity: 0; }

/* ============================================================
   ★ ビル（v5: 手前に大きく、v5.1: 地面82%に合わせて微調整）
   ============================================================ */
.tower {
  position: absolute;
  bottom: 12%;
  right: 9%;
  width: 120px;
  height: 320px;
  z-index: 4;
  cursor: pointer;
}
.tower svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  transition: filter 0.3s ease;
}
.tower:hover svg {
  filter: drop-shadow(0 0 16px rgba(29, 111, 66, 0.4));
}

.aviation-light {
  fill: var(--aviation-red);
  opacity: 0;
  transition: opacity 2s ease;
}
[data-time="day"]     .aviation-light,
[data-time="morning"] .aviation-light { opacity: 0; }

@keyframes blink-soft {
  0%, 60%   { opacity: 0.6; }
  61%, 100% { opacity: 0.2; }
}
[data-time="evening"] .aviation-light {
  opacity: 0.6;
  animation: blink-soft 2.4s ease-in-out infinite;
}

@keyframes blink-strong {
  0%, 55%   { opacity: 1; filter: drop-shadow(0 0 4px var(--aviation-red)); }
  56%, 100% { opacity: 0.15; filter: none; }
}
[data-time="night"] .aviation-light {
  opacity: 1;
  animation: blink-strong 1.8s ease-in-out infinite;
}

.aviation-light[data-delay="0"]   { animation-delay: 0s; }
.aviation-light[data-delay="0.3"] { animation-delay: 0.3s; }
.aviation-light[data-delay="0.6"] { animation-delay: 0.6s; }
.aviation-light[data-delay="0.9"] { animation-delay: 0.9s; }
.aviation-light[data-delay="1.2"] { animation-delay: 1.2s; }
.aviation-light[data-delay="1.5"] { animation-delay: 1.5s; }

.tower-window {
  fill: var(--cream);
  opacity: 0.35;
  transition: fill 2.5s ease, opacity 2.5s ease;
}
[data-time="evening"] .tower-window {
  fill: var(--warm-orange);
  opacity: 0.7;
}
[data-time="night"] .tower-window {
  fill: var(--soft-yellow);
  opacity: 0.95;
}
.tower-window-off { opacity: 0.3; }
[data-time="night"] .tower-window-off {
  fill: rgba(50, 50, 60, 0.5);
  opacity: 0.5;
}

/* ============================================================
   講師ポップアップ
   ============================================================ */
.teacher-popup {
  position: absolute;
  bottom: calc(12% + 340px);
  right: 4%;
  width: 280px;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 4px 4px 0 var(--ink);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  z-index: 10;
  pointer-events: none;
}
.tower:hover ~ .teacher-popup,
.teacher-popup:hover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}
.teacher-popup::after {
  content: "";
  position: absolute;
  bottom: -12px;
  right: 60px;
  width: 0; height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 12px solid var(--ink);
}
.teacher-popup::before {
  content: "";
  position: absolute;
  bottom: -9px;
  right: 62px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 10px solid var(--paper);
  z-index: 1;
}
.teacher-popup-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.teacher-popup-img {
  width: 56px; height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--excel-green);
  flex-shrink: 0;
}
.teacher-popup-img-fallback {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--excel-green-soft);
  border: 2px solid var(--excel-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--excel-green);
  flex-shrink: 0;
}
.teacher-popup-name {
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0 0 2px;
  color: var(--ink);
}
.teacher-popup-role {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--excel-green);
  letter-spacing: 0.12em;
}
.teacher-popup-msg {
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 0 0 14px;
}
.teacher-popup-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--paper);
  background: var(--excel-green);
  padding: 8px 14px;
  border-radius: 100px;
  letter-spacing: 0.05em;
  transition: background 0.2s ease;
}
.teacher-popup-link:hover { background: var(--excel-green-d); }

/* ============================================================
   地平線 + 地面（v5: 行番号削除、v5.1: top 82%）
   ============================================================ */
.horizon-line {
  position: absolute;
  top: 82%;
  left: 0; right: 0;
  height: 1px;
  background: rgba(29, 111, 66, 0.2);
  z-index: 3;
}
.ground {
  position: absolute;
  top: 82%;
  left: 0; right: 0;
  bottom: 0;
  background: var(--ground);
  z-index: 1;
  overflow: hidden;
  transition: background 2.5s ease;
}
.ground::before {
  content: "";
  position: absolute;
  top: 0; left: -10%;
  width: 120%; height: 200%;
  background-image:
    linear-gradient(0deg, transparent 27px, var(--ground-line) 27px, var(--ground-line) 28px, transparent 28px),
    linear-gradient(90deg, transparent 67px, var(--ground-line) 67px, var(--ground-line) 68px, transparent 68px);
  background-size: 28px 28px, 68px 28px;
  transform-origin: 50% 0;
  transform: perspective(800px) rotateX(56deg);
}
[data-time="night"] .ground { background: #2a3445; }
[data-time="night"] .stage { background: #0d1628; }

/* 中央：タイトル＋Start */
.center-stage {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 5;
  padding: 0 24px;
  max-width: 90%;
}
.title-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.4em;
  color: var(--excel-green);
  margin-bottom: 16px;
  font-weight: 500;
  transition: color 2.5s ease;
}
[data-time="night"] .title-mark { color: var(--excel-green-ll); }

.title-main {
  font-family: var(--font-jp);
  font-size: clamp(2.4rem, 7vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink);
  transition: color 2.5s ease;
}
.title-100 {
  display: inline-block;
  color: var(--excel-green);
  font-style: italic;
  transition: color 2.5s ease;
}
[data-time="night"] .title-main { color: var(--paper); }
[data-time="night"] .title-100 { color: var(--excel-green-ll); }

.title-tag {
  font-size: clamp(0.85rem, 2.2vw, 1.05rem);
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 36px;
  font-weight: 400;
  transition: color 2.5s ease;
  white-space: nowrap;
}
[data-time="night"] .title-tag { color: var(--cream); opacity: 0.85; }

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 56px;
  font-family: var(--font-jp);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--paper);
  background: var(--excel-green);
  border-radius: 100px;
  letter-spacing: 0.12em;
  box-shadow:
    0 4px 0 var(--excel-green-l) inset,
    0 8px 0 var(--excel-green-d),
    0 12px 24px rgba(29, 111, 66, 0.3);
  transition: all 0.2s ease;
  text-decoration: none;
}
.start-btn::after {
  content: "▶";
  font-size: 0.7em;
  color: var(--paper);
}
.start-btn:hover {
  transform: translateY(2px);
  box-shadow:
    0 4px 0 var(--excel-green-l) inset,
    0 6px 0 var(--excel-green-d),
    0 10px 18px rgba(29, 111, 66, 0.35);
}
.start-btn:active {
  transform: translateY(6px);
  box-shadow:
    0 4px 0 var(--excel-green-l) inset,
    0 2px 0 var(--excel-green-d),
    0 4px 8px rgba(29, 111, 66, 0.3);
}

.sub-menu {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 28px;
  flex-wrap: wrap;
}
.sub-menu a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 100px;
  transition: all 0.2s ease;
}
.sub-menu a:hover {
  border-color: var(--excel-green);
  color: var(--excel-green);
  transform: translateY(-2px);
}
[data-time="night"] .sub-menu a { background: rgba(255,255,255,0.95); }

/* さえちゃん */
.sae {
  position: absolute;
  bottom: 24px;
  left: 24px;
  z-index: 7;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 380px;
}
.sae-img {
  width: 110px;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}
.sae-fallback {
  width: 110px; height: 110px;
  background: var(--cream);
  border: 2px dashed var(--line);
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-mute);
  letter-spacing: 0.1em;
}
.sae-bubble {
  position: relative;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 16px;
  padding: 14px 18px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  max-width: 240px;
}
.sae-bubble::after {
  content: "";
  position: absolute;
  left: -12px;
  bottom: 18px;
  width: 0; height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 12px solid var(--ink);
}
.sae-bubble::before {
  content: "";
  position: absolute;
  left: -9px;
  bottom: 19px;
  width: 0; height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 10px solid var(--paper);
  z-index: 1;
}
.sae-greeting {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: var(--excel-green);
  margin-bottom: 4px;
  font-weight: 500;
}

/* さえちゃん吹き出し：夜のダークモード */
[data-time="night"] .sae-bubble {
  background: #1f2937;
  border-color: #4b5563;
  color: #e5e7eb;
  box-shadow: 3px 3px 0 #4b5563;
}
[data-time="night"] .sae-bubble::after {
  border-right-color: #4b5563;
}
[data-time="night"] .sae-bubble::before {
  border-right-color: #1f2937;
}
[data-time="night"] .sae-greeting {
  color: var(--excel-green-ll, #5cb85c);
}

/* ブランド / メニュー / 時計 */
.brand {
  position: absolute;
  top: 60px;
  left: 28px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.15em;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 2.5s ease;
}
.brand-dot {
  width: 8px; height: 8px;
  background: var(--excel-green);
  border-radius: 50%;
}
[data-time="night"] .brand { color: var(--paper); }

.top-nav {
  position: absolute;
  top: 60px;
  right: 28px;
  display: flex;
  gap: 22px;
  z-index: 8;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
}
.top-nav a {
  color: var(--ink);
  opacity: 0.7;
  transition: opacity 0.2s ease, color 2.5s ease;
}
.top-nav a:hover { opacity: 1; }
[data-time="night"] .top-nav a { color: var(--paper); }

.clock {
  position: absolute;
  bottom: 24px; right: 24px;
  z-index: 7;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink);
  letter-spacing: 0.12em;
  opacity: 0.55;
  text-align: right;
  transition: color 2.5s ease;
}
[data-time="night"] .clock { color: var(--paper); opacity: 0.7; }
.clock-line { display: block; }
.clock-time { font-size: 12px; font-weight: 500; margin-top: 2px; letter-spacing: 0.18em; }

/* レスポンシブ */
@media (max-width: 1024px) {
  .tower {
    right: 7%;
    bottom: 12%;
    width: 100px;
    height: 260px;
  }
  .sae { max-width: 320px; }
  .sae-img, .sae-fallback { width: 90px; }
  .teacher-popup {
    right: 2%;
    width: 260px;
    bottom: calc(12% + 280px);
  }
}

@media (max-width: 767px) {
  html, body { overflow-x: hidden; }

  .stage { 
    padding-top: 22px;
    min-height: 100vh;
    min-height: 100dvh; /* スマホのアドレスバーを考慮 */
  }
  .col-headers-top { height: 26px; font-size: 9px; }

  /* 地平線を上に移動（スマホ用）*/
  .ground { top: 72%; }
  /* 空も合わせて高さを調整 */
  .sky { height: calc(72% - 26px); }
  .stars { height: 72%; }

  .center-stage { top: 40%; }
  .title-main { font-size: clamp(2.2rem, 9vw, 3rem); }
  .title-tag  { 
    font-size: 0.82rem; 
    margin-bottom: 28px;
    letter-spacing: 0.04em;
  }
  .start-btn  { padding: 16px 40px; font-size: 1rem; letter-spacing: 0.12em; }

  .balloon-1 { width: 44px; left: 8%; }
  .balloon-2 { width: 32px; right: 12%; }
  .cloud-1 { width: 80px; height: 20px; }
  .cloud-2 { width: 60px; height: 16px; }
  .cloud-3 { width: 90px; height: 22px; }

  /* タワーを上に */
  .tower {
    right: 6%;
    bottom: 26%;
    width: 72px;
    height: 190px;
  }

  .celestial { width: 60px; height: 60px; top: 11%; right: 8%; }
  [data-time="evening"] .celestial,
  [data-time="night"] .celestial { width: 54px; height: 54px; }

  /* スマホ用：影（::before）のサイズと位置を再調整 */
  [data-time="morning"] .celestial::before {
    top: 6px; right: 7px;
    width: 46px; height: 46px;
  }
  [data-time="evening"] .celestial::before {
    top: 6px; right: 7px;
    width: 40px; height: 40px;
  }
  [data-time="night"] .celestial::before {
    top: 6px; right: 6px;
    width: 42px; height: 42px;
  }

  /* さえちゃんを大幅に上に移動 */
  .sae {
    bottom: 12%;
    left: 12px;
    right: 12px;
    max-width: none;
    gap: 10px;
  }
  .sae-img, .sae-fallback { width: 64px; }
  .sae-fallback { height: 64px; }
  .sae-bubble { font-size: 0.78rem; padding: 9px 12px; flex: 1; }

  .clock { display: none; }
  .brand { top: 38px; left: 16px; font-size: 11px; }
  .top-nav { top: 38px; right: 16px; gap: 14px; font-size: 10px; }
  .top-nav a:nth-child(2) { display: none; }

  .sub-menu { gap: 6px; margin-top: 20px; }
  .sub-menu a { padding: 7px 14px; font-size: 0.72rem; }

  /* タワーに合わせて講師ポップアップも上に */
  .teacher-popup {
    right: 16px;
    left: 16px;
    width: auto;
    bottom: calc(26% + 200px);
  }
  .teacher-popup::after,
  .teacher-popup::before { right: 60px; }
}

@media (max-width: 380px) {
  .sub-menu a { padding: 6px 10px; font-size: 0.7rem; }
  .title-tag  { 
    font-size: 0.76rem; 
    letter-spacing: 0.02em;
  }
}

/* ============================================================
   テーマ切替トグル（☀️ 🕐 🌙）
   ============================================================ */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 100px;
  padding: 3px;
  margin-left: 12px;
  backdrop-filter: blur(8px);
}
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--ink-mute);
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 0;
  border: none;
  background: transparent;
}
.theme-toggle-btn:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.05);
}
.theme-toggle-btn.is-active {
  background: var(--excel-green);
  color: var(--paper);
}
.theme-toggle-btn svg { width: 13px; height: 13px; }

/* 夜のトグル調整 */
[data-time="night"] .theme-toggle {
  background: rgba(26, 31, 46, 0.7);
  border-color: rgba(255, 255, 255, 0.15);
}
[data-time="night"] .theme-toggle-btn {
  color: rgba(255, 255, 255, 0.6);
}
[data-time="night"] .theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.9);
}
[data-time="night"] .theme-toggle-btn.is-active {
  background: var(--excel-green);
  color: #0a0e1a;
}

/* 夕方のトグル調整 */
[data-time="evening"] .theme-toggle {
  background: rgba(255, 255, 255, 0.65);
}

/* スマホ */
@media (max-width: 767px) {
  .theme-toggle {
    margin-left: 8px;
  }
  .theme-toggle-btn { width: 24px; height: 24px; }
  .theme-toggle-btn svg { width: 11px; height: 11px; }
}

/* ============================================================
   共通フッター（ダークグレー基調 #1a1a1a）
   ============================================================ */
.site-footer {
  background: #1a1a1a;
  border-top: 1px solid #2a2a2a;
  padding: 32px 0 24px;
  font-family: var(--font-jp);
  color: #d0d0d0;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.site-footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  margin-bottom: 18px;
  border-bottom: 1px solid #2e2e2e;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: #e8e8e8;
}
.footer-logo-img {
  height: 32px;
  width: auto;
  display: inline-block;
}
.footer-logo-text {
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.18em;
  color: #e8e8e8;
  font-weight: 500;
}
.footer-brand-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #21a366;
}
.footer-nav {
  display: flex;
  gap: 24px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.15em;
}
.footer-nav a {
  color: #a0a0a0;
  text-decoration: none;
  transition: color 0.2s ease;
}
.footer-nav a:hover {
  color: #21a366;
}
.site-footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-jp);
  font-size: 0.78rem;
  color: #888;
  gap: 16px;
  flex-wrap: wrap;
}

/* スマホ */
@media (max-width: 767px) {
  .site-footer { padding: 24px 0 20px; }
  .site-footer-inner { padding: 0 20px; }
  .site-footer-top {
    padding-bottom: 16px;
    margin-bottom: 14px;
    gap: 14px;
  }
  .footer-logo-img { height: 28px; }
  .footer-logo-text { font-size: 11px; }
  .footer-nav { gap: 14px; font-size: 10px; }
  .site-footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }
  .site-footer-left,
  .site-footer-right { font-size: 0.72rem; }
}
