/* Kullanım rehberi (Pages/Guide.cshtml).
   Sitenin "Sticker Kitaplık" dilinin üstüne kurulu: kenarlık ve gölge --stk-border / --stk-shadow'dan gelir.
   Bütün sınıflar kg- önekli; sayfa dışında kullanılmaz. Betiği: wwwroot/js/guide.js */

.kg {
    --kg-ink: #22334a;
    --kg-text: #33465e;
    --kg-muted: #4a6482;
    --kg-paper: #ffffff;
    --kg-wash: #e6ecf3;
    --kg-rule: #b9c6d6;
    --kg-blue: #1d72c6;
    --kg-sun: #ffb703;
    --kg-stage: #162231;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    color: var(--kg-text);
}
.dark .kg {
    --kg-ink: #f1f5f9;
    --kg-text: #cdd8e4;
    --kg-muted: #9db0c4;
    --kg-paper: #1e2936;
    --kg-wash: #263445;
    --kg-rule: #3d5270;
    --kg-blue: #7dbcf8;
}
.kg :where(h1, h2, h3, p, ol, ul, dl, dd, figure) { margin: 0; }
.kg :where(ol, ul) { padding: 0; list-style: none; }
.kg-display { font-family: 'Baloo 2', 'Baloo 2 Fallback', sans-serif; }

/* ---------- Açılış: başlık + oynanabilir sahne ---------- */
.kg-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.75rem;
    align-items: center;
}
.kg-title {
    font-weight: 800;
    font-size: clamp(2.5rem, 1.55rem + 4.6vw, 4.6rem);
    line-height: 0.98;
    letter-spacing: -0.015em;
    color: var(--kg-ink);
    text-wrap: balance;
}
.kg-lede {
    margin-top: 1.1rem;
    font-size: 1.125rem;
    line-height: 1.6;
    max-width: 36ch;
}
.kg-arrow {
    display: none;
    margin-top: 1.25rem;
    color: var(--kg-muted);
    opacity: 0.7;
}
@media (min-width: 1024px) {
    .kg-hero {
        grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
        gap: 3.5rem;
        padding-block: 1rem 1.25rem;
    }
    .kg-arrow { display: block; }
}

