/* ========== RESET & BASE ========== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-primary: #0f1020;
  --bg-secondary: #171830;
  --bg-card: #1e2044;
  --bg-card-hover: #282a58;
  --bg-input: #222450;
  --border-subtle: rgba(130, 135, 255, 0.2);
  --border-accent: rgba(130, 135, 255, 0.5);
  --text-primary: #f0f0ff;
  --text-secondary: #b8b8e0;
  --text-muted: #8888bb;
  --accent-primary: #818cf8;
  --accent-secondary: #c084fc;
  --accent-tertiary: #f472b6;
  --accent-success: #34d399;
  --accent-warning: #fbbf24;
  --accent-danger: #f87171;
  --gradient-main: linear-gradient(135deg, #818cf8 0%, #c084fc 50%, #f472b6 100%);
  --gradient-card: linear-gradient(145deg, rgba(129, 140, 248, 0.1) 0%, rgba(192, 132, 252, 0.05) 100%);
  --shadow-glow: 0 0 40px rgba(129, 140, 248, 0.2);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-subtle);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-base: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 350ms cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-base);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hidden {
  display: none !important;
}

/* ========== LOADING SCREEN ========== */
#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loader-content {
  text-align: center;
}

.loader-icon {
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }
}

.loader-content h2 {
  font-size: 1.5rem;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.loader-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.progress-bar {
  width: 300px;
  height: 4px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  margin: 0 auto;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gradient-main);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* ========== HEADER ========== */
header {
  position: relative;
  padding: 28px 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  overflow: hidden;
}

.header-glow {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 300px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-icon {
  font-size: 2.4rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-6px);
  }
}

.logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pro-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--gradient-main);
  -webkit-text-fill-color: white;
  vertical-align: super;
  letter-spacing: 1px;
}

.subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.header-stats {
  display: flex;
  gap: 10px;
}

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.stat-icon {
  font-size: 1rem;
}

/* ========== TAB NAVIGATION ========== */
.tab-nav {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 6px 0;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-base);
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}

.tab:hover {
  color: var(--text-secondary);
  background: rgba(99, 102, 241, 0.06);
}

.tab.active {
  color: var(--text-primary);
  background: var(--bg-card);
  box-shadow: 0 0 0 1px var(--border-accent), var(--shadow-glow);
}

.tab-icon {
  font-size: 1.1rem;
}

/* ========== SEARCH CARD ========== */
.panel {
  display: none;
  animation: fadeIn 0.3s ease;
}

.panel.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-card {
  margin-top: 24px;
  padding: 28px;
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card);
}

.strategy-card {
  border-color: rgba(168, 85, 247, 0.25);
}

.search-header h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.search-header p {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.search-input-wrapper {
  margin-top: 20px;
  display: flex;
  align-items: center;
  background: var(--bg-input);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 4px 12px;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15), var(--shadow-glow);
}

.search-icon {
  font-size: 1.2rem;
  margin-right: 8px;
  opacity: 0.6;
}

.search-input-wrapper input[type="text"] {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 500;
  padding: 12px 4px;
  letter-spacing: 1px;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-base);
  font-weight: 400;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  opacity: 0;
  pointer-events: none;
}

.clear-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.clear-btn:hover {
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

/* ========== FILTERS ========== */
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.filter-label,
.sort-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-label {
  margin-left: auto;
}

.filter-num {
  width: 60px;
  padding: 6px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: center;
  outline: none;
  transition: border-color var(--transition-fast);
}

.filter-num:focus {
  border-color: var(--accent-primary);
}

.filter-select {
  padding: 6px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-base);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

.filter-select:focus {
  border-color: var(--accent-primary);
}

/* ========== DUAL SEARCH LAYOUT ========== */
.dual-search {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  align-items: flex-end;
}

.dual-search .search-field {
  flex: 1;
}

.dual-search .search-input-wrapper {
  margin-top: 8px;
}

.field-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.search-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 10px;
}

.divider-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* Suffix highlight different color */
.word-card .word-text .highlight-suffix {
  color: var(--accent-secondary);
  text-decoration: underline;
  text-decoration-color: rgba(168, 85, 247, 0.4);
  text-underline-offset: 3px;
}

