/* Japan Puzzle Plugin v1.1.0 - Responsive */
/* 修正: v1.1.0 でUI改善（未使用サイドバーCSS削除、各種ユーザビリティ修正） */

/* ========== WPテーマ干渉リセット ========== */
.entry-content .pzl-wrap,
.wp-block-group .pzl-wrap,
.site-content .pzl-wrap,
.page-content .pzl-wrap,
.post-content .pzl-wrap {
  margin: 0 !important;
  padding: 0 !important;
}
.entry-content > *:has(> .pzl-wrap),
.wp-block-group:has(.pzl-wrap) {
  padding: 0 !important;
  margin: 0 !important;
}
.pzl-wrap p, .pzl-wrap ul, .pzl-wrap ol,
.pzl-wrap li, .pzl-wrap h1, .pzl-wrap h2, .pzl-wrap h3 {
  margin: 0 !important;
  padding: 0 !important;
}
.okinawa-puzzle-wrapper {
  display: block;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0;
  font-size: 0;
}
/* 修正: #clearOverlay / #modeOverlay は .pzl-wrap の外側（兄弟要素）にあるため、
   上記の .pzl-wrap 用リセットが効かずCocoonテーマ側のp/div/button既定スタイルが
   素通しになっていた（タイトルとサブタイトルの重なり、ボタン文字の消失の原因）。
   ただしmargin/paddingを一括!important指定すると自作のレイアウトまで壊れるため、
   ここでは危険性の高いプロパティ（行間・文字装飾・appearance等）だけに限定する。
   margin/padding/背景色は各コンポーネントの個別ルール側で!importantを付けて対応する。 */
#clearOverlay, #modeOverlay,
#clearOverlay *, #modeOverlay * {
  box-sizing: border-box !important;
  line-height: normal !important;
  text-decoration: none !important;
  list-style: none !important;
  -webkit-text-fill-color: currentColor !important;
  font-family: 'Noto Sans JP', sans-serif !important;
}
#clearOverlay button, #modeOverlay button {
  -webkit-appearance: none !important;
  appearance: none !important;
  box-shadow: none;
  background-image: none;
}