.kg-stage-wrap {
    position: relative;
    isolation: isolate;
    margin: 0 0.6rem 0 0;
}
.kg-stage-wrap::before {
    content: "";
    position: absolute;
    inset: 0.5rem -0.6rem -0.7rem 0.6rem;
    z-index: -1;
    background: var(--kg-sun);
    border: 2px solid var(--stk-border);
    border-radius: 1.6rem;
    transform: rotate(-1.8deg);
}
.kg-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--kg-stage);
    border: 2px solid var(--stk-border);
    border-radius: 1.5rem;
    color: #fff;
}
.kg-shot {
    position: relative;
    aspect-ratio: 960 / 643;
    background: #0f1822;
}
.kg-shot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.45s ease;
}
.kg-shot img.is-on { opacity: 1; }
.kg-tap {
    position: absolute;
    inset: 0;
    z-index: 1;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.kg-tap:focus-visible {
    outline: 3px solid var(--kg-sun);
    outline-offset: -7px;
    border-radius: 1.2rem;
}
.kg-ui {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 11.5rem;
    padding: 1rem 1.1rem 1.15rem;
    text-align: center;
    pointer-events: none;
}
.kg-ui :where(button, a) { pointer-events: auto; }
.kg-ui [hidden] { display: none; }
@media (min-width: 640px) {
    .kg-ui {
        position: absolute;
        inset: auto 0 0 0;
        min-height: 0;
        padding: 4.5rem 1.75rem 1.35rem;
        background: linear-gradient(to top, rgba(13, 20, 30, 0.95) 0%, rgba(13, 20, 30, 0.8) 58%, rgba(13, 20, 30, 0) 100%);
    }
}
.kg-who {
    width: fit-content;
    margin: 0 auto 0.5rem;
    padding: 0.1rem 0.75rem;
    border-radius: 999px;
    background: #fff;
    color: #22334a;
    font-size: 0.8125rem;
    font-weight: 700;
}
.kg-line {
    font-size: 1.0625rem;
    font-weight: 600;
    line-height: 1.5;
    text-wrap: pretty;
}
.kg-line.is-narration { font-style: italic; }
.kg-line.is-swap { animation: kgLine 0.25s ease-out; }
@keyframes kgLine {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
@media (min-width: 640px) {
    .kg-line { font-size: 1.1875rem; }
}
.kg-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.1rem;
    margin-top: 0.55rem;
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.8125rem;
}
.kg-hint .material-symbols-outlined { font-size: 18px; }

.kg-choices {
    display: grid;
    gap: 0.6rem;
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
}
.kg-choose {
    color: var(--kg-sun);
    font-size: 1.125rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.kg-choice {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.9rem;
    border: 2px solid #22334a;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 3px 3px 0 #0a1017;
    color: #22334a;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}
.kg-choice:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #0a1017;
}
.kg-choice:active {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #0a1017;
}
@media (min-width: 640px) {
    /* Resmin üstünde: iki yol yan yana durur, sahne kapanmaz */
    .kg-choices {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: none;
    }
    .kg-choose { grid-column: 1 / -1; }
    .kg-choice {
        padding: 0.6rem 0.75rem;
        font-size: 0.9375rem;
    }
}
.kg-choice-mark {
    display: grid;
    place-items: center;
    flex: none;
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    background: #e1eefb;
    color: #1d72c6;
}
.kg-choice-mark .material-symbols-outlined { font-size: 20px; }

.kg-end-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.15;
}
.kg-end-text {
    max-width: 38ch;
    margin: 0.3rem auto 0.9rem;
    color: rgba(255, 255, 255, 0.86);
    font-size: 0.9375rem;
    line-height: 1.5;
}
.kg-end-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.65rem;
}
.kg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.1rem;
    border: 2px solid #22334a;
    border-radius: 0.9rem;
    box-shadow: 3px 3px 0 #0a1017;
    color: #22334a;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.12s ease-out, box-shadow 0.12s ease-out;
}
.kg-btn:hover {
    transform: translate(-1px, -1px);
    box-shadow: 5px 5px 0 #0a1017;
}
.kg-btn-paper { background: #fff; }
.kg-btn-sun { background: var(--kg-sun); }
.kg-choice:focus-visible,
.kg-btn:focus-visible {
    outline: 3px solid var(--kg-sun);
    outline-offset: 3px;
}
.kg-credit {
    margin-top: 1.5rem;
    padding-right: 0.25rem;
    color: var(--kg-muted);
    font-size: 0.8125rem;
    text-align: right;
}

/* ---------- Gövde: içindekiler + bölümler ---------- */
.kg-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2.25rem;
}
.kg-toc-title { display: none; }
.kg-toc ul {
    display: flex;
    gap: 0.55rem;
    margin-inline: -1rem;
    padding: 0.15rem 1rem 0.45rem;
    overflow-x: auto;
    scrollbar-width: none;
}
.kg-toc ul::-webkit-scrollbar { display: none; }
.kg-toc a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.9rem;
    border: 2px solid var(--stk-border);
    border-radius: 999px;
    background: var(--kg-paper);
    color: var(--kg-ink);
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}
.kg-toc a::before,
.kg-h2::before {
    content: "";
    flex: none;
    border: 2px solid var(--stk-border);
    background: var(--kg-tone, var(--kg-sun));
    transform: rotate(-8deg);
}
.kg-toc a::before {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 0.2rem;
}
.kg-toc a:focus-visible,
.kg-link:focus-visible,
.kg-switch:focus-visible {
    outline: 3px solid var(--kg-blue);
    outline-offset: 3px;
}
@media (min-width: 1180px) {
    .kg-body {
        grid-template-columns: 13rem minmax(0, 1fr);
        gap: 3.5rem;
        align-items: start;
    }
    .kg-toc {
        position: sticky;
        top: 5.75rem;
    }
    .kg-toc-title {
        display: block;
        margin-bottom: 0.8rem;
        color: var(--kg-ink);
        font-size: 1.125rem;
        font-weight: 700;
    }
    .kg-toc ul {
        flex-direction: column;
        gap: 0.1rem;
        margin: 0;
        padding: 0.15rem 0 0.15rem 0;
        overflow: visible;
        border-left: 3px dashed var(--kg-rule);
    }
    .kg-toc a {
        display: flex;
        margin-left: -3px;
        padding: 0.4rem 0 0.4rem 1rem;
        border: 0;
        border-left: 3px solid transparent;
        border-radius: 0;
        background: none;
        color: var(--kg-muted);
        font-size: 0.9375rem;
        font-weight: 600;
        white-space: normal;
    }
    .kg-toc a:hover { color: var(--kg-ink); }
    .kg-toc a.is-here {
        border-left-color: var(--stk-border);
        color: var(--kg-ink);
        font-weight: 700;
    }
}

