/**
 * ========================================
 * STS2 Critical CSS
 * ========================================
 * 目的: 初期表示に必要な最小限のスタイル
 * 依存: sts2-variables.css
 * ========================================
 */

/* ========================================
   共通アニメーション定義
======================================== */
@keyframes sts2-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes sts2-fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sts2-glow {
  0% {
    box-shadow: 0 0 0.9375em rgba(255, 220, 100, 0.8);
    transform: scale(1.1);
  }
  100% {
    box-shadow: 0 var(--sts2-border-base) 0.25em rgba(0, 0, 0, 0.3);
    transform: scale(1);
  }
}

@keyframes sts2-pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* ========================================
   基本コンテナ
======================================== */
.sts2-container {
  max-width: 75em;
  margin: 0 auto;
  user-select: text;
  min-height: 100vh;
}

.sts2-title {
  margin: 0 0 0.4em;
  color: var(--sts2-bg-dark);
  font-size: 1.8em;
  font-weight: 700;
  text-align: center;
  line-height: var(--sts2-line-height-tight);
  text-shadow: 0 0.05em 0.15em rgba(0, 0, 0, 0.12);
}

/* アプリ名ラベル */
.sts2-title-app {
  display: block;
  font-size: 0.38em;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.35);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-top: 0.4em;
}

/* ページ名 + パッチラベルのグループ */
.sts2-title-page-group {
  text-align: center;
  margin-bottom: 1.8em;
}

/* タイトルサブテキスト（ページ名） */
.sts2-title-sub {
  display: block;
  font-size: 1em;
  font-weight: 600;
  color: var(--sts2-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* パッチバージョン表示 */
.sts2-patch-label {
  text-align: center;
  color: rgba(0, 0, 0, 0.35);
  font-size: var(--sts2-font-sm);
  margin: 0.3em 0 0;
}

/* タイトルリンク */
.sts2-title a {
  color: inherit;
  text-decoration: none;
  transition: var(--sts2-transition-fast);
}

.sts2-title a:hover {
  color: var(--sts2-primary);
  text-shadow: none;
}

/* ========================================
   セクション
======================================== */
.sts2-section {
  background: var(--sts2-gradient-dark);
  border-radius: var(--sts2-radius-lg);
  border: 0.15em solid var(--sts2-border);
  box-shadow: var(--sts2-shadow-lg);
  overflow: hidden;
}

/* ========================================
   タブ
======================================== */
.sts2-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: var(--sts2-bg-overlay);
  border-bottom: 0.15em solid var(--sts2-border);
}

.sts2-tabs.four-cols {
  grid-template-columns: repeat(4, 1fr);
}

/* ----------------------------------------
   Actタブ（サブマップ対応）共通
   ---------------------------------------- */

.sts2-tabs.sts2-tabs--acts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.sts2-tabs--acts [data-char="all"] {
  display: none;
}

.sts2-tabs--acts .sts2-tab:not(.sts2-tab--submap) {
  padding: 1.1em 0.45em;
}

.sts2-tabs--acts .sts2-tab:not(.sts2-tab--submap) .label {
  font-size: 1em;
}

.sts2-tabs--acts .sts2-tab--submap {
  padding-top: 0.45em;
  padding-bottom: 0.45em;
}

.sts2-tabs--acts .sts2-tab--submap .label {
  font-size: 0.82em;
}

.act-tab-group {
  display: flex;
  flex-direction: column;
}

.act-tab-group > .sts2-tab {
  width: 100%;
  flex: none;
}

.act-submaps {
  display: flex;
  border-top: 2px solid
    color-mix(in srgb, var(--color, var(--sts2-border)) 35%, var(--sts2-border));
}

.sts2-tab--submap {
  flex: 1;
  font-size: 0.9em;
  padding-top: 0.5em;
  padding-bottom: 0.5em;
  background: transparent !important;
  color: var(--sts2-text-muted);
  opacity: 1;
}

.sts2-tab--submap:not(:last-child) {
  border-right: 1px solid var(--sts2-border);
}

.sts2-tab--submap.active {
  background: transparent !important;
  color: var(--sts2-accent-gold);
}

.sts2-tab--submap.active::after {
  display: none;
}

.sts2-tab {
  padding: 0.9em 0.45em;
  background: transparent;
  color: var(--sts2-text-muted);
  font-weight: 600;
  font-size: var(--sts2-font-base);
  text-align: center;
  cursor: pointer;
  transition: var(--sts2-transition);
  border: none;
  border-right: var(--sts2-border-thin) solid var(--sts2-border);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2em;
}

.sts2-tab:last-child {
  border-right: none;
}

.sts2-tab::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 0.22em;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.75) 30%,
    rgba(255, 255, 255, 0.75) 70%,
    transparent 100%
  );
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.sts2-tab:hover {
  background: var(--sts2-border);
  color: var(--sts2-text-secondary);
}