/* ========== ルート ========== */
.pzl-wrap {
  --base: #FFFFFF;
  --base-light: #FAFAFA;
  --base-dark: #F0F4F8;
  --main: #1e3a5f;
  --main-light: #2d5a8f;
  --main-dark: #0f1e3a;
  --accent: #d4af37;
  --accent-light: #f4cf5f;
  --accent-dark: #b8941f;
  --text: #2C3E50;
  --text-light: #7F8C8D;
  --border: #E8E8E8;
  --shadow: 0 4px 20px rgba(30,58,95,0.1);
  --ok: #27ae60;
  --ng: #e74c3c;

  font-family: 'Noto Sans JP', sans-serif;
  line-height: 1;
  background: linear-gradient(160deg, #e8f0f8 0%, #f5f0e8 100%);
  display: flex;
  flex-direction: column;
  width: 100%;
  /* 修正12: 100dvhでタブレットのブラウザUI分の欠けを防止（非対応環境は100vhにフォールバック） */
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  box-sizing: border-box;
  position: relative;
}
.pzl-wrap *, .pzl-wrap *::before, .pzl-wrap *::after {
  box-sizing: border-box;
}

/* ========== 右コンテンツ ========== */
.pzl-content {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  padding: 8px; gap: 8px; overflow: hidden;
}

/* ---- 地図パネル ---- */
.pzl-map-panel {
  background: var(--base);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
  flex: 1; min-height: 0;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.pzl-map-panel::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  border-radius: 16px 16px 0 0; z-index: 2;
}

.pzl-map-wrapper {
  flex: 1; min-height: 0;
  overflow: hidden; position: relative;
  touch-action: none; cursor: grab;
  /* 修正: 海に見える背景色を追加（未配置の陸は薄いクリーム色で対比させる） */
  background: linear-gradient(160deg, #bfe0f0 0%, #d7ecf5 55%, #e8f4f8 100%);
}
.pzl-map-wrapper.panning { cursor: grabbing; }

#mapContainer {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0;
}
#mapSvg { display: block; }

/* 修正8: ズームボタンをタッチ操作しやすい44px以上に拡大 */
.pzl-zoom-btns {
  position: absolute; bottom: 10px; right: 10px;
  display: flex; flex-direction: column; gap: 6px; z-index: 10;
}
.pzl-zoom-btn {
  width: 44px; height: 44px;
  background: var(--main); color: #fff;
  border: 2px solid var(--accent); border-radius: 10px;
  font-size: 22px; font-weight: 900; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(30,58,95,0.3);
  transition: all 0.15s; user-select: none; line-height: 1;
}
.pzl-zoom-btn:hover { background: var(--main-light); transform: scale(1.08); }
.pzl-zoom-reset-btn {
  width: 44px; height: 44px;
  background: rgba(255,255,255,0.92); color: var(--main);
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 11px; font-weight: 900; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(30,58,95,0.15); transition: all 0.15s; user-select: none;
}
.pzl-zoom-reset-btn:hover { background: var(--base-dark); }

/* ---- ドロップゾーン ---- */
/* 修正: 海(map-wrapper)を青系にしたのにあわせ、未配置の陸は生成り色に変更。
   non-scaling-strokeで線幅は常に画面上で一定 */
.drop-zone {
  fill: rgba(244,238,222,0.92);
  stroke: #8a7a5c; stroke-width: 1.1;
  transition: fill 0.15s, stroke 0.15s;
}
.drop-zone.hover-active {
  fill: rgba(244,207,95,0.6);
  stroke: var(--accent); stroke-width: 2;
}
.drop-zone.placed-ok {
  stroke: rgba(255,255,255,0.9) !important;
  stroke-width: 1.5 !important;
}
/* 修正13: transform属性(離島の位置移動)と衝突しないよう、
   translateXではなくfill/stroke/filterの点滅のみでNGを表現 */
.drop-zone.placed-ng {
  animation: ngFlash 0.45s ease;
}
@keyframes ngFlash {
  0%   { fill: rgba(231,76,60,0.75); stroke: var(--ng); stroke-width: 3; }
  60%  { fill: rgba(231,76,60,0.35); stroke: var(--ng); stroke-width: 2; }
  100% { fill: rgba(244,238,222,0.92); stroke: #8a7a5c; stroke-width: 1.1; }
}
/* 難易度モードで対象外の県：淡色表示・操作不可 */
.drop-zone.zone-locked {
  fill: rgba(180,180,180,0.4) !important;
  stroke: rgba(150,150,150,0.5) !important;
  pointer-events: none;
}
/* 修正: 判定専用の透明パス（見た目は離島込み、判定は本土のみにする県で使用） */
.drop-zone-hit {
  fill: none !important;
  stroke: none !important;
  pointer-events: none !important;
}

/* ========== スコアフロート（左上・折りたたみ可） ========== */
/* 修正9: 折りたたみボタンを追加し、地図が隠れて見づらい場合に最小化できるようにする */
.pzl-float-score {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(30, 58, 95, 0.82);
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 92px;
  z-index: 10;
  transition: opacity 0.15s;
}
.pzl-float-toggle {
  position: absolute;
  top: -9px; right: -9px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--main-dark);
  border: 2px solid #fff;
  font-size: 13px; font-weight: 900;
  line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 11;
}
.pzl-float-body {
  display: flex; flex-direction: column; gap: 5px;
}
.pzl-float-score.collapsed {
  min-width: 0; padding: 8px;
}
.pzl-float-score.collapsed .pzl-float-body { display: none; }
.pzl-float-score.collapsed .pzl-float-toggle { transform: rotate(45deg); }

.pzl-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.pzl-score-lbl {
  color: rgba(212, 175, 55, 0.85);
  font-size: 10px;
  font-weight: 700;
}
.pzl-score-val {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
}
.pzl-score-timer {
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
}
.pzl-score-divider {
  width: 100%;
  height: 0.5px;
  background: rgba(212, 175, 55, 0.3);
}
/* 修正11: timer="off" 指定時にタイマー行を非表示（JSでルート要素へ .timer-off を付与） */
.pzl-wrap.timer-off .pzl-timer-row { display: none; }

/* 修正10: 正解数の進捗バー */
.pzl-progress-track {
  width: 100%; height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  overflow: hidden;
  margin: 2px 0;
}
.pzl-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 4px;
  transition: width 0.25s ease;
}

