/* ==========================
   グローバル（木箱・木のテーブル基調）
   ========================== */
:root {
  /* ベージュ／クリーム */
  --cream: #f5e6d3;
  --beige: #e6d3b3;
  --beige-deep: #c8a87a;
  /* 明るい木（オーク系） */
  --wood-light-top: #e9c191;
  --wood-light-bot: #b07b4a;
  --wood-light-edge: #7a4a20;
  /* 濃い木（ウォルナット系） */
  --wood-dark-top: #7a3f15;
  --wood-dark-bot: #4a2105;
  --wood-dark-edge: #2a1003;
  /* ビーズ */
  --bead-on-light: #3d1d05;
  --bead-on-dark: #f5e6d3;
  /* アクセント・テキスト */
  --orange: #d97706;
  --orange-deep: #92400e;
  --fg-deep: #3a2410;
  --fg: #4a2e15;
  --muted: #7a5a3a;
  /* パネル（クリーム系の和紙風） */
  --panel: rgba(245, 230, 211, 0.92);
  --panel-border: rgba(122, 69, 32, 0.35);
  --panel-shadow: 0 6px 20px rgba(74, 33, 5, 0.18);
  /* 盤面の枠 */
  --board-frame: #5a3410;
  --board-frame-inner: #2e1605;
  --cell-size: 64px;
  --cell-radius: 8px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  /* クリーム地 + ごく薄い縦の木目 */
  background:
    repeating-linear-gradient(
      90deg,
      rgba(122, 69, 32, 0.06) 0px,
      rgba(122, 69, 32, 0.06) 1px,
      transparent 1px,
      transparent 7px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(122, 69, 32, 0.03) 0px,
      rgba(122, 69, 32, 0.03) 2px,
      transparent 2px,
      transparent 23px
    ),
    linear-gradient(180deg, #f7ecd5 0%, #ead6b3 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}

.hidden { display: none !important; }

.screen {
  min-height: 100vh;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* ==========================
   ホーム画面 - ヒーロー
   ========================== */
.hero {
  width: 100%;
  max-width: 420px;
  text-align: center;
  margin-top: 8px;
}

.hero-title {
  margin: 6px 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.1;
}
.title-main {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--fg-deep);
  text-shadow: 0 2px 0 rgba(255, 240, 220, 0.6), 0 4px 10px rgba(58, 28, 8, 0.25);
}

.hero-art {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 8px auto 8px;
}
.hero-box {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 8px 16px rgba(58, 28, 8, 0.35));
  animation: float 3.4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.hero-tagline {
  font-size: 14px;
  color: var(--fg);
  margin: 8px 0 26px;
  line-height: 1.6;
}
.hero-tagline strong {
  color: var(--orange-deep);
  font-weight: 800;
}

/* ==========================
   ホーム画面 - 難易度カード
   ========================== */
.plan-label {
  width: 100%;
  max-width: 420px;
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--fg);
  font-weight: 700;
  margin-bottom: 10px;
  text-align: left;
  padding-left: 4px;
}

.difficulty-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 420px;
}

.difficulty-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 16px;
  text-align: left;
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--panel-shadow);
}
.difficulty-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 240, 220, 0.35) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s;
  pointer-events: none;
}
.difficulty-card:hover::before {
  transform: translateX(100%);
}
.difficulty-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(58, 28, 8, 0.25);
  border-color: var(--orange);
}
.difficulty-card:active {
  transform: translateY(-1px);
}
.difficulty-card.easy   { border-left: 4px solid #8fbf6a; }
.difficulty-card.normal { border-left: 4px solid var(--orange); }
.difficulty-card.hard   { border-left: 4px solid #c0492b; }

.card-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: linear-gradient(140deg, var(--cream), var(--beige));
  border: 1px solid var(--panel-border);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.diff-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--fg-deep);
}
.diff-desc {
  font-size: 12px;
  color: var(--muted);
}