/* ========== ADD WORD ROW ========== */
.add-word-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 12px;
  background: rgba(34, 197, 94, 0.04);
  border: 1px dashed rgba(34, 197, 94, 0.2);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-normal), background var(--transition-normal);
}

.add-word-row:focus-within {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}

.add-icon {
  color: var(--accent-success);
  font-size: 1.1rem;
  font-weight: 700;
  opacity: 0.6;
}

.add-word-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 4px 0;
}

.add-word-row input::placeholder {
  color: var(--text-muted);
  font-family: var(--font-base);
  font-size: 0.82rem;
}

.add-hint {
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity var(--transition-fast);
}

.add-hint.success {
  color: var(--accent-success);
}

.add-hint.error {
  color: var(--accent-danger);
}

/* ========== WORD CARD HIDE BUTTON ========== */
.word-card {
  position: relative;
}

.word-card .hide-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
  z-index: 2;
}

.word-card:hover .hide-btn {
  opacity: 0.6;
}

.word-card .hide-btn:hover {
  opacity: 1;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: var(--accent-danger);
}

/* Custom word badge */
.custom-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--accent-success);
  letter-spacing: 0.5px;
}

/* ========== HIDDEN WORDS SECTION ========== */
.hidden-section {
  margin-top: 20px;
}

.hidden-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-family: var(--font-base);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.hidden-toggle:hover {
  border-color: var(--border-accent);
  color: var(--text-secondary);
}

.toggle-arrow {
  font-size: 0.7rem;
  transition: transform var(--transition-normal);
}

.toggle-arrow.open {
  transform: rotate(180deg);
}

.hidden-grid {
  display: none;
  margin-top: 8px;
}

.hidden-grid.open {
  display: grid;
}

/* Dimmed hidden word cards */
.word-card.hidden-word {
  opacity: 0.45;
  border-style: dashed;
}

.word-card.hidden-word:hover {
  opacity: 0.7;
}

.word-card.hidden-word .hide-btn {
  opacity: 0.5;
}

.word-card.hidden-word .hide-btn:hover {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
  color: var(--accent-success);
}

@media (max-width: 768px) {
  .dual-search {
    flex-direction: column;
    gap: 12px;
  }

  .search-divider {
    padding: 0;
  }
}

/* ========== STRATEGY OPTIONS ========== */
.strategy-options {
  margin-top: 16px;
}

.syl-count-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.syl-buttons {
  display: flex;
  gap: 6px;
}

.syl-btn {
  padding: 6px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-base);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.syl-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
}

.syl-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
}

.strategy-tip {
  margin-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.tip-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.score-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.78rem;
}

.score-badge.low {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-success);
}

.score-badge.medium {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
}

.score-badge.high {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
}

/* ========== RESULTS ========== */
.results-info {
  padding: 10px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========== SECTION HEADERS ========== */
#results-container {
  margin-top: 12px;
}

#results-container.dual-mode {
  display: flex;
  gap: 10px;
}

#results-container.dual-mode .result-section {
  flex: 1;
  min-width: 0;
}

.result-section {
  margin-top: 0;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 6px;
}

.section-icon {
  font-size: 0.9rem;
}

.section-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.section-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-primary);
  font-weight: 600;
}

/* ========== HORIZONTAL SCROLL ROW ========== */
.hscroll-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 2px 0;
}

.hscroll-row::-webkit-scrollbar {
  width: 4px;
}

.hscroll-row::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 4px;
}

/* Pill-style compact cards for hscroll */
.hscroll-row .word-card {
  padding: 5px 10px;
  flex: 0 0 auto;
  min-width: 80px;
  max-width: 180px;
  border-radius: var(--radius-sm);
}

