/* ============================================================
   10SEC スケッチ - メインスタイルシート
   ============================================================ */

/* --- リセット & ベース --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #F06449;
  --primary-light: #F4845F;
  --primary-dark: #D94A33;
  --secondary: #4EBFCF;
  --secondary-light: #6BC9DE;
  --secondary-dark: #2A8FA5;
  --accent: #D4A843;
  --accent-dark: #B8912E;
  --navy: #2C3E50;
  --navy-light: #3D5266;
  --bg-outer: #3B5C6B;
  --bg-card: #FFFFFF;
  --bg-game: #F5F0E8;
  --text: #2C3E50;
  --text-light: #6B7B8D;
  --success: #2ECC71;
  --danger: #E74C3C;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 3px 12px rgba(44,62,80,0.1);
  --shadow-lg: 0 6px 24px rgba(44,62,80,0.15);
  --shadow-glow: 0 0 24px rgba(240,100,73,0.2);
}

html { scroll-behavior: smooth; }

body {
  font-family: "M PLUS Rounded 1c", "Hiragino Maru Gothic Pro", "BIZ UDPGothic", "Yu Gothic", sans-serif;
  font-size: 20px;
  /* 外側フレーム: ダークティール + グリッド */
  background:
    linear-gradient(rgba(78,191,207,0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(78,191,207,0.07) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 30%, rgba(78,191,207,0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(78,191,207,0.06) 0%, transparent 50%),
    linear-gradient(145deg, #2D4A56 0%, #3B5C6B 40%, #334F5C 100%);
  background-size: 48px 48px, 48px 48px, auto, auto, auto;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  overflow-x: hidden;
  position: relative;
}

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

ruby rt { font-size: 0.6em; }

/* --- 画面管理 --- */
.screen {
  display: none;
  flex-direction: column;
  margin: 24px auto;
  width: calc(100% - 48px);
  max-width: 1100px;
  min-height: calc(100dvh - 48px);
  background:
    /* 上部ブロブ群 */
    radial-gradient(ellipse 280px 180px at 2% -4%, rgba(78,191,207,0.22) 58%, transparent 59%),
    radial-gradient(ellipse 200px 150px at 22% -6%, rgba(150,210,170,0.2) 52%, transparent 53%),
    radial-gradient(circle 50px at 12% 5%, rgba(150,210,170,0.18) 90%, transparent 91%),
    radial-gradient(ellipse 240px 160px at 80% -5%, rgba(78,191,207,0.24) 55%, transparent 56%),
    radial-gradient(ellipse 160px 120px at 98% 2%, rgba(150,210,170,0.2) 50%, transparent 51%),
    /* 下部ブロブ群 */
    radial-gradient(ellipse 320px 180px at 50% 106%, rgba(78,191,207,0.26) 55%, transparent 56%),
    radial-gradient(ellipse 200px 150px at 5% 104%, rgba(150,210,170,0.22) 55%, transparent 56%),
    radial-gradient(ellipse 180px 130px at 92% 103%, rgba(150,210,170,0.2) 50%, transparent 51%),
    /* ベースカラー */
    var(--bg-game);
  border-radius: 24px;
  border: 4px solid rgba(255,255,255,0.5);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.screen.active { display: flex; }

/* ストライプは上部ブロブ領域のみに表示（マスク的に） */
.screen::before {
  content: "";
  position: absolute;
  top: -20px; left: -10px;
  width: 260px; height: 170px;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 5px,
      rgba(255,255,255,0.35) 5px,
      rgba(255,255,255,0.35) 7px
    );
  border-radius: 30% 70% 60% 40% / 50% 40% 60% 50%;
  z-index: 0;
  pointer-events: none;
}
.screen::after {
  content: "";
  position: absolute;
  bottom: -20px; right: 15%;
  width: 280px; height: 160px;
  background:
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 5px,
      rgba(255,255,255,0.3) 5px,
      rgba(255,255,255,0.3) 7px
    );
  border-radius: 50% 50% 40% 60% / 60% 40% 50% 50%;
  z-index: 0;
  pointer-events: none;
}


/* ============================================================
   ボタン
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn:active { transform: scale(0.95); }
.btn-large { padding: 20px 40px; font-size: 28px; }
.btn-full { width: 100%; }

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 0 var(--primary-dark), 0 6px 16px rgba(240,100,73,0.25);
  border-bottom: none;
}
.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: 0 4px 0 var(--primary-dark), 0 8px 20px rgba(240,100,73,0.35);
  transform: translateY(-2px);
}
.btn-primary:active {
  box-shadow: 0 1px 0 var(--primary-dark);
  transform: translateY(2px);
}
.btn-primary:disabled {
  background: #D1D5DB;
  color: #9CA3AF;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 4px 0 var(--secondary-dark), 0 6px 16px rgba(58,186,213,0.25);
}
.btn-secondary:hover {
  background: var(--secondary-light);
  box-shadow: 0 4px 0 var(--secondary-dark), 0 8px 20px rgba(58,186,213,0.35);
  transform: translateY(-2px);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 3px solid var(--primary);
  box-shadow: 0 4px 0 rgba(240,100,73,0.2);
}
.btn-outline:hover {
  background: #FEF0EC;
  box-shadow: 0 4px 0 rgba(240,100,73,0.3);
  transform: translateY(-2px);
}

/* ============================================================
   トップ画面
   ============================================================ */
/* 背景デコレーション（外側の暗い背景上） */
.bg-deco {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.deco-star {
  position: absolute;
  font-size: 42px;
  opacity: 0.7;
  animation: twinkle 3s ease-in-out infinite;
}
/* 4色: コーラル / ゴールド / ティール / ライトグレー */
.ds1  { top: 3%;  left: 3%;   font-size: 28px; color: var(--accent);    animation-delay: 0s; }
.ds2  { top: 7%;  left: 18%;  font-size: 14px; color: var(--secondary); animation-delay: 1.5s; }
.ds3  { top: 4%;  right: 18%; font-size: 22px; color: var(--secondary); animation-delay: 0.7s; }
.ds4  { top: 10%; right: 4%;  font-size: 18px; color: var(--primary);   animation-delay: 2.1s; }
.ds5  { top: 18%; left: 5%;   font-size: 12px; color: #C0C8D0;         animation-delay: 0.3s; }
.ds6  { top: 25%; left: 12%;  font-size: 24px; color: var(--accent);    animation-delay: 1.8s; }
.ds7  { top: 22%; right: 8%;  font-size: 16px; color: var(--secondary); animation-delay: 2.5s; }
.ds8  { top: 35%; left: 2%;   font-size: 20px; color: var(--primary);   animation-delay: 0.9s; }
.ds9  { top: 40%; right: 3%;  font-size: 14px; color: #C0C8D0;         animation-delay: 1.2s; }
.ds10 { top: 48%; left: 6%;   font-size: 18px; color: var(--secondary); animation-delay: 2.8s; }
.ds11 { top: 52%; right: 5%;  font-size: 26px; color: var(--accent);    animation-delay: 0.5s; }
.ds12 { top: 58%; left: 3%;   font-size: 10px; color: #C0C8D0;         animation-delay: 1.9s; }
.ds13 { top: 65%; right: 6%;  font-size: 22px; color: var(--primary);   animation-delay: 2.3s; }
.ds14 { top: 70%; left: 8%;   font-size: 14px; color: var(--accent);    animation-delay: 0.2s; }
.ds15 { top: 75%; left: 4%;   font-size: 30px; color: var(--secondary); animation-delay: 1.4s; }
.ds16 { top: 78%; right: 10%; font-size: 16px; color: #C0C8D0;         animation-delay: 2.6s; }
.ds17 { top: 84%; right: 4%;  font-size: 20px; color: var(--accent);    animation-delay: 0.8s; }
.ds18 { top: 88%; left: 15%;  font-size: 12px; color: var(--primary);   animation-delay: 1.7s; }
.ds19 { top: 92%; left: 4%;   font-size: 24px; color: var(--secondary); animation-delay: 2.2s; }
.ds20 { top: 94%; right: 3%;  font-size: 32px; color: var(--accent);    animation-delay: 0.4s; }

@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(1) rotate(0deg); }
  50%      { opacity: 0.85; transform: scale(1.2) rotate(15deg); }
}

#screen-top { position: relative; overflow: hidden; }

.top-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 12px;
  position: relative; z-index: 2;
}

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

.top-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.top-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: 440px;
}
.top-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-title {
  font-size: 60px;
  font-weight: 800;
  color: var(--navy);
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.04em;
  text-shadow: 2px 2px 0 rgba(58,186,213,0.2);
}

.top-subtitle {
  font-size: 18px;
  color: var(--text-light);
  text-align: center;
  font-weight: 700;
  margin-top: 6px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.top-buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.top-buttons-row {
  display: flex;
  gap: 14px;
  width: 100%;
}
.top-buttons-row .btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
}

.brand-link {
  font-size: 17px;
  color: var(--navy);
  font-weight: 700;
  text-decoration: none;
  margin-top: 4px;
  transition: color 0.2s;
}
.brand-link:hover { color: var(--primary); }

/* レベル選択 */
.level-selector {
  width: 100%;
  text-align: center;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  box-shadow: var(--shadow);
  border: 2px solid #E0E4E8;
}

.level-label { font-size: 22px; font-weight: 700; color: var(--text); }

#level-display {
  font-size: 40px;
  font-weight: 800;
  color: var(--primary);
}

.level-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(to right, #10B981, #FFD700, #FF6B35, #EF4444);
  outline: none;
  margin-top: 10px;
}
.level-slider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff;
  border: 4px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.level-slider::-moz-range-thumb {
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff;
  border: 4px solid var(--primary);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.level-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
  position: relative;
}
.level-range-labels span:nth-child(2) {
  position: absolute;
  left: 44.4%;
  transform: translateX(-50%);
}

/* ============================================================
   あんずキャラクター
   ============================================================ */
.anzu-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
}
.anzu-area::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%) scaleX(1);
  width: 52%;
  height: 12px;
  background: rgba(0,0,0,0.25);
  border-radius: 50%;
  z-index: 0;
  animation: shadow-bounce 2s ease-in-out infinite;
}
.anzu { filter: drop-shadow(0 4px 6px rgba(0,0,0,0.12)); z-index: 1; }