.pzl-btn-reset {
  background: rgba(212, 175, 55, 0.18) !important;
  border: 1px solid rgba(212, 175, 55, 0.5) !important;
  border-radius: 8px;
  color: #f4cf5f !important;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 0;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s;
}
.pzl-btn-reset:hover { background: rgba(212, 175, 55, 0.32) !important; }
/* 修正7: リセット確定待ち状態（誤タップ防止の2段階確認） */
.pzl-btn-reset[data-armed="1"] {
  background: rgba(231, 76, 60, 0.35) !important;
  border-color: var(--ng) !important;
  color: #fff !important;
  animation: armedPulse 0.9s infinite;
}
@keyframes armedPulse {
  0%, 100% { opacity: 1; } 50% { opacity: 0.6; }
}

.pzl-btn-mode {
  background: rgba(255,255,255,0.1) !important;
  border: 1px solid rgba(255,255,255,0.3) !important;
  border-radius: 8px;
  color: #fff !important;
  font-size: 10px;
  font-weight: 700;
  padding: 6px 0;
  width: 100%;
  cursor: pointer;
  transition: background 0.15s;
}
.pzl-btn-mode:hover { background: rgba(255,255,255,0.2) !important; }

/* ========== 正解トースト ========== */
/* 修正10: 正解演出（軽いポップ表示） */
.pzl-correct-toast {
  position: absolute;
  top: 42%; left: 50%;
  transform: translate(-50%, -50%) scale(0.6);
  background: rgba(39, 174, 96, 0.92);
  color: #fff;
  font-size: clamp(16px, 3vw, 26px);
  font-weight: 900;
  padding: 10px 26px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  white-space: nowrap;
}
.pzl-correct-toast.show {
  animation: toastPop 0.7s ease forwards;
}
@keyframes toastPop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  20%  { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  35%  { transform: translate(-50%, -50%) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}

/* ========== 出典 ========== */
.pzl-credit {
  color: rgba(30, 58, 95, 0.45);
  font-size: 9px;
  margin-bottom: 3px;
}

/* ---- ピーストレイ ---- */
.pzl-tray-panel {
  background: var(--base);
  border: 2px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  position: relative;
  padding: 6px 12px 8px;
  flex-shrink: 0;
}
.pzl-tray-panel::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-light), var(--accent));
  border-radius: 16px 16px 0 0;
}
.pzl-tray-label {
  color: var(--main); font-weight: 900; font-size: 12px;
  margin-bottom: 5px; display: flex; align-items: center; gap: 6px;
}
.pzl-tray-label::before {
  content: ''; display: inline-block;
  width: 4px; height: 14px;
  background: var(--accent); border-radius: 2px;
}

/* 修正3: トレイのスクロール可視化（フェード＋左右矢印ボタン） */
.pzl-tray-scroll-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pzl-tray {
  display: flex; flex-wrap: nowrap; gap: 8px;
  overflow-x: auto; overflow-y: hidden;
  padding: 4px 2px 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex: 1; min-width: 0;
  scroll-behavior: smooth;
}
.pzl-tray::-webkit-scrollbar { display: none; }

.pzl-tray-fade {
  position: absolute;
  top: 4px; bottom: 4px;
  width: 28px;
  pointer-events: none;
  z-index: 3;
  opacity: 0;
  transition: opacity 0.2s;
}
.pzl-tray-fade-left {
  left: 40px;
  background: linear-gradient(90deg, var(--base) 10%, rgba(255,255,255,0) 100%);
}
.pzl-tray-fade-right {
  right: 40px;
  background: linear-gradient(270deg, var(--base) 10%, rgba(255,255,255,0) 100%);
}
.pzl-tray-fade.show { opacity: 1; }

