/* =====================
   Taiwan Header & Drawer Custom (Fixed & Slow Close)
===================== */

/* --- Header Base --- */
.taiwan-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

/* ロゴの色を「黒」で引き締める場合 */
.taiwan-header__logo {
  color: #1a1a1a !important; /* またはボタンと同じ #b71c1c */
  /* 既存のコードに追加 */
  display: flex;
  align-items: center;
  height: 100%; /* 親要素の高さを利用 */
}

.taiwan-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

@media (min-width: 1024px) {
  .taiwan-header__inner {
    padding: 14px 45px;
  }
}

.taiwan-header__logo {
  font-weight: 900;
  font-size: 24px;
  text-decoration: none;
  line-height: 1;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

@media (min-width: 768px) {
  .taiwan-header__logo {
    font-size: 30px;
  }
}

.taiwan-header__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* --- Buttons --- */
.taiwan-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 18px; border-radius: 12px;
  font-weight: 700; text-decoration: none; font-size: 13px;
  transition: all 0.2s ease; cursor: pointer;
}
.taiwan-btn:active { transform: scale(0.96); }

.taiwan-btn--ghost {
  border: 1px solid #e0e0e0; color: #333 !important; background: transparent;
}
.taiwan-btn--ghost:hover {
  border-color: #333; background: #333; color: #fff !important;
}

.taiwan-btn--solid {
  border: 1px solid #1a1a1a; color: #fff !important; background: #1a1a1a;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.taiwan-btn--solid:hover {
  background: #333; transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(0,0,0,0.25);
}

/* --- Points Button --- */
.taiwan-points { position: relative; display: flex; align-items: center; }

.taiwan-pointbtn {
  display: inline-flex; align-items: center; height: 34px; border: 0;
  background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
  color: #fff !important; border-radius: 99px; cursor: pointer;
  padding: 5px; transition: filter 0.2s;
  box-shadow: 0 4px 12px rgba(183, 28, 28, 0.3); outline: none !important;
}
.taiwan-pointbtn:hover {
  box-shadow: 0 6px 16px rgba(183, 28, 28, 0.5); transform: translateY(-1px);
}
.taiwan-pointbtn:active { transform: scale(0.96); }

.taiwan-pointbtn__coin {
  width: 24px; height: 24px; object-fit: contain; margin: 0 6px 0 8px; display: block;
}
.taiwan-pointbtn__text { font-weight: 800; font-size: 14px; margin-right: 4px;
color:#fff !important; }
.taiwan-pointbtn__plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 100%; font-size: 16px; font-weight: 900;
  border-left: 1px solid rgba(255,255,255,0.2); margin-left: 4px;
  color:#fff !important;
}

.taiwan-pointmenu {
  position: absolute; 
  top: 42px; 
  right: 0; 
  min-width: 150px;
  border-radius: 8px;
  /* ▼ ドロワーに合わせたダークスタイル */
  background: #1a1a1a !important; 
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
  display: none; 
  padding: 8px; 
  z-index: 9999;
}
.taiwan-pointmenu.is-open { 
  display: block; 
  animation: taiwanFadeIn 0.2s ease; 
}

.taiwan-pointmenu__item {
  display: block; 
  padding: 8px 12px; 
  border-radius: 6px; 
  text-decoration: none;
  color: #ccc !important; 
  font-weight: 700; 
  font-size: 14px; 
  transition: all 0.2s ease;
}
.taiwan-pointmenu__item:hover { 
  background: rgba(255,255,255,0.08); /* うっすら白く */
  color: #fff !important;             /* 文字は白く輝く */
  border-color: rgba(255, 0, 0, 0.5); /*枠線を赤く */
  padding-left: 18px; /* ドロワー同様、少し右に動く */
      box-shadow: 0 0 10px rgb(198 64 64); /* 赤い光 */ 
}

/* --- Hamburger Menu --- */
.taiwan-hamburger {
  width: 44px; height: 44px; border: 0; background: transparent !important;
  cursor: pointer; display: inline-flex; flex-direction: column;
  justify-content: center; align-items: center; gap: 5px; padding: 0; margin-left: 4px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
}
.taiwan-header .taiwan-hamburger span,
button.taiwan-hamburger span {
  display: block !important; width: 24px !important; height: 2px !important;
  background-color: #111 !important; background: #1a1a1a !important;
  border-radius: 2px; transition: all 0.3s ease;
}

/* Hamburger Animations */
.taiwan-drawer.is-open ~ .taiwan-header__inner .taiwan-hamburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.taiwan-drawer.is-open ~ .taiwan-header__inner .taiwan-hamburger span:nth-child(2) {
  opacity: 0;
}
.taiwan-drawer.is-open ~ .taiwan-header__inner .taiwan-hamburger span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}


