html,
body {
  height: 100%;
  margin: 0;
}
body {
  margin: 0;
  font-family: sans-serif;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: url('../images/bg/bg-home.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  overflow: hidden;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 50, 0.55);
  z-index: -1;
}

.header {
  position: sticky;
  top: 0;
  z-index: 10;

  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
}

.avatar {
  font-size: 40px;
  margin-right: 12px;
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.profile-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 1;
}
.profile-info .name {
  font-size: 18px;
  font-weight: 700;
}

.profile-info .rank {
  font-size: 14px;
  opacity: 0.85;
}
.total-asset {
  text-align: right;
}

.balance-cards {
  display: flex;
  gap: 12px;
  padding: 0 16px;
}
.item-icon {
  width: 93px;
  height: 93px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffffff, #59d1ff);
  display: flex;
  align-items: center;
  justify-content: center;
}
.item-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.card {
  flex: 1;
  background: rgba(255, 255, 255, 0.18); /* ← 透け */
  backdrop-filter: blur(8px);
  border-radius: 18px;
  padding: 16px;
}

.card.gold {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.card.usdt {
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
}

.card button {
  margin-top: 8px;
  width: 100%;
  height: 40px;
  border-radius: 999px;
  border: none;

  font-weight: bold;
  font-size: 15px;
  color: #003b2b;

  background: linear-gradient(135deg, #1fff9b, #22e6ff);

  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.usdt button {
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
}

.matching {
  margin: 16px;
  padding: 16px 0;

  text-align: center;
  font-size: 20px;
  font-weight: bold;

  border-radius: 20px;
  color: #003b2b;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);

  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.item-list-wrapper {
  flex: 1;
  overflow-y: auto;
  padding: 8px 12px 16px;
  margin-top: 16px;
  max-height: calc(100vh - 420px);
  overflow-y: auto;
  padding-bottom: 123px;
}

.home-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 14px 18px;
  margin-bottom: 14px;

  border-radius: 18px;

  background: rgba(0, 0, 0, 0.55);

  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.home-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.home-item-name {
  font-size: 14px;
  font-weight: 600;
  color: #faff00;
}

.home-item-count {
  font-size: 28px;
  font-weight: bold;
  background: linear-gradient(90deg, #58c6ff 0%, #076ad9 40%, #15ffcc 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.count-num {
  font-size: 60px;
  font-weight: 900;
  margin-left: 2px;
}
.item-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item-card {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #4f6cff, #222327);
  border-radius: 14px;
  padding: 12px;
}

.item-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-right: 12px;
}

.item-card .count {
  margin-left: auto;
  font-size: 28px;
  color: #eaff4f;
}

.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  height: 108px;

  /* 背景画像は使わない */
  background: linear-gradient(
    to top,
    rgba(8, 12, 24, 0.95) 0%,
    rgba(12, 20, 40, 0.85) 40%,
    rgba(18, 40, 80, 0.55) 100%
  );

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  display: flex;
  justify-content: space-around;
  align-items: center;

  padding-bottom: 8px;
  z-index: 100;
}
.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(0, 255, 220, 0.35),
    transparent
  );
}

.footer-item span {
  font-size: 12px;
  color: rgba(220, 240, 255, 0.75);
}

.footer-item img {
  width: 22px;
  height: 22px;
  opacity: 0.75;
}
.footer-item.active span {
  color: #3fffd6;
}

.footer-item.active img {
  filter: drop-shadow(0 0 6px rgba(63, 255, 214, 0.6));
  opacity: 1;
}
.footer-item {
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}

.footer-item:active {
  transform: scale(0.95);
  opacity: 0.85;
}

.header,
.profile,
.balance-cards,
.matching {
  flex-shrink: 0;
}
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 100px;
}

.avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
}
.footer > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.currency-icon {
  width: 24px;
  height: 24px;
}
.total-asset .amount {
  font-size: 32px;
  font-weight: bold;
  color: #1fff9b;
  letter-spacing: 1px;
}
.card-balance {
  text-align: right;
  font-size: 18px;
  font-weight: 700;
}
.g-icon {
  width: 15px;
  height: 15px;
  vertical-align: middle;
  margin: 0 2px;
}
.currency-label {
  display: flex;
  align-items: center; /* ← 縦ズレ完全解消 */
  gap: 6px; /* アイコンと文字の間隔 */
}

.currency-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.currency-name {
  font-weight: 600;
  line-height: 1; /* 余計な上下余白を消す */
}
.amount-controls {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}

.amount-controls button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  font-size: 24px;
  font-weight: 700;
  color: #003b2b;
  background: linear-gradient(135deg, #1fff9b, #22e6ff);
}
.gold-amount-display {
  font-size: 48px;
  color: #3cff6f;
  text-align: center;
  cursor: pointer;
}