.hscroll-row .word-card .word-text {
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hscroll-row .word-card .word-meaning {
  display: none;
}

.hscroll-row .word-card .word-meta {
  margin-top: 2px;
}

.hscroll-row .word-card .length-badge {
  font-size: 0.6rem;
  padding: 0px 4px;
}

.hscroll-row .word-card .hide-btn {
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  font-size: 0.55rem;
}

.hscroll-row .word-card .custom-badge {
  font-size: 0.55rem;
  padding: 0 3px;
}

.hscroll-row .word-card .strategy-score {
  font-size: 0.6rem;
  padding: 0px 4px;
}

.results-info .count {
  color: var(--accent-primary);
  font-weight: 600;
  font-family: var(--font-mono);
}

.results-info .time {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.results-grid {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 4px;
}

.results-grid::-webkit-scrollbar {
  width: 6px;
}

.results-grid::-webkit-scrollbar-track {
  background: transparent;
}

.results-grid::-webkit-scrollbar-thumb {
  background: var(--border-accent);
  border-radius: 3px;
}

.word-card {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.word-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.word-card:hover {
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.word-card:hover::before {
  opacity: 1;
}

.word-card .word-text {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.word-card .word-text .highlight {
  color: #a5b4fc;
  text-decoration: underline;
  text-decoration-color: rgba(165, 180, 252, 0.5);
  text-underline-offset: 3px;
}

.word-card .word-meaning {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.word-card .word-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.word-card .length-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(129, 140, 248, 0.15);
  color: #a5b4fc;
}

.word-card .strategy-score {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: auto;
}

.word-card .strategy-score.killer {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-success);
}

.word-card .strategy-score.good {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
}

.word-card .strategy-score.meh {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-warning);
}

.word-card .strategy-score.bad {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
}

/* ========== STRATEGY ANALYSIS ========== */
.strategy-analysis {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.analysis-card {
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.analysis-card .analysis-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  margin-bottom: 6px;
}

.analysis-card .analysis-value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.analysis-card .analysis-detail {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--shadow-glow);
  max-width: 520px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  position: relative;
  transform: scale(0.95) translateY(10px);
  transition: transform var(--transition-smooth);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  color: var(--accent-danger);
  border-color: var(--accent-danger);
}

.modal-word {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.modal-section {
  margin-top: 16px;
}

.modal-section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-section-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.modal-badge {
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ========== FOOTER ========== */
footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: 8px 16px;
    flex-shrink: 0;
  }

  .search-card {
    padding: 20px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .filter-row {
    gap: 8px;
  }

  .sort-label {
    margin-left: 0;
  }

  .strategy-analysis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 1.3rem;
  }

  .search-input-wrapper input[type="text"] {
    font-size: 1rem;
  }

  .strategy-analysis {
    grid-template-columns: 1fr;
  }
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.88rem;
}

/* ========== ANIMATIONS ========== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.word-card {
  animation: slideUp 0.2s ease forwards;
}

/* Stagger animation for cards */
.word-card:nth-child(1) {
  animation-delay: 0ms;
}

.word-card:nth-child(2) {
  animation-delay: 15ms;
}

.word-card:nth-child(3) {
  animation-delay: 30ms;
}

.word-card:nth-child(4) {
  animation-delay: 45ms;
}

.word-card:nth-child(5) {
  animation-delay: 60ms;
}

.word-card:nth-child(6) {
  animation-delay: 75ms;
}

.word-card:nth-child(7) {
  animation-delay: 90ms;
}

.word-card:nth-child(8) {
  animation-delay: 105ms;
}

.word-card:nth-child(9) {
  animation-delay: 120ms;
}

.word-card:nth-child(10) {
  animation-delay: 135ms;
}

/* No results animation */
.no-results {
  grid-column: 1 / -1;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.modal-section {
  margin-top: 16px;
}

.modal-section-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 6px;
}

.modal-section-content {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.modal-badge {
  padding: 4px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

/* ========== FOOTER ========== */
footer {
  margin-top: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

footer p {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab {
    padding: 8px 16px;
    flex-shrink: 0;
  }

  .search-card {
    padding: 20px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .filter-row {
    gap: 8px;
  }

  .sort-label {
    margin-left: 0;
  }

  .strategy-analysis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .logo h1 {
    font-size: 1.3rem;
  }

  .search-input-wrapper input[type="text"] {
    font-size: 1rem;
  }

  .strategy-analysis {
    grid-template-columns: 1fr;
  }
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.empty-state p {
  font-size: 0.88rem;
}

/* ========== ANIMATIONS ========== */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.word-card {
  animation: slideUp 0.2s ease forwards;
}

/* Stagger animation for cards */
.word-card:nth-child(1) {
  animation-delay: 0ms;
}

.word-card:nth-child(2) {
  animation-delay: 15ms;
}

.word-card:nth-child(3) {
  animation-delay: 30ms;
}

.word-card:nth-child(4) {
  animation-delay: 45ms;
}

.word-card:nth-child(5) {
  animation-delay: 60ms;
}

.word-card:nth-child(6) {
  animation-delay: 75ms;
}

.word-card:nth-child(7) {
  animation-delay: 90ms;
}

.word-card:nth-child(8) {
  animation-delay: 105ms;
}

.word-card:nth-child(9) {
  animation-delay: 120ms;
}

.word-card:nth-child(10) {
  animation-delay: 135ms;
}

/* No results animation */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.no-results .no-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
} 
 
/* ========== MINI MODE (GAMING) OVERHAUL ========== */
body.mini-mode header {
  padding: 0;
  border: none;
  background: transparent;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 100;
}
body.mini-mode .header-glow, 
body.mini-mode .logo,
body.mini-mode .stat-chip,
body.mini-mode .install-btn,
body.mini-mode .tab-nav,
body.mini-mode .search-header { 
  display: none !important; 
}
body.mini-mode header > .container {
  padding: 0;
  margin: 0;
}
body.mini-mode .container {
  padding: 0 8px; /* Extra tight horizontal padding */
}
body.mini-mode .search-card {
  margin-top: 45px; /* Leave space for the toggle button */
  padding: 12px;
  border-radius: var(--radius-md);
}
body.mini-mode .dual-search {
  margin-top: 0;
  gap: 8px;
  flex-direction: column;
  align-items: stretch;
}
body.mini-mode .dual-search .search-field {
  margin-bottom: 0;
  width: 100%;
}
body.mini-mode .search-input-wrapper {
  margin-top: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
body.mini-mode .search-input-wrapper input[type="text"] {
  padding: 4px;
  font-size: 1.05rem;
}
body.mini-mode .search-icon {
  font-size: 1.1rem;
  margin-right: 8px;
}
body.mini-mode .clear-btn {
  font-size: 1.1rem;
  padding: 2px 6px;
}
body.mini-mode .field-label {
  font-size: 0.75rem;
}
body.mini-mode .search-divider {
  display: none; /* Hide the completely unnecessary '+' divider in mini mode */
}
body.mini-mode .filter-row {
  margin-top: 10px;
  gap: 6px;
  justify-content: space-between;
}
body.mini-mode .filter-num {
  width: 50px;
  padding: 4px;
  font-size: 0.85rem;
}
body.mini-mode .filter-select {
  padding: 4px 8px;
  font-size: 0.85rem;
}
body.mini-mode .filter-label, 
body.mini-mode .sort-label {
  font-size: 0.75rem;
}
body.mini-mode #results-container {
  margin-top: 8px;
}

body.mini-mode .section-header {
  padding: 6px 10px;
  margin-bottom: 6px;
}
body.mini-mode .section-title {
  font-size: 0.85rem;
}
body.mini-mode .hscroll-row {
  max-height: calc(100vh - 190px);
  padding-bottom: 12px;
}
body.mini-mode .results-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px;
  max-height: calc(100vh - 190px);
  padding-right: 4px;
  padding-bottom: 12px;
}
body.mini-mode .word-card {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}
body.mini-mode .word-card .word-text {
  font-size: 0.9rem;
  margin-bottom: 4px;
}
body.mini-mode .word-card .word-meta {
  margin-top: 4px;
}
body.mini-mode .word-card .length-badge {
  font-size: 0.65rem;
  padding: 2px 4px;
}
body.mini-mode .word-card .strategy-score {
  font-size: 0.65rem;
  padding: 2px 4px;
}
body.mini-mode .word-card .hide-btn {
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
}
body.mini-mode .results-info {
  padding: 6px 10px;
  font-size: 0.85rem;
}
body.mini-mode .add-word-row {
  margin-top: 10px;
  padding: 6px 10px;
}
body.mini-mode .add-word-row input {
  font-size: 0.85rem;
  padding: 4px 0;
}
body.mini-mode footer,
body.mini-mode .shortcut-hint {
  display: none;
}


/* Also clean up web mode mobile layout natively */
@media (max-width: 480px) {
  body:not(.mini-mode) .search-card { padding: 16px; }
  body:not(.mini-mode) .word-card { padding: 10px 14px; }
  body:not(.mini-mode) .hscroll-row .word-card { min-width: 80px; }
  body:not(.mini-mode) .dual-search { flex-direction: column; }
}