/* ============================================================
   css/common.css  — 共通スタイル（スマホ最適化）
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; width: 100%;
  overflow: hidden;
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  font-size: 14px;
  background: #1a1a2e;
  color: #fff;
  -webkit-text-size-adjust: 100%;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ── ボタン共通 ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: bold; cursor: pointer;
  transition: opacity .15s, transform .1s;
  -webkit-appearance: none;
}
.btn:active { opacity: .75; transform: scale(.97); }

.btn-primary   { background: #2d5a27; color: #fff; }
.btn-danger    { background: #c0392b; color: #fff; }
.btn-secondary { background: #444;    color: #fff; }
.btn-sm        { padding: 6px 12px; font-size: 12px; border-radius: 6px; }
.btn-icon      { padding: 8px; border-radius: 50%; width: 40px; height: 40px; }
.btn:disabled  { opacity: .4; pointer-events: none; }

/* ── 入力フォーム共通 ── */
input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px; color: #fff; font-size: 14px;
  outline: none; transition: border-color .15s;
  -webkit-appearance: none;
}
input:focus, textarea:focus, select:focus {
  border-color: #5daa52;
}
select option { background: #2a2a3e; color: #fff; }

/* ── モーダル共通 ── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex; align-items: flex-end;
  z-index: 1000;
  animation: fadeIn .2s ease;
}
.modal-overlay.center { align-items: center; }

.modal-sheet {
  width: 100%; max-height: 80vh;
  background: #1e2a3a; border-radius: 16px 16px 0 0;
  padding: 16px; overflow-y: auto;
}
.modal-overlay.center .modal-sheet {
  max-width: 360px; margin: 0 auto;
  border-radius: 16px; max-height: 90vh;
}
.modal-handle {
  width: 40px; height: 4px; background: rgba(255,255,255,.3);
  border-radius: 2px; margin: 0 auto 16px;
}
.modal-title {
  font-size: 16px; font-weight: bold; margin-bottom: 16px; text-align: center;
}
.modal-close {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none; color: rgba(255,255,255,.6);
  font-size: 22px; cursor: pointer; padding: 4px 8px;
}

/* ── フォームグループ ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; color: rgba(255,255,255,.6); margin-bottom: 5px; }
.form-row   { display: flex; gap: 10px; }
.form-row > * { flex: 1; }

/* ── バッジ ── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 12px;
  font-size: 11px; font-weight: bold;
}
.badge-online  { background: rgba(93,170,82,.25); color: #5daa52; }
.badge-offline { background: rgba(192,57,43,.25);  color: #e74c3c; }

/* ── ローディング ── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid rgba(255,255,255,.2);
  border-top-color: #5daa52;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── アニメーション ── */
@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
@keyframes spin    { to { transform: rotate(360deg) } }

.slide-up { animation: slideUp .25s ease; }

/* ── スクロールバー非表示 ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

/* ── トースト通知 ── */
#toast-container {
  position: fixed;
  /* ボトムメニュー(65px) + 余白 の上に表示 */
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.toast {
  background: #1a2535;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px; font-weight: bold; white-space: nowrap;
  border-left: 3px solid #5daa52;
  box-shadow: 0 2px 12px rgba(0,0,0,.6);
  animation: fadeIn .2s ease;
  text-shadow: none;
  -webkit-font-smoothing: subpixel-antialiased;
}
.toast.error  { border-left-color: #e74c3c; }
.toast.info   { border-left-color: #3498db; }
