/* AI slovník — static front-end */

:root {
  --radius: 14px;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-ui: "Plus Jakarta Sans", system-ui, sans-serif;

  /* dark (default + prefers dark) */
  --bg-deep: #0c0d10;
  --bg-card: #14161c;
  --bg-card-hover: #1a1d26;
  --text: #e8eaef;
  --text-muted: #8b919d;
  --accent: #ff4d2e;
  --accent-soft: rgba(255, 77, 46, 0.18);
  --accent-glow: rgba(255, 77, 46, 0.35);
  --accent-card-hover-border: rgba(255, 77, 46, 0.22);
  --accent-card-playing-border: rgba(255, 77, 46, 0.45);
  --accent-mark-border: rgba(255, 77, 46, 0.25);
  --accent-play-hover-bg: rgba(255, 77, 46, 0.32);
  --accent-play-hover-fg: #ff6e52;
  --bonus: #f5b14a;
  --bonus-soft: rgba(245, 177, 74, 0.15);
  --bonus-border: rgba(245, 177, 74, 0.25);
  --bonus-border-hover: rgba(245, 177, 74, 0.4);
  --bonus-playing-border: rgba(245, 177, 74, 0.55);
  --bonus-grad-start: #18151a;
  --bonus-play-hover-bg: rgba(245, 177, 74, 0.28);
  --bonus-play-hover-fg: #ffd089;
  --border: rgba(255, 255, 255, 0.06);
  --shadow-card: 0 18px 40px rgba(0, 0, 0, 0.45);
  --brand-domain: rgba(139, 145, 157, 0.85);
  --skip-fg: #0c0d10;
  --toast-fg: #0c0d10;
  --toast-bg: #e8eaef;
  --toast-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  --page-grad-1: rgba(255, 77, 46, 0.12);
  --page-grad-2: rgba(80, 120, 255, 0.06);
  --noise-opacity: 0.04;
  --theme-toggle-bg: var(--bg-card);
  --theme-toggle-hover: var(--bg-card-hover);
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg-deep: #edeae4;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f3ee;
    --text: #16171c;
    --text-muted: #5e636e;
    --accent: #e04228;
    --accent-soft: rgba(224, 66, 40, 0.12);
    --accent-glow: rgba(224, 66, 40, 0.22);
    --accent-card-hover-border: rgba(224, 66, 40, 0.32);
    --accent-card-playing-border: rgba(224, 66, 40, 0.5);
    --accent-mark-border: rgba(224, 66, 40, 0.3);
    --accent-play-hover-bg: rgba(224, 66, 40, 0.22);
    --accent-play-hover-fg: #c23520;
    --bonus: #c98a16;
    --bonus-soft: rgba(201, 138, 22, 0.14);
    --bonus-border: rgba(201, 138, 22, 0.35);
    --bonus-border-hover: rgba(201, 138, 22, 0.5);
    --bonus-playing-border: rgba(201, 138, 22, 0.65);
    --bonus-grad-start: #faf7f0;
    --bonus-play-hover-bg: rgba(201, 138, 22, 0.22);
    --bonus-play-hover-fg: #a66f0a;
    --border: rgba(0, 0, 0, 0.08);
    --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.07);
    --brand-domain: rgba(94, 99, 110, 0.9);
    --skip-fg: #ffffff;
    --toast-fg: #f5f3ee;
    --toast-bg: #24262c;
    --toast-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    --page-grad-1: rgba(224, 66, 40, 0.08);
    --page-grad-2: rgba(80, 100, 200, 0.06);
    --noise-opacity: 0.025;
    --theme-toggle-bg: var(--bg-card);
    --theme-toggle-hover: var(--bg-card-hover);
    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg-deep: #edeae4;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f3ee;
  --text: #16171c;
  --text-muted: #5e636e;
  --accent: #e04228;
  --accent-soft: rgba(224, 66, 40, 0.12);
  --accent-glow: rgba(224, 66, 40, 0.22);
  --accent-card-hover-border: rgba(224, 66, 40, 0.32);
  --accent-card-playing-border: rgba(224, 66, 40, 0.5);
  --accent-mark-border: rgba(224, 66, 40, 0.3);
  --accent-play-hover-bg: rgba(224, 66, 40, 0.22);
  --accent-play-hover-fg: #c23520;
  --bonus: #c98a16;
  --bonus-soft: rgba(201, 138, 22, 0.14);
  --bonus-border: rgba(201, 138, 22, 0.35);
  --bonus-border-hover: rgba(201, 138, 22, 0.5);
  --bonus-playing-border: rgba(201, 138, 22, 0.65);
  --bonus-grad-start: #faf7f0;
  --bonus-play-hover-bg: rgba(201, 138, 22, 0.22);
  --bonus-play-hover-fg: #a66f0a;
  --border: rgba(0, 0, 0, 0.08);
  --shadow-card: 0 10px 28px rgba(0, 0, 0, 0.07);
  --brand-domain: rgba(94, 99, 110, 0.9);
  --skip-fg: #ffffff;
  --toast-fg: #f5f3ee;
  --toast-bg: #24262c;
  --toast-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  --page-grad-1: rgba(224, 66, 40, 0.08);
  --page-grad-2: rgba(80, 100, 200, 0.06);
  --noise-opacity: 0.025;
  --theme-toggle-bg: var(--bg-card);
  --theme-toggle-hover: var(--bg-card-hover);
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .phrase-card,
  .phrase-card__play,
  .toast,
  body,
  .site-header,
  .page-bg,
  .theme-toggle,
  .share-bar__link {
    transition: none !important;
    animation: none !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background-color: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: no-preference) {
  body {
    transition:
      background-color 0.22s ease,
      color 0.22s ease;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: var(--accent);
  color: var(--skip-fg);
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
}

.skip-link:focus {
  top: 1rem;
}

.page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 80% at 10% -20%, var(--page-grad-1), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 30%, var(--page-grad-2), transparent 50%),
    var(--bg-deep);
}