/* キャラクター名 */
.anzu-name {
  display: block;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: 0.1em;
  margin-top: -8px;
  z-index: 2;
  position: relative;
}

.speech-bubble {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  box-shadow: 0 3px 0 rgba(44,62,107,0.1);
  max-width: 400px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--navy);
  border: 3px solid var(--navy);
  margin-bottom: -8px;
}
.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -12px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 12px solid var(--navy);
}
.speech-bubble-sm { font-size: 18px; padding: 10px 18px; }


/* ============================================================
   ルールモーダル
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.modal[hidden] { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }

.modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--navy);
  max-width: 520px; width: 100%;
  padding: 32px;
}

.modal-title {
  font-size: 32px; font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 24px;
}

.rule-steps { display: flex; flex-direction: column; gap: 20px; margin-bottom: 28px; }
.rule-step { display: flex; gap: 16px; align-items: flex-start; }

.step-number {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--secondary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 3px 0 var(--secondary-dark);
}
.step-title { font-size: 22px; font-weight: 700; }
.step-desc { font-size: 18px; color: var(--text-light); margin-top: 4px; line-height: 1.6; }

/* ============================================================
   お題表示画面
   ============================================================ */
.theme-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  gap: 20px;
  position: relative;
}

.theme-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 560px;
  z-index: 1;
}

