/* ==========================================================================
   zemalgo.com - Master Harmonized Minimalist Stylesheet
   ========================================================================== */

:root {
  /* Color Palette - Dark Gray Theme with Warm Beige Accents */
  --bg: #09090b;
  --bg-surface: #121215;
  --bg-surface-hover: #18181d;
  --text-main: #f5f2eb;
  --text-muted: #a89f91;
  --text-dim: #6b6357;
  --border: #22201e;
  --border-hover: #383430;
  --accent-cyan: #d4b483;
  --accent-emerald: #588157;
  
  /* Fonts */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Border Radii */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Standardized Typography Scale */
  --font-h1: 2.2rem;
  --font-h2: 1.2rem;
  --font-body: 0.95rem;
  --font-sub: 0.88rem;
  --font-mono-tag: 0.8rem;
  --font-mono-sm: 0.74rem;

  /* Standardized Spacing Scale */
  --gap-xs: 8px;
  --gap-sm: 16px;
  --gap-md: 18px;
  --gap-lg: 32px;
  --gap-xl: 40px;
  --gap-xxl: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg);
  color: var(--text-main);
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
  min-height: 100vh;
}

/* Background Canvas */
#bg-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
}

/* Layout Wrapper */
.wrapper {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 24px 72px;
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--font-mono-tag);
}

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

/* Pixel-Perfect Master Header Navigation */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 44px;
  margin-bottom: var(--gap-xl);
}

.header-left {
  display: flex;
  align-items: center;
  line-height: 1;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1;
  min-width: 58px;
  height: 36px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.4px;
  line-height: 1;
}

.logo-mark {
  width: 24px;
  height: 24px;
  color: var(--accent-cyan);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.logo:hover .logo-mark {
  transform: scale(1.08);
}

.return-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1;
  transition: color 0.15s ease, transform 0.15s ease;
  display: inline-flex;
  align-items: center;
}

.return-link:hover {
  color: var(--text-main);
  transform: translateX(-2px);
}

.return-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.return-btn.icon-only {
  width: 58px;
  height: 36px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none !important;
}

.return-icon-svg {
  width: 26px;
  height: 26px;
  stroke: #ffffff;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35));
  transition: transform 0.2s ease, filter 0.2s ease, stroke 0.2s ease;
}

.return-btn.icon-only:hover .return-icon-svg {
  stroke: var(--accent-cyan);
  transform: translateX(-4px) scale(1.1);
  filter: drop-shadow(0 0 20px rgba(212, 180, 131, 0.85));
}

/* Hero & Page Title Sections */
.hero, .page-title-section {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.hero-logo-emblem {
  width: 52px;
  height: 52px;
  color: var(--accent-cyan);
  margin-bottom: 16px;
  filter: drop-shadow(0 0 16px rgba(212, 180, 131, 0.45));
  transition: transform 0.3s ease, filter 0.3s ease;
}

.title-right-emblem-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: none;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
}

.title-right-emblem {
  width: 58px;
  height: 58px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 20px rgba(212, 180, 131, 0.5));
  flex-shrink: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
  user-select: none;
}

.title-right-emblem-link:hover .title-right-emblem,
.title-right-emblem:hover {
  transform: scale(1.08) rotate(15deg);
  filter: drop-shadow(0 0 30px rgba(212, 180, 131, 0.85));
}

.title-right-emblem:hover {
  transform: scale(1.08) rotate(15deg);
  filter: drop-shadow(0 0 30px rgba(212, 180, 131, 0.8));
}

.steam-link-text {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease, transform 0.15s ease;
}

.steam-link-text:hover {
  color: var(--accent-cyan);
  transform: translateX(2px);
}

.hero-logo-emblem:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 24px rgba(212, 180, 131, 0.65));
}

.hero-heading {
  font-size: var(--font-h1);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
  color: var(--accent-cyan);
}

.hero-heading span.text-muted {
  color: var(--accent-cyan);
  opacity: 0.85;
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 8px;
  opacity: 0.9;
}

.page-eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(212, 180, 131, 0.6);
}

.page-title {
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -1px;
  margin: 0 0 4px 0;
  color: var(--accent-cyan);
  min-height: 48px;
  display: flex;
  align-items: flex-start;
}

.text-muted { color: var(--text-muted); }

.hero-text {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 300;
  line-height: 1.6;
}

.page-subtitle {
  font-size: 1.08rem;
  color: var(--text-main);
  font-weight: 500;
  line-height: 1.5;
  max-width: 600px;
  opacity: 0.92;
}