.sts2-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: var(--sts2-text-primary);
}

.sts2-tab.active::after {
  transform: scaleX(1);
}

.sts2-tab .icon {
  font-size: 1.4em;
  flex-shrink: 0;
}

.sts2-tab .label {
  font-size: var(--sts2-font-base);
}

/* ========================================
   グリッドコンテナ
======================================== */
.sts2-grid-container {
  position: relative;
  padding: 1.3em;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.2), transparent);
  min-height: 27em;
  animation: sts2-fadeIn var(--sts2-duration-base) ease both;
}

.sts2-grid {
  display: grid;
  gap: 1.3em;
}

/* ========================================
   モーダル
======================================== */
.modal,
.enemy-patterns-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--sts2-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.modal.show,
.enemy-patterns-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(0.25em);
}

.modal-content,
.enemy-patterns-panel {
  position: relative;
  width: 90%;
  max-width: 52em;
  max-height: 90vh;
  background: var(--sts2-gradient-dark);
  border-radius: var(--sts2-radius-xs);
  border: 0.15em solid var(--sts2-border);
  box-shadow: var(--sts2-shadow-xl);
  display: flex;
  flex-direction: column;
  transform: translateY(1.25em);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.enemy-patterns-panel {
  max-width: 50em;
  max-height: 80vh;
}

.modal.show .modal-content,
.enemy-patterns-overlay.show .enemy-patterns-panel {
  transform: translateY(0);
  opacity: 1;
}

.modal-close,
.patterns-close {
  position: absolute;
  top: 0;
  right: 0;
  width: 3em;
  height: 3em;
  background: var(--sts2-gradient-danger-strong);
  border: none;
  border-bottom-left-radius: var(--sts2-radius-md);
  color: var(--sts2-text-primary);
  font-size: 1.2em;
  cursor: pointer;
  transition: var(--sts2-transition);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -2px 2px 8px rgba(0, 0, 0, 0.4);
}

.modal-close:hover,
.patterns-close:hover {
  transform: scale(1.05);
  box-shadow: -3px 3px 12px rgba(220, 20, 60, 0.5);
}

.modal-close:active,
.patterns-close:active {
  transform: scale(0.95);
}

.modal-body {
  padding: 1.8em;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.modal-body h2 {
  margin: 0 0 1.3em;
  padding: 0 3em;
  color: var(--sts2-text-primary);
  font-size: 1.6em;
  text-align: center;
  text-shadow: var(--sts2-border-base) var(--sts2-border-base) 0.25em
    rgba(0, 0, 0, 0.8);
}

/* ========================================
   履歴リスト
======================================== */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.history-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--sts2-border);
  border-radius: var(--sts2-radius-sm);
  padding: 1em 1.25em;
  box-shadow: none;
}

.history-item:first-child {
  border-top: 1px solid var(--sts2-border);
  padding-top: 1em;
}

.history-item.latest {
  border-color: rgba(220, 180, 50, 0.3);
  background: rgba(220, 180, 50, 0.03);
  box-shadow: none;
}

.history-item.latest .enemy-history-details::before {
  display: none;
}