.amount-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.amount-modal.hidden {
  display: none;
}

.amount-modal-inner {
  width: 90%;
  max-width: 360px;
  background: linear-gradient(
    160deg,
    rgba(70, 120, 255, 0.55),
    rgba(120, 70, 255, 0.55)
  );
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    inset 0 0 30px rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 20px;
}

.modal-amount {
  font-size: 42px;
  color: #3cff70cb;
  text-align: center;
  margin-bottom: 20px;
}

.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.keypad button {
  padding: 14px 0;
  font-size: 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #b58cff, #3cf5d6);
  border: none;
  color: #fff;
}

.submit-btn {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  font-size: 18px;
  border-radius: 24px;
  background: linear-gradient(90deg, #32ff9a, #2dd4ff);
  border: none;
}
.keypad button:active {
  transform: scale(0.96);
  filter: brightness(1.1);
}

.submit-btn:active {
  transform: scale(0.98);
}
#goldAmountDisplay,
#modalAmount {
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 42px;
  color: #3cff9e;
  text-shadow:
    0 0 12px rgba(60, 255, 158, 0.6),
    0 0 30px rgba(60, 255, 158, 0.25);
}
/* タブヘッダー */
.gold-tabs {
  display: flex;
  justify-content: space-around;
  margin-top: 12px;
}

.gold-tab {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 14px;
  padding-bottom: 8px;
  position: relative;
}

.gold-tab.active {
  color: #4cffb0;
}

.gold-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60%;
  height: 3px;
  border-radius: 4px;
  background: linear-gradient(90deg, #3cff9c, #2fd8ff);
}

/* タブ中身 */
.gold-tab-content {
  display: none;
  padding: 20px 16px;
}

.gold-tab-content.active {
  display: block;
}
.gold-history-item {
  display: flex;
  justify-content: space-between;
  padding: 14px;
  margin-bottom: 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(10px);
}

.gold-history-item .type {
  font-size: 14px;
  color: #fff;
}

.gold-history-item .date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}

.gold-history-item .right {
  color: #4cffb0;
  font-weight: bold;
}
/* =========================
   📜 GOLD 履歴 UI（既存HTML対応）
========================= */

/* リスト全体 */
#historyList {
  padding: 12px 14px 120px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 1履歴 */
.history-item {
  padding: 14px 16px;
  border-radius: 16px;

  background: rgba(20, 30, 60, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 8px 20px rgba(0, 0, 0, 0.25);

  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* タイトル */
.history-title {
  font-size: 13px;
  font-weight: 600;
  color: #ffd86a; /* GOLD色 */
  letter-spacing: 0.5px;
}

/* 日付 */
.history-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 4px;
}

/* 行 */
.history-row {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  justify-content: space-between;
}

/* 数値強調 */
.history-row strong {
  font-size: 15px;
  color: #3dffb0;
}

/* 空状態 */
#historyList .empty {
  text-align: center;
  margin-top: 40px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}
.gold-header {
  flex-shrink: 0;
  height: 96px; /* ← タブ含めた固定高さ */
}
.gold-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* =====================
   サイドバー
===================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 260px;
  height: 100vh;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
  color: #fff;
  z-index: 1000;
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
}

.sidebar.show {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  font-size: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.sidebar-menu {
  display: flex;
  flex-direction: column;
  padding: 12px;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px;
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  transition:
    background 0.2s,
    transform 0.1s;
}
.sidebar-menu a:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}
.menu-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.4));
}
.sidebar-menu a span {
  font-size: 15px;
  letter-spacing: 0.5px;
}
/* =====================
   オーバーレイ
===================== */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 999;
}

.hidden {
  display: none;
}
/* =====================
   ログアウトボタン
===================== */
.sidebar-menu a.logout {
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 18px;
  color: #ffffff;
}

.sidebar-menu a.logout:hover {
  background: rgba(255, 80, 80, 0.15);
}

.sidebar-menu a.logout .menu-icon {
  filter: drop-shadow(0 0 6px rgba(255, 80, 80, 0.6));
}
/* =====================
   サイドバープロフィール
===================== */
.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.sidebar-name {
  font-size: 14px;
  font-weight: 600;
}

.sidebar-rank {
  font-size: 12px;
  opacity: 0.7;
}
.sidebar-menu a.active {
  background: linear-gradient(90deg, #3cfcc6cc, #35e1ff7e);
  color: #000;
}

.sidebar-menu a.active img {
  filter: brightness(0);
}
.toggle-password img {
  filter: brightness(0.2); /* 黒っぽくする */
}
