:root {
  --bg: #eef3f0;
  --bg-deep: #d9e6df;
  --ink: #14241c;
  --muted: #5a6f64;
  --panel: rgba(255, 252, 248, 0.88);
  --line: rgba(20, 36, 28, 0.12);
  --teal: #0f6b5c;
  --teal-dark: #0a4a3f;
  --amber: #c47a2c;
  --danger: #a33b2d;
  --shadow: 0 18px 40px rgba(20, 36, 28, 0.08);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Nunito Sans", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { font-size: 16px; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #cfe5da 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #f0e2c8 0%, transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-dark); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(238, 243, 240, 0.82);
  border-bottom: 1px solid var(--line);
}

.site-nav {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink) !important;
  letter-spacing: -0.02em;
}

.nav-toggle {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 12px;
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.75rem;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  cursor: pointer;
  touch-action: manipulation;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 1rem;
}

.nav-links[hidden] {
  display: none !important;
}

@media (min-width: 841px) {
  .nav-links[hidden] {
    display: flex !important;
  }
}

.nav-links ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.nav-links a { color: var(--ink); font-weight: 600; }

.auth-links {
  list-style: none;
  display: flex;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  align-items: center;
}

.auth-links a, .link-btn {
  color: var(--ink);
  font-weight: 600;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.nav-cta {
  background: var(--teal) !important;
  color: #fff !important;
  padding: 0.4rem 0.9rem !important;
  border-radius: 999px;
}

.page-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(3rem, env(safe-area-inset-bottom));
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.flash-success {
  background: #dff0e6;
  border: 1px solid #b7d8c5;
  color: var(--teal-dark);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-head h1, .hero h1, .empty-state h2 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  margin: 0.15rem 0 0.4rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--amber);
  margin: 0;
}

.lead, .hero-sub { color: var(--muted); max-width: 38rem; }

.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  min-height: 44px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.85rem; }
.btn-primary { background: var(--teal); color: #fff !important; }
.btn-accent { background: var(--amber); color: #fff !important; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink) !important; }
.btn-danger, .btn.btn-danger { background: var(--danger); color: #fff !important; }
.danger { color: var(--danger) !important; }

.hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 140px);
  padding: 1rem 0 2rem;
}

.brand-mark {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 700;
  margin: 0;
  color: var(--teal-dark);
  line-height: 1;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 500;
  max-width: 14ch;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1.25rem 0;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1rem;
}

.hero-stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.hero-stats span { color: var(--muted); font-size: 0.9rem; }

.hero-visual {
  position: relative;
  min-height: 320px;
}

.hero-card {
  position: absolute;
  width: min(260px, 80%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: float 5s ease-in-out infinite;
}

.hero-card span {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
}

.hero-card em { color: var(--muted); font-style: normal; }
.stack-1 { top: 10%; left: 8%; animation-delay: 0s; }
.stack-2 { top: 38%; left: 28%; animation-delay: 0.4s; }
.stack-3 { top: 66%; left: 12%; animation-delay: 0.8s; }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.feature-strip > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.feature-strip h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.4rem;
}

.feature-strip p { margin: 0; color: var(--muted); }

.day-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 1.15rem;
}

.day-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.day-tile-link {
  display: block;
  padding: 1.2rem 1.2rem 0.8rem;
  color: inherit !important;
}

.day-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.day-tile h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0.35rem 0;
  overflow-wrap: anywhere;
}

.day-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
}

.badge-due {
  color: var(--teal-dark);
  font-weight: 700;
}

.day-tile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.day-tile-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 107, 92, 0.08);
  color: var(--teal-dark) !important;
  border: 1px solid rgba(15, 107, 92, 0.14);
}

.day-tile-actions a:hover {
  background: rgba(15, 107, 92, 0.16);
}

.empty-state, .form-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.empty-state { text-align: center; }

.form-panel { max-width: 720px; }

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.form-group {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.grow { flex: 1; min-width: 180px; }

.form-group label { font-weight: 700; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.form-control {
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  padding: 0.65rem 0.85rem !important;
  background: #fff !important;
  font-size: 16px !important; /* iOS zoom önleme */
  min-height: 44px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.hint { color: var(--muted); font-size: 0.85rem; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }

.word-table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.word-table {
  width: 100%;
  border-collapse: collapse;
}

.word-table th, .word-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.word-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  background: #e4efe9;
  color: var(--teal-dark);
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  margin-right: 0.25rem;
}

.row-actions {
  white-space: nowrap;
  display: flex;
  gap: 0.65rem;
  font-weight: 600;
}

.speak-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  margin-left: 0.25rem;
}

.back-link { margin-top: 1.25rem; }

.mode-switch {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.mode-switch a {
  padding: 0.45rem 0.9rem;
  color: var(--ink);
  font-weight: 700;
}

.mode-switch a.active {
  background: var(--teal);
  color: #fff !important;
}

.study-progress {
  max-width: 520px;
  margin: 0 auto 1rem;
  text-align: center;
}

.study-progress-bar {
  height: 8px;
  background: rgba(20, 36, 28, 0.1);
  border-radius: 999px;
  overflow: hidden;
}

.study-progress-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--teal), #3aa891);
  transition: width 0.25s ease;
}