.history-header {
  display: flex;
  gap: var(--sts2-gap-sm);
  align-items: center;
  margin-bottom: 0.5em;
  padding-bottom: 0;
  border-bottom: none;
}

.version-badge {
  padding: 0.375em 0.875em;
  background: var(--sts2-gradient-primary);
  color: var(--sts2-text-primary);
  font-weight: 700;
  font-size: var(--sts2-font-lg);
  border-radius: var(--sts2-radius-xs);
  border: var(--sts2-border-thin) solid rgba(100, 150, 200, 0.4);
  box-shadow: var(--sts2-shadow-sm);
}

.latest-badge {
  padding: 0.25em 0.625em;
  background: var(--sts2-gradient-accent);
  color: var(--sts2-text-primary);
  font-weight: 700;
  font-size: var(--sts2-font-xs);
  border-radius: var(--sts2-radius-xs);
  text-transform: uppercase;
  letter-spacing: 0.03125em;
  box-shadow: var(--sts2-shadow-sm);
}

/* ========================================
   ローディング画面
======================================== */
.sts2-loading-overlay {
  position: fixed;
  inset: 0;
  background: var(--sts2-gradient-dark);
  z-index: var(--sts2-z-loading);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.sts2-loading-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sts2-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2em;
}

.sts2-loading-spinner {
  width: 80px;
  height: 80px;
  border: 6px solid var(--sts2-border);
  border-top-color: var(--sts2-primary);
  border-right-color: var(--sts2-info);
  border-radius: 50%;
  animation: sts2-spin 1s linear infinite;
}

.sts2-loading-text {
  color: var(--sts2-text-primary);
  font-size: 1.2em;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-align: center;
}

.sts2-loading-subtext {
  color: var(--sts2-text-muted);
  font-size: var(--sts2-font-lg);
  margin-top: 0.5em;
  animation: sts2-pulse 1.5s ease-in-out infinite;
}

/* ========================================
   画像調整
======================================== */
.sts2-grid [class$="-icon"],
.sts2-shortcode-container [class$="-icon"] {
  opacity: 0.9;
}

.sts2-grid [class$="-icon"]::after,
.sts2-shortcode-container [class$="-icon"]::after {
  z-index: -1;
}

/* ========================================
   スクロールバー
======================================== */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 150, 200, 0.6) rgba(0, 0, 0, 0.2);
}

*::-webkit-scrollbar {
  width: 0.625em;
  height: 0.625em;
}

*::-webkit-scrollbar-track {
  background: rgba(25, 30, 40, 0.8);
  border-radius: var(--sts2-radius-xs);
}

*::-webkit-scrollbar-thumb {
  background: rgba(70, 110, 170, 0.8);
  border-radius: var(--sts2-radius-xs);
  transition: var(--sts2-transition);
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(90, 130, 190, 0.9);
}

*::-webkit-scrollbar-thumb:active {
  background: rgba(110, 150, 210, 1);
}

*::-webkit-scrollbar-corner {
  background: rgba(0, 0, 0, 0.2);
}

/* ========================================
   レスポンシブ
======================================== */
/* ========================================
   スマホフルワイド (834px 以下)
   親 main.main の padding: 32px 16px を突き破る
======================================== */
@media (max-width: 52.125em) {
  /* パッチノート以外のアプリを全幅 */
  #sts2-cards-app,
  #sts2-relics-app,
  #sts2-potions-app,
  #sts2-enemies-app,
  #sts2-events-app,
  #sts2-deck-app,
  #sts2-stats-app {
    width: 100vw;
    margin-inline: calc(50% - 50vw);
  }

  .sts2-section {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
}