.theme-anzu {
  position: absolute;
  right: -100px;
  bottom: 10px;
  z-index: 2;
  pointer-events: none;
}
.theme-anzu .anzu {
  width: 200px;
  height: auto;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.12));
}

/* スマホ: お題画面キャラ非表示 */
@media (max-width: 700px) {
  .theme-anzu { display: none; }
}

.theme-label { font-size: 28px; font-weight: 700; color: var(--primary); }

/* カウントダウン */
.countdown-area { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }

.countdown-bar {
  width: 100%; max-width: 400px;
  height: 16px;
  background: #E5E7EB;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.countdown-bar-fill {
  height: 100%; width: 0%;
  background: var(--secondary);
  border-radius: 8px;
  transition: width 1s linear;
}
.countdown-bar-fill.urgent {
  background: var(--danger);
}

.countdown-number {
  font-size: 80px; font-weight: 800;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  text-shadow: none;
  background: #fff;
  width: 120px; height: 120px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}
.countdown-number.urgent {
  color: var(--danger);
  animation: countdown-urgent 0.5s ease-in-out infinite;
}

/* お題カード */
.theme-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  width: 100%;
  text-align: center;
  border: 3px solid var(--accent);
}

.theme-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 22px; font-weight: 700;
  padding: 14px 32px;
  border-radius: 999px;
  margin-bottom: 24px;
  box-shadow: 0 3px 0 var(--primary-dark);
  letter-spacing: 0.05em;
}

.theme-keywords {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 10px; margin-top: 12px;
}

.keyword-chip {
  display: inline-block;
  background: var(--secondary);
  color: #fff;
  font-size: 24px; font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  border: none;
  box-shadow: 0 3px 0 var(--secondary-dark);
  transition: transform 0.2s;
}
.keyword-chip.bonus {
  background: var(--accent);
  color: var(--navy);
  box-shadow: 0 3px 0 var(--accent-dark);
}

/* ============================================================
   描画画面
   ============================================================ */
.drawing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 6px;
  max-height: calc(100dvh - 48px);
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* トップバー */
.drawing-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 8px;
  flex-shrink: 0;
}
.drawing-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.drawing-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawing-topbar-right .submit-hint {
  font-size: 14px;
  margin: 0;
}
.drawing-topbar-right .btn {
  white-space: nowrap;
}
.btn-sm { padding: 8px 16px !important; font-size: 14px !important; }
.btn-topbar {
  padding: 10px 22px;
  font-size: 16px;
  white-space: nowrap;
  height: 46px;
  box-sizing: border-box;
}

.drawing-time,
.drawing-level { font-size: 20px; color: var(--text-light); font-weight: 600; }
.drawing-time span { font-weight: 800; font-variant-numeric: tabular-nums; }

/* メインエリア */
.drawing-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* サイドバー */
.drawing-sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  align-items: center;
}

