/* Defterde: tek çalışma sayfası, içerik boyuna göre sayfalama. */
.tangram-app { padding: calc(44px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); }
.catalog-header { position: relative; gap: 24px; align-items: center; }
.catalog-header .title-block { flex-shrink: 0; }
.catalog-header .catalog-heading { order: 2; flex: 1; display: flex; align-items: center; gap: 20px; margin: 0; min-width: 0; }
#edition-count { white-space: nowrap; }
.catalog-header .search { flex: 1; width: auto; min-width: 100px; margin: 0; }
#catalog-view, #game-view { display: flex; flex-direction: column; }
.catalog-browse { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: center; margin: 6px 0 2px; }
.categories { flex: 1 1 100%; gap: 0 12px; padding: 0; }
.category-button { font-size: 18px; padding-inline: 2px; }
.category-picker { display: none; }
.catalog-options { flex: none; font-size: 18px; }
.catalog-options > summary, .game-options > summary { min-height: 44px; padding: 10px 2px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; color: var(--pen); }
.catalog-tools, .help-panel { position: absolute; left: 0; right: 0; z-index: 8; padding: 16px 20px; margin: 0; max-height: min(70dvh, 520px); overflow-y: auto; background: var(--paper) url("kit/gren.png"); box-shadow: 4px 8px 18px rgba(58, 36, 16, .2); }
.catalog-tools { top: 100%; gap: 12px 20px; }
.catalog-tools .content-links { flex-basis: 100%; justify-content: flex-start; margin: 0; }
.catalog-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; padding: 4px 0; }
.puzzle-link { min-width: 0; height: 124px; padding: 4px; }
.puzzle-link svg { height: 72px; flex: none; }
.puzzle-link .puzzle-name { font-size: 20px; line-height: 22px; min-height: 44px; max-width: 100%; margin: 0; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.puzzle-link[aria-pressed="true"] .puzzle-name::after { transform: scaleX(1); }
.favorite-command { right: 0; top: 0; }
.favorite-command svg { width: 17px; height: 17px; }
@media (hover: hover) {
  .favorite-command:not([aria-pressed="true"]) { opacity: 0; }
  .catalog-grid li:hover .favorite-command, .catalog-grid li:focus-within .favorite-command { opacity: 1; }
}
.catalog-footer { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0 12px; padding-top: 0; margin: 8px 0 0; border-top: 0; min-height: 44px; font-size: 16px; }
.catalog-progress { order: 2; margin: 0; font-size: 16px; }
.catalog-footer .design-link { order: 3; font-size: 18px; }
.pagination { order: 1; flex-wrap: nowrap; gap: 4px; }
.pagination span { font-size: 19px; }
.page-arrow { display: grid; place-items: center; }
.page-arrow::after { display: none; }
.page-arrow svg { width: 28px; height: 22px; }
.page-arrow path, #rotate-left path, #rotate-right path { fill: none; stroke: currentColor; stroke-width: 1.5; }
.empty-state { min-height: 150px; }
.game-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; }
#back-to-catalog { font-size: 18px; }
.puzzle-heading { flex: 1; min-width: 0; margin: 0; align-items: baseline; }
.puzzle-heading { justify-content: flex-start; gap: 0 10px; flex-wrap: wrap; }
.puzzle-heading > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; }
#puzzle-category::before, .difficulty::before { content: "·"; margin-right: 10px; color: var(--muted); }
.puzzle-title-line { display: flex; align-items: baseline; }
#puzzle-number { display: none; }
.puzzle-heading h2 { font-size: 24px; }
.puzzle-heading p { font-size: 18px; margin: 0; }
.difficulty { font-size: 18px; gap: 0; }
.difficulty-mark { display: none; }
.play-topline { position: relative; display: flex; align-items: center; margin-top: 10px; justify-content: space-between; gap: 12px; min-height: 44px; }
.game-options { font-size: 18px; }
.game-options > summary { white-space: nowrap; }
.help-panel { top: 100%; }
.game-topline { justify-content: flex-start; margin: 0; }
.learning-controls { margin: 0; font-size: 17px; }
.input-help { font-size: 17px; margin: 8px 0; }
.scene-wrap { margin: 0; }
.selection-status { font-size: 16px; line-height: 20px; min-height: 40px; margin: 0; }
.placement-status { font-size: 15px; line-height: 20px; min-height: 20px; margin: 0; }
.selection-actions { justify-content: flex-start; font-size: 17px; gap: 16px; }
.game-controls { position: static; border: 0; margin: 0; padding: 0; gap: 0 16px; font-size: 19px; background: none; box-shadow: none; }
.control-group { flex: none; gap: 14px; }
#rotate-left, #rotate-right { display: inline-flex; gap: 5px; align-items: center; justify-content: center; }
#rotate-left svg, #rotate-right svg { width: 22px; height: 22px; }
#rotate-left::after { display: none; }
.keyboard-help { margin: 0; font-size: 17px; }
.help-panel .preview-notice { margin: 8px 0 0; text-align: left; font-size: 15px; }
.completion { margin: 8px 0; }
.completion p:first-child { font-size: 27px; }
.storage-status:empty { display: none; }
.storage-status { font-size: 16px; margin: 8px 0 0; }
/* Kategoriler tek satıra sığmadığında iki satıra kırılmak yerine seçiciye geçer. */
@media (max-width: 1000px) {
  .catalog-browse { flex-wrap: nowrap; gap: 20px; }
  .categories { display: none; }
  .category-picker { min-width: 0; flex: 0 1 320px; display: flex; gap: 8px; align-items: center; font-size: 18px; }
  .category-picker select { min-width: 0; width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; font-size: 18px; color: var(--pen); }
}
@media (max-width: 800px) {
  .catalog-header { flex-wrap: wrap; gap: 4px 16px; }
  .catalog-header .catalog-heading { order: 3; flex: 1 0 100%; }
  .categories { gap: 0 14px; }
  .category-button { font-size: 18px; }
  .game-controls { font-size: 18px; justify-content: space-between; gap: 0 8px; }
  .control-group { gap: 8px; }
}
@media (max-width: 580px) {
  .tangram-app { padding-inline: max(8px, env(safe-area-inset-right)); }
  #edition-count { display: none; }
  .catalog-header .catalog-heading { gap: 12px; }
  .wide-label { display: none; }
  .catalog-browse { flex-wrap: nowrap; gap: 12px; margin: 2px 0; }
  .categories { display: none; }
  .category-picker { min-width: 0; flex: 1; display: flex; gap: 7px; align-items: center; font-size: 16px; }
  .category-picker select { min-width: 0; width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid var(--rule); background: transparent; font-size: 17px; }
  .catalog-options { flex-shrink: 0; font-size: 16px; }
  .catalog-grid { gap: 12px 12px; }
  .puzzle-link .puzzle-name { font-size: 18px; }
  .catalog-footer { gap: 0 8px; }
  .pagination { flex: 1 0 100%; justify-content: center; }
  .catalog-progress { font-size: 14px; }
  .catalog-footer .design-link { font-size: 16px; }
  .game-page-header { gap: 8px; }
  #back-to-catalog { font-size: 16px; }
  .puzzle-heading h2 { font-size: 25px; }
  .puzzle-heading p { font-size: 14px; }
  .puzzle-heading > div { gap: 0 8px; }
  .difficulty { font-size: 16px; }
  .game-options { font-size: 17px; }
  .game-controls { display: grid; grid-template-columns: minmax(0,1fr) 44px; gap: 0 8px; }
  .game-controls .control-group { flex: none; justify-content: space-around; gap: 4px; }
  .game-controls .control-group:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .sound-button { grid-column: 2; grid-row: 1; }
}

/* Defterde oyunlarıyla ortak dil: kırmızı kalem alt çizgisi, sayfa dışı İçindekiler bağlantısı. */
.word-button::after { background: var(--accent); opacity: .7; height: 1.5px; }
.word-button:disabled::after { background: currentColor; opacity: .3; }
.game-page-header { align-items: flex-start; }
.game-page-header #back-to-catalog { margin-top: 2px; }
@media (max-width: 580px) {
  .tangram-app { padding-top: calc(40px + env(safe-area-inset-top, 0px)); }
  .game-page-header .subtitle { display: none; }
}