.card-high {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.high-label {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.high-value {
  font-size: 16px;
  font-weight: 800;
  color: var(--orange-deep);
}

/* ==========================
   あそびかた
   ========================== */
.practice-area {
  width: 100%;
  max-width: 420px;
  margin-bottom: 18px;
}

.practice-toggle {
  width: 100%;
  background: linear-gradient(135deg, var(--cream), var(--beige));
  border: 1px dashed var(--panel-border);
  color: var(--fg-deep);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: transform 0.12s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: var(--panel-shadow);
}
.practice-toggle:hover {
  transform: translateY(-2px);
  border-color: var(--orange);
  box-shadow: 0 8px 22px rgba(58, 28, 8, 0.25);
}

.practice-panel {
  margin-top: 12px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 14px 16px 18px;
  box-shadow: var(--panel-shadow);
}

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

.practice-step {
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--orange-deep);
  font-weight: 700;
}

.practice-skip {
  background: transparent;
  border: 1px solid var(--panel-border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
}
.practice-skip:hover { color: var(--fg-deep); border-color: var(--orange); }

.practice-title {
  font-size: 17px;
  margin: 4px 0 4px;
  color: var(--fg-deep);
  font-weight: 800;
}

.practice-desc {
  font-size: 13px;
  color: var(--fg);
  margin: 0 0 10px;
  line-height: 1.6;
}
.practice-desc strong { color: var(--orange-deep); }

.practice-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 240, 220, 0.6);
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  transition: background 0.3s, border-color 0.3s;
}
.practice-score-row.hidden { display: none; }
.practice-score-label { font-size: 12px; color: var(--muted); }
.practice-score-value {
  font-size: 18px;
  font-weight: 800;
  color: var(--fg-deep);
  transition: color 0.25s, transform 0.25s, text-shadow 0.25s;
}
.practice-score-value.bumped {
  color: var(--orange-deep);
  transform: scale(1.25);
  text-shadow: 0 0 18px rgba(217, 119, 6, 0.55);
}

.practice-board-area {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 50px 0 50px;
}

.practice-board-frame {
  position: relative;
  padding: 0;
  background: transparent;
}

.practice-board-rotator {
  transform: rotate(45deg);
  transform-origin: center center;
}

.practice-board-grid {
  display: grid;
  grid-template-columns: repeat(6, var(--practice-cell-size, 36px));
  grid-template-rows: repeat(6, var(--practice-cell-size, 36px));
  gap: 2px;
  padding: 2px;
  background: var(--wood-dark-bot);
  touch-action: none;
}

.practice-board-grid .cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--bg-tint);
  padding: 1px;
}

.practice-board-grid .cell.empty {
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.06) 0px,
      rgba(0, 0, 0, 0.06) 1px,
      transparent 1px,
      transparent 2px,
      rgba(255, 240, 200, 0.09) 2px,
      rgba(255, 240, 200, 0.09) 3px,
      transparent 3px,
      transparent 5px
    );
}

.practice-board-grid .cell.target {
  outline: 3px dashed var(--orange);
  outline-offset: -3px;
  animation: target-pulse 1.4s ease-in-out infinite;
  z-index: 1;
}

.practice-board-grid .cell.pushable {
  outline: 3px solid var(--orange);
  outline-offset: -2px;
  background: rgba(217, 119, 6, 0.18);
  animation: pushable-pulse 1.1s ease-in-out infinite;
  z-index: 2;
}

@keyframes target-pulse {
  0%, 100% { outline-color: rgba(217, 119, 6, 0.55); }
  50%      { outline-color: rgba(217, 119, 6, 1); }
}
@keyframes pushable-pulse {
  0%, 100% {
    outline-color: rgba(217, 119, 6, 0.85);
    outline-width: 3px;
  }
  50%      {
    outline-color: #ffb84d;
    outline-width: 4px;
  }
}

.practice-board-grid .cell-inner {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  background: var(--cell-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* 木の質感: 縦の木目 */
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.06) 0px,
      rgba(0, 0, 0, 0.06) 1px,
      transparent 1px,
      transparent 4px
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 220, 0.4),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25);
}

.practice-board-grid .cell.light .cell-inner { color: var(--bead-on-light); }
.practice-board-grid .cell.dark  .cell-inner { color: var(--bead-on-dark); }

.practice-board-grid .cell-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 1px;
  padding: 4px;
  width: 100%;
  height: 100%;
  transform: rotate(-45deg);
  place-items: center;
}

.practice-board-grid .icon {
  width: 100%;
  height: 100%;
  max-width: 9px;
  max-height: 9px;
  display: block;
}

.practice-status {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  min-height: 18px;
  margin-bottom: 10px;
}
.practice-status.success {
  color: var(--orange-deep);
  font-weight: 700;
}

.practice-cash-out-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  margin: 6px 0 12px;
  padding: 10px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px dashed rgba(217, 119, 6, 0.5);
  border-radius: 10px;
}
.practice-cash-out-row.hidden { display: none; }

.practice-cash-out {
  background: linear-gradient(135deg, #f0a040, var(--orange));
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
  animation: cash-out-pulse 1.6s ease-in-out infinite;
  transition: transform 0.1s, box-shadow 0.15s;
}
.practice-cash-out:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(217, 119, 6, 0.6);
}
.practice-cash-out:active { transform: translateY(0); }