/* ツールバー */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #fff;
  border: 2px solid #E0E4E8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 12px;
  width: 100%;
}
.tool-row {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
}
.tool-divider-v {
  width: 1px;
  height: 28px;
  background: #D1D5DB;
  margin: 0 2px;
}

.tool-btn {
  padding: 10px 14px; border-radius: 10px;
  font-size: 15px; font-weight: 700;
  font-family: inherit; border: none;
  background: #F3F4F6; color: var(--text-light);
  cursor: pointer; transition: all 0.2s;
}
/* 均等サイズツールボタン */
.tool-btn.tool-sq {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  justify-content: center;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
}
.tool-btn:hover { background: #E5E7EB; }
.tool-btn.tool-active {
  background: var(--secondary);
  color: #fff;
  box-shadow: 0 2px 0 var(--secondary-dark);
}
.tool-btn.tool-danger { background: #FEF2F2; color: var(--danger); }
.tool-btn.tool-danger:hover { background: #FEE2E2; }
.tool-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.tool-btn-size {
  width: 42px; height: 42px; border-radius: 50%;
  border: none; background: #F3F4F6;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.tool-btn-size.active { background: var(--secondary); }
.tool-btn-size .size-dot { display: block; border-radius: 50%; background: #000; }
.tool-btn-size.active .size-dot { background: #fff; }

.tool-divider { width: 1px; height: 32px; background: #D1D5DB; margin: 0 4px; }

/* 消しゴムアイコン */
.icon-eraser {
  display: inline-block;
  width: 14px;
  height: 10px;
  background: linear-gradient(135deg, #FFB6C1, #FF9AAE);
  border-radius: 2px;
  border: 1px solid #D4909A;
  vertical-align: middle;
}

/* アンチエイリアスボタン */
.tool-btn-aa {
  width: 36px; height: 36px; border-radius: 8px;
  border: 2px solid #D1D5DB;
  background: #F3F4F6;
  font-family: inherit; font-size: 11px; font-weight: 800;
  color: var(--text-light);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.tool-btn-aa.active {
  background: var(--secondary);
  color: #fff;
  border-color: var(--secondary-dark);
}
.tool-btn-aa:hover { opacity: 0.85; }
.tool-size-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  white-space: nowrap;
}

/* ============================================================
   カラーピッカー
   ============================================================ */
.color-picker {
  background: #fff;
  border: 2px solid #E0E4E8;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.color-presets {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; flex-wrap: wrap;
}

.color-swatch {
  width: 38px; height: 38px; border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer; transition: all 0.15s;
  outline: none;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text);
}

/* (btn-picker-toggle は btn-picker-open に統合) */

/* カラー詳細 インライン展開 */
.picker-detail {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: #F9FAFB;
  border-radius: 10px;
}
.picker-detail[hidden] { display: none; }

/* カラー詳細を開くボタン */
.btn-picker-open {
  padding: 6px 14px !important;
  font-size: 13px !important;
  border-radius: 8px !important;
  width: 100%;
}

.picker-preview-row {
  display: flex; align-items: center; gap: 12px;
}

.color-preview {
  width: 48px; height: 48px; border-radius: 12px;
  background: #000;
  border: 2px solid #E5E7EB;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.color-hex-input {
  font-family: monospace;
  font-size: 20px; font-weight: 700;
  width: 120px;
  padding: 10px 12px;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  text-transform: uppercase;
  text-align: center;
  outline: none;
}
.color-hex-input:focus { border-color: var(--secondary); }

.picker-slider-group {
  display: flex; align-items: center; gap: 10px;
}
.picker-slider-group label {
  font-size: 14px; font-weight: 700; color: var(--text-light);
  width: 56px; flex-shrink: 0;
}

.slider-hue,
.slider-sat,
.slider-light {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 14px; border-radius: 7px;
  outline: none; cursor: pointer;
}

.slider-hue {
  background: linear-gradient(to right,
    hsl(0,100%,50%), hsl(60,100%,50%), hsl(120,100%,50%),
    hsl(180,100%,50%), hsl(240,100%,50%), hsl(300,100%,50%), hsl(360,100%,50%));
}
.slider-sat { background: linear-gradient(to right, #888, #f00); }
.slider-light { background: linear-gradient(to right, #000, #888, #fff); }

.slider-hue::-webkit-slider-thumb,
.slider-sat::-webkit-slider-thumb,
.slider-light::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  border: 3px solid #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}
.slider-hue::-moz-range-thumb,
.slider-sat::-moz-range-thumb,
.slider-light::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  border: 3px solid #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
  cursor: pointer;
}

.picker-rgb-row {
  display: flex; gap: 8px; justify-content: center;
}
.rgb-field {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.rgb-field label {
  font-size: 13px; font-weight: 700; color: var(--text-light);
}
.rgb-field input {
  width: 68px; padding: 8px 8px;
  font-family: monospace;
  font-size: 18px; font-weight: 700;
  border: 2px solid #E5E7EB;
  border-radius: 8px;
  text-align: center;
  outline: none;
}
.rgb-field input:focus { border-color: var(--secondary); }

/* ============================================================
   キャンバス
   ============================================================ */
.canvas-wrapper {
  width: 100%; max-width: 500px;
  aspect-ratio: 1;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 0 2px rgba(0,0,0,0.06);
  overflow: hidden;
  flex-shrink: 1;
  min-height: 0;
  min-width: 0;
}

#drawing-canvas {
  width: 100%; height: 100%;
  touch-action: none;
  cursor: crosshair;
}

/* スクロールナビボタン（スマホのみ表示） */
.scroll-nav-btn { display: none; }

/* 拡大時: カスタムスクロールバー（キャンバス外にグリッド配置） */
.zoom-scroll-area {
  display: grid;
  grid-template-columns: 1fr 20px;
  grid-template-rows: 1fr 20px;
  gap: 4px;
  flex-shrink: 0;
  margin-right: 16px;
}
.zoom-scroll-area .canvas-wrapper {
  grid-column: 1;
  grid-row: 1;
}
.zoom-sb-h {
  grid-column: 1;
  grid-row: 2;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  position: relative;
  height: 20px;
}
.zoom-sb-v {
  grid-column: 2;
  grid-row: 1;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  position: relative;
  width: 20px;
}
.zoom-sb-thumb {
  position: absolute;
  background: var(--primary);
  border-radius: 8px;
  opacity: 0.7;
  touch-action: none;
  cursor: grab;
}
.zoom-sb-h .zoom-sb-thumb {
  height: 100%;
  top: 0;
}
.zoom-sb-v .zoom-sb-thumb {
  width: 100%;
  left: 0;
}
.zoom-sb-thumb.dragging,
.zoom-sb-thumb:hover {
  opacity: 1;
  cursor: grabbing;
}

.submit-area {
  width: 100%;
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
}

.submit-hint { font-size: 18px; color: #9CA3AF; }

/* キャンバス画面のキャラクター */
.drawing-anzu-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

/* ============================================================
   採点中画面
   ============================================================ */
.scoring-content {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 32px 16px; gap: 28px;
}

.loading-dots { display: flex; gap: 12px; }
.dot {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary);
  animation: dot-pulse 1s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }
.scoring-text { font-size: 22px; color: var(--text-light); }

/* ============================================================
   結果画面（スクロールなしレイアウト）
   ============================================================ */
.result-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 16px;
  gap: 10px;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* --- ヘッダー: スコア＋ランク横並び --- */
.result-header {
  width: 100%;
  flex-shrink: 0;
}

.result-score-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 10px 24px;
  text-align: center;
  width: 100%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.result-score-label {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 700;
}

.score-animate {
  display: flex;
  align-items: baseline;
}

.result-total-score {
  font-size: 52px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  text-shadow: 0 2px 8px rgba(255,107,53,0.15);
}

.result-score-max {
  font-size: 20px;
  color: #9CA3AF;
  margin-left: 4px;
}

.result-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 800;
  padding: 2px 22px;
  border-radius: 999px;
  border: 4px solid var(--primary);
  color: var(--primary);
  line-height: 1.2;
}

/* --- メイン: 描画 + キャラクター感想 --- */
.result-main {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 0;
}

.result-drawing-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-height: 0;
}

.result-theme-text {
  background: #F9FAFB;
  border-radius: 10px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
  white-space: pre-line;
  color: var(--text);
  flex-shrink: 0;
}

.result-drawing-wrap {
  background: #fff;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.result-drawing-img {
  display: block;
  width: 100%;
  height: auto;
}

.result-unique-id {
  font-size: 11px;
  color: #9CA3AF;
  text-align: center;
  flex-shrink: 0;
}

/* --- キャラクター＋感想 --- */
.result-anzu-section {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 6px;
}

.result-anzu-section .anzu-area {
  align-items: center;
}

.result-anzu-section .speech-bubble {
  font-size: 14px;
  padding: 10px 14px;
  max-width: 260px;
  min-height: 60px;
  line-height: 1.5;
  margin-bottom: 8px;
  flex-shrink: 0;
  overflow: hidden;
}

.result-anzu-section .anzu {
  width: 120px;
  height: 120px;
  margin-top: 8px;
}

/* キャラクター下の影を下に移動 */
.result-anzu-section .anzu-area::after {
  bottom: 10px;
}

/* キャプチャ時の影非表示 */
.capture-hide-shadow::after {
  display: none !important;
}

/* --- ダウンロードメニュー --- */
.download-wrap {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
}

.download-wrap .btn {
  width: 100%;
}

.download-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 2px solid #E0E4E8;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 10;
  min-width: 200px;
}

.download-menu[hidden] { display: none; }

.download-menu-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #F3F4F6;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
  white-space: nowrap;
}

.download-menu-item:hover {
  background: var(--secondary);
  color: #fff;
}

/* --- アクションボタン --- */
.result-actions {
  display: flex;
  gap: 10px;
  width: 100%;
  flex-shrink: 0;
  justify-content: center;
}

.result-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  white-space: nowrap;
  padding: 12px 8px;
  font-size: 15px;
  height: 48px;
  box-sizing: border-box;
}

/* ============================================================
   アニメーション
   ============================================================ */
@keyframes countdown-urgent {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.3); }
  100% { transform: scale(1); }
}
@keyframes dot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.6; }
}
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 4px 0 var(--primary-dark), 0 6px 16px rgba(240,100,73,0.25), 0 0 0 0 rgba(255,107,53,0.4); }
  50%      { box-shadow: 0 4px 0 var(--primary-dark), 0 6px 16px rgba(240,100,73,0.25), 0 0 0 14px rgba(255,107,53,0); }
}
.btn-pulse { animation: btn-pulse 2s ease-in-out infinite; }