.kg-sections {
    display: flex;
    flex-direction: column;
    gap: 4.5rem;
    min-width: 0;
}
.kg-sec { scroll-margin-top: 6rem; }
.kg-h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--kg-ink);
    font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.4rem);
    font-weight: 700;
    line-height: 1.1;
}
.kg-h2::before {
    width: 1rem;
    height: 1rem;
    border-radius: 0.3rem;
}
.kg-sub {
    max-width: 62ch;
    margin-top: 0.55rem;
    font-size: 1.0625rem;
    line-height: 1.6;
}
.kg-h3 {
    color: var(--kg-ink);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}
.kg-p {
    max-width: 60ch;
    margin-top: 0.3rem;
    line-height: 1.65;
}
.kg-p strong,
.kg-sub strong { color: var(--kg-ink); font-weight: 700; }
.kg-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--kg-blue);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
.kg-link:hover { text-decoration-thickness: 3px; }
.kg-ico {
    font-size: 1.15em;
    vertical-align: -0.2em;
    color: var(--kg-ink);
}

/* Başlarken: gerçek bir sıra, patika gibi dizilir */
.kg-trail {
    position: relative;
    display: grid;
    gap: 1.9rem;
    margin-top: 2rem;
    counter-reset: kg-step;
}
.kg-trail::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    bottom: 3rem;
    left: calc(1.5rem - 1.5px);
    border-left: 3px dashed var(--kg-rule);
}
.kg-trail > li {
    position: relative;
    padding-left: 4.25rem;
    counter-increment: kg-step;
}
.kg-trail > li::before {
    content: counter(kg-step);
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border: 2px solid var(--stk-border);
    border-radius: 50%;
    background: var(--kg-sun);
    box-shadow: 3px 3px 0 var(--stk-shadow);
    color: #22334a;
    font-family: 'Baloo 2', 'Baloo 2 Fallback', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    transform: rotate(-4deg);
}
.kg-trail > li:nth-child(even)::before { transform: rotate(5deg); }
@media (min-width: 640px) and (max-width: 899px) {
    .kg-trail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2rem 2.5rem;
    }
    .kg-trail::before { display: none; }
}
@media (min-width: 900px) {
    .kg-trail {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 1.75rem;
    }
    .kg-trail::before {
        top: calc(1.5rem - 1.5px);
        right: calc((100% - 5.25rem) / 4 - 1.5rem);
        bottom: auto;
        left: 1.5rem;
        border-top: 3px dashed var(--kg-rule);
        border-left: 0;
    }
    .kg-trail > li {
        padding-top: 4.1rem;
        padding-left: 0;
    }
}