.pzl-tray-arrow {
  flex-shrink: 0;
  width: 32px; height: 44px;
  background: var(--main); color: #fff;
  border: none; border-radius: 8px;
  font-size: 20px; font-weight: 900;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s, background 0.15s;
  z-index: 4;
}
.pzl-tray-arrow:hover { background: var(--main-light); }
.pzl-tray-arrow:disabled {
  opacity: 0.25; cursor: default; pointer-events: none;
}

/* ---- ピース ---- */
.pzl-piece {
  display: flex; flex-direction: column; align-items: center;
  cursor: grab; transition: transform 0.15s;
  flex-shrink: 0; user-select: none;
}
.pzl-piece:hover:not(.dragging) { transform: translateY(-3px) scale(1.06); }
.pzl-piece.dragging { opacity: 0.35; cursor: grabbing; }
.pzl-piece svg { display: block; }
.pzl-piece-name {
  font-size: 10px; font-weight: 900; color: var(--main);
  white-space: nowrap; margin-top: 2px;
  pointer-events: none; letter-spacing: 0.2px;
}

/* ---- ドラッグゴースト ---- */
#dragGhost {
  position: fixed; pointer-events: none; z-index: 9999;
  opacity: 0.88; display: none;
}

/* ---- モード選択画面 ---- */
#modeOverlay {
  position: fixed !important; inset: 0 !important;
  background: rgba(30,58,95,0.85) !important;
  display: none; align-items: center !important; justify-content: center !important;
  z-index: 2100 !important;
  padding: 16px !important;
}
#modeOverlay.show { display: flex !important; animation: fadeIn 0.3s ease; }
.pzl-mode-box {
  background: #fbfaf7 !important; border: 3px solid var(--accent) !important;
  border-radius: 24px !important;
  padding: clamp(18px, 3vw, 30px) clamp(20px, 4vw, 40px) !important;
  text-align: center !important; box-shadow: 0 20px 60px rgba(212,175,55,0.3) !important;
  max-width: 94vw; max-height: 90vh; overflow-y: auto;
  position: relative !important;
}
/* 修正: 右上の閉じるボタン */
.pzl-mode-close-x {
  position: absolute !important; top: 12px !important; right: 12px !important;
  width: 32px !important; height: 32px !important;
  border-radius: 50% !important;
  background: var(--base-dark) !important; color: var(--main) !important;
  border: none !important; font-size: 14px !important; font-weight: 900 !important;
  cursor: pointer; line-height: 1 !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  transition: background 0.15s, transform 0.15s;
  margin: 0 !important; padding: 0 !important;
}
.pzl-mode-close-x:hover { background: var(--border) !important; transform: rotate(90deg); }
.pzl-mode-title {
  display: block !important;
  font-size: clamp(18px, 3vw, 24px) !important; font-weight: 900 !important; color: var(--main) !important;
  margin: 0 0 18px !important; padding: 0 !important;
}
.pzl-mode-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 12px !important;
  margin: 0 0 18px !important; padding: 0 !important;
}
/* 修正: カードらしいデザインに刷新（上部にアクセントカラーの帯、件数はピル表示） */
.pzl-mode-item {
  --card-accent: #1e3a5f;
  position: relative !important;
  background: #ffffff !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  border-radius: 16px !important;
  padding: 18px 8px 14px !important;
  font-size: 12.5px !important; font-weight: 900 !important; color: var(--main) !important;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 2px 6px rgba(30,58,95,0.08) !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  min-height: 72px;
  line-height: 1.3 !important;
  overflow: hidden;
  margin: 0 !important;
}
.pzl-mode-item::before {
  content: '';
  position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; height: 5px !important;
  background: var(--card-accent) !important;
  margin: 0 !important; padding: 0 !important;
}
.pzl-mode-item-label {
  display: block !important;
  word-break: keep-all;
  overflow-wrap: break-word;
  margin: 0 !important; padding: 0 !important;
}
.pzl-mode-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(30,58,95,0.18) !important;
  border-color: var(--card-accent) !important;
}
.pzl-mode-item.active {
  background: var(--card-accent) !important;
  color: #fff !important;
  border-color: var(--card-accent) !important;
  box-shadow: 0 6px 16px rgba(30,58,95,0.3) !important;
}
.pzl-mode-item.active .pzl-mode-count {
  background: rgba(255,255,255,0.25) !important;
  color: #fff !important;
}
.pzl-mode-count {
  display: inline-block !important;
  font-size: 10px !important; font-weight: 700 !important;
  background: var(--base-dark) !important;
  color: var(--text-light) !important;
  padding: 2px 9px !important;
  border-radius: 999px !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}