@keyframes fade-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in 0.5s ease-out forwards; }

@keyframes anzu-bounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.anzu-bounce { animation: anzu-bounce 2s ease-in-out infinite; }
.anzu-area .speech-bubble { animation: anzu-bounce 2s ease-in-out infinite; }

@keyframes shadow-bounce {
  0%, 100% { transform: translateX(-50%) scaleX(1); }
  50%      { transform: translateX(-50%) scaleX(0.7); }
}

@keyframes score-pop {
  from { opacity: 0; transform: scale(0.5); }
  to   { opacity: 1; transform: scale(1); }
}
.score-animate { animation: score-pop 0.8s cubic-bezier(0.34,1.56,0.64,1) forwards; }

/* ============================================================
   PC レイアウト (横長)
   ============================================================ */
@media (min-width: 900px) {

  /* PC: ブラウン管テレビ風（横長・上下中央） */
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
  }
  .screen {
    min-height: auto;
    height: calc(100dvh - 120px);
    max-height: 640px;
    margin: 0 auto;
  }

  /* --- トップ: タイトル上部、下に左右2カラム --- */
  .top-content {
    padding: 24px 48px;
    max-width: 960px;
    margin: 0 auto;
    gap: 10px;
  }
  .top-header { width: 100%; margin-top: -24px; }
  .top-body {
    flex-direction: row;
    align-items: stretch;
    gap: 24px;
    max-width: 760px;
  }
  .top-left {
    flex: 1;
    max-width: 420px;
    justify-content: space-between;
  }
  .top-right {
    flex: 0 0 280px;
    display: flex;
    justify-content: center;
  }
  .top-right .anzu-area {
    flex: 1;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 20px;
  }
  .anzu-top { width: 240px; height: auto; }
  .top-title { font-size: 68px; }

  /* --- お題画面: 中央にお題、右にキャラ --- */
  .theme-content {
    justify-content: center;
    padding: 24px 40px;
    max-width: 1100px;
    margin: 0 auto;
  }
  .theme-center {
    max-width: 640px;
  }
  .theme-card {
    padding: 18px 22px;
  }
  .theme-keywords {
    gap: 7px;
    margin-top: 8px;
  }
  .keyword-chip {
    font-size: 18px;
    padding: 8px 16px;
    box-shadow: 0 2px 0 var(--secondary-dark);
  }
  .keyword-chip.bonus {
    box-shadow: 0 2px 0 var(--accent-dark);
  }
  .theme-badge {
    font-size: 18px;
    padding: 12px 24px;
    margin-bottom: 16px;
  }
  .theme-anzu {
    right: -200px;
    bottom: 16px;
  }

  /* --- 描画画面: トップバー＋メイン（キャンバス＋サイドバー） --- */
  .drawing-content {
    padding: 8px 24px;
    gap: 4px;
    max-width: 1200px;
    margin: 0 auto;
  }

  .drawing-main {
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
  }

  .canvas-wrapper {
    width: 512px;
    height: 512px;
    max-width: 512px;
    aspect-ratio: 1;
    flex: 0 0 512px;
  }

  .drawing-sidebar {
    width: 380px;
    flex-shrink: 0;
    overflow: visible;
    max-height: 100%;
    gap: 6px;
  }

  /* PC: ツールバー */
  .drawing-sidebar .toolbar {
    padding: 8px 10px;
    gap: 4px;
  }
  .drawing-sidebar .tool-btn {
    padding: 8px 6px;
    font-size: 14px;
    border-radius: 8px;
  }
  .drawing-sidebar .tool-btn-size {
    width: 32px;
    height: 32px;
  }
  .drawing-sidebar .tool-btn-aa {
    width: 32px;
    height: 32px;
    font-size: 10px;
  }
  .drawing-sidebar .tool-divider-v {
    height: 24px;
  }
  .drawing-sidebar .tool-size-label {
    font-size: 12px;
  }

  /* PC: カラーピッカー — 1行に10色 */
  .drawing-sidebar .color-picker {
    padding: 8px 12px;
    gap: 6px;
    max-width: none;
  }
  .drawing-sidebar .color-swatch {
    width: 30px;
    height: 30px;
    border-width: 2px;
  }
  .drawing-sidebar .color-presets {
    gap: 5px;
    flex-wrap: nowrap;
  }
  .drawing-sidebar .btn-picker-open {
    font-size: 13px !important;
    padding: 6px 12px !important;
  }

  /* PC: 詳細パネル */
  .drawing-sidebar .picker-detail {
    padding: 10px;
    gap: 6px;
  }
  .drawing-sidebar .picker-detail .picker-preview-row { gap: 10px; }
  .drawing-sidebar .picker-detail .color-preview {
    width: 40px; height: 40px; border-radius: 8px;
  }
  .drawing-sidebar .picker-detail .color-hex-input {
    font-size: 15px; padding: 6px 10px; width: 100px;
  }
  .drawing-sidebar .picker-detail .picker-slider-group { gap: 8px; }
  .drawing-sidebar .picker-detail .picker-slider-group label {
    font-size: 12px; width: 40px;
  }
  .drawing-sidebar .picker-detail .slider-hue,
  .drawing-sidebar .picker-detail .slider-sat,
  .drawing-sidebar .picker-detail .slider-light {
    height: 12px;
  }
  .drawing-sidebar .picker-detail .slider-hue::-webkit-slider-thumb,
  .drawing-sidebar .picker-detail .slider-sat::-webkit-slider-thumb,
  .drawing-sidebar .picker-detail .slider-light::-webkit-slider-thumb {
    width: 18px; height: 18px; border-width: 2px;
  }
  .drawing-sidebar .picker-detail .rgb-field input {
    width: 56px; padding: 5px; font-size: 14px;
  }
  .drawing-sidebar .picker-detail .rgb-field label {
    font-size: 12px;
  }

  /* PC: キャラクター — サイドバー下中央寄りに配置 */
  #screen-drawing .drawing-anzu-area {
    position: absolute;
    bottom: 80px;
    right: 120px;
    padding: 0;
    gap: 4px;
    z-index: 3;
    pointer-events: none;
  }
  .drawing-sidebar .drawing-anzu-area .anzu {
    width: 160px;
    height: 160px;
  }
  .drawing-sidebar .drawing-anzu-area .speech-bubble-sm {
    font-size: 16px;
    padding: 8px 16px;
  }

  /* --- 結果画面: スクロールなし2カラム --- */
  .result-content {
    padding: 16px 28px;
    gap: 10px;
    max-width: 960px;
    margin: 0 auto;
  }

  .result-score-card {
    max-width: 560px;
    margin: 0 auto;
    padding: 10px 28px;
    gap: 20px;
  }

  .result-main {
    flex: 0 1 auto;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 28px;
  }

  .result-drawing-section {
    flex: 0 1 auto;
    max-width: 340px;
  }

  .result-drawing-wrap {
    max-width: 320px;
    max-height: 320px;
  }

  .result-anzu-section {
    flex: 0 0 auto;
  }

  .result-anzu-section .anzu {
    width: 140px;
    height: 140px;
  }

  .result-anzu-section .speech-bubble {
    font-size: 15px;
    padding: 12px 16px;
    max-width: 320px;
    min-height: 70px;
  }

  .result-actions {
    max-width: 680px;
  }

  .result-actions .btn {
    padding: 14px 12px;
    font-size: 17px;
  }
}