.flashcard {
  max-width: 520px;
  margin: 0 auto;
}

.flashcard-inner {
  position: relative;
  min-height: 280px;
}

.flashcard-face {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  text-align: center;
  min-height: 280px;
}

.flashcard-face.back {
  display: none;
}

.flashcard.flipped .flashcard-face.front {
  display: none;
}

.flashcard.flipped .flashcard-face.back {
  display: flex;
}

.card-day {
  position: absolute;
  top: 1rem;
  left: 1.2rem;
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 600;
}

.card-prompt, .card-answer {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  margin: 0.5rem 0;
}

.card-hint { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }
.card-extra { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; }
.card-speak { margin-top: 0.75rem; font-weight: 700; color: var(--teal); }

.study-controls {
  max-width: 520px;
  margin: 1.25rem auto 0;
  text-align: center;
}

.nav-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.25rem;
}

.nav-row #btn-prev { justify-self: start; }
.nav-row #btn-next { justify-self: end; }
.nav-row button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.grade-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.grade {
  border: none;
  border-radius: 14px;
  padding: 0.75rem 0.4rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #fff;
}

.grade.again { background: #8b3a32; }
.grade.hard { background: #b06a24; }
.grade.good { background: #1f6f5b; }
.grade.easy { background: #2f6f9f; }

.tag-field {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
  min-height: 0.25rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #e4efe9;
  color: var(--teal-dark);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.tag-remove {
  border: none;
  background: transparent;
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  padding: 0;
}

.tag-add-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.tag-add-row .form-control {
  flex: 1;
}

.mini-list {
  margin: 0;
  padding-left: 1.1rem;
}

.mini-list li { margin: 0.1rem 0; }

.folder-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.folder-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink) !important;
  font-weight: 700;
}

.folder-tab.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff !important;
}

.folder-count, .folder-count-lg {
  display: inline-flex;
  min-width: 1.4rem;
  justify-content: center;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-size: 0.85rem;
}

.folder-tab.active .folder-count {
  background: rgba(255,255,255,0.2);
}

.subfolder-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  border: 1px dashed var(--teal);
  background: rgba(15, 107, 92, 0.06);
  color: inherit !important;
}

.subfolder-card p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.folder-count-lg {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--teal-dark);
  background: #fff;
  padding: 0.35rem 0.7rem;
}

.later-tag {
  background: #f3e4c8 !important;
  color: #8a5a12 !important;
}

.later-btn {
  margin-top: 0.85rem;
  width: 100%;
  max-width: 520px;
  font-weight: 700;
}

.card-pos {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--amber);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inline-form { display: inline; }

.pos-picker-group {
  margin-bottom: 1.25rem;
}