.hero-text strong { color: var(--text-main); font-weight: 500; }

/* Quick Name & Pronunciation Button on Index Bottom */
.bottom-name-bar {
  display: flex;
  width: 100%;
  margin-top: 32px;
}

.name-quick-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}

.name-quick-btn:hover {
  transform: translateY(-2px);
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  border-left-color: var(--accent-cyan);
}

.name-quick-btn .btn-arrow {
  color: var(--accent-cyan);
  transition: transform 0.15s ease;
}

.name-quick-btn:hover .btn-arrow {
  transform: translateX(3px);
}

/* Standardized Sections & Labels */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  margin-bottom: var(--gap-xl);
}

.section {
  margin-bottom: var(--gap-xl);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--border);
}

.workshop-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  color: var(--accent-cyan) !important;
  text-decoration: none !important;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.workshop-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(212, 180, 131, 0.07);
  border: 1px solid rgba(212, 180, 131, 0.28);
  padding: 8px 16px;
  border-radius: 100px;
  color: var(--text-main) !important;
  text-decoration: none !important;
  font-size: 0.84rem;
  font-weight: 500;
  line-height: 1;
  box-sizing: border-box;
  transition: transform 0.15s ease, border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.workshop-profile-pill:hover,
.workshop-profile-pill:visited,
.workshop-profile-pill:active,
.workshop-profile-pill:focus {
  text-decoration: none !important;
}

.workshop-profile-pill:hover {
  transform: translateY(-1px);
  background: rgba(212, 180, 131, 0.15);
  border-color: rgba(212, 180, 131, 0.55);
  color: var(--accent-cyan) !important;
}

.workshop-btn:hover, .workshop-btn:visited, .workshop-btn:active {
  color: var(--accent-cyan) !important;
  background: var(--bg-surface-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.section-label {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.84rem;
  margin-bottom: var(--gap-sm);
  letter-spacing: 1.2px;
}

/* --------------------------------------------------------------------------
   Hub Grid (index.html)
   -------------------------------------------------------------------------- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--gap-sm);
}

.hub-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--text-main);
  transition: border-color 0.15s ease, background-color 0.15s ease;
  min-height: 205px;
  height: 100%;
}

.hub-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.hub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  height: 26px;
}

.hub-num { font-size: 0.82rem; font-weight: 500; color: var(--text-dim); }
.hub-icon { font-size: 1.35rem; }

.hub-title {
  font-size: var(--font-h2);
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
  height: 28px;
  display: flex;
  align-items: center;
}

.hub-desc {
  font-size: var(--font-sub);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
  min-height: 44px;
}

.hub-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: auto;
}

.hub-card:hover .hub-footer { color: var(--text-muted); }
.hub-card:hover .arrow { color: var(--accent-cyan); transform: translateX(3px); transition: transform 0.15s ease; }

.toast.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Name / Pronunciation Page (name.html)
   -------------------------------------------------------------------------- */

.pronounce-hero-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-align: center;
  margin-bottom: 0;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pronounce-hero-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.ipa-badge {
  display: inline-block;
  color: var(--accent-cyan);
  background: rgba(212, 180, 131, 0.1);
  border: 1px solid rgba(212, 180, 131, 0.25);
  padding: 2px 10px;
  border-radius: 100px;
  margin-bottom: 8px;
  font-size: 0.74rem;
}

.big-phonetic {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.phonetic-subtitle {
  font-size: 0.88rem;
  color: var(--text-main);
  font-weight: 400;
  margin-bottom: 12px;
}

.phonetic-subtitle strong {
  color: var(--accent-cyan);
  font-weight: 600;
}

.speech-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--text-main);
  color: var(--bg);
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
  transition: transform 0.15s ease, background 0.15s ease;
}

.speak-btn:hover {
  transform: translateY(-1px);
  background: #ffffff;
}

.audio-wave-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 16px;
  margin-top: 14px;
  flex-shrink: 0;
}

.wave-bar {
  width: 3px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 4px;
  transform: scaleY(0.28);
  transform-origin: center;
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.audio-wave-box.playing .wave-bar {
  animation: wave-anim 0.6s infinite alternate ease-in-out;
}

.audio-wave-box.playing .wave-bar:nth-child(2) { animation-delay: 0.1s; }
.audio-wave-box.playing .wave-bar:nth-child(3) { animation-delay: 0.2s; }
.audio-wave-box.playing .wave-bar:nth-child(4) { animation-delay: 0.3s; }
.audio-wave-box.playing .wave-bar:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave-anim {
  0% { transform: scaleY(0.28); background: var(--text-muted); }
  100% { transform: scaleY(1); background: var(--accent-cyan); }
}

/* Guidelines Section */
.guidelines-container {
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  gap: 10px;
}

.guideline-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  min-height: 48px;
  box-sizing: border-box;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.guideline-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  border-left-color: var(--accent-cyan);
}

