/* ============ 高級變數設計系統 ============ */
:root{
  /* 高級色彩調色板 */
  --bg: #050607;
  --bg-subtle: #0a0c0f;
  --panel: linear-gradient(135deg, #0f1419 0%, #1a1f26 100%);
  --panel-hover: linear-gradient(135deg, #151a21 0%, #1f242c 100%);
  --panel-2: linear-gradient(145deg, #1c212a 0%, #242932 100%);
  --text: #f8fafc;
  --text-secondary: #e2e8f0;
  --muted: #94a3b8;
  --muted-2: #64748b;
  
  /* 高端品牌色彩 */
  --primary: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --primary-glow: #10b98140;
  --primary-solid: #10b981;
  --accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --accent-glow: #f59e0b30;
  
  /* 高級邊框與陰影 */
  --border: #1e293b;
  --border-subtle: #334155;
  --border-glow: rgba(16, 185, 129, 0.3);
  
  /* 精緻陰影系統 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.15);
  --shadow-accent: 0 8px 32px rgba(245, 158, 11, 0.2);
  
  /* 高級間距與圓角 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* 高級字體設計 */
  --font-heading: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --font-body: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans TC", system-ui, sans-serif;
  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
}

/* ============ 全域重設與基礎 ============ */
*{
  box-sizing: border-box;
}

*:before, *:after {
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  height: 100%;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

/* 高級背景效果 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.03) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(245, 158, 11, 0.02) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.01) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}

/* 高級滾動條 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #374151, #4b5563);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #4b5563, #6b7280);
}

/* ============ 容器系統 ============ */
.container {
  width: min(1200px, 100% - var(--spacing-lg));
  margin-inline: auto;
  position: relative;
}

/* ============ 高級頁首設計 ============ */
.site-header {
  position: static;
  background: rgba(5, 6, 7, 0.95);
  backdrop-filter: blur(24px) saturate(200%);
  border-bottom: 1px solid var(--border-glow);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.site-header.header-hidden {
  transform: translateY(-100%);
}

.site-header.header-compact {
  padding: 0;
}

.site-header.header-compact .hero {
  display: none;
}

.site-header.header-compact .toolbar {
  margin-bottom: 0;
  padding: var(--spacing-sm) 0;
}

.site-header.header-compact .pills {
  padding: var(--spacing-xs) 0;
}

.site-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(16, 185, 129, 0.6) 25%, 
    rgba(245, 158, 11, 0.6) 75%, 
    transparent 100%);
  opacity: 0.8;
}

/* 英雄區域 */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
  margin-bottom: var(--spacing-lg);
}

.brand-block {
  flex: 1;
}

.brand {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, 
    #ffffff 0%, 
    #e2e8f0 30%, 
    #10b981 70%, 
    #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  text-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.brand::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(135deg, var(--primary-solid), var(--accent-glow));
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.subtitle {
  margin: var(--spacing-sm) 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 500;
  opacity: 0.9;
}

.hero-cta {
  display: flex;
  gap: var(--spacing-md);
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(245, 158, 11, 0.1));
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.nav-chip::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.6s;
}

.nav-chip:hover {
  border-color: var(--primary-solid);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(245, 158, 11, 0.15));
}

.nav-chip:hover::before {
  left: 100%;
}

.nav-chip .emoji {
  font-size: 1.2em;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
}

/* 工具列設計 */
.toolbar {
  display: flex;
  gap: var(--spacing-lg);
  align-items: stretch;
  margin-bottom: var(--spacing-lg);
  flex-wrap: wrap;
}

.input-wrap {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.input-wrap::before {
  content: '🔍';
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}

input[type="search"] {
  width: 100%;
  padding: var(--spacing-md) var(--spacing-md) var(--spacing-md) 3rem;
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.9), rgba(30, 41, 59, 0.4));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 400;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

input[type="search"]:focus {
  outline: none;
  border-color: var(--primary-solid);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2),
              inset 0 2px 8px rgba(0, 0, 0, 0.2),
              0 4px 20px rgba(16, 185, 129, 0.1);
  background: linear-gradient(135deg, rgba(15, 20, 25, 1), rgba(30, 41, 59, 0.6));
}