.practice-cash-out-hint {
  text-align: center;
  font-size: 11px;
  color: var(--orange-deep);
  letter-spacing: 0.3px;
}

@keyframes cash-out-pulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45); }
  50%      { box-shadow: 0 6px 24px rgba(217, 119, 6, 0.85); }
}

.practice-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 8px;
}

.practice-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--panel-border);
  color: var(--fg-deep);
  font-size: 22px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.15s, border-color 0.15s, transform 0.1s, opacity 0.15s;
}
.practice-arrow:hover:not(:disabled) {
  background: var(--beige);
  border-color: var(--orange);
  transform: translateY(-1px);
}
.practice-arrow:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.practice-dots {
  display: flex;
  align-items: center;
  gap: 10px;
}

.practice-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(74, 46, 21, 0.25);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}
.practice-dot:hover { background: rgba(74, 46, 21, 0.5); }
.practice-dot.active {
  background: var(--orange);
  transform: scale(1.4);
  box-shadow: 0 0 10px rgba(217, 119, 6, 0.6);
}
.practice-dot.cleared:not(.active) {
  background: rgba(217, 119, 6, 0.55);
}

.practice-swipe-hint {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.4px;
  opacity: 0.8;
}

/* ==========================
   ゲーム画面: 上部の情報バー（難易度/手数/経過）
   ========================== */
.game-info-bar {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
  padding: 0 4px;
}

.diff-label {
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--orange-deep);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(245, 230, 211, 0.85);
  border: 1px solid var(--panel-border);
}

button.ghost {
  background: rgba(245, 230, 211, 0.85);
  border: 1px solid var(--panel-border);
  color: var(--fg-deep);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}
button.ghost:hover { background: var(--cream); }

button.primary {
  background: linear-gradient(135deg, #f0a040, var(--orange));
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.3px;
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.4);
  transition: transform 0.1s, box-shadow 0.15s;
}
button.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(217, 119, 6, 0.55);
}
button.primary:active { transform: translateY(0); }

/* ==========================
   ポイント表示（中央・透明背景・そこそこ大きく）
   ========================== */
.points-hero {
  width: 100%;
  max-width: 600px;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 6px 0 10px;
  text-align: center;
  color: var(--fg-deep);
  box-shadow: none;
  margin-bottom: 10px;
}
.points-label {
  font-size: 12px;
  letter-spacing: 2px;
  font-weight: 700;
  color: var(--muted);
}
.points-value {
  font-size: 36px;
  font-weight: 900;
  line-height: 1.1;
  margin-top: 2px;
  letter-spacing: 0.5px;
  color: var(--orange-deep);
}

/* ==========================
   ボタン行（戻る + 完了）
   ========================== */
.game-actions {
  width: 100%;
  max-width: 600px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 14px;
}
.game-actions .ghost {
  font-size: 13px;
  padding: 0 14px;
  min-height: 56px;
}

/* 完了ボタン（押しやすい大型・行内で伸びる） */
.complete-button {
  background: linear-gradient(135deg, #f0a040, var(--orange));
  color: #fff;
  border: none;
  padding: 14px 24px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 22px;
  letter-spacing: 3px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(217, 119, 6, 0.5);
  transition: transform 0.1s, box-shadow 0.15s;
  min-height: 56px;
}
.complete-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(217, 119, 6, 0.65);
}
.complete-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 14px rgba(217, 119, 6, 0.45);
}

/* ==========================
   スコアパネル（補助情報）
   ========================== */
.score-panel {
  width: 100%;
  max-width: 600px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.score-item {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  box-shadow: var(--panel-shadow);
}
.score-item .label {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.score-item .value {
  font-size: 18px;
  font-weight: 800;
  margin-top: 2px;
  color: var(--fg-deep);
}

/* ==========================
   盤面（45度回転）+ 木箱フレーム
   ========================== */
.board-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 80px 0;
}

/* 盤面コンテナ（フレームなし。ブロックそのものが主役） */
.board-frame {
  position: relative;
  padding: 0;
  background: transparent;
}

.board-rotator {
  transform: rotate(45deg);
  transform-origin: center center;
  position: relative;
  z-index: 1;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(6, var(--cell-size));
  grid-template-rows: repeat(6, var(--cell-size));
  gap: 2px;
  padding: 2px;
  background: var(--wood-dark-bot);
  box-shadow:
    inset 0 0 0 2px var(--board-frame-inner),
    0 8px 26px rgba(0, 0, 0, 0.45);
  /* 盤面内ではドラッグ操作を優先 */
  touch-action: none;
}

.cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background-color: var(--bg-tint);
  padding: 2px;
}

