/* style.css - 印刷くん 共通スタイル
   ベース: 元のPythonスクリプト BASE_CSS をそのまま移植
   追加: .pick-btn（共通下地図の選択ボタン）のみ追記
*/

* { box-sizing: border-box; }
html, body {
  height: 100%; margin: 0; padding: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto,
    'Hiragino Kaku Gothic ProN', 'Yu Gothic UI', sans-serif;
  background: #f9fafb;
  color: #111;
}

/* 長押し・選択抑制（全ページ） */
.noselect, .btn, .action-btn, .toggle, .fun-btn, .badge, h1 {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

h1 { font-size: 20px; text-align: center; margin: 12px 0; }

.container {
  height: calc(100% - 44px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.big-grid {
  display: grid;
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
  gap: 12px;
  height: 100%;
}

.btn {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  border-radius: 16px; border: 2px solid #111;
  background: #fff; font-size: 22px; font-weight: 700;
  text-decoration: none; color: #111;
  box-shadow: 0 4px 0 #111;
}
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #111; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.label { font-weight: 700; }

.select, .input {
  appearance: none;
  width: 100%;
  border: 2px solid #111;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 18px;
  background: #fff;
  font-family: inherit;
}

.small { font-size: 14px; opacity: .7; }

.card {
  border: 2px solid #111;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 4px 0 #111;
}

.stack { display: flex; flex-direction: column; gap: 12px; }

.actions { display: flex; gap: 12px; }

.action-btn {
  flex: 1 1 auto;
  border: 2px solid #111;
  border-radius: 12px;
  padding: 12px;
  font-weight: 800;
  font-size: 16px;
  font-family: inherit;
  text-align: center;
  background: #ffd53d;
  box-shadow: 0 3px 0 #111;
  cursor: pointer;
  text-decoration: none;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
}
.action-btn.secondary { background: #e2e8f0; }
.action-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #111; }
.action-btn[disabled] { opacity: .5; cursor: not-allowed; }

.twocol {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.scrollbox {
  border: 2px dashed #111;
  border-radius: 12px;
  padding: 8px;
  height: 220px;
  overflow-y: auto;
  background: #f8fafc;
  -webkit-overflow-scrolling: touch;
}

.badge {
  display: inline-block;
  padding: 6px 10px;
  border: 2px solid #111;
  border-radius: 12px;
  margin: 4px;
  background: #fff;
  cursor: pointer;
}

.toggle-row { display: flex; gap: 12px; flex-wrap: wrap; }
.toggle {
  flex: 1 1 45%;
  text-align: center;
  border: 2px solid #111;
  border-radius: 12px;
  padding: 12px;
  font-weight: 800;
  background: #e2e8f0;
  cursor: pointer;
}
.toggle.active { background: #b2f2bb; }

.footer-note { text-align: center; font-size: 12px; color: #555; }

/* 入力系だけは選択可 */
input, select, textarea {
  -webkit-user-select: text;
  user-select: text;
}

/* FUN: 全画面ボタン */
.fun-wrap { flex: 1 1 auto; display: flex; flex-direction: column; gap: 12px; }
.fun-btn {
  width: 100%; flex: 1 1 auto;
  border: 3px solid #111; border-radius: 24px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 5px 0 #111;
  font-weight: 900; text-align: center; padding: 12px;
  font-size: clamp(24px, 12vw, 120px);
  line-height: 1.1;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
}
.fun-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #111; }

.counter { text-align: center; font-size: 18px; font-weight: 700; }
.history {
  border: 2px dashed #111;
  border-radius: 12px;
  padding: 8px;
  background: #fff;
  max-height: 220px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.history .rowline {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px;
  border-bottom: 1px dashed #ddd;
}
.history .rowline:last-child { border-bottom: none; }

/* ★追加: 共通下地図の印刷セット選択ボタン */
.pick-grid {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.pick-btn {
  flex: 1 1 240px;
  border: 2px solid #111;
  border-radius: 12px;
  padding: 12px 10px;
  font-weight: 900;
  font-family: inherit;
  background: #e2e8f0;
  box-shadow: 0 3px 0 #111;
  text-align: center;
  cursor: pointer;
}
.pick-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #111;
}
.pick-btn.active {
  background: #b2f2bb;
}