/* --- Drawer (Slow Close Setting) --- */
.taiwan-drawer {
  position: fixed; inset: 0; z-index: 10000;
  
  /* 【重要】閉まる時間を考慮して visibility の切り替えを遅らせる */
  visibility: hidden;
  transition: visibility 0.6s step-end; /* パネルが閉まりきる時間(0.6s)に合わせる */
}

.taiwan-drawer.is-open {
  visibility: visible;
  transition: visibility 0s step-start; /* 開くときは即座に */
}

/* Overlay */
.taiwan-drawer__overlay {
  position: absolute; inset: 0; background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  opacity: 0;
  
  /* 閉まる時はゆっくり消える(0.6s) */
  transition: opacity 0.6s ease;
}
.taiwan-drawer.is-open .taiwan-drawer__overlay {
  opacity: 1;
  /* 開くときは少し早め(0.3s) */
  transition: opacity 0.3s ease;
}

/* Panel */
.taiwan-drawer__panel {
  position: absolute; top: 0; right: 0; width: min(320px, 85vw); height: 100%;
  background: #121212; color: #fff; padding: 20px;
  overflow-y: auto; box-shadow: -5px 0 20px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.5);

  transform: translateX(100%);
  
  /* 【ここが調整箇所】閉まるときのスピード（ゆっくり） */
  transition: transform 0.6s cubic-bezier(0.2, 0, 0.1, 1);
}

.taiwan-drawer.is-open .taiwan-drawer__panel {
  transform: translateX(0);
  
  /* 【ここが調整箇所】開くときのスピード（早め） */
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Close Button (修正あり) */
.taiwan-drawer__close {
  position: absolute; top: 15px; right: 15px; width: 40px; height: 40px;
  border: 0; background: none;
  font-size: 24px; cursor: pointer; color: #fff; box-shadow: none;
  display: flex; align-items: center; justify-content: center; z-index: 2;
  transition: all 0.3s;
}

/* ★修正箇所: コロンの前のスペースを削除しました */
.taiwan-drawer__close:hover,
.taiwan-drawer__close:focus {
  background: none;
  transform: rotate(90deg);
}

/* Drawer Internal Items */
.taiwan-drawer__top {
  margin-top: 40px; border-radius: 16px; padding: 20px;
  background: rgba(255,255,255,0.05); border: 1px solid #eee;
  border: 1px solid rgba(255,255,255,0.1);
}
.taiwan-drawer__meta {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 15px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 12px;
}
.taiwan-drawer__metaTitle {
  font-size: 11px; font-weight: 700; color: #888; letter-spacing: 1px;
}
.taiwan-drawer__metaValue {
  font-size: 14px; font-weight: 700; color: #fff; font-family: monospace;
}

.taiwan-drawer__pt {
  background: linear-gradient(90deg, #1a1a1a, #000);
  border: 1px solid rgba(255,255,255,0.15); color: #fff; border-radius: 10px;
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center;
  position: relative; overflow: hidden;
}
.taiwan-drawer__pt::before {
  content: ""; position: absolute; top: -50%; right: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(183,28,28,0.3) 0%, transparent 60%);
  pointer-events: none;
}
.taiwan-drawer__ptlabel {
  font-size: 11px; color:#aaa; font-weight: 700; opacity: 0.9; position: relative; z-index: 1;
}
.taiwan-drawer__ptvalue {
  font-size: 18px; color:#fff; font-weight: 900; z-index: 1; position: relative;
  text-shadow: 0 0 10px rgba(183,28,28,0.5);
}

.taiwan-drawer__menu { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.taiwan-drawer__item {
  background: transparent; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 14px 18px; text-decoration: none; color: #ccc !important;
  font-weight: 700; font-size: 14px; display: flex; justify-content: space-between;
  align-items: center; transition: all 0.2s ease;
}

.taiwan-drawer__item::after {
  content: ">"; font-size: 20px; color: #666; transition: color 0.2s;
}


.taiwan-drawer__item:hover {
  background: rgba(255, 255, 255, 0.08) ;
  color: #fff ;
  border-color: rgba(255, 0, 0, 0.5);
  box-shadow: 0 0 10px rgb(198, 64, 64);
  padding-left: 22px ;
}

/* 矢印（>）も白くする */
.taiwan-drawer__item:hover::after {
  color: #fff !important;
}

.taiwan-drawer__item--logout {
  margin-top: 15px; background: transparent; border: 0; color: #666 !important;
  justify-content: center; font-size: 13px;
}
.taiwan-drawer__item--logout:hover {
  background: transparent; color: #b71c1c !important; padding-left: 16px;
    border-color: none;
  box-shadow: none;
}
.taiwan-drawer__item--logout::after { display: none; }



/* Animations Keyframes */
@keyframes taiwanFadeIn { from { opacity: 0; } to { opacity: 1; } }