/* ============================================================
   スマホ レスポンシブ
   ============================================================ */
@media (max-width: 480px) {
  .screen {
    margin: 10px auto;
    width: calc(100% - 20px);
    min-height: calc(100dvh - 20px);
    border-radius: 18px;
  }
  /* 描画画面: viewport高さに固定し内部スクロールでツールへ到達 */
  #screen-drawing.active {
    height: calc(100dvh - 20px);
    min-height: 0;
    overflow: hidden;
  }
  /* リザルト画面: スクロール前提 */
  #screen-result.active {
    min-height: 0;
    height: auto;
  }
  body { font-size: 17px; }
  .top-title { font-size: 38px; }
  .top-subtitle { font-size: 16px; white-space: normal; }
  .btn { font-size: 18px; padding: 14px 24px; }
  .btn-large { font-size: 22px; padding: 16px 28px; }
  .countdown-number { font-size: 56px; }
  /* スマホ: 結果画面 — スクロール前提のレイアウト */
  .result-content { padding: 10px 12px; gap: 8px; overflow: visible; flex: none; }
  .result-score-card { padding: 8px 14px; gap: 10px; }
  .result-score-label { font-size: 13px; }
  .result-total-score { font-size: 38px; }
  .result-score-max { font-size: 16px; }
  .result-rank { font-size: 26px; padding: 2px 14px; border-width: 3px; }
  .result-theme-text { font-size: 12px; padding: 4px 10px; }
  .result-drawing-wrap { max-width: 220px; }
  /* スマホ: キャラ小さめ表示 */
  .result-anzu-section .anzu {
    width: 80px;
    height: 80px;
    margin-top: 4px;
  }
  .result-anzu-section .anzu-area::after {
    bottom: 2px;
  }
  .result-anzu-section .speech-bubble {
    font-size: 13px;
    padding: 10px 14px;
    max-width: 100%;
    width: 100%;
    min-height: auto;
    max-height: none;
    margin-bottom: 0;
  }
  .result-main {
    flex: none;
    flex-direction: column;
    gap: 6px;
  }
  .result-drawing-section {
    flex-shrink: 0;
  }
  .result-drawing-wrap { max-width: 260px; }
  .result-anzu-section { width: 100%; flex-shrink: 0; }
  .result-anzu-section .anzu-area { width: 100%; }
  .result-actions { flex-direction: column; gap: 8px; }
  .result-actions .btn { width: 100%; font-size: 16px; padding: 12px 16px; }
  .toolbar { padding: 6px 8px; gap: 6px; }
  .tool-btn { padding: 8px 12px; font-size: 15px; }

  /* スマホ: ツール行1 → 2x2グリッド */
  .toolbar .tool-row:first-child {
    flex-wrap: wrap;
    gap: 6px;
  }
  .toolbar .tool-row:first-child .tool-btn.tool-sq {
    width: calc(50% - 3px);
    flex: none;
  }

  /* スマホ: ツール行2（バケツ・スポイト・拡大・縮小）→ 2x2グリッド */
  .toolbar .tool-row:nth-child(2) {
    flex-wrap: wrap;
    gap: 6px;
  }
  .toolbar .tool-row:nth-child(2) .tool-btn.tool-sq {
    width: calc(50% - 3px);
    flex: none;
  }

  /* スマホ: ツール行3（ペンの太さ・AA） */
  .toolbar .tool-row:last-child {
    flex-wrap: wrap;
    gap: 6px;
  }
  .toolbar .tool-row:last-child .tool-divider-v:first-of-type {
    display: none;
  }
  /* ペンの太さ＋AAを1行に収める */
  .toolbar .tool-btn-size {
    width: 34px;
    height: 34px;
  }
  .toolbar .tool-btn-aa {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }
  .toolbar .tool-size-label {
    font-size: 11px;
  }

  /* スマホ: トップバー調整 */
  .drawing-topbar { flex-wrap: wrap; }
  .drawing-topbar-left { gap: 8px; }
  .drawing-topbar-right { gap: 4px; }
  .drawing-topbar-right .submit-hint {
    font-size: 11px;
    white-space: nowrap;
  }
  .btn-topbar {
    padding: 8px 14px !important;
    font-size: 14px !important;
    height: 38px !important;
  }
  .color-presets { gap: 6px; }
  .color-swatch { width: 30px; height: 30px; }
  .keyword-chip { font-size: 20px; padding: 10px 18px; }
  .speech-bubble { font-size: 18px; }
  .theme-label { font-size: 22px; }
  .level-label { font-size: 20px; }
  #level-display { font-size: 34px; }

  .drawing-anzu-area { display: none; }
  .anzu-area::after { bottom: 4px; }

  /* スマホ: 描画画面スクロール可能（カラーピッカーまで届くように） */
  .drawing-content {
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* キャンバスサイズを固定し、カラー詳細を開いても縮まないようにする */
  .drawing-main {
    flex: none;
    overflow: visible;
  }
  .canvas-wrapper {
    width: calc(100vw - 44px);
    height: calc(100vw - 44px);
    max-width: 500px;
    max-height: 500px;
    flex-shrink: 0;
  }

  /* スマホ: スクロールナビボタン */
  .scroll-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: sticky;
    bottom: 10px;
    align-self: flex-end;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border-radius: 50%;
    border: none;
    background: rgba(240, 100, 73, 0.75);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 20;
    margin-right: 4px;
  }
  .scroll-nav-btn:active {
    background: rgba(200, 80, 55, 0.85);
  }
}

/* --- Google AdSense サイド広告 --- */
.adsense-side {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 160px;
  z-index: 10;
}
.adsense-left {
  left: calc((100vw - 1100px) / 2 / 2 - 80px);
}
.adsense-right {
  right: calc((100vw - 1100px) / 2 / 2 - 80px);
}

/* 画面幅が狭い場合（コンテンツ+広告が収まらない）は非表示 */
@media (max-width: 1500px) {
  .adsense-side { display: none; }
}