/* Hikaye okurken: anlatım + okuyucunun düğmeleri */
.kg-read {
    display: grid;
    gap: 2rem;
    margin-top: 1.75rem;
}
.kg-points {
    display: grid;
    gap: 1.5rem;
    align-content: start;
}
.kg-bar {
    padding: 1.35rem 1.25rem 1.4rem;
    border: 2px solid var(--stk-border);
    border-radius: 1.5rem;
    background: var(--kg-stage);
    box-shadow: 4px 4px 0 var(--stk-shadow);
    color: #fff;
}
.kg-bar-title {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 700;
}
.kg-keys {
    display: grid;
    gap: 0.9rem;
}
.kg-keys li {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
}
.kg-key {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.8rem;
    background: #eef1f4;
    color: #22334a;
    font-size: 0.875rem;
    font-weight: 800;
}
.kg-key.is-level { color: #f59e0b; }
.kg-key.is-exit {
    background: #ef4444;
    color: #fff;
}
.kg-keys b {
    display: block;
    font-weight: 700;
}
.kg-keys span.kg-key-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9375rem;
    line-height: 1.5;
}
.kg-bar-note {
    margin-top: 1.1rem;
    padding-top: 0.9rem;
    border-top: 2px dashed rgba(255, 255, 255, 0.22);
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9375rem;
    line-height: 1.5;
}
@media (min-width: 900px) {
    .kg-read {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 3rem;
    }
}