.pos-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pos-btn {
  border: none;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  color: #fff;
  transition: opacity 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.pos-btn.is-active {
  opacity: 1;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(20, 36, 28, 0.18);
}

.pos-btn.is-passive {
  opacity: 0.38;
  filter: grayscale(0.25);
}

.pos-btn.is-passive:hover {
  opacity: 0.72;
}

.pos-unspecified { background: #7a8690; }
.pos-noun { background: #1f6f5b; }
.pos-verb { background: #2f6f9f; }
.pos-adjective { background: #8a4b9c; }
.pos-adverb { background: #b06a24; }
.pos-preposition { background: #3d7c47; }
.pos-conjunction { background: #a33b2d; }
.pos-pronoun { background: #2a6b7c; }
.pos-interjection { background: #c45c2c; }
.pos-other { background: #5c6570; }

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(196, 122, 44, 0.08);
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--amber);
  flex-shrink: 0;
}

.check-row strong {
  display: block;
  font-size: 1rem;
}

.check-row small {
  display: block;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.global-later-card {
  margin-bottom: 0.5rem;
}

.later-pdf-link {
  margin: 0 0 1.25rem;
  font-weight: 700;
}

.listen-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  margin-bottom: 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(15, 107, 92, 0.08), rgba(196, 122, 44, 0.1));
  box-shadow: var(--shadow);
}

.listen-bar-copy {
  flex: 1;
  min-width: 220px;
}

.listen-bar-copy strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.listen-bar-copy p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.listen-now {
  margin-top: 0.55rem !important;
  color: var(--ink) !important;
  font-weight: 700;
  font-size: 1.05rem !important;
  min-height: 1.3em;
}

.listen-status {
  margin-top: 0.2rem !important;
  font-weight: 600;
}

.listen-bar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.listen-bar.is-listening {
  border-color: var(--teal);
}

tr.is-listening-row {
  background: rgba(15, 107, 92, 0.12) !important;
}

tr.is-listening-row td {
  border-bottom-color: rgba(15, 107, 92, 0.25);
}

.listen-playlist {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}

.listen-playlist h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0 0 0.85rem;
}

.listen-track-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.listen-track-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  border: 1px solid transparent;
}

.listen-track-list li span {
  color: var(--muted);
  text-align: right;
}

.listen-track-list li.is-listening-row {
  background: rgba(15, 107, 92, 0.12);
  border-color: rgba(15, 107, 92, 0.25);
}

/* Matching game */
.match-progress {
  text-align: center;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 1rem;
}

.match-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.match-col h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
}

.match-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 0.75rem 1rem;
  text-align: left;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.25s ease, border-color 0.15s ease;
}

.match-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.match-btn.is-selected {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(15, 107, 92, 0.25);
  background: #e7f4ef;
}

.match-btn.is-correct {
  border-color: #1f6f5b;
  background: #d9f0e5;
}

.match-btn.is-wrong {
  border-color: var(--danger);
  background: #f8e4e1;
  animation: matchShake 0.4s ease;
}

.match-btn.is-leaving {
  opacity: 0;
  transform: scale(0.92);
}

.match-en { border-left: 4px solid var(--teal); }
.match-tr { border-left: 4px solid var(--amber); }

.match-hint {
  text-align: center;
  color: var(--muted);
  margin-top: 1rem;
}

@keyframes matchShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.match-modal[hidden] { display: none !important; }

.match-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.match-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 36, 28, 0.45);
  backdrop-filter: blur(3px);
}

.match-modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, 100%);
  max-height: min(86vh, 720px);
  overflow: auto;
  background: #fffdf9;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 1.4rem 1.5rem 1.25rem;
  animation: matchModalIn 0.22s ease;
}

@keyframes matchModalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.match-modal-panel h2 {
  font-family: var(--font-display);
  margin: 0.15rem 0 0.35rem;
  font-size: 1.8rem;
}

.match-modal-meaning {
  font-size: 1.15rem;
  margin: 0 0 0.75rem;
  color: var(--ink);
}

.match-modal-block {
  margin-top: 0.85rem;
}

.match-modal-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--teal-dark);
}

#match-modal-continue {
  margin-top: 1.1rem;
  width: 100%;
}

body.nav-open {
  overflow: hidden;
}

body.modal-open {
  overflow: hidden;
}

