/* ========================================
   CSS変数定義（グローバル）
======================================== */
:root {
  /* カラーパレット */
  --sts2-primary: #4169e1;
  --sts2-danger: #dc143c;
  --sts2-success: #32cd32;
  --sts2-warning: #ffd700;
  --sts2-info: #9370db;

  /* 背景色 */
  --sts2-bg-dark: #1a1a2e;
  --sts2-bg-darker: #16213e;
  --sts2-bg-overlay: rgba(0, 0, 0, 0.3);

  /* テキスト色 */
  --sts2-text-primary: rgba(255, 255, 255, 0.95);
  --sts2-text-secondary: rgba(255, 255, 255, 0.7);
  --sts2-text-muted: rgba(255, 255, 255, 0.5);

  /* 共通サイズ変数 */
  --sts2-font-xs: 0.7em;
  --sts2-font-sm: 0.75em;
  --sts2-font-base: 0.8em;
  --sts2-font-md: 0.85em;
  --sts2-font-lg: 0.9em;
  --sts2-font-xl: 1em;

  --sts2-padding-xs: 0.3em;
  --sts2-padding-sm: 0.45em;
  --sts2-padding-md: 0.65em;
  --sts2-padding-lg: 1em;
  --sts2-padding-xl: 1.35em;

  --sts2-gap-xs: 0.3em;
  --sts2-gap-sm: 0.45em;
  --sts2-gap-md: 0.65em;
  --sts2-gap-lg: 0.9em;
  --sts2-gap-xl: 1.35em;

  --sts2-border-thin: 0.0625em;
  --sts2-border-base: 0.125em;
  --sts2-border-thick: 0.1875em;

  /* 共通カラー */
  --sts2-rarity-starter: #808080;
  --sts2-rarity-common: #c0c0c0;
  --sts2-rarity-uncommon: #4169e1;
  --sts2-rarity-rare: #9370db;
  --sts2-rarity-boss: #dc143c;
  --sts2-rarity-event: #ffd700;
  --sts2-rarity-curse: #4b0082;

  --sts2-cost-base: rgba(60, 80, 120, 0.9);
  --sts2-cost-changed: rgba(220, 180, 50, 0.9);

  /* ボーダー */
  --sts2-border: rgba(255, 255, 255, 0.1);
  --sts2-border-hover: rgba(255, 255, 255, 0.2);

  /* スペーシング */
  --sts2-space-xs: 0.25em;
  --sts2-space-sm: 0.5em;
  --sts2-space-md: 1em;
  --sts2-space-lg: 1.5em;
  --sts2-space-xl: 2em;

  /* 角丸 */
  --sts2-radius-xs: 0.25em;
  --sts2-radius-sm: 0.5em;
  --sts2-radius-md: 0.75em;
  --sts2-radius-lg: 1em;

  /* シャドウ */
  --sts2-shadow-sm: 0 0.125em 0.25em rgba(0, 0, 0, 0.2);
  --sts2-shadow-md: 0 0.25em 0.5em rgba(0, 0, 0, 0.3);
  --sts2-shadow-lg: 0 0.5em 1em rgba(0, 0, 0, 0.4);
  --sts2-shadow-xl: 0 1.25em 3.75em rgba(0, 0, 0, 0.8);

  /* トランジション */
  --sts2-transition: all 0.3s ease;
  --sts2-transition-fast: all 0.15s ease;

  /* Z-Index */
  --sts2-z-base: 1;
  --sts2-z-dropdown: 100;
  --sts2-z-sticky: 200;
  --sts2-z-fixed: 1000;
  --sts2-z-modal: 9999;
  --sts2-z-loading: 99999;

  /* グラデーション */
  --sts2-gradient-card: linear-gradient(135deg, #252525, #1a2a3a);
  --sts2-gradient-dark: linear-gradient(135deg, #1a1a2e, #16213e);
  --sts2-gradient-darker: linear-gradient(135deg, #0f0f1a, #1a1a2e);
  --sts2-gradient-overlay: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    transparent
  );
  --sts2-gradient-overlay-strong: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.08),
    transparent
  );
  --sts2-gradient-primary: linear-gradient(
    135deg,
    rgba(60, 80, 120, 0.8),
    rgba(40, 60, 100, 0.8)
  );
  --sts2-gradient-primary-strong: linear-gradient(
    135deg,
    rgba(60, 80, 120, 0.95),
    rgba(40, 60, 100, 0.95)
  );
  --sts2-gradient-primary-light: linear-gradient(
    135deg,
    rgba(80, 100, 140, 0.9),
    rgba(60, 80, 120, 0.9)
  );
  --sts2-gradient-accent: linear-gradient(
    135deg,
    rgba(220, 180, 50, 0.9),
    rgba(180, 140, 30, 0.9)
  );
  --sts2-gradient-accent-strong: linear-gradient(
    135deg,
    rgba(220, 180, 50, 0.95),
    rgba(180, 140, 30, 0.95)
  );
  --sts2-gradient-danger: linear-gradient(
    135deg,
    rgba(200, 20, 60, 0.8),
    rgba(160, 15, 50, 0.8)
  );
  --sts2-gradient-danger-strong: linear-gradient(
    135deg,
    rgba(200, 20, 60, 0.9),
    rgba(160, 15, 50, 0.9)
  );
}

