/* =====================
   共通リセット
===================== */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body.gold-bg {
  margin: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Kaku Gothic ProN',
    'Noto Sans JP', sans-serif;
  color: #fff;
  min-height: 100vh;
  overflow-y: auto;
  background: url('../images/bg/bg-gold.jpg') center / cover no-repeat;
}

/* =====================
   Header
===================== */
.gp-header {
  height: 56px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gp-header .icon {
  width: 23px;
  height: 20px;
  opacity: 0.9;
}

.gp-header .title {
  font-size: 18px;
  font-weight: 600;
}

/* =====================
   Tabs
===================== */
.gp-tabs {
  display: flex;
  padding: 0 16px;
  margin-top: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.gp-tabs .tab {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  padding: 10px 0;
  position: relative;
}

.gp-tabs .tab.active {
  color: #2dff7a;
  font-weight: 600;
}

.gp-tabs .tab.active::after {
  content: '';
  position: absolute;
  left: 20%;
  right: 20%;
  bottom: -1px;
  height: 2px;
  background: #2dff7a;
  border-radius: 2px;
}

/* =====================
   Main
===================== */
.gp-main {
  padding: 24px 20px 100px;
  overflow-y: auto;
  padding-bottom: 100px; /* CTA + footer 分 */
}

/* =====================
   金額表示
===================== */
.gp-amount {
  text-align: center;
  margin-top: 12px;
}

.gp-amount .amount-value {
  font-size: 48px;
  font-weight: 700;
  color: #2dff7a;
  letter-spacing: 1px;
}

.gp-amount .gold-icon {
  width: 36px;
  margin-top: 6px;
  opacity: 0.9;
}

/* =====================
   支払方法
===================== */
.gp-payment {
  margin-top: 32px;
}

.gp-payment .label {
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.wallet-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px;
  backdrop-filter: blur(8px);
}

.wallet-btn {
  flex: 1;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.7);
  padding: 10px 0;
  font-size: 14px;
  border-radius: 999px;
}

.wallet-btn.active {
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
  color: #003b2b;
  font-weight: 600;
}

/* =====================
   現在の残高
===================== */
.gp-balance {
  margin-top: 28px;
}

.gp-balance .label {
  font-size: 14px;
  margin-bottom: 10px;
  opacity: 0.9;
}

.balance-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.balance-row img {
  width: 28px;
}

.balance-row .currency {
  font-size: 22px;
  font-weight: 600;
}

.balance-row .value {
  margin-left: auto;
  font-size: 26px;
  font-weight: 700;
  color: #2dff7a;
}

/* =====================
   外部ウォレット領域
===================== */
.gp-external {
  margin-top: 24px;
  text-align: center;
}

.gp-external.hidden {
  display: none;
}

.gp-external .qr {
  width: 150px;
  margin: 10px auto;
  background: #fff;
  padding: 8px;
  border-radius: 12px;
}

.address-box {
  margin-top: 14px;
  padding: 12px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  word-break: break-all;
}

.hint {
  font-size: 11px;
  margin-top: 6px;
  opacity: 0.7;
}

.tx-input {
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 12px;
}
/* =====================
   Modal
===================== */
.gp-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.gp-modal.hidden {
  display: none;
}

.modal-card {
  width: 90%;
  background: rgba(255, 255, 255, 0.95);
  color: #222;
  padding: 20px;
  border-radius: 16px;
}

.modal-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.modal-card p {
  font-size: 13px;
  margin-bottom: 12px;
}

.modal-card input {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  border: none;
  background: #eee;
  margin-bottom: 12px;
}

.modal-card .confirm {
  width: 100%;
  height: 44px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
  font-weight: 600;
}
body.gold-bg {
  height: 100vh;
  overflow: hidden;
}
.gold-tab-contents {
  height: calc(100vh - 56px - 44px); /* header + tabs */
  overflow: hidden;
}

.gold-tab-content {
  height: 100%;
  overflow-y: auto;
  padding-bottom: 40px; /* CTA分の余白 */
}
.gold-history-list {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.history-item {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-title {
  font-size: 14px;
  font-weight: 600;
  color: #ffd45c;
}

.history-date {
  font-size: 11px;
  opacity: 0.7;
}

.history-amount {
  font-size: 20px;
  font-weight: 700;
  color: #2dff7a;
}

.gold-tab-content.active {
  display: block;
}

/* 履歴専用スクロール */
#tab-history {
  height: calc(100vh - 120px); /* header + tabs 分 */
  overflow-y: auto;
  padding: 16px;
}

/* 履歴カード */
.history-item {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.gold-tab-content {
  display: none;
}

.hidden {
  display: none !important;
}
.address-box {
  cursor: pointer;
  user-select: all;
}
.address-box:active {
  opacity: 0.7;
}
/* =====================
   Toast（スマホ崩れ防止 完全版）
===================== */
.gp-toast {
  position: fixed;
  top: 90px;
  left: 16px;
  right: 16px;
  background: linear-gradient(90deg, #1edc8c, #17c3b2);
  color: #0b1f16;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}

/* 非表示 */
.gp-toast.hidden {
  display: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.wallet-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: 999px;
  font-weight: 700;
}

.wallet-badge.internal {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.wallet-badge.external {
  background: linear-gradient(135deg, #22e6ff, #1fff9b);
  color: #003b2b;
}
.btn-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading .gp-submit-inner {
  visibility: hidden;
}

.loading .btn-spinner {
  display: inline-block;
}
/* =====================
   GOLD 送信タブ
===================== */

.gold-send-card {
  max-width: 420px;
  margin: 24px auto;
  padding: 20px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
}

/* 入力グループ */
.send-group {
  margin-bottom: 20px;
}

.send-label {
  display: block;
  font-size: 14px;
  margin-bottom: 8px;
  color: #aefde1;
}

/* テキスト入力 */
.send-input {
  width: 100%;
  height: 44px;
  border-radius: 10px;
  border: none;
  padding: 0 14px;
  font-size: 15px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.send-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* 数量調整 */
.send-amount-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.amount-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  font-size: 22px;
  font-weight: bold;
  color: #003b2b;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
}

.amount-value {
  flex: 1;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #1fff9b;
}

/* 注意文 */
.send-warning {
  margin-top: 12px;
  font-size: 13px;
  color: #ffb6b6;
  text-align: center;
}

/* CTAは既存 gp-submit を使用 */
/* 送信タブ用：下CTA分の余白 */
#tab-send {
  height: calc(100vh - 120px);
  padding-bottom: 100px;
}
/* ====== タブスクロール + CTA被り防止（最終上書き） ====== */
.gold-tab-contents {
  height: calc(100vh - 56px - 44px); /* header + tabs */
  overflow: hidden;
}

.gold-tab-content {
  height: 100%;
  overflow-y: auto;
}

/* CTAがfixedなので、各タブは下に余白を必ず持つ */
#tab-purchase,
#tab-send,
#tab-history {
  padding-bottom: 140px;
}
/* =====================
   GOLD送信 確認モーダル
===================== */

.send-confirm-card {
  max-width: 320px;
  text-align: center;
}

.confirm-text {
  margin: 12px 0 16px;
  font-size: 14px;
  opacity: 0.9;
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  margin: 8px 0;
  font-size: 15px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.btn-cancel,
.btn-confirm {
  flex: 1;
  height: 44px;
  border-radius: 22px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.btn-cancel {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.btn-confirm {
  background: linear-gradient(135deg, #11ff9b, #22e6ff);
  color: #003b2b;
}
/* =====================================================
   GOLD 送信確認モーダル（ダークガラス + ネオン）
   追記場所：css/gold-purchase.css の一番下
===================================================== */

/* オーバーレイ（背景） */
#sendConfirmModal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;

  /* 背景：暗め＋ぼかしで世界観合わせ */
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(10px);

  z-index: 9999;
  padding: 18px;
}

/* hidden のとき */
#sendConfirmModal.hidden {
  display: none;
}

/* モーダル本体（カード） */
#sendConfirmModal .send-confirm-card {
  width: min(420px, 100%);
  border-radius: 18px;
  padding: 18px 18px 16px;

  /* “白い箱”をやめてガラスに */
  background: rgba(10, 18, 22, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);

  color: rgba(255, 255, 255, 0.92);
}

/* タイトル */
#sendConfirmModal .send-confirm-title {
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.3px;
  margin-bottom: 8px;
}

/* 説明文 */
#sendConfirmModal .send-confirm-desc {
  font-size: 12px;
  text-align: center;
  opacity: 0.75;
  margin-bottom: 14px;
  line-height: 1.4;
}

/* 行 */
#sendConfirmModal .send-confirm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;

  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  margin-bottom: 10px;
}

#sendConfirmModal .send-confirm-row .label {
  font-size: 12px;
  opacity: 0.75;
}

#sendConfirmModal .send-confirm-row .value {
  font-size: 14px;
  font-weight: 800;
  color: #2dff7a;
}

/* ボタン行 */
#sendConfirmModal .send-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

/* NO ボタン：見えづらい問題を解消（薄すぎ禁止） */
#sendConfirmModal #cancelSend {
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);

  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.9);

  font-weight: 800;
  letter-spacing: 0.2px;
}