input[type="search"]::placeholder {
  color: var(--muted-2);
  font-weight: 400;
}

.select-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  min-width: 180px;
}

.select-wrap label {
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

select {
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(135deg, rgba(15, 20, 25, 0.9), rgba(30, 41, 59, 0.4));
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

select:focus {
  outline: none;
  border-color: var(--primary-solid);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border-glow);
  font-weight: 600;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn.ghost::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.btn.ghost:hover {
  border-color: var(--primary-solid);
  color: #0a0c0f;
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.btn.ghost:hover::before {
  opacity: 1;
}

/* ============ 高級篩選欄 ============ */
.filter-bar {
  position: sticky;
  top: 88px;
  z-index: 40;
  background: rgba(5, 6, 7, 0.9);
  backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.pills {
  display: flex;
  gap: var(--spacing-sm);
  overflow-x: auto;
  padding: var(--spacing-md) 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  padding: var(--spacing-md) var(--spacing-lg);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.pill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--primary);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.pill:hover {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.pill.is-active {
  border-color: var(--primary-solid);
  color: #0a0c0f;
  font-weight: 600;
  box-shadow: var(--shadow-glow);
}

.pill.is-active::before {
  opacity: 1;
}

/* 修正按鈕點擊後的顏色問題 */
.pill:active {
  transform: translateY(1px);
  color: var(--text) !important;
}

.pill:focus {
  color: var(--text) !important;
}

.pill.is-active:active {
  color: #0a0c0f !important;
}

.pill.is-active:focus {
  color: #0a0c0f !important;
}

/* ============ 高級版面設計 ============ */
.layout {
  display: grid;
  gap: var(--spacing-xl);
  grid-template-columns: 1fr;
  margin-top: var(--spacing-xl);
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 280px 1fr;
  }
}

/* ============ 高級側邊欄 ============ */
.sidebar {
  display: none;
  position: sticky;
  top: 140px;
  align-self: start;
  max-height: calc(100vh - 160px);
  overflow-y: auto;
  padding: var(--spacing-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
}

@media (min-width: 960px) {
  .sidebar {
    display: block;
  }
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 var(--spacing-md);
  color: var(--text-secondary);
}

.link-list {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--spacing-lg);
}

.link-list li {
  margin: var(--spacing-xs) 0;
}

.link-list a {
  display: block;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-decoration: none;
  font-weight: 400;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.link-list a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 0;
  background: var(--primary);
  border-radius: 2px;
  transform: translateY(-50%);
  transition: height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-list a:hover {
  background: var(--panel-2);
  color: var(--text);
  padding-left: var(--spacing-lg);
}

.link-list a:hover::before {
  height: 60%;
}

/* ============ 高級內容區域 ============ */
.content {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

/* ============ 高級卡片設計 ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-glow), transparent);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover::before {
  opacity: 1;
}

.card-head {
  padding: var(--spacing-lg) var(--spacing-lg) 0;
}

.card-head h2 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-body {
  padding: var(--spacing-lg);
}

/* ============ 高級按鈕與表單 ============ */
.row {
  display: flex;
  gap: var(--spacing-md);
  align-items: center;
  flex-wrap: wrap;
}

.label {
  display: block;
  margin-bottom: var(--spacing-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.875rem;
}

input[type="number"] {
  background: rgba(15, 20, 25, 0.8);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--spacing-md);
  width: 120px;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--primary-solid);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn {
  background: var(--primary);
  color: #0a0c0f;
  border: 0;
  border-radius: var(--radius-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: translateY(0);
}

/* ============ 高級骰子設計 ============ */
.dice-results {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-lg);
}

.dice {
  width: 48px;
  height: 48px;
  background-size: cover;
  background-position: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.dice::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary-glow), var(--accent-glow));
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.dice:hover {
  transform: translateY(-4px) scale(1.05);
}

.dice:hover::before {
  opacity: 1;
}

/* ============ 高級遊戲卡片網格 ============ */
.game-grid {
  column-gap: var(--spacing-lg);
  column-count: 1;
}

@media (min-width: 720px) {
  .game-grid {
    column-count: 2;
  }
}

@media (min-width: 1200px) {
  .game-grid {
    column-count: 3;
  }
}

.game {
  break-inside: avoid;
  margin: 0 0 var(--spacing-lg);
}

.game-summary {
  cursor: pointer;
  padding: var(--spacing-lg);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.game-summary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--panel-hover);
  opacity: 0;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
}

.game-summary:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--border-glow);
}

.game-summary:hover::before {
  opacity: 1;
}

.game-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.star {
  color: var(--accent-glow);
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.6));
  font-size: 1.1em;
}

