/* =========================================================
   ぱすてるらいふ — スタイルシート
   iPad Safari 向け：大きいボタン・パステルカラー・丸いデザイン
   ========================================================= */

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  /* iPadでのバウンススクロール・長押し選択を止める */
  overscroll-behavior: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  background: #bfe3f5;
  font-family: "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "BIZ UDGothic", "Yu Gothic", sans-serif;
}

/* ===== ゲームキャンバス ===== */
#game {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  display: block;
}

.hidden { display: none !important; }

/* ===== 上のバー ===== */
#topbar {
  position: fixed; top: env(safe-area-inset-top, 6px); left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 8px;
  z-index: 20;
  pointer-events: none;
}
.tb-item {
  background: rgba(255,255,255,.85);
  border: 3px solid #ffd9ec;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 17px; font-weight: bold; color: #7a6a8a;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(180,150,200,.25);
}

/* ===== ジョイスティック ===== */
#joystick {
  position: fixed; left: 26px; bottom: 26px;
  width: 150px; height: 150px;
  border-radius: 50%;
  background: rgba(255,255,255,.35);
  border: 4px solid rgba(255,255,255,.7);
  z-index: 30;
}
#joy-knob {
  position: absolute; left: 45px; top: 45px;
  width: 60px; height: 60px; border-radius: 50%;
  background: linear-gradient(#fff, #ffe3f1);
  border: 3px solid #f8bcd9;
  box-shadow: 0 4px 8px rgba(150,100,150,.3);
}

/* ===== アクションボタン ===== */
.big-btn {
  position: fixed; right: 30px; bottom: 190px;
  min-width: 130px; height: 74px;
  border-radius: 999px;
  border: 4px solid #fff;
  background: linear-gradient(#ffe9a8, #ffd166);
  color: #8a6a20; font-size: 24px; font-weight: bold;
  box-shadow: 0 5px 0 #d9a83e;
  z-index: 30;
}
.big-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #d9a83e; }

/* ===== 右下メニュー ===== */
#menubar {
  position: fixed; right: 14px; bottom: 14px;
  display: flex; gap: 10px;
  z-index: 30;
}
.menu-btn {
  width: 68px; height: 78px;
  border-radius: 20px;
  border: 3px solid #fff;
  background: rgba(255,255,255,.88);
  font-size: 26px;
  color: #7a6a8a;
  box-shadow: 0 4px 0 rgba(160,130,180,.3);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
}
.menu-btn span { font-size: 12px; font-weight: bold; }
.menu-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(160,130,180,.3); }

/* ===== もようがえツールバー ===== */
#buildbar {
  position: fixed; right: 14px; bottom: 14px;
  display: flex; gap: 8px;
  z-index: 35;
}
.tool-btn {
  width: 64px; height: 78px;
  border-radius: 20px;
  border: 3px solid #fff;
  background: rgba(255,255,255,.88);
  font-size: 24px; color: #7a6a8a;
  box-shadow: 0 4px 0 rgba(160,130,180,.3);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.tool-btn span { font-size: 12px; font-weight: bold; }
.tool-btn.active { background: #ffe3f1; border-color: #f8a8ce; }

/* ===== 家具そうさボタン ===== */
#furn-ctrl {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%);
  display: flex; gap: 10px; z-index: 36;
}
.fc-btn {
  height: 62px; padding: 0 20px;
  border-radius: 999px; border: 3px solid #fff;
  background: rgba(255,255,255,.92);
  font-size: 19px; font-weight: bold; color: #7a6a8a;
  box-shadow: 0 4px 0 rgba(160,130,180,.3);
}
.fc-btn.ok { background: linear-gradient(#d9f7d9, #a8e6a8); color: #2f7a2f; }
.fc-btn:active { transform: translateY(2px); }

/* ===== パネル（カタログ・ずかん・もちもの等） ===== */
#panel {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(860px, 92vw); height: min(600px, 82vh);
  background: #fffaf3;
  border: 5px solid #ffd9ec;
  border-radius: 28px;
  z-index: 50;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(120,80,140,.35);
  overflow: hidden;
}
#panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(#ffe9f4, #ffd9ec);
}
#panel-title { font-size: 22px; font-weight: bold; color: #a25a85; }
#panel-close {
  width: 52px; height: 52px; border-radius: 50%;
  border: 3px solid #fff; background: #ff9db8;
  color: #fff; font-size: 22px; font-weight: bold;
  box-shadow: 0 3px 0 #d97a99;
}
#panel-tabs {
  display: flex; gap: 6px; padding: 8px 12px 0;
  flex-wrap: wrap;
  background: #fff2f8;
}
.ptab {
  padding: 9px 16px;
  border-radius: 14px 14px 0 0;
  border: 3px solid #ffd9ec; border-bottom: none;
  background: #fff; color: #a08aa8;
  font-size: 16px; font-weight: bold;
}
.ptab.active { background: #ffd9ec; color: #8a4a70; }
#panel-body {
  flex: 1; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 14px;
}