/* ——— Mobil ——— */
@media (max-width: 840px) {
  body {
    background-attachment: scroll;
  }

  .match-board { grid-template-columns: 1fr; }
  .hero, .feature-strip { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-visual { min-height: 220px; margin-top: 0.5rem; }
  .hero h1 { max-width: none; }

  .site-nav {
    padding-top: max(0.75rem, env(safe-area-inset-top));
  }

  .nav-toggle { display: inline-flex; }

  .nav-links {
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.5rem 0 0.75rem;
    border-top: 1px solid var(--line);
  }

  .nav-links.is-open,
  .nav-links:not([hidden]) {
    display: flex;
  }

  .nav-links ul,
  .nav-links .auth-links {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .nav-links li a,
  .nav-links .auth-links a,
  .nav-links .link-btn {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 0.65rem 0.35rem;
    border-bottom: 1px solid var(--line);
    width: 100%;
  }

  .nav-cta {
    border-radius: 12px !important;
    justify-content: center;
    margin-top: 0.35rem;
  }

  .page-shell {
    padding-top: 1rem;
    padding-bottom: max(2.5rem, env(safe-area-inset-bottom));
  }

  .page-head {
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.1rem;
  }

  .page-head h1 {
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn {
    flex: 1 1 calc(50% - 0.35rem);
    min-width: calc(50% - 0.35rem);
  }

  .study-head .page-actions {
    flex-direction: column;
  }

  .study-head .mode-switch {
    width: 100%;
    display: flex;
  }

  .study-head .mode-switch a {
    flex: 1;
    text-align: center;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .day-grid {
    grid-template-columns: 1fr;
  }

  .day-tile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .day-tile-actions a {
    min-height: 42px;
  }

  .folder-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .folder-tab {
    flex: 0 0 auto;
    min-height: 44px;
  }

  .subfolder-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .listen-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .listen-bar-copy {
    min-width: 0;
  }

  .listen-bar-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .listen-bar-actions .btn {
    width: 100%;
  }

  .listen-bar-actions [data-listen-stop] {
    grid-column: 1 / -1;
  }

  /* Kelime tablosu → kart listesi */
  .word-table-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
    overflow: visible;
  }

  .word-table,
  .word-table tbody {
    display: block;
    width: 100%;
  }

  .word-table thead {
    display: none;
  }

  .word-table tr {
    display: block;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 0.85rem 1rem;
    margin-bottom: 0.85rem;
  }

  .word-table td {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 0.5rem;
    padding: 0.45rem 0;
    border-bottom: 1px dashed var(--line);
    text-align: left;
  }

  .word-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .word-table td::before {
    content: attr(data-label);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    padding-top: 0.15rem;
  }

  .word-table td.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-top: 0.75rem;
    margin-top: 0.25rem;
  }

  .word-table td.row-actions::before {
    display: none;
  }

  .row-actions a,
  .row-actions .link-btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(15, 107, 92, 0.08);
  }

  .flashcard {
    max-width: none;
  }

  .flashcard-inner,
  .flashcard-face {
    min-height: min(48vh, 340px);
  }

  .flashcard-face {
    padding: 1.1rem;
    border-radius: 18px;
  }

  .card-day {
    left: 0.85rem;
    right: 0.85rem;
    top: 0.75rem;
    font-size: 0.72rem;
  }

  .study-controls {
    max-width: none;
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: 0.75rem 0 max(0.75rem, env(safe-area-inset-bottom));
    background: linear-gradient(180deg, transparent, var(--bg) 28%);
  }

  .nav-row {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }

  .nav-row #btn-prev,
  .nav-row #btn-next,
  .nav-row #btn-flip {
    justify-self: stretch;
    width: 100%;
  }

  .later-btn {
    max-width: none;
  }

  .form-panel {
    padding: 1.1rem;
  }

  .form-actions .btn {
    flex: 1 1 100%;
  }

  .pos-picker {
    gap: 0.4rem;
  }

  .pos-btn {
    min-height: 42px;
    flex: 1 1 calc(50% - 0.4rem);
  }

  .tag-add-row {
    flex-direction: column;
    align-items: stretch;
  }

  .match-btn {
    min-height: 52px;
    font-size: 1.05rem;
  }

  .match-modal-panel {
    width: 100%;
    max-height: min(90vh, 100%);
    border-radius: 18px 18px 0 0;
    margin-top: auto;
  }

  .match-modal {
    align-items: flex-end;
    padding: 0;
  }
}

@media (max-width: 480px) {
  .page-actions .btn {
    flex: 1 1 100%;
  }

  .day-tile-actions {
    grid-template-columns: 1fr;
  }

  .brand {
    font-size: 1.2rem;
  }

  .lead {
    font-size: 0.95rem;
  }
}

@media (hover: none) {
  .btn:hover { transform: none; }
  .day-tile-actions a:hover {
    background: rgba(15, 107, 92, 0.08);
  }
}

/* Eş anlamlı çalışma */
.syn-card {
  max-width: 560px;
  margin: 0 auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 1.5rem 1.25rem 1.25rem;
  text-align: center;
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.syn-meaning {
  margin: 0.35rem 0 0;
  font-size: 1.05rem;
}

.syn-options {
  max-width: 560px;
  margin: 1.1rem auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
}

.syn-option {
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.65rem 1.1rem;
  min-height: 44px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.syn-option.is-selected {
  border-color: var(--teal);
  background: rgba(15, 107, 92, 0.12);
  color: var(--teal-dark);
}

.syn-option.is-correct {
  border-color: #1f6f5b;
  background: #1f6f5b;
  color: #fff;
}

.syn-option.is-wrong {
  border-color: #a33b2d;
  background: #a33b2d;
  color: #fff;
}

.syn-option.is-missed {
  border-color: #1f6f5b;
  background: rgba(31, 111, 91, 0.12);
  color: var(--teal-dark);
  box-shadow: inset 0 0 0 1px #1f6f5b;
}

.syn-option:disabled {
  cursor: default;
}

.syn-feedback {
  max-width: 560px;
  margin: 0.85rem auto 0;
  text-align: center;
  font-weight: 700;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
}

.syn-feedback.is-ok {
  background: #dff0e6;
  color: var(--teal-dark);
}

.syn-feedback.is-bad {
  background: #f8e4e1;
  color: var(--danger);
}

.syn-controls {
  margin-top: 1rem;
}

@media (max-width: 840px) {
  .syn-option {
    flex: 1 1 calc(50% - 0.55rem);
  }
}