@media (prefers-reduced-motion: no-preference) {
  .page-bg {
    transition: background 0.22s ease;
  }
}

.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: var(--noise-opacity);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.site-header {
  padding: clamp(1.75rem, 4vw, 3rem) clamp(1.25rem, 4vw, 2.5rem) 1.5rem;
  border-bottom: 1px solid var(--border);
}

@media (prefers-reduced-motion: no-preference) {
  .site-header {
    transition: border-color 0.22s ease;
  }
}

.site-header__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.site-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem 1.5rem;
}

.theme-control {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  max-width: 100%;
}

.theme-control__status {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-align: right;
  line-height: 1.35;
  max-width: 16rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--theme-toggle-bg);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

@media (prefers-reduced-motion: no-preference) {
  .theme-toggle {
    transition:
      background 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease,
      transform 0.15s ease;
  }
}

.theme-toggle:hover {
  background: var(--theme-toggle-hover);
  border-color: var(--accent-card-hover-border);
  color: var(--text);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.theme-toggle:active {
  transform: scale(0.97);
}

.theme-toggle__icon {
  display: none;
  flex-shrink: 0;
}

.theme-toggle[data-icon="sun"] .theme-toggle__icon--sun,
.theme-toggle[data-icon="moon"] .theme-toggle__icon--moon,
.theme-toggle[data-icon="system"] .theme-toggle__icon--system {
  display: block;
}

.brand {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.brand__mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
  border: 1px solid var(--accent-mark-border);
}

.brand__title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.95rem, 4vw, 2.85rem);
  letter-spacing: -0.015em;
  line-height: 1.18;
}

.brand__tagline {
  margin: 0.45rem 0 0;
  color: var(--text-muted);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.55;
  letter-spacing: 0.01em;
}

.brand__domain {
  margin: 0.65rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  color: var(--brand-domain);
}

.main {
  padding: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 4vw, 2.5rem) clamp(2.5rem, 5vw, 4rem);
  max-width: 72rem;
  margin: 0 auto;
}

.dictionary-section {
  margin: 0;
}

.dictionary-section__title {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.dictionary-section__lead {
  margin: 0 0 clamp(1.35rem, 3vw, 1.85rem);
  max-width: 44rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.dictionary-section__lead strong {
  color: var(--text);
  font-weight: 600;
}

.share-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 0 0 clamp(1.35rem, 3vw, 1.85rem);
}

.share-bar__label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.share-bar__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.share-bar__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--theme-toggle-bg);
  color: var(--text);
  box-shadow: var(--shadow-card);
  text-decoration: none;
}

@media (prefers-reduced-motion: no-preference) {
  .share-bar__link {
    transition:
      background 0.2s ease,
      border-color 0.2s ease,
      color 0.2s ease,
      transform 0.15s ease;
  }
}

.share-bar__link:hover {
  background: var(--theme-toggle-hover);
  border-color: var(--accent-card-hover-border);
  color: var(--accent);
}

.share-bar__link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.share-bar__link:active {
  transform: scale(0.97);
}

.share-bar__icon {
  display: block;
  flex-shrink: 0;
}

.phrase-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.5rem), 1fr));
  gap: clamp(1rem, 2.2vw, 1.35rem);
}

.phrase-grid__bonus-wrap {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .phrase-grid__bonus-wrap {
    grid-column: span 2;
  }
}

@media (min-width: 960px) {
  .phrase-grid__bonus-wrap {
    grid-column: span 3;
  }
}

.phrase-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 6.25rem;
  padding: 1.2rem 1.15rem 1.2rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition:
    transform 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

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

.phrase-card:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.phrase-card--playing {
  border-color: var(--accent-card-playing-border);
  box-shadow:
    var(--shadow-card),
    0 0 0 1px var(--accent-glow),
    0 0 28px var(--accent-soft);
}

.phrase-card--bonus {
  border-color: var(--bonus-border);
  background: linear-gradient(145deg, var(--bonus-grad-start) 0%, var(--bg-card) 45%);
}

.phrase-card--bonus:hover {
  border-color: var(--bonus-border-hover);
}

.phrase-card--bonus.phrase-card--playing {
  border-color: var(--bonus-playing-border);
  box-shadow:
    var(--shadow-card),
    0 0 24px var(--bonus-soft);
}

.phrase-card__badge {
  position: absolute;
  top: 0.55rem;
  left: 1rem;
  margin: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bonus);
}

.phrase-card--bonus .phrase-card__text {
  margin-top: 1.1rem;
}

.phrase-card__text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.22rem, 2.4vw, 1.45rem);
  letter-spacing: 0.02em;
  line-height: 1.38;
  flex: 1;
  padding-right: 0.35rem;
}

.phrase-card__play {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.phrase-card__play:hover {
  background: var(--accent-play-hover-bg);
  color: var(--accent-play-hover-fg);
}

.phrase-card__play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.phrase-card--bonus .phrase-card__play {
  background: var(--bonus-soft);
  color: var(--bonus);
}

.phrase-card--bonus .phrase-card__play:hover {
  background: var(--bonus-play-hover-bg);
  color: var(--bonus-play-hover-fg);
}

.phrase-card__play:active {
  transform: scale(0.94);
}

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  max-width: min(90vw, 22rem);
  padding: 0.85rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--toast-fg);
  background: var(--toast-bg);
  border-radius: 12px;
  box-shadow: var(--toast-shadow);
  z-index: 90;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

.toast[hidden] {
  display: block;
  visibility: hidden;
}

.toast.is-visible {
  visibility: visible;
}

#player {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