/* 空きマス(木箱の床)にも縦の木目を入れる(控えめ) */
.cell.empty {
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.06) 0px,
      rgba(0, 0, 0, 0.06) 1px,
      transparent 1px,
      transparent 3px,
      rgba(255, 240, 200, 0.09) 3px,
      rgba(255, 240, 200, 0.09) 4px,
      transparent 4px,
      transparent 7px
    );
}

.cell-inner {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  background: var(--cell-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* 木の質感: 縦の木目 + ハイライト */
  background-image:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.07) 0px,
      rgba(0, 0, 0, 0.07) 1px,
      transparent 1px,
      transparent 5px
    );
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 220, 0.45),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.cell.light .cell-inner { color: var(--bead-on-light); }
.cell.dark  .cell-inner { color: var(--bead-on-dark); }

.cell.light:hover .cell-inner,
.cell.dark:hover .cell-inner {
  filter: brightness(1.06);
}

.cell-icons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 2px;
  padding: 6px;
  width: 100%;
  height: 100%;
  transform: rotate(-45deg);
  place-items: center;
}

.icon {
  width: 100%;
  height: 100%;
  max-width: 14px;
  max-height: 14px;
  display: block;
}

.cell.dragging {
  transform: scale(0.95);
  opacity: 0.7;
}

/* ==========================
   トースト
   ========================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--cream), var(--beige));
  color: var(--fg-deep);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  z-index: 100;
  border: 1px solid var(--panel-border);
  box-shadow: 0 8px 24px rgba(58, 28, 8, 0.35);
  animation: toast-in 0.25s ease-out;
}
.toast.celebrate {
  background: linear-gradient(135deg, #f0a040, var(--orange));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 30px rgba(217, 119, 6, 0.55);
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================
   紙吹雪
   ========================== */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 99;
}
.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  animation: confetti-fall linear forwards;
}
@keyframes confetti-fall {
  0%   { transform: translateY(0) rotate(0deg);   opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0.4; }
}

/* ==========================
   結果モーダル
   ========================== */
.result-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(46, 22, 5, 0.55);
  backdrop-filter: blur(4px);
}
.result-card {
  position: relative;
  width: 100%;
  max-width: 360px;
  background: linear-gradient(180deg, var(--cream), var(--beige));
  border: 2px solid var(--wood-dark-edge);
  border-radius: 16px;
  padding: 24px 22px 20px;
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  animation: result-pop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes result-pop {
  from { transform: scale(0.85) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0);     opacity: 1; }
}
.result-title {
  font-size: 24px;
  font-weight: 900;
  text-align: center;
  color: var(--fg-deep);
  letter-spacing: 2px;
  margin-bottom: 16px;
}
.result-score-block {
  background: rgba(255, 240, 220, 0.7);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  margin-bottom: 18px;
}
.result-score-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}
.result-score-value {
  font-size: 36px;
  font-weight: 900;
  color: var(--orange-deep);
  margin: 4px 0 4px;
  line-height: 1.1;
}
.result-best {
  font-size: 12px;
  color: var(--muted);
}
.result-new-record {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 1px;
  animation: record-glow 1.4s ease-in-out infinite;
}
@keyframes record-glow {
  0%, 100% { text-shadow: 0 0 6px rgba(217, 119, 6, 0.4); }
  50%      { text-shadow: 0 0 14px rgba(240, 160, 64, 0.9); }
}
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.result-actions button {
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 800;
  border-radius: 10px;
  cursor: pointer;
}

/* ==========================
   スマホ対応
   ========================== */
@media (max-width: 480px) {
  :root {
    --cell-size: 48px;
  }
  .icon { width: 9px; height: 9px; }
  .title-main { font-size: 36px; letter-spacing: 3px; }
  .hero-art { width: 170px; height: 170px; }
  .points-value { font-size: 30px; }
  .complete-button { font-size: 18px; padding: 12px 16px; min-height: 52px; letter-spacing: 2px; }
  .game-actions .ghost { min-height: 52px; font-size: 12px; padding: 0 10px; }
  .score-panel { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .score-item .value { font-size: 15px; }
  .score-item .label { font-size: 10px; }
  .practice-board-grid { --practice-cell-size: 30px; }
  .practice-board-grid .icon { max-width: 7px; max-height: 7px; }
}