.guideline-num {
  color: var(--accent-cyan);
  background: rgba(212, 180, 131, 0.12);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  flex-shrink: 0;
}

.guideline-content {
  font-size: 0.92rem;
  color: var(--text-main);
  line-height: 1.45;
  display: flex;
  align-items: center;
}

.guideline-content p { margin: 0; }

/* Notice Banner */
.global-notice-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  font-size: var(--font-sub);
  color: var(--text-muted);
  line-height: 1.45;
}

.global-notice-box strong { color: var(--text-main); }
.notice-icon { font-size: 1rem; margin-top: 1px; }

.lang-search-box, .search-filter-box {
  margin-bottom: 16px;
}

/* Transcriptions Grid */
.transcriptions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  justify-content: center;
}

.lang-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  text-align: center;
  height: 120px !important;
  box-sizing: border-box;
}

.lang-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.lang-header {
  height: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1px;
}

.lang-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.native-script {
  color: var(--text-muted);
  font-size: 0.74rem;
  line-height: 1.2;
}

.lang-script {
  height: 40px;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.3;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  white-space: nowrap;
}

.lang-script.compact {
  font-size: 0.88rem;
  line-height: 1.3;
}

.lang-script.rtl {
  direction: rtl;
  text-align: center;
  justify-content: center;
}

.lang-note {
  height: 14px;
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Tools Page (tools.html)
   -------------------------------------------------------------------------- */
.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: var(--gap-md);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.tool-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-surface-hover);
}

.tool-card-header {
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.tool-tag { color: var(--text-dim); display: block; margin-bottom: 4px; }
.tool-card-header h2 { font-size: var(--font-h2); font-weight: 600; }

.tool-textarea {
  width: 100%;
  height: 110px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-sans);
  padding: 14px;
  font-size: var(--font-body);
  outline: none;
  resize: vertical;
  margin-bottom: 14px;
}

.tool-textarea:focus { border-color: var(--border-hover); }

.text-stats {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 0.82rem;
}

.text-stats strong { color: var(--text-main); }

.tool-btn-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tool-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
}

.tool-btn.active {
  background: var(--accent-cyan);
  color: #09090b;
  font-weight: 600;
  border-color: var(--accent-cyan);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.input-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tool-input, .tool-select {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.glass-box {
  background: rgba(9, 9, 11, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.res-row {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-sub);
  color: var(--text-muted);
  padding: 4px 0;
}

/* --------------------------------------------------------------------------
   Dynamic Modular Tool Docks (tools.html)
   -------------------------------------------------------------------------- */
.tool-card {
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.dock-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dock-action-btn {
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.dock-action-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-hover);
}

.dock-action-btn.remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.35);
}

/* Bottom Add Dock Search Bar & Catalog */
.add-dock-section {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-top: 32px;
  margin-bottom: 40px;
}

.add-dock-search-box {
  position: relative;
  margin-bottom: 20px;
}

.add-dock-search-input {
  width: 100%;
  padding: 14px 18px 14px 44px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.add-dock-search-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(212, 180, 131, 0.2);
}

.add-dock-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
}

.dock-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.catalog-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.catalog-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.catalog-card-info h3 {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.catalog-card-info p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.add-btn {
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-hover);
  color: var(--accent-cyan);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.add-btn:hover {
  background: var(--accent-cyan);
  color: #09090b;
}

/* Palette Swatches */
.palette-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.palette-swatch {
  height: 64px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  transition: transform 0.15s ease;
}

.palette-swatch:hover {
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   Links Page (links.html)
   -------------------------------------------------------------------------- */
.profile-header {
  margin-bottom: var(--gap-lg);
}

.profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface-hover);
  border: 1px solid var(--border-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.profile-logo-mark {
  width: 36px;
  height: 36px;
  color: var(--accent-cyan);
  filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.4));
}

.profile-title { font-size: 1.8rem; font-weight: 700; margin-bottom: 4px; }
.profile-handle { color: var(--text-muted); margin-bottom: 12px; }
.profile-bio { font-size: 0.95rem; color: var(--text-muted); max-width: 480px; margin: 0 auto 20px; }