/* Okuma araçları: örnek cümle + anahtarlar */
.kg-lab {
    display: grid;
    gap: 1.5rem;
    margin-top: 1.75rem;
}
.kg-sample {
    display: flex;
    align-items: center;
    min-height: 12.5rem;
    padding: 1.6rem 1.5rem;
    border: 2px solid var(--stk-border);
    border-radius: 1.5rem;
    background: var(--kg-paper);
    box-shadow: 4px 4px 0 var(--stk-shadow);
}
.kg-sample p {
    color: var(--kg-ink);
    font-size: clamp(1.3rem, 1.05rem + 1.2vw, 1.7rem);
    font-weight: 500;
    line-height: 1.7;
}
.kg-sample b { font-weight: 800; }
.kg-sample.is-dys p {
    font-family: 'OpenDyslexic', sans-serif;
    font-size: clamp(1.1rem, 0.95rem + 0.8vw, 1.35rem);
    letter-spacing: 0.04em;
    word-spacing: 0.1em;
    line-height: 1.9;
}
.kg-s1,
.kg-s2 { font-weight: 700; }
.kg-s1 { color: #2b8cee; }
.kg-s2 { color: #f59e0b; }
.dark .kg-s1 { color: #60a5fa; }
.dark .kg-s2 { color: #fbbf24; }
.kg-switches {
    display: grid;
    gap: 1.25rem;
    align-content: start;
}
.kg-switches li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}
.kg-switch {
    position: relative;
    width: 3.25rem;
    height: 1.9rem;
    margin-top: 0.1rem;
    padding: 0;
    border: 2px solid var(--stk-border);
    border-radius: 999px;
    background: var(--kg-wash);
    cursor: pointer;
    transition: background-color 0.15s ease-out;
}
.kg-switch::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 1.4rem;
    height: 1.4rem;
    border: 2px solid var(--stk-border);
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s ease-out;
}
.kg-switch[aria-checked="true"] { background: var(--kg-tone, var(--kg-sun)); }
.kg-switch[aria-checked="true"]::after { transform: translateX(1.35rem); }
.kg-also {
    display: grid;
    gap: 1.5rem;
    margin-top: 2.25rem;
    padding-top: 1.75rem;
    border-top: 3px dashed var(--kg-rule);
}
@media (min-width: 900px) {
    .kg-lab {
        grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
        gap: 2.5rem;
        align-items: start;
    }
    .kg-sample {
        position: sticky;
        top: 6rem;
    }
    .kg-also {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 2.5rem;
    }
}

/* Ödüller */
.kg-earn {
    display: grid;
    gap: 1.6rem 2.5rem;
    margin-top: 1.75rem;
}
.kg-earn dt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--kg-ink);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}
.kg-earn dd {
    max-width: 48ch;
    margin-top: 0.3rem;
    line-height: 1.65;
}
@media (min-width: 640px) {
    .kg-earn { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.kg-ledger-wrap {
    margin-top: 2.25rem;
    border: 2px solid var(--stk-border);
    border-radius: 1.5rem;
    background: var(--kg-paper);
    box-shadow: 4px 4px 0 var(--stk-shadow);
    overflow: hidden;
}
.kg-ledger {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
    line-height: 1.5;
}
.kg-ledger caption {
    padding: 1.1rem 1.25rem 0.9rem;
    color: var(--kg-ink);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: left;
}
.kg-ledger th,
.kg-ledger td {
    padding: 0.75rem 1rem;
    border-top: 2px solid var(--kg-wash);
    text-align: left;
    vertical-align: top;
}
.kg-ledger thead th {
    border-top: 2px solid var(--stk-border);
    border-bottom: 2px solid var(--stk-border);
    color: #22334a;
    font-size: 1.0625rem;
    font-weight: 800;
}
.kg-ledger thead th:first-child { background: var(--kg-wash); }
.kg-ledger thead .is-token { background: #ffd978; }
.kg-ledger thead .is-diamond { background: #d9ccff; }
.kg-ledger thead th + th,
.kg-ledger td { border-left: 2px solid var(--kg-wash); }
.kg-ledger thead th + th { border-left-color: var(--stk-border); }
.kg-ledger tbody th {
    width: 26%;
    color: var(--kg-ink);
    font-weight: 700;
}
.kg-ledger .material-symbols-outlined {
    font-size: 20px;
    vertical-align: -0.25em;
}
@media (max-width: 479px) {
    .kg-ledger th,
    .kg-ledger td { padding: 0.65rem 0.7rem; }
    .kg-ledger { font-size: 0.875rem; }
}

/* Ebeveynler ve öğretmenler / Ücretsiz ve Premium: iki sütun */
.kg-duo {
    display: grid;
    gap: 2.25rem;
    margin-top: 1.75rem;
}
@media (min-width: 900px) {
    .kg-duo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 3rem;
    }
}
.kg-list {
    display: grid;
    gap: 0.6rem;
    max-width: 58ch;
    margin-top: 0.8rem;
    line-height: 1.6;
}
.kg-list li {
    position: relative;
    padding-left: 1.4rem;
}
.kg-list li::before {
    content: "";
    position: absolute;
    top: 0.55em;
    left: 0.1rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 0.15rem;
    background: var(--kg-tone, var(--kg-ink));
    transform: rotate(-8deg);
}
.kg-list strong { color: var(--kg-ink); font-weight: 700; }
.kg-plan {
    padding: 1.4rem 1.35rem 1.5rem;
    border: 2px solid var(--stk-border);
    border-radius: 1.5rem;
    background: var(--kg-paper);
    box-shadow: 4px 4px 0 var(--stk-shadow);
}
.kg-plan.is-premium {
    background: var(--kg-sun);
    color: #22334a;
    --kg-ink: #22334a;
    --kg-tone: #22334a;
    --kg-blue: #22334a;
}

/* Kapanış */
.kg-help {
    padding-top: 1.75rem;
    border-top: 3px dashed var(--kg-rule);
}
.kg-help .kg-link { margin-right: 1.25rem; }

@media (prefers-reduced-motion: reduce) {
    .kg-shot img,
    .kg-choice,
    .kg-btn,
    .kg-switch,
    .kg-switch::after { transition: none; }
    .kg-line.is-swap { animation: none; }
    .kg-choice:hover,
    .kg-btn:hover { transform: none; }
}