.badges {
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
}

.badge {
  padding: var(--spacing-xs) var(--spacing-sm);
  background: rgba(148, 163, 184, 0.1);
  color: var(--muted);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

/* ============ 高級 Modal 設計 ============ */
.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1000;
}

.modal.is-open {
  display: block;
  animation: modalFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  animation: backdropFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes backdropFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-panel {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(800px, 100vw);
  max-height: 90vh;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  animation: panelSlideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelSlideUp {
  from {
    transform: translateX(-50%) translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

@media (min-width: 960px) {
  .modal-panel {
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%);
    border-radius: var(--radius-lg);
    max-height: 80vh;
    animation: panelZoomIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes panelZoomIn {
    from {
      transform: translate(-50%, -50%) scale(0.9);
      opacity: 0;
    }
    to {
      transform: translate(-50%, -50%) scale(1);
      opacity: 1;
    }
  }
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(15, 20, 25, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--spacing-sm);
  align-items: start;
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border);
}

.modal-tools {
  display: flex;
  gap: var(--spacing-sm);
  align-items: center;
}

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: var(--spacing-sm);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.icon-btn:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  transform: scale(1.05);
}

.modal-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.modal-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.75rem;
  line-height: 1;
  padding: var(--spacing-sm);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-close:hover {
  background: rgba(148, 163, 184, 0.1);
  color: var(--text);
  transform: scale(1.1);
}

.modal-meta {
  color: var(--muted);
  font-size: 0.875rem;
  grid-column: 1 / -1;
  display: flex;
  gap: var(--spacing-sm);
  flex-wrap: wrap;
  margin-top: var(--spacing-sm);
}

.modal-content {
  padding: var(--spacing-lg);
  line-height: 1.8;
  color: var(--text-secondary);
}

.modal-content a {
  color: var(--primary-solid);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-content a:hover {
  border-bottom-color: var(--primary-solid);
}

.modal-content ol,
.modal-content ul {
  padding-left: var(--spacing-lg);
}

/* ============ 回到頂部與動作連結 ============ */
.actions {
  margin-top: var(--spacing-md);
}

.action-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-link:hover {
  color: var(--text);
}

/* ============ 高級響應式優化 ============ */
@media (max-width: 768px) {
  
  .hero {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
  }
  
  .toolbar {
    flex-direction: column;
    gap: var(--spacing-md);
  }
  
  .input-wrap {
    min-width: auto;
  }
  
  .select-wrap {
    min-width: auto;
  }
  
  .btn.ghost {
    align-self: stretch;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .container {
    width: calc(100% - var(--spacing-md));
  }
  
  .brand {
    font-size: 1.75rem;
  }
  
  .pills {
    padding: var(--spacing-sm) 0;
  }
  
  .pill {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.8rem;
  }
}

/* ============ 高級載入動畫 ============ */
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.loading {
  animation: shimmer 1.2s ease-in-out infinite;
  background: linear-gradient(90deg, var(--panel) 25%, var(--panel-2) 50%, var(--panel) 75%);
  background-size: 468px 100%;
}

/* ============ 高級微動畫 ============ */
@media (prefers-reduced-motion: no-preference) {
  .game-summary {
    animation: float 6s ease-in-out infinite;
  }
  
  .game-summary:nth-child(2n) {
    animation-delay: -2s;
  }
  
  .game-summary:nth-child(3n) {
    animation-delay: -4s;
  }
  
  @keyframes float {
    0%, 100% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-4px);
    }
  }
}

/* ============ 高級焦點樣式 ============ */
.pill:focus,
.nav-link:focus,
.btn:focus,
input:focus,
.game-summary:focus {
  outline: 2px solid var(--primary-solid);
  outline-offset: 2px;
}

/* ============ 高級選擇樣式 ============ */
::selection {
  background: var(--primary-glow);
  color: var(--text);
}