@media (max-width: 48em) {
  .sts2-title {
    font-size: 1.4em;
    margin-bottom: 1.3em;
  }

  .sts2-grid-container {
    padding: 1.1em 0.9em;
  }

  .sts2-grid {
    gap: 1.1em;
  }

  .sts2-tabs,
  .sts2-tabs.four-cols {
    grid-template-columns: repeat(3, 1fr);
  }

  .sts2-tabs.sts2-tabs--acts {
    grid-template-columns: repeat(2, 1fr);
  }

  .sts2-tabs--acts .sts2-tab:not(.sts2-tab--submap) {
    padding: 0.75em 0.25em;
  }

  .sts2-tabs--acts .sts2-tab--submap .label {
    font-size: 0.7em;
  }

  .sts2-tab {
    padding: 0.45em 0.15em;
    font-size: var(--sts2-font-xs);
  }

  .sts2-tab .icon {
    font-size: 1.05em;
  }

  .sts2-tab .label {
    font-size: 0.7em;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    align-self: flex-end;
    max-height: 95vh;
  }

  .enemy-patterns-panel {
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    align-self: flex-end;
    max-height: 95vh;
  }

  .modal-body {
    padding: 1.3em 0.9em;
  }

  .modal-body h2 {
    font-size: 1.3em;
    padding-right: 2.5em;
  }

  .modal-close,
  .patterns-close {
    width: 2.5em;
    height: 2.5em;
    font-size: 1.1em;
  }

  *::-webkit-scrollbar {
    width: 0.5em;
    height: 0.5em;
  }

  .sts2-loading-spinner {
    width: 60px;
    height: 60px;
    border-width: 5px;
  }

  .sts2-loading-text {
    font-size: var(--sts2-font-xl);
  }

  .sts2-loading-subtext {
    font-size: var(--sts2-font-md);
  }
}

/* ========================================
   PC サイドバーレイアウト (64em+)
======================================== */
@media (min-width: 64em) {
  #sts2-cards-app .sts2-container,
  #sts2-relics-app .sts2-container,
  #sts2-potions-app .sts2-container,
  #sts2-enemies-app .sts2-container,
  #sts2-events-app .sts2-container,
  #sts2-deck-app .sts2-container,
  #sts2-enchantments-app .sts2-container,
  #sts2-afflictions-app .sts2-container {
    max-width: none;
    margin-inline: calc(50% - 50vw);
  }

  .sts2-section--sidebar {
    display: grid;
    grid-template-columns: 20em 1fr;
    align-items: stretch;
    overflow: visible;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  /* top広告はスマホのみ（サイドバーなしページは除く） */
  .sts2-ad-wrapper--top {
    display: none;
  }
  .sts2-ad-wrapper--top.sts2-ad-top-enabled {
    display: block;
  }

  .sts2-sidebar-ad {
    display: block;
  }

  .sts2-sidebar {
    display: flex;
    flex-direction: column;
    border-right: var(--sts2-border-thin) solid var(--sts2-border);
  }

  .sts2-sidebar-sticky {
  }

  .sts2-sidebar-sticky--active {
    position: sticky;
    top: 0;
    padding-top: 1em;
    animation: sts2-sticky-in 0.25s ease both;
  }

  @keyframes sts2-sticky-in {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* タブ縦並び */
  .sts2-section--sidebar .sts2-tabs {
    display: flex;
    flex-direction: column;
    border-bottom: none;
  }

  .sts2-section--sidebar .sts2-tab {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.6em;
    padding: 0.75em 1em;
    border-right: none;
    border-bottom: var(--sts2-border-thin) solid var(--sts2-border);
  }

  /* フィルター: 1列 */
  .sts2-section--sidebar .sts2-search-filter {
    flex: 1;
  }

  .sts2-section--sidebar .filter-groups {
    grid-template-columns: 1fr;
  }

  .sts2-section--sidebar .filter-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--sts2-gap-md);
  }

  .sts2-section--sidebar .btn-clear {
    width: 100%;
  }

  .sts2-section--sidebar .result-count {
    text-align: center;
  }

  .sts2-content {
    min-height: 100vh;
  }
}

/* ========================================
   テーマ見出しスタイルのリセット（ショートコード内）
   Cocoon等のテーマが .article h2 等に当てる
   margin/padding/background/color を打ち消す。
   STS2スタイルは sts2-enhanced.css で同詳細度・後読み込みで上書きする。
======================================== */
.article .sts2-shortcode-container h2,
.article .sts2-shortcode-container h3,
.article .sts2-shortcode-container h4,
.article .sts2-shortcode-container h5,
.article .sts2-shortcode-container h6,
.article .sts2-page-nav-content h3 {
  background: none;
  padding: 0;
  border: none;
  border-radius: 0;
}