/* 押した感じ */
#sendConfirmModal #cancelSend:active {
  transform: translateY(1px);
  opacity: 0.92;
}

/* YES ボタン：既存テーマのネオン */
#sendConfirmModal #confirmSend {
  height: 46px;
  border-radius: 999px;
  border: none;

  background: linear-gradient(135deg, #1fff9b, #22e6ff);
  color: #003b2b;

  font-weight: 900;
  letter-spacing: 0.2px;
  box-shadow: 0 8px 22px rgba(0, 255, 180, 0.32);
}

#sendConfirmModal #confirmSend:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(0, 255, 180, 0.25);
}

/* ローディング中：YESボタンに loading を付けた時も見た目崩れないように */
#sendConfirmModal #confirmSend.loading {
  filter: brightness(0.95);
}
/* =========================
   送信タブ：残高表示 修正
========================= */
.send-balance {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.send-balance-row {
  display: flex;
  align-items: center;
  gap: 10px; /* ← ここが重要 */
}

.send-balance-row .label {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.9;
}

.send-balance-row .value {
  margin-left: auto; /* ← 数字だけ右寄せにしたい場合 */
  font-weight: 700;
  color: #2cffc9;
}
.history-title.send {
  color: #ff9f43;
}

.history-title.receive {
  color: #2cffc9;
}

.history-row.minus {
  color: #ff7675;
}

.history-row.plus {
  color: #2cffc9;
}
.notification-panel {
  position: fixed;
  top: 60px;
  right: 10px;
  width: 300px;
  max-height: 60vh;
  background: #1f1f1f;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}

.notification-panel.hidden {
  display: none;
}

.notification-header {
  padding: 10px;
  font-weight: bold;
  border-bottom: 1px solid #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-list {
  overflow-y: auto;
}

.notification-item {
  padding: 10px;
  border-bottom: 1px solid #333;
  cursor: pointer;
}

.notification-item.unread {
  background: #2b2b2b;
}

.notification-item.read {
  opacity: 0.6;
}

.notification-time {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 4px;
}
.bell-wrapper {
  position: relative;
}

.notification-badge.hidden {
  display: none;
}
.popup-notification {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 9999;
}
.icon-bell {
  font-size: 22px;
  color: white;
}
.hidden {
  display: none !important;
}
.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: red;
  color: white;
  border-radius: 999px;

  min-width: 18px;
  height: 18px;

  display: flex;
  align-items: center; /* 縦中央 */
  justify-content: center; /* 横中央 */

  font-size: 12px;
  font-weight: bold;
  padding: 0 5px; /* 2桁対応 */
  z-index: 9999;
}
/* ログアウトモーダル全体 */
#logoutModal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

/* 中央ボックス */
#logoutModal .modal-box {
  background: linear-gradient(135deg, #0b1a1f, #000);
  border-radius: 16px;
  padding: 20px 24px;
  width: 80%;
  max-width: 320px;
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.3);
  color: white;
  text-align: center;
}
#logoutModal .modal-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 16px;
  gap: 12px;
}