/* カタロググリッド */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.cell {
  background: #fff;
  border: 3px solid #ecdff2;
  border-radius: 16px;
  padding: 8px 6px;
  text-align: center;
  font-size: 13px; font-weight: bold; color: #7a6a8a;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.cell:active { background: #ffeef6; }
.cell canvas { width: 72px; height: 72px; }
.cell .price { color: #c9962f; font-size: 13px; }
.cell.locked { opacity: .45; filter: grayscale(.8); }
.cell .cnt { color: #5a9a5a; font-size: 12px; }

/* きがえパネルの行 */
.opt-row { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.opt-label { width: 92px; font-weight: bold; color: #8a6a9a; font-size: 16px; }
.opt-btn {
  min-width: 56px; height: 52px; padding: 0 12px;
  border-radius: 14px; border: 3px solid #ecdff2;
  background: #fff; font-size: 15px; font-weight: bold; color: #7a6a8a;
}
.opt-btn.sel { border-color: #f8a8ce; background: #ffe3f1; }
.swatch { width: 44px; height: 44px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 0 0 2px #ddd; }
.swatch.sel { box-shadow: 0 0 0 3px #f069a8; }

/* メニューの大きいボタン */
.menu-big {
  display: block; width: 100%;
  margin: 8px 0; padding: 16px;
  font-size: 20px; font-weight: bold;
  border-radius: 18px; border: 3px solid #ecdff2;
  background: #fff; color: #7a6a8a;
}
.menu-big:active { background: #ffeef6; }

/* ===== せりふ ===== */
#dialog {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(720px, 88vw);
  background: rgba(255,255,255,.95);
  border: 4px solid #cfe8ff;
  border-radius: 22px;
  padding: 14px 22px;
  z-index: 60;
}
#dialog-name { font-size: 16px; font-weight: bold; color: #5a8ac9; }
#dialog-text { font-size: 21px; color: #5a5a6a; line-height: 1.6; min-height: 66px; }
#dialog-next { text-align: right; font-size: 13px; color: #a8a8c0; }

/* ===== 選択肢 ===== */
#choices {
  position: fixed; left: 50%; bottom: 170px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 10px;
  z-index: 61; width: min(560px, 80vw);
}
.choice-btn {
  padding: 14px 20px; font-size: 20px; font-weight: bold;
  border-radius: 999px; border: 4px solid #fff;
  background: linear-gradient(#e8f4ff, #cfe8ff);
  color: #4a7ab8;
  box-shadow: 0 4px 0 #a8c8e8;
}
.choice-btn:active { transform: translateY(2px); }

/* ===== トースト ===== */
#toast {
  position: fixed; top: 74px; left: 50%; transform: translateX(-50%);
  background: rgba(90,70,110,.88); color: #fff;
  padding: 10px 24px; border-radius: 999px;
  font-size: 18px; font-weight: bold;
  z-index: 70; pointer-events: none;
  transition: opacity .4s;
}

/* ===== 場所バナー ===== */
#zone-banner {
  position: fixed; top: 90px; left: 50%; transform: translateX(-50%);
  font-size: 34px; font-weight: bold; color: #fff;
  text-shadow: 0 2px 0 rgba(150,110,170,.6), 0 0 18px rgba(255,180,220,.9);
  z-index: 25; pointer-events: none;
  transition: opacity .8s;
}

/* ===== タイトル画面 ===== */
#title-screen {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(#bfe3f5, #ffd9ec 70%, #d9f7d9);
  display: flex; align-items: center; justify-content: center;
}
#title-card {
  text-align: center;
  background: rgba(255,255,255,.85);
  border: 5px solid #fff;
  border-radius: 32px;
  padding: 34px 60px;
  box-shadow: 0 14px 50px rgba(140,90,160,.3);
}
#title-card h1 {
  font-size: 52px; color: #f069a8;
  text-shadow: 0 3px 0 #ffd9ec;
  letter-spacing: 6px;
}
#title-card .subtitle { font-size: 19px; color: #8a7a9a; margin: 6px 0 14px; }
#title-card .hint { font-size: 16px; color: #9a8aaa; line-height: 1.8; margin-bottom: 18px; }
#title-card .tiny { font-size: 13px; color: #b0a0c0; margin-top: 14px; }
.title-btn {
  display: block; width: 300px; margin: 12px auto;
  padding: 16px; font-size: 24px; font-weight: bold;
  border-radius: 999px; border: 4px solid #fff;
  background: linear-gradient(#ffd166, #ffb84d);
  color: #8a5a10; box-shadow: 0 6px 0 #d9962e;
}
.title-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #d9962e; }
#btn-continue { background: linear-gradient(#a8e6a8, #7ed67e); color: #1f6a1f; box-shadow: 0 6px 0 #5aa85a; }