/* ========================================
   CLS防止: 記事内画像のスペース確保
   PHP の wp_filter_content_tags() で width/height が補完できない場合の fallback。
   width/height 属性なし画像に aspect-ratio を付与して 0px 崩壊を防ぐ。
======================================== */
.article img:not([width]):not([height]) {
  /* 実際の表示比率（正方形）に合わせてスペース確保 */
  aspect-ratio: 1;
  width: 100%;
  height: auto;
}

/* ========================================
   CLS防止: 広告スペース確保
======================================== */
.sts2-ad-wrapper {
  overflow: hidden;
}

.sts2-ad-wrapper--top {
  min-height: 100px;
}

.sts2-sidebar-ad {
  width: 100%;
  padding: var(--sts2-padding-md);
  /* 広告未取得時のフォールバック: 長い広告（600px相当）を基準に高さを確保 */
  min-height: 600px;
}

.sts2-ad-wrapper--bottom {
  min-height: 90px;
}

/* ========================================
   CLS防止: アプリコンテナ初期スペース確保
   ローディング中もレイアウト予約で測定CLSを抑制
======================================== */
#sts2-cards-app,
#sts2-relics-app,
#sts2-potions-app,
#sts2-enemies-app,
#sts2-events-app {
  min-height: 100vh;
}

/* ========================================
   ユーティリティ
======================================== */
.hidden {
  visibility: hidden !important;
}

/* ========================================
   統一フォーカススタイル（アクセシビリティ）
======================================== */
*:focus-visible {
  outline: var(--sts2-focus-width, 3px) solid
    var(--sts2-focus-color, var(--sts2-primary));
  outline-offset: var(--sts2-focus-offset, 2px);
  border-radius: var(--sts2-radius-xs, 0.25em);
}

/* スキップリンク */
.skip-to-content {
  position: absolute;
  top: -999px;
  left: 0;
  background: var(--sts2-primary);
  color: white;
  padding: var(--sts2-padding-md, 0.65em);
  z-index: var(--sts2-z-modal, 9999);
  text-decoration: none;
  font-weight: 600;
  border-radius: 0 0 var(--sts2-radius-xs, 0.25em) 0;
}

.skip-to-content:focus {
  top: 0;
}

/* サイドバー広告はPCレイアウト（64em以上）のみ表示 */
@media (max-width: calc(64em - 0.01px)) {
  .sts2-sidebar-ad {
    display: none;
  }
}

/* アプリメニュー */
.sts2-app-menu-wrap {
  position: relative; /* hint の基準点 */
}

.sts2-app-menu-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35em;
  padding: 0.3em 0.4em;
  background: transparent;
  border: none;
  border-radius: var(--sts2-radius-xs);
  cursor: pointer;
  color: rgba(255, 255, 255, 0.45);
  transition:
    color 0.2s,
    background 0.2s;
}

.sts2-app-menu-toggle:hover,
.sts2-app-menu-wrap.open .sts2-app-menu-toggle {
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.07);
}

/* ☰ / ✕ アニメーション */
.sts2-app-menu-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  font-size: 0.9em;
  line-height: 1;
  flex-shrink: 0;
}