/* 共通 */
#logoutModal button {
  flex: 1;
  padding: 10px 0;
  border-radius: 999px;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

/* キャンセル（暗め） */
#logoutCancelBtn {
  background: #333;
  color: #ccc;
}

/* ログアウト（メインカラー） */
#logoutOkBtn {
  background: linear-gradient(135deg, #00ffcc, #00b3ff);
  color: black;
  box-shadow: 0 0 10px rgba(0, 255, 200, 0.6);
}
/* =========================
   通知パネル（ほうらん調）
========================= */
.notification-panel {
  position: fixed;
  top: 60px;
  right: 12px;
  width: 90%;
  max-width: 360px;
  max-height: 70vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  border-radius: 18px;
  box-shadow: 0 0 20px rgba(0, 255, 200, 0.25);
  overflow: hidden;
  z-index: 9999;
  animation: fadeInUp 0.25s ease;
}

/* ヘッダー */
.notification-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: linear-gradient(135deg, #00ffc8, #00bfa5);
  color: #003b34;
  font-weight: bold;
  font-size: 15px;
}

/* すべて既読ボタン */
#markAllReadBtn {
  background: rgba(0, 0, 0, 0.2);
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
}

#markAllReadBtn:hover {
  background: rgba(0, 0, 0, 0.35);
}

/* リスト */
.notification-list {
  max-height: 55vh;
  overflow-y: auto;
}

/* 通知1件 */
.notification-item {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: white;
  font-size: 13px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.03);
}

.notification-item.unread {
  background: linear-gradient(
    90deg,
    rgba(0, 255, 200, 0.15),
    rgba(255, 255, 255, 0.03)
  );
  font-weight: bold;
}

/* 時刻 */
.notification-time {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

/* 表示アニメーション */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
#sendGoldBtn {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 140px;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

#sendGoldBtn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.gp-submit {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 140px; /* フッター分 */
  height: 56px;

  z-index: 9999; /* ← これが超重要 */

  display: flex;
  align-items: center;
  justify-content: center;

  border: none;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  color: #003b2b;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
  box-shadow: 0 8px 24px rgba(0, 255, 180, 0.35);
}

.gp-submit.hidden {
  display: none;
}

.gp-submit.show {
  display: flex !important;
  opacity: 1;
  transform: translateY(0);
}