/**/
.sts2-sidebar-nav {
  margin: 0;
  padding: 0;
}

.sts2-sidebar-nav-list {
  display: flex;
  flex-direction: column;
  gap: var(--sts2-gap-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sts2-sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--sts2-gap-md);
  padding: var(--sts2-padding-md);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.98),
    rgba(250, 250, 252, 0.95)
  );
  border-left: 0.1875em solid rgba(0, 0, 0, 0.1);
  border-radius: 0 var(--sts2-radius-xs) var(--sts2-radius-xs) 0;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 0.0625em 0.25em rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(0.5em);
  border-top: var(--sts2-border-thin) solid rgba(0, 0, 0, 0.04);
  border-right: var(--sts2-border-thin) solid rgba(0, 0, 0, 0.04);
  border-bottom: var(--sts2-border-thin) solid rgba(0, 0, 0, 0.04);
  animation: slideIn 0.3s ease forwards;
}

.sts2-sidebar-nav-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5),
    rgba(245, 245, 250, 0.3)
  );
  opacity: 0;
  transition: opacity 0.25s ease;
}

.sts2-sidebar-nav-item:hover {
  transform: translateX(0.25em);
  border-left-color: rgba(0, 0, 0, 0.2);
  box-shadow:
    0 0.125em 0.5em rgba(0, 0, 0, 0.1),
    -0.125em 0 0.5em rgba(0, 0, 0, 0.04);
}

.sts2-sidebar-nav-item:hover::before {
  opacity: 1;
}

.sts2-sidebar-nav-thumb {
  flex-shrink: 0;
  width: 3.15em;
  height: 3.15em;
  border-radius: var(--sts2-radius-xs);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.04);
  border: var(--sts2-border-thin) solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 0.0625em 0.1875em rgba(0, 0, 0, 0.06);
}

.sts2-sidebar-nav-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
  opacity: 0.95;
}

.sts2-sidebar-nav-item:hover .sts2-sidebar-nav-thumb img {
  transform: scale(1.05);
  opacity: 1;
}

.sts2-sidebar-nav-content {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sts2-gap-sm);
  min-width: 0;
}

.sts2-sidebar-nav-title {
  flex: 1;
  font-size: var(--sts2-font-md);
  font-weight: 600;
  color: #333;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

.sts2-sidebar-nav-item:hover .sts2-sidebar-nav-title {
  color: #111;
}

.sts2-sidebar-nav-arrow {
  flex-shrink: 0;
  width: 1.1em;
  height: 1.1em;
  opacity: 0;
  transform: rotate(-90deg) translateX(0.125em);
  transition: all 0.25s ease;
}

.sts2-sidebar-nav-arrow svg {
  width: 100%;
  height: 100%;
  fill: #666;
}

.sts2-sidebar-nav-item:hover .sts2-sidebar-nav-arrow {
  opacity: 0.5;
  transform: rotate(-90deg) translateX(0);
}

.sts2-sidebar-nav-item:hover .sts2-sidebar-nav-arrow svg {
  fill: #333;
}

.sts2-sidebar-nav-item:not(:has(.sts2-sidebar-nav-thumb)) {
  padding: 1em 0.75em;
}

.sts2-sidebar-nav-item:not(:has(.sts2-sidebar-nav-thumb))
  .sts2-sidebar-nav-title {
  font-size: 0.95em;
}

.sts2-sidebar-nav-item.current-page {
  border-left-color: rgba(0, 0, 0, 0.25);
  background: rgba(0, 0, 0, 0.03);
}

.sts2-sidebar-nav-item.current-page .sts2-sidebar-nav-title {
  color: #111;
  font-weight: 700;
}

.sts2-sidebar-nav-item.current-page .sts2-sidebar-nav-arrow {
  opacity: 0.6;
  transform: translateX(0);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-1em);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sts2-sidebar-nav-item:nth-child(1) {
  animation-delay: 0.05s;
}
.sts2-sidebar-nav-item:nth-child(2) {
  animation-delay: 0.1s;
}
.sts2-sidebar-nav-item:nth-child(3) {
  animation-delay: 0.15s;
}
.sts2-sidebar-nav-item:nth-child(4) {
  animation-delay: 0.2s;
}
.sts2-sidebar-nav-item:nth-child(5) {
  animation-delay: 0.25s;
}
.sts2-sidebar-nav-item:nth-child(6) {
  animation-delay: 0.3s;
}

@media (max-width: 64em) {
  .sts2-sidebar-nav {
    position: static;
    margin-bottom: 2em;
  }
}

@media (max-width: 48em) {
  .sts2-sidebar-nav {
    padding: 1.1em;
  }

  .sts2-sidebar-nav h3 {
    font-size: var(--sts2-font-lg);
    margin-bottom: var(--sts2-gap-lg);
  }

  .sts2-sidebar-nav-link {
    padding: 0.55em 0.75em;
    font-size: var(--sts2-font-base);
  }

  .sts2-sidebar-nav-icon {
    font-size: var(--sts2-font-xl);
  }
}