.sts2-icon-ham,
.sts2-icon-close {
  position: absolute;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.sts2-icon-ham {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.sts2-icon-close {
  opacity: 0;
  transform: rotate(-45deg) scale(0.6);
  font-size: 0.9em;
}

.sts2-app-menu-wrap.open .sts2-icon-ham {
  opacity: 0;
  transform: rotate(45deg) scale(0.6);
}

.sts2-app-menu-wrap.open .sts2-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.sts2-app-menu-label {
  font-size: 0.65em;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

/* dropdown は container(position:fixed) を基準に配置 */
.sts2-app-menu-dropdown {
  display: none;
  position: absolute;
  right: calc(100% + 0.5em);
  top: 0;
  min-width: 10em;
  flex-direction: column;
  background: linear-gradient(
    135deg,
    rgba(25, 30, 42, 0.75),
    rgba(18, 22, 32, 0.75)
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(100, 150, 200, 0.25);
  border-radius: var(--sts2-radius-xs);
  box-shadow: 0 0.25em 1em rgba(0, 0, 0, 0.4);
  overflow: hidden;
  z-index: 10;
}

.sts2-app-menu-dropdown.open {
  display: flex;
}

.sts2-app-menu-item {
  padding: 0.55em 0.9em;
  font-size: 0.85em;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s;
}

.sts2-app-menu-item:hover {
  background: rgba(100, 150, 200, 0.15);
  color: rgba(255, 255, 255, 0.95);
}

/* 初回アクセスヒント */
.sts2-menu-hint {
  position: absolute;
  top: calc(100% + 1em);
  right: 0;
  left: 0;
  bottom: auto;
  transform: none;
  display: flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.5em 0.6em 0.5em 0.85em;
  background: rgba(18, 26, 50, 0.97);
  border: 1px solid rgba(100, 160, 220, 0.5);
  border-radius: 0.6em;
  box-shadow: 0 0.3em 1em rgba(0, 0, 0, 0.55);
  white-space: nowrap;
  font-size: 0.72em;
  color: rgba(255, 255, 255, 0.92);
  z-index: 15;
  pointer-events: auto;
  animation: sts2-hint-in 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

/* 吹き出し矢印（上向き・右寄り） — 二重三角でボーダー表現 */
.sts2-menu-hint::before {
  content: "";
  position: absolute;
  bottom: 100%;
  right: 0.65em;
  width: 0;
  height: 0;
  border-left: 0.5em solid transparent;
  border-right: 0.5em solid transparent;
  border-bottom: 0.5em solid rgba(100, 160, 220, 0.5);
}

.sts2-menu-hint::after {
  content: "";
  position: absolute;
  bottom: calc(100% - 1px);
  right: calc(0.65em + 1px);
  width: 0;
  height: 0;
  border-left: calc(0.5em - 1px) solid transparent;
  border-right: calc(0.5em - 1px) solid transparent;
  border-bottom: calc(0.5em - 1px) solid rgba(18, 26, 50, 0.97);
}

.sts2-menu-hint-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4em;
  height: 1.4em;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font-size: 0.85em;
  line-height: 1;
  transition: color 0.15s;
  flex-shrink: 0;
}

.sts2-menu-hint-close:hover {
  color: rgba(255, 255, 255, 0.88);
}

@keyframes sts2-hint-in {
  from {
    opacity: 0;
    transform: translateY(0.3em);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sts2-menu-hint.hiding {
  animation: sts2-hint-out 0.22s ease forwards;
}

@keyframes sts2-hint-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(0.3em);
  }
}

@media (max-width: 48em) {
  .sts2-lang-toggle-container {
    top: 50% !important;
    right: 0 !important;
    transform: translateY(-50%);
    flex-direction: column !important;
    gap: 0 !important;
    padding: 0.25em !important;
    border-radius: var(--sts2-radius-xs) 0 0 var(--sts2-radius-xs) !important;
  }

  .sts2-lang-row {
    flex-direction: column !important;
    gap: 0 !important;
  }

  .sts2-lang-btn {
    padding: 0.8em 0.4em !important;
    min-width: unset !important;
    writing-mode: vertical-rl !important;
    letter-spacing: 0.1em !important;
  }

  /* スマホ: ラベル非表示、アイコンのみ */
  .sts2-app-menu-label {
    display: none !important;
  }

  .sts2-app-menu-toggle {
    justify-content: center;
    padding: 0.6em 0.4em !important;
  }

  .sts2-app-menu-dropdown {
    right: calc(100% + 0.25em);
    top: 0;
    bottom: auto;
  }

  .sts2-menu-hint {
    display: none !important;
  }
}