.btn-sm-minimal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 6px 14px;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm-minimal:hover { background: var(--bg-surface-hover); border-color: var(--border-hover); }

.search-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
}

.search-input:focus { border-color: var(--border-hover); }

.links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  min-height: 52px;
  text-decoration: none !important;
  color: var(--text-main);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.link-item:hover,
.link-item:visited,
.link-item:active,
.link-item:focus {
  text-decoration: none !important;
}

.link-item:hover {
  background: var(--bg-surface-hover);
  border-color: rgba(212, 180, 131, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}

.link-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.link-icon-box {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.link-item:hover .link-icon-box {
  background: rgba(212, 180, 131, 0.1);
  border-color: rgba(212, 180, 131, 0.3);
}

.link-name {
  font-weight: 500;
  font-size: 0.92rem;
  color: var(--text-main);
  letter-spacing: -0.2px;
}

.link-arrow {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: transform 0.2s ease, color 0.2s ease;
}

.link-item:hover .link-arrow {
  transform: translateX(4px);
  color: var(--accent-cyan);
}
.link-sub { font-size: 0.8rem; }
/* Mod Gallery Showcase Grid (Equal Card Dimensions) */
.mods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  grid-auto-rows: 1fr;
  gap: 20px;
  align-items: stretch;
}

.mod-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: var(--text-main);
}