/* ---- クリア画面 ---- */
#clearOverlay {
  position: fixed !important; inset: 0 !important;
  background: rgba(30,58,95,0.85) !important;
  display: none; align-items: center !important; justify-content: center !important;
  z-index: 2000 !important;
}
#clearOverlay.show { display: flex !important; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from{opacity:0} to{opacity:1} }
.pzl-clear-box {
  background: #ffffff !important; border: none !important;
  border-radius: 28px !important;
  padding: clamp(28px, 4vw, 40px) clamp(24px, 5vw, 44px) clamp(24px, 4vw, 32px) !important;
  text-align: center !important; box-shadow: 0 24px 64px rgba(30,58,95,0.35) !important;
  max-width: 90vw; width: 380px !important;
  position: relative !important;
  overflow: visible !important;
}

/* 修正: クリア演出（紙吹雪ドット。絵文字は使わずCSS図形のみで表現） */
.pzl-clear-confetti {
  position: relative !important;
  height: 36px !important;
  margin: 0 0 4px !important;
  padding: 0 !important;
}
.pzl-confetti-dot {
  position: absolute !important;
  width: 8px; height: 8px;
  border-radius: 50% !important;
  top: 50%; left: 50%;
  opacity: 0;
  animation: confettiFly 0.7s ease-out forwards;
  animation-delay: 0.15s;
  margin: 0 !important; padding: 0 !important;
}
.pzl-confetti-dot-1 { background: #e74c3c !important; --tx: -46px; --ty: -18px; }
.pzl-confetti-dot-2 { background: #2980b9 !important; --tx: 44px; --ty: -20px; }
.pzl-confetti-dot-3 { background: #27ae60 !important; --tx: -34px; --ty: 14px; }
.pzl-confetti-dot-4 { background: #d4af37 !important; --tx: 36px; --ty: 16px; }
.pzl-confetti-dot-5 { background: #9b59b6 !important; --tx: -14px; --ty: -28px; }
.pzl-confetti-dot-6 { background: #e67e22 !important; --tx: 16px; --ty: -30px; }
@keyframes confettiFly {
  0% { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
  100% { transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(1); opacity: 0; }
}

.pzl-clear-title {
  display: block !important;
  font-size: clamp(30px, 5vw, 42px) !important; font-weight: 900 !important;
  color: var(--main-dark) !important; letter-spacing: 0.02em;
  margin: 0 !important; padding: 0 !important; position: static !important;
}
.pzl-clear-subtitle {
  display: block !important;
  font-size: clamp(13px, 2vw, 15px) !important; font-weight: 700 !important;
  color: var(--text-light) !important;
  margin: 4px 0 0 !important; padding: 0 !important; position: static !important;
}

/* 区切りドット */
.pzl-clear-divider {
  display: flex !important; justify-content: center !important; gap: 5px !important;
  margin: 14px 0 18px !important; padding: 0 !important;
}
.pzl-clear-divider span {
  width: 4px; height: 4px; border-radius: 50% !important;
  background: var(--accent-light) !important;
  margin: 0 !important; padding: 0 !important;
}

.pzl-clear-stat {
  display: flex !important; align-items: center !important; gap: 10px !important;
  background: var(--base-dark) !important;
  border-radius: 14px !important;
  padding: 12px 16px !important;
  margin: 0 0 10px !important;
  text-align: left !important;
}
.pzl-clear-stat-label { display: inline-block !important; font-size: 13px !important; font-weight: 700 !important; color: var(--text) !important; flex: 1; margin: 0 !important; }
.pzl-clear-stat-value { display: inline-block !important; font-size: 19px !important; font-weight: 900 !important; margin: 0 !important; }
.pzl-clear-stat-miss .pzl-clear-stat-value { color: #2980b9 !important; }
.pzl-clear-stat-time .pzl-clear-stat-value { color: #1e8449 !important; }

/* 修正1: 「もう一度」ボタンの文字が背景と同化して読めなかった問題を修正（文字色を白に）
   修正: `.pzl-btn-again` 単体だとCocoonテーマの `.entry-content button` のような
   クラス+タグ構成のセレクタに詳細度で負けることがあるため、#clearOverlay を
   前置して詳細度を底上げする */
#clearOverlay .pzl-btn-again,
#clearOverlay button.pzl-btn-again {
  background: linear-gradient(135deg, #2d5a8f, #1e3a5f) !important;
  background-color: #1e3a5f !important;
  color: #ffffff !important; border: none !important; border-radius: 14px !important;
  padding: 13px 32px !important; font-size: clamp(14px, 2vw, 17px) !important; font-weight: 900 !important;
  cursor: pointer; margin: 10px 0 0 !important;
  box-shadow: 0 4px 16px rgba(30,58,95,0.3) !important; transition: all 0.2s;
  display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px;
  width: 100% !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
}
#clearOverlay .pzl-btn-again:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(30,58,95,0.35) !important; }
#clearOverlay .pzl-btn-map,
#clearOverlay button.pzl-btn-map,
#modeOverlay .pzl-btn-map,
#modeOverlay button.pzl-btn-map {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #1e3a5f !important; border: 2px solid var(--border) !important; border-radius: 14px !important;
  padding: 11px 32px !important; font-size: clamp(12px, 1.8vw, 15px) !important; font-weight: 900 !important;
  cursor: pointer; margin: 10px 0 0 !important;
  transition: all 0.2s; width: 100% !important;
  display: flex !important; align-items: center !important; justify-content: center !important; gap: 8px;
  -webkit-text-fill-color: #1e3a5f !important;
  opacity: 1 !important;
}
#clearOverlay .pzl-btn-map:hover,
#modeOverlay .pzl-btn-map:hover { background: var(--base-dark) !important; transform: translateY(-2px); }



/* ==========================================
   タブレット（768px 以下）
========================================== */
@media (max-width: 768px) {
  .pzl-content { padding: 6px; gap: 6px; }
  .pzl-float-score { min-width: 78px; padding: 6px 8px; }
  .pzl-score-val { font-size: 16px; }
  .pzl-score-timer { font-size: 12px; }
  .pzl-btn-reset, .pzl-btn-mode { font-size: 10px; padding: 5px 0; }
  .pzl-mode-grid { grid-template-columns: repeat(2, minmax(90px, 1fr)); }
}

/* ==========================================
   スマホ（480px 以下）
========================================== */
@media (max-width: 480px) {
  .pzl-tray-panel { padding: 4px 8px 6px; }
  .pzl-tray-label { font-size: 11px; margin-bottom: 3px; }
  .pzl-piece-name { font-size: 9px; }
  .pzl-zoom-btn { width: 40px; height: 40px; font-size: 18px; }
  .pzl-zoom-reset-btn { width: 40px; height: 40px; font-size: 9px; }
  .pzl-tray-arrow { width: 26px; height: 40px; font-size: 16px; }
  .pzl-float-score { min-width: 68px; }
  .pzl-mode-grid { grid-template-columns: repeat(2, minmax(80px, 1fr)); }
}