.mod-card:hover {
  background: var(--bg-surface-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.mod-thumb-wrapper {
  position: relative;
  width: 100%;
  height: 185px;
  flex-shrink: 0;
  overflow: hidden;
  background: #18181c;
}

.mod-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.mod-card:hover .mod-thumb {
  transform: scale(1.05);
}

.mod-game-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(9, 9, 11, 0.88);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.mod-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.mod-card-title {
  font-size: 0.98rem;
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.25;
  min-height: 2.4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mod-card-desc {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
  min-height: 2.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.mod-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-cyan);
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: auto;
}

/* Standardized Footer & Toast */
.footer {
  margin-top: var(--gap-xxl);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  padding-top: var(--gap-md);
  border-top: 1px solid var(--border);
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
}

.footer-link-arrow {
  display: inline-block;
  line-height: 1;
  transform: translateY(-1.5px);
  transition: transform 0.15s ease;
}

.footer-link:hover { color: var(--text-main); }
.footer-link:hover .footer-link-arrow {
  transform: translate(-3px, -1.5px);
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1c1c1e;
  border: 1px solid var(--border-hover);
  color: var(--text-main);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.toast.hidden {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Transcriptions List View (Master Minimalist List Rows)
   -------------------------------------------------------------------------- */
.transcriptions-list {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.lang-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  border-bottom: 1px solid var(--border);
  transition: background-color 0.15s ease;
  height: 56px !important; /* Strict 100% equal height across all rows */
  min-height: 56px;
  box-sizing: border-box;
}

.lang-row:last-child {
  border-bottom: none;
}

.lang-row:hover {
  background: var(--bg-surface-hover);
}

.row-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
}

.lang-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.native-script {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1px;
  text-align: right;
}

.lang-script {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

.lang-script.compact {
  font-size: 0.82rem;
  line-height: 1.25;
}

.lang-script.rtl {
  direction: rtl;
}

.lang-note {
  font-size: 0.7rem;
  color: var(--text-dim);
  line-height: 1.2;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   404 Error Card (Desktop)
   -------------------------------------------------------------------------- */
.error-hero-card {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.error-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 12px auto 8px auto;
  color: var(--accent-cyan) !important;
  text-align: center;
  width: 100%;
}

.error-subtitle {
  max-width: 480px;
  margin: 0 auto 24px auto;
  white-space: normal;
  line-height: 1.5;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Mobile App & Small Device Optimization (@media max-width: 600px)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
  .wrapper {
    padding: 20px 14px 48px;
  }

  /* Compact Mobile Header */
  .header {
    margin-bottom: 24px;
  }
  .logo { font-size: 1.05rem; }
  .page-badge { font-size: 0.78rem; }
  .back-link { font-size: 0.78rem; }

  /* Page Title Section */
  .hero, .page-title-section {
    margin-bottom: 24px;
  }
  .hero-heading, .page-title {
    font-size: 1.65rem;
    margin-bottom: 2px;
    letter-spacing: -0.5px;
    min-height: auto;
  }
  .hero-text, .page-subtitle {
    font-size: 0.88rem;
    line-height: 1.45;
  }

  /* Pronunciation Hero Card */
  .pronounce-hero-card {
    padding: 18px 14px !important;
    min-height: 185px !important;
    height: auto !important;
    margin-bottom: 0;
  }
  .hero-card-badge, .ipa-badge {
    font-size: 0.68rem;
    padding: 2px 8px;
    margin-bottom: 8px;
    white-space: nowrap;
  }
  .hero-card-title, .big-phonetic {
    font-size: 1.45rem;
    margin-bottom: 6px;
    white-space: nowrap;
  }
  .hero-card-subtitle, .phonetic-subtitle {
    font-size: 0.8rem;
    margin-bottom: 14px;
    line-height: 1.35;
    white-space: nowrap;
  }
  .speech-controls {
    margin-bottom: 0;
  }
  .hero-card-btn, .speak-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
  }
  .audio-wave-box {
    margin-top: 12px;
  }

  /* 404 Error Card Mobile Rules */
  .error-hero-card {
    padding: 28px 16px !important;
    min-height: 180px !important;
    height: auto !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }
  .error-title {
    font-size: 1.45rem !important;
    margin: 8px auto 6px auto !important;
    white-space: normal !important;
    text-align: center !important;
    width: 100% !important;
    word-break: break-word !important;
    color: var(--accent-cyan) !important;
  }
  .error-subtitle {
    font-size: 0.82rem !important;
    margin: 0 auto 20px auto !important;
    white-space: normal !important;
    text-align: center !important;
    line-height: 1.4 !important;
    width: 100% !important;
  }

  /* Section Spacing & Labels */
  .section {
    margin-bottom: 28px;
    padding-top: 16px;
  }
  .section-label {
    margin-bottom: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 1.2px;
  }

  /* Guidelines Cards */
  .guidelines-container {
    gap: 8px;
  }
  .guideline-card {
    padding: 10px 12px;
    gap: 10px;
    min-height: 54px;
    height: 100%;
    align-items: center;
    box-sizing: border-box;
  }
  .guideline-num {
    padding: 2px 6px;
    font-size: 0.75rem;
    flex-shrink: 0;
  }
  .guideline-content {
    font-size: 0.85rem;
    line-height: 1.4;
  }

  /* Global Notice Box */
  .global-notice-box {
    padding: 10px 12px;
    gap: 8px;
    font-size: 0.78rem;
    line-height: 1.4;
    margin-bottom: 14px;
  }
  .notice-icon { font-size: 0.95rem; }

  /* Transcriptions List - Master Minimalist Mobile Rows */
  .lang-search-box, .search-filter-box {
    margin-bottom: 14px;
  }
  .search-input {
    font-size: 0.82rem;
    padding: 10px 14px;
    text-overflow: ellipsis;
  }
  .lang-row {
    padding: 8px 14px;
    height: 54px !important;
    min-height: 54px;
  }
  .row-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
  }
  .row-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 1px;
    text-align: right;
  }
  .lang-name { font-size: 0.85rem; line-height: 1.2; }
  .native-script { font-size: 0.74rem; line-height: 1.2; }
  .lang-script { font-size: 1.05rem; line-height: 1.2; }
  .lang-script.compact { font-size: 0.8rem; line-height: 1.25; }
  .lang-note { font-size: 0.7rem; line-height: 1.2; }

  /* Hub Cards (3 Columns Side-by-Side on Mobile) */
  .hub-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .hub-card {
    padding: 14px 8px 12px;
    min-height: 142px;
    height: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-sizing: border-box;
  }
  .hub-card-header {
    margin-bottom: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: auto;
    width: 100%;
  }
  .hub-num {
    font-size: 0.72rem;
    line-height: 1;
    font-weight: 500;
    color: var(--text-dim);
  }
  .hub-icon {
    font-size: 1.45rem;
    line-height: 1;
    display: block;
    margin: 4px 0 2px;
  }
  .hub-title {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.25;
    margin-bottom: 10px;
    text-align: center;
    height: auto;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
  }
  .hub-desc { display: none; }
  .hub-footer {
    padding-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    justify-content: center;
    width: 100%;
    margin-top: auto;
    border-top: 1px solid var(--border);
  }
  .hub-footer span:first-child { display: none; }
  
  .tool-card {
    padding: 18px 14px;
    margin-bottom: 16px;
  }

  /* Bottom Quick Access Button Spans 100% Grid Width on Mobile */
  .bottom-name-bar {
    width: 100%;
    margin-top: 16px;
  }

  .name-quick-btn {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    font-size: 0.78rem;
  }

  /* Footer */
  .footer {
    margin-top: 36px;
    padding-top: 18px;
    font-size: 0.78rem;
  }
}




