/* My Little Muslim Town: the floating town map with its ten places, each place's scene, and its situations played in
   the manners style. Drawings live in Views/Town/_TownArt.cshtml and _TownMap.cshtml (places and objects only, no faces).
   Lantern time (dark theme) turns the town to dusk: windows glow and every lit lantern shines. */

.kt { --kt-s1: #9FD6FF; --kt-s2: #DFF2FF; --kt-s3: #FFE9F2; --kt-sun: #FFE07A; position: relative; }
:root[data-theme="dark"] .kt { --kt-s1: #1C1A55; --kt-s2: #4A3C9C; --kt-s3: #C978B2; --kt-sun: #FFF1C4; }
.kt-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.kt-sky-1 { stop-color: var(--kt-s1); }
.kt-sky-2 { stop-color: var(--kt-s2); }
.kt-sky-3 { stop-color: var(--kt-s3); }
.kt-sun { fill: var(--kt-sun); }
:root[data-theme="dark"] .kt-win { fill: #FFD86A; filter: drop-shadow(0 0 3px rgba(255, 200, 90, .9)); }
:root[data-theme="dark"] .kt-cloud { opacity: .28; }
/* Dusk falls on the island too; the lanterns and windows keep shining through it. */
:root[data-theme="dark"] .kt-map-art > g { filter: brightness(.78) saturate(.92); }
:root[data-theme="dark"] .kt-lamp.is-lit .kt-lamp-halo { filter: brightness(1.5); }
:root[data-theme="dark"] .ts-sky { filter: brightness(.55) saturate(1.2) hue-rotate(-12deg); }

/* ---------- lanterns: dim until a place has something learned, glowing once it does ---------- */
.kt-lamp-glass { fill: #E6E0F7; transition: fill .6s; }
.kt-lamp-flame { fill: #CFC6EE; opacity: .55; transform-box: fill-box; transform-origin: 50% 100%; transition: fill .6s, opacity .6s; }
.kt-lamp-halo { fill: #FFD27A; opacity: 0; transition: opacity .8s; }
.kt-lamp-halo--on { opacity: .5; }
.kt-lamp.is-lit .kt-lamp-glass { fill: #FFE7A0; }
.kt-lamp.is-lit .kt-lamp-flame { fill: #FF9A2E; opacity: 1; animation: kt-flicker 1.8s ease-in-out infinite; }
.kt-lamp.is-lit .kt-lamp-halo { opacity: .55; animation: kt-halo 2.6s ease-in-out infinite; }
.kt-lamp.is-full .kt-lamp-halo { fill: #FFC84A; opacity: .8; }
:root[data-theme="dark"] .kt-lamp.is-lit .kt-lamp-halo { opacity: .85; }
@keyframes kt-flicker { 50% { transform: scale(.86, 1.08); } }
@keyframes kt-halo { 50% { opacity: .25; } }

/* ---------- ambient life: smoke, flags, water, clouds, swings and flowers ---------- */
.kt-smoke circle { fill: #fff; opacity: 0; animation: kt-smoke 4.5s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.kt-smoke circle:nth-child(2) { animation-delay: 1.5s; }
.kt-smoke circle:nth-child(3) { animation-delay: 3s; }
@keyframes kt-smoke { 0% { opacity: 0; transform: translate(0, 10px) scale(.5); } 25% { opacity: .75; } 100% { opacity: 0; transform: translate(6px, -14px) scale(1.25); } }
.kt-flag { transform-box: fill-box; transform-origin: 0 50%; animation: kt-flag 1.6s ease-in-out infinite; }
@keyframes kt-flag { 50% { transform: skewY(8deg) scaleX(.9); } }
.kt-jet { stroke-dasharray: 6 5; animation: kt-jet .9s linear infinite; }
.kt-jet--1 { animation-duration: .7s; }
@keyframes kt-jet { to { stroke-dashoffset: -22; } }
.kt-ripple { animation: kt-ripple 3s ease-in-out infinite; }
@keyframes kt-ripple { 50% { opacity: .2; transform: translateX(4px); } }
.kt-cloud { animation: kt-drift 26s ease-in-out infinite alternate; }
.kt-cloud--b { animation-duration: 34s; animation-delay: -8s; }
.kt-cloud--c { animation-duration: 40s; animation-delay: -14s; }
.kt-cloud--d, .kt-cloud--e { animation-duration: 30s; }
@keyframes kt-drift { to { translate: 46px 0; } }
.kt-swing { animation: kt-swing 2.6s ease-in-out infinite; }
.kt-swing--b { animation-delay: -1.3s; }
@keyframes kt-swing { 25% { rotate: 9deg; } 75% { rotate: -9deg; } }
.kt-sway { transform-box: fill-box; transform-origin: 50% 100%; animation: kt-sway 4s ease-in-out infinite; }
@keyframes kt-sway { 50% { rotate: 6deg; } }
.kt-tree { transition: transform .3s; }
.kt-kite { animation: kt-kite 5s ease-in-out infinite; }
@keyframes kt-kite { 50% { translate: 6px -8px; rotate: 4deg; } }
.kt-drip { animation: kt-drip 1.4s ease-in infinite; animation-delay: var(--d, 0s); }
@keyframes kt-drip { from { transform: translateY(-3px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(9px); opacity: 0; } }
.kt-stone { animation: kt-bob 4s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
@keyframes kt-bob { 50% { translate: 0 -4px; } }

/* ---------- arriving in town ---------- */
.kt-hero {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 18px 28px;
    margin-bottom: 18px;
}
.kt-isle {
    display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; text-decoration: none;
    font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--rose-deep);
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-s);
    transition: transform .25s var(--ease-bounce);
}
.kt-isle:hover { transform: translateY(-2px); }
.kt-isle img { width: 38px; height: 38px; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(91, 63, 208, .25)); }
:root[data-theme="dark"] .kt-isle { color: #FFC2DA; }
.kt-hero h1 {
    margin: 10px 0 4px; font-size: clamp(2.2rem, 5vw, 3.9rem); line-height: .98; letter-spacing: -.035em;
    text-shadow: 0 2px 0 rgba(255, 255, 255, .9), 0 4px 0 color-mix(in srgb, var(--rose) 35%, #fff), 0 16px 30px rgba(91, 63, 208, .22);
}
:root[data-theme="dark"] .kt-hero h1 { text-shadow: 0 2px 0 rgba(70, 50, 150, .6), 0 0 30px rgba(255, 190, 210, .45); }
:root[lang="ar"] .kt-hero h1, :root[lang="ur"] .kt-hero h1, :root[lang="ar"] .kt-scene-card h1, :root[lang="ur"] .kt-scene-card h1 { line-height: 1.4; letter-spacing: 0; }
.kt-hero-intro { margin: 0 0 12px; max-width: 640px; font-size: 1.12rem; font-weight: 600; color: var(--ink-soft); }
.kt-guide .k-mascot-svg { width: 64px; height: 80px; }
.kt-guide .k-bubble { font-size: 1.02rem; padding: 10px 14px; }

.kt-hero-glance { display: grid; gap: 10px; min-width: 300px; }
.kt-glance {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 24px; text-decoration: none; color: var(--ink);
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.kt-glance--lamps { flex-direction: column; align-items: stretch; gap: 6px; }
.kt-glance p { margin: 0; font-family: var(--font-display); font-size: 1rem; }
.kt-glance--collection svg { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 6px 8px rgba(227, 158, 0, .4)); }
.kt-glance--collection span { display: grid; }
.kt-glance--collection b { font-family: var(--font-display); font-size: 1.08rem; }
.kt-glance--collection small { color: var(--ink-soft); font-weight: 600; }
.kt-glance--collection:hover { transform: translateY(-2px); }
.kt-lamprow { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.kt-lamprow li { flex: 1; max-width: 34px; }
.kt-lamprow svg { width: 100%; height: auto; display: block; filter: grayscale(1) opacity(.35); transition: filter .6s, transform .6s var(--ease-bounce); }
.kt-lamprow li.is-lit svg { filter: drop-shadow(0 0 8px rgba(255, 190, 90, .9)); transform: translateY(-2px); }
.is-awake .kt-lamprow li.is-lit svg { animation: kt-lamp-on .9s var(--ease-bounce) both; }
.is-awake .kt-lamprow li:nth-child(2) svg { animation-delay: .08s; } .is-awake .kt-lamprow li:nth-child(3) svg { animation-delay: .16s; }
.is-awake .kt-lamprow li:nth-child(4) svg { animation-delay: .24s; } .is-awake .kt-lamprow li:nth-child(5) svg { animation-delay: .32s; }
.is-awake .kt-lamprow li:nth-child(6) svg { animation-delay: .4s; } .is-awake .kt-lamprow li:nth-child(7) svg { animation-delay: .48s; }
.is-awake .kt-lamprow li:nth-child(8) svg { animation-delay: .56s; } .is-awake .kt-lamprow li:nth-child(9) svg { animation-delay: .64s; }
.is-awake .kt-lamprow li:nth-child(10) svg { animation-delay: .72s; }
@keyframes kt-lamp-on { from { transform: translateY(8px) scale(.6); } }

/* ---------- the map ---------- */
.kt-mapwrap { position: relative; margin: 0 0 30px; }
.kt-map {
    position: relative; overflow: hidden; border-radius: 40px; isolation: isolate;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85), var(--shadow-l);
    background: linear-gradient(180deg, var(--kt-s1), var(--kt-s2) 70%, var(--kt-s3));
}
:root[data-theme="dark"] .kt-map { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12), var(--shadow-l); }
.kt-map-art { display: block; width: 100%; height: auto; }
.kt-map-art--tall { display: none; }
.kt-b-lift { transition: transform .45s var(--ease-bounce), filter .45s; }
.kt-b.is-hover .kt-b-lift { transform: translateY(-10px); filter: drop-shadow(0 14px 10px rgba(76, 52, 150, .28)) brightness(1.04); }
.kt-pins { position: absolute; inset: 0; margin: 0; padding: 0; list-style: none; pointer-events: none; }
.kt-pin {
    --x: var(--wx); --y: var(--wy);
    position: absolute; left: var(--x); top: var(--y); width: 13.5%; height: 26%;
    transform: translate(-50%, -76%);
    display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
    pointer-events: auto; text-decoration: none; color: var(--ink); border-radius: 28px;
    -webkit-tap-highlight-color: transparent;
}
[dir="rtl"] .kt-pin { left: auto; right: calc(100% - var(--x)); transform: translate(50%, -76%); }
.kt-pin-tag {
    position: relative; top: 8px; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px 5px 6px; border-radius: 999px; white-space: nowrap;
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), 0 10px 18px -10px color-mix(in srgb, var(--td) 80%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    transform: translateY(18px); transition: transform .3s var(--ease-bounce), box-shadow .3s;
}
.kt-pin-tag b { font-family: var(--font-display); font-weight: 700; font-size: .98rem; line-height: 1.1; }
.kt-pin-tag small { font-weight: 700; font-size: .78rem; color: var(--ink-soft); padding-inline-start: 7px; border-inline-start: 1.5px solid var(--line); }
.kt-pin-lamp {
    width: 22px; height: 22px; border-radius: 50%; flex: none;
    background: radial-gradient(circle at 50% 55%, #fff 0 18%, color-mix(in srgb, var(--t) 60%, #fff) 20% 52%, color-mix(in srgb, var(--t) 25%, transparent) 54%);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 50%, #fff);
}
.kt-pin.is-lit .kt-pin-lamp { background: radial-gradient(circle at 50% 55%, #FFF8D6 0 22%, #FFC84A 26% 58%, rgba(255, 190, 80, .2) 62%); box-shadow: 0 0 14px 4px rgba(255, 196, 90, .75); animation: kt-pin-glow 2.4s ease-in-out infinite; }
@keyframes kt-pin-glow { 50% { box-shadow: 0 0 6px 1px rgba(255, 196, 90, .45); } }
.kt-pin.is-full .kt-pin-tag { box-shadow: inset 0 0 0 2px #FFC84A, 0 0 22px -2px rgba(255, 196, 90, .8); }
.kt-pin:hover .kt-pin-tag, .kt-pin:focus-visible .kt-pin-tag { transform: translateY(10px) scale(1.08); box-shadow: inset 0 0 0 2px var(--t), 0 16px 26px -12px color-mix(in srgb, var(--td) 90%, transparent); }
.kt-pin:focus-visible { outline: 4px solid color-mix(in srgb, var(--t) 70%, #fff); outline-offset: 2px; }
.kt-pin-last {
    position: absolute; top: 4%; padding: 3px 10px; border-radius: 999px; font-family: var(--font-display); font-weight: 600; font-size: .78rem;
    color: #fff; background: var(--td); box-shadow: 0 8px 14px -8px var(--td); animation: kt-bob 3s ease-in-out infinite;
}
.kt-map-hint { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; font-weight: 600; color: var(--ink-soft); font-size: .95rem; }
.kt-map-hint .k-ico { width: 22px; height: 22px; }

/* ---------- places, as cards ---------- */
.kt-places { margin-bottom: 34px; }
.kt-place-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.kt-place {
    position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 26px; text-decoration: none; color: var(--ink);
    background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
    transition: transform .3s var(--ease-bounce), box-shadow .3s;
}
.kt-place:hover, .kt-place:focus-visible { transform: translateY(-5px) rotate(-.4deg); box-shadow: inset 0 0 0 2px var(--t), var(--shadow-l); }
.kt-place:focus-visible { outline: 4px solid color-mix(in srgb, var(--t) 60%, #fff); outline-offset: 3px; }
.kt-place-art { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ts); }
.kt-place-art svg { width: 100%; height: 100%; display: block; transition: transform .6s var(--ease-soft); }
.kt-place:hover .kt-place-art svg { transform: scale(1.06); }
.kt-place-body { display: flex; flex-direction: column; gap: 5px; padding: 10px 12px 12px; flex: 1; }
.kt-place-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kt-place-top b { font-family: var(--font-display); font-size: 1.08rem; line-height: 1.1; }
.kt-place-body > small { font-size: .84rem; font-weight: 600; color: var(--ink-soft); line-height: 1.3; }
.kt-place-lamp { width: 26px; height: 26px; flex: none; }
.kt-place-lamp svg { width: 100%; height: 100%; display: block; filter: grayscale(1) opacity(.35); transition: filter .6s; }
.is-lit > .kt-place-body .kt-place-lamp svg, .kt-chip-place.is-lit .kt-place-lamp svg { filter: drop-shadow(0 0 6px rgba(255, 190, 90, .95)); }
.kt-place-levels { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 4px; }
.kt-lvl { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700; background: var(--ts); color: color-mix(in srgb, var(--td) 60%, #000); }
.kt-lvl b { font-weight: 800; }
.kt-lvl .k-ico { width: 13px; height: 13px; }
.kt-lvl.is-locked { opacity: .7; }
:root[data-theme="dark"] .kt-lvl { color: var(--ink); }
.kt-place-bar { display: block; height: 7px; border-radius: 99px; background: color-mix(in srgb, var(--t) 18%, transparent); overflow: hidden; }
.kt-place-bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #FFC84A, var(--t)); transition: width .8s var(--ease-soft); }
.kt-place-done { font-size: .78rem; font-weight: 700; color: var(--ink-soft); }

/* ---------- the collection ---------- */
.kt-collection {
    position: relative; margin-bottom: 30px; padding: clamp(16px, 2.6vw, 28px); border-radius: 36px;
    background:
        radial-gradient(70% 90% at 100% 0%, rgba(255, 200, 74, .22), transparent 60%),
        radial-gradient(60% 80% at 0% 100%, rgba(255, 143, 184, .18), transparent 60%),
        var(--glass-strong);
    box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
}
.kt-collection-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; }
.kt-collection-head h2 { margin: 0; }
.kt-collection-head p { margin: 0; color: var(--ink-soft); font-weight: 600; }
.kt-collection-empty { margin: 12px 0 0; padding: 12px 16px; border-radius: 18px; background: var(--sun-soft); font-weight: 600; }
.kt-tokens { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.kt-tokens.is-collapsed .kt-token:nth-child(n+13) { display: none; }
.kt-token a {
    display: flex; align-items: center; gap: 10px; height: 100%; padding: 8px 12px 8px 8px; border-radius: 20px; text-decoration: none; color: var(--ink);
    background: color-mix(in srgb, var(--paper) 70%, transparent); box-shadow: inset 0 0 0 1.5px var(--line);
    transition: transform .25s var(--ease-bounce), box-shadow .25s;
}
.kt-token a:hover, .kt-token a:focus-visible { transform: translateY(-3px); box-shadow: inset 0 0 0 2px var(--t), var(--shadow-s); }
.kt-token-art {
    position: relative; flex: none; display: grid; place-items: center; width: 50px; height: 50px; border-radius: 16px;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--ink) 6%, transparent) 0 6px, transparent 6px 12px);
    box-shadow: inset 0 0 0 2px dashed;
}
.kt-token-art svg { width: 36px; height: 36px; filter: grayscale(1) brightness(1.2) opacity(.35); transition: filter .6s, transform .6s var(--ease-bounce); }
.kt-token-text { display: grid; min-width: 0; }
.kt-token-text b { font-family: var(--font-display); font-weight: 600; font-size: .92rem; line-height: 1.15; color: var(--ink-faint); }
.kt-token-text small { font-size: .74rem; font-weight: 700; color: var(--ink-faint); }
.kt-token.is-found .kt-token-art { background: radial-gradient(circle at 50% 40%, #fff, var(--ts)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 45%, #fff), 0 6px 14px -6px var(--t); }
.kt-token.is-found .kt-token-art svg { filter: none; transform: rotate(-6deg); }
.kt-token.is-found .kt-token-text b { color: var(--ink); }
.kt-token.is-found .kt-token-text small { color: var(--td); }
:root[data-theme="dark"] .kt-token.is-found .kt-token-text small { color: var(--ink-soft); }
.kt-tokens-more { margin-top: 12px; }

/* ---------- a place up close ---------- */
.kt-scene {
    position: relative; overflow: hidden; isolation: isolate; border-radius: 40px; margin-bottom: 22px;
    display: grid; grid-template-columns: minmax(330px, 40%) minmax(0, 1fr); align-items: stretch;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .85), var(--shadow-l);
    background:
        radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--t) 40%, transparent), transparent 60%),
        conic-gradient(from 45deg at 20% 80%, color-mix(in srgb, var(--t) 12%, transparent) 0 25%, transparent 0 50%, color-mix(in srgb, var(--t) 12%, transparent) 0 75%, transparent 0) 0 0 / 36px 36px,
        var(--ts);
}
:root[data-theme="dark"] .kt-scene { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12), var(--shadow-l); }
.kt-scene-art { grid-column: 2; grid-row: 1; position: relative; min-height: 100%; aspect-ratio: 640 / 300; }
.kt-scene-art svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* The scene's sky fades into the card's side so the two read as one picture. */
.kt-scene-art::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: -1px; width: 12%; z-index: 1; background: linear-gradient(to right, var(--ts), transparent); pointer-events: none; }
[dir="rtl"] .kt-scene-art::before { background: linear-gradient(to left, var(--ts), transparent); }
.kt-scene-card {
    grid-column: 1; grid-row: 1; align-self: center; position: relative; z-index: 2; margin: 18px; margin-inline-end: -40px; padding: 18px 20px; border-radius: 30px;
    background: color-mix(in srgb, var(--glass-strong) 90%, transparent); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.kt-scene-back {
    display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px 4px 6px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .9rem;
    color: color-mix(in srgb, var(--td) 80%, #000); background: var(--ts); transition: transform .25s var(--ease-bounce);
}
.kt-scene-back svg { width: 18px; height: 18px; }
.kt-scene-back:hover { transform: translateX(calc(-3px * var(--flip, 1))); }
[dir="rtl"] .kt-scene-back { --flip: -1; }
:root[data-theme="dark"] .kt-scene-back { color: var(--ink); }
.kt-scene-eyebrow { margin: 10px 0 0; font-family: var(--font-display); font-weight: 600; font-size: .9rem; color: var(--td); text-transform: uppercase; letter-spacing: .08em; }
:root[data-theme="dark"] .kt-scene-eyebrow { color: #FFE3A0; }
.kt-scene-card h1 { margin: 2px 0 2px; font-size: clamp(2rem, 4.4vw, 3.2rem); line-height: 1; letter-spacing: -.03em; }
.kt-scene-blurb { margin: 0 0 10px; font-weight: 600; color: var(--ink-soft); }
.kt-scene-progress { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-family: var(--font-display); font-weight: 600; }
.kt-scene-lamp { width: 30px; height: 30px; }
.kt-scene-lamp svg { width: 100%; height: 100%; filter: grayscale(1) opacity(.4); transition: filter .6s; }
.kt-scene-lamp.is-lit svg { filter: drop-shadow(0 0 8px rgba(255, 190, 90, .95)); animation: kt-lamp-on .9s var(--ease-bounce) both; }

/* level tabs */
.kt-levels-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }
.kt-levels-head h2 { margin: 0; }
.kt-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.kt-tab {
    display: grid; grid-template-columns: auto auto; align-items: center; gap: 0 10px; padding: 8px 16px; border: 0; border-radius: 20px; cursor: pointer;
    font: inherit; color: var(--ink); text-align: start; background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-s);
    transition: transform .25s var(--ease-bounce), box-shadow .25s, background .25s;
}
.kt-tab-name { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.kt-tab-name .k-ico { width: 18px; height: 18px; }
.kt-tab small { grid-column: 1; font-weight: 600; font-size: .78rem; color: var(--ink-soft); }
.kt-tab-lamps { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 3px; }
.kt-tab-lamps i { width: 9px; height: 13px; border-radius: 4px 4px 5px 5px; background: color-mix(in srgb, var(--ink) 15%, transparent); transition: background .5s, box-shadow .5s; }
.kt-tab-lamps i.is-on { background: linear-gradient(180deg, #FFF3C2, #FFA34A); box-shadow: 0 0 8px 2px rgba(255, 190, 100, .7); }
.kt-tab:hover { transform: translateY(-2px); }
.kt-tab[aria-selected="true"] { background: linear-gradient(180deg, color-mix(in srgb, var(--t) 30%, var(--paper)), var(--paper)); box-shadow: inset 0 0 0 2.5px var(--t), var(--shadow); }
.kt-tab:focus-visible { outline: 4px solid color-mix(in srgb, var(--t) 60%, #fff); outline-offset: 2px; }
.kt-tab.is-locked { opacity: .8; }

/* situation cards */
.kt-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; counter-reset: kt; }
.kt-card {
    position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 100%;
    padding: 12px 14px; border-radius: 24px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-s);
    transition: transform .25s var(--ease-bounce), box-shadow .25s;
}
.kt-card:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 60%, transparent), var(--shadow); }
.kt-card-art { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 20px; background: radial-gradient(circle at 50% 35%, #fff, var(--ts)); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--t) 35%, #fff); }
.kt-card-art svg { width: 44px; height: 44px; }
.kt-card-theme { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 4px; }
.kt-card-theme .k-chip { font-size: .76rem; }
.kt-card-done { display: inline-flex; align-items: center; gap: 3px; font-size: .78rem; font-weight: 800; color: var(--leaf-deep); }
.kt-card-done .k-ico { width: 15px; height: 15px; }
.kt-card h3 { margin: 0; font-family: var(--font-read); font-weight: 400; font-size: 1.04rem; line-height: 1.35; }
.kt-card-go { white-space: nowrap; }
.kt-card-go svg { width: 16px; height: 16px; }
.kt-card.is-done { background: linear-gradient(135deg, color-mix(in srgb, #FFE7A0 26%, var(--paper)), var(--paper) 60%); }
.kt-card.is-done .kt-card-art { box-shadow: inset 0 0 0 2px #FFC84A, 0 0 16px -2px rgba(255, 196, 90, .8); }
:root[data-theme="dark"] .kt-card-done { color: #9BF0B0; }

.kt-locked {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding: 18px 20px; border-radius: 26px;
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--t) 10%, var(--paper)) 0 14px, var(--paper) 14px 28px); box-shadow: inset 0 0 0 1.5px var(--line);
}
.kt-locked p { margin: 0; flex: 1 1 260px; font-weight: 600; }
.kt-locked-art { position: relative; width: 54px; height: 54px; }
.kt-locked-art svg { width: 100%; height: 100%; filter: grayscale(1) opacity(.5); }
.kt-locked-art .k-ico { position: absolute; inset-inline-end: -4px; bottom: -2px; width: 24px; height: 24px; }

/* ---------- playing a situation ---------- */
.kt-player { scroll-margin-top: 90px; }
.kt-player-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 12px; }
.kt-player-count { font-family: var(--font-display); font-weight: 600; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 8px; }
.kt-player-keys { margin-inline-start: auto; padding: 4px 10px; border-radius: 10px; font-size: .78rem; font-weight: 700; color: var(--ink-soft); background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--line); }
.kt-lvl-chip { padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800; color: #fff; background: var(--t); }
.kt-lvl-chip.kt-lvl--hard { background: var(--grape-deep); }
.kt-lvl-chip.kt-lvl--medium { background: var(--sky-deep); }
.kt-lvl-chip.kt-lvl--easy { background: var(--leaf-deep); }

.kt-play {
    position: relative; padding: clamp(16px, 2.8vw, 30px); border-radius: 36px; background: var(--paper);
    box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow-l);
}
.kt-play.is-entering { animation: sg-slide-in .5s var(--ease-bounce) both; }
.kt-play-head {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 16px; border-radius: 28px;
    background:
        radial-gradient(80% 120% at 0% 0%, color-mix(in srgb, var(--t) 28%, transparent), transparent 60%),
        var(--ts);
}
.kt-play-art {
    display: grid; place-items: center; width: clamp(80px, 11vw, 112px); aspect-ratio: 1; border-radius: 30px;
    background: radial-gradient(circle at 50% 35%, #fff 0 45%, color-mix(in srgb, var(--t) 30%, #fff)); box-shadow: inset 0 -4px 0 color-mix(in srgb, var(--t) 30%, transparent), var(--shadow-s);
    animation: kt-bob 4s ease-in-out infinite;
}
.kt-play-art svg { width: 72%; height: 72%; }
.kt-play-theme { margin: 0 0 6px; }
.kt-play-situation { margin: 0; font-family: var(--font-read); font-size: clamp(1.2rem, 2.3vw, 1.55rem); line-height: 1.4; }
.kt-wwyd { margin: 18px 0 10px; font-size: 1.25rem; }
.kt-choices { display: grid; gap: 10px; }
.kt-choice {
    display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 10px 16px; border: 0; border-radius: 22px; cursor: pointer; text-align: start;
    font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; color: var(--ink);
    background: var(--paper); box-shadow: inset 0 0 0 2px var(--line), inset 0 -4px 0 color-mix(in srgb, var(--t) 18%, transparent), var(--shadow-s);
    transition: transform .2s var(--ease-bounce), box-shadow .2s, background .2s, opacity .2s;
}
.kt-choice:hover:not([disabled]) { transform: translateY(-3px); box-shadow: inset 0 0 0 2.5px var(--t), inset 0 -4px 0 color-mix(in srgb, var(--t) 25%, transparent), var(--shadow); }
.kt-choice:focus-visible { outline: 4px solid color-mix(in srgb, var(--t) 60%, #fff); outline-offset: 2px; }
.kt-choice[disabled] { cursor: default; }
.kt-choice.is-right { background: var(--leaf-soft); box-shadow: inset 0 0 0 2.5px var(--leaf), 0 0 0 6px color-mix(in srgb, var(--leaf) 18%, transparent); animation: sg-wave .55s var(--ease-bounce) both; }
.kt-choice.is-soft-wrong { background: var(--sun-soft); opacity: .78; animation: k-wiggle .4s; }
.kt-outcome:empty { display: none; }
.kt-outcome { display: grid; gap: 12px; margin-top: 16px; }
.kt-what { padding: 14px 18px; border-radius: 22px; animation: k-pop .35s var(--ease-bounce); }
.kt-what strong { display: block; font-family: var(--font-display); font-size: .86rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; }
.kt-what p { margin: 4px 0 0; font-family: var(--font-read); font-size: 1.12rem; }
.kt-what.is-right { background: var(--leaf-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--leaf) 40%, transparent); }
.kt-what.is-learn { background: var(--sun-soft); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--sun) 50%, transparent); }

.kt-teach {
    padding: 16px 18px; border-radius: 26px; animation: k-pop .45s .1s var(--ease-bounce) both;
    background: linear-gradient(160deg, color-mix(in srgb, var(--grape) 12%, var(--paper)), var(--paper));
    box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--grape) 25%, transparent);
}
.kt-teach h4 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 6px; font-size: 1.1rem; }
.kt-teach h4 small { font-family: var(--font-body); font-size: .76rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--grape-soft); color: var(--grape-deep); }
:root[data-theme="dark"] .kt-teach h4 small { color: var(--ink); }
.kt-src-ico { width: 26px; height: 26px; flex: none; }
.kt-teach-text { margin: 0 0 10px; font-family: var(--font-read); font-size: 1.12rem; line-height: 1.45; }
.kt-verse { margin: 10px 0 0; padding: 12px 16px; border-radius: 20px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.kt-verse figcaption, .kt-hadith summary { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 600; font-size: .95rem; color: var(--mint-deep); }
:root[data-theme="dark"] .kt-verse figcaption, :root[data-theme="dark"] .kt-hadith summary { color: #9BF0D0; }
.kt-verse-ar { margin: 8px 0; font-family: "Amiri", "Noto Naskh Arabic", serif; font-size: clamp(1.5rem, 2.8vw, 1.95rem); line-height: 1.9; text-align: center; color: var(--ink); }
.kt-verse-tr { margin: 0 0 4px; font-family: var(--font-read); font-size: 1rem; color: var(--ink-soft); }
.kt-verse cite, .kt-hadith cite { font-style: normal; font-weight: 700; font-size: .84rem; color: var(--ink-soft); }
.kt-hadith { margin: 10px 0 0; padding: 10px 16px; border-radius: 20px; background: var(--paper); box-shadow: inset 0 0 0 1.5px var(--line); }
.kt-hadith summary { cursor: pointer; list-style: none; }
.kt-hadith summary::-webkit-details-marker { display: none; }
.kt-hadith summary::after { content: "+"; margin-inline-start: auto; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--mint-soft); font-size: 1.2rem; }
.kt-hadith[open] summary::after { content: "−"; }
.kt-hadith summary span { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.kt-hadith p { margin: 8px 0 0; font-family: var(--font-read); font-size: .98rem; line-height: 1.5; }
.kt-hadith-ref, .kt-hadith-note { font-size: .84rem !important; color: var(--ink-soft); }

.kt-found {
    position: relative; display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 24px; overflow: hidden;
    background: linear-gradient(120deg, #FFF3CF, #FFE9F2 70%); color: #2B2350; box-shadow: inset 0 0 0 2px #FFD97A;
    animation: k-pop .5s .2s var(--ease-bounce) both;
}
:root[data-theme="dark"] .kt-found { background: linear-gradient(120deg, #4C3F55, #522F63 70%); color: var(--ink); box-shadow: inset 0 0 0 2px rgba(255, 217, 122, .5); }
.kt-found-art { position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 4px rgba(255, 200, 74, .35), 0 10px 18px -8px rgba(227, 158, 0, .6); }
.kt-found-art svg { width: 46px; height: 46px; position: relative; z-index: 1; }
.kt-found.is-new .kt-found-art svg { animation: kt-found 1s .5s var(--ease-bounce) both; }
.kt-found-art i { position: absolute; inset: -10px; border-radius: 50%; background: conic-gradient(from 0deg, rgba(255, 200, 74, .0), rgba(255, 200, 74, .55), rgba(255, 200, 74, 0) 30%, rgba(255, 200, 74, .55) 55%, rgba(255, 200, 74, 0) 70%); animation: kt-rays 6s linear infinite; }
@keyframes kt-found { from { transform: scale(.2) rotate(-40deg); opacity: 0; } }
@keyframes kt-rays { to { rotate: 360deg; } }
.kt-found b { font-family: var(--font-display); font-size: 1.15rem; }
.kt-found p { margin: 2px 0; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.kt-found small { display: block; font-weight: 700; font-size: .8rem; opacity: .75; }
.kt-play-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- around the town ---------- */
.kt-around { margin: 34px 0 22px; }
.kt-around ul { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.kt-chip-place {
    position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; padding: 6px 6px 10px; border-radius: 22px; text-align: center;
    text-decoration: none; color: var(--ink); background: var(--glass-strong); box-shadow: inset 0 0 0 1.5px var(--glass-edge), var(--shadow-s);
    transition: transform .25s var(--ease-bounce), box-shadow .25s;
}
.kt-chip-place:hover, .kt-chip-place:focus-visible { transform: translateY(-4px); box-shadow: inset 0 0 0 2px var(--t), var(--shadow); }
.kt-chip-art { width: 100%; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 16px; background: var(--ts); }
.kt-chip-art svg { width: 100%; height: 100%; display: block; }
.kt-chip-place b { font-family: var(--font-display); font-size: .88rem; line-height: 1.1; }
.kt-chip-place small { font-size: .72rem; font-weight: 800; color: var(--td); }
.kt-chip-place .kt-place-lamp { position: absolute; top: 2px; inset-inline-end: 2px; width: 22px; height: 22px; }
.kt-chip-place.is-next { box-shadow: inset 0 0 0 2px var(--t), var(--shadow-s); }

.kt-status { text-align: center; font-weight: 600; color: var(--ink-soft); }
.kt-status--error { color: var(--coral-deep); }
.kt-grownups { margin-top: 18px; }

/* ---------- tablets and phones ---------- */
@media (max-width: 1100px) {
    .kt-place-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kt-around ul { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
    .kt-hero { grid-template-columns: 1fr; }
    .kt-hero-glance { grid-template-columns: 1fr 1fr; min-width: 0; }
    .kt-cards { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .kt-map-art--wide { display: none; }
    .kt-map-art--tall { display: block; }
    .kt-pin { --x: var(--tx); --y: var(--ty); width: 30%; height: 14%; transform: translate(-50%, -74%); }
    [dir="rtl"] .kt-pin { transform: translate(50%, -74%); }
    .kt-pin-tag { padding: 4px 9px 4px 5px; gap: 5px; transform: translateY(14px); }
    .kt-pin-tag b { font-size: .86rem; }
    .kt-pin-tag small { display: none; }
    .kt-pin-lamp { width: 16px; height: 16px; }
    .kt-map { border-radius: 30px; }
    .kt-place-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .kt-scene { grid-template-columns: 1fr; border-radius: 30px; }
    .kt-scene-art { grid-column: 1; grid-row: 1; }
    .kt-scene-art::before { display: none; }
    .kt-scene-card { grid-column: 1; grid-row: 2; margin: -34px 10px 10px; padding: 14px 16px; }
    .kt-around ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .kt-card { grid-template-columns: auto minmax(0, 1fr); }
    .kt-card-go { grid-column: 1 / -1; justify-self: stretch; }
    .kt-play-head { grid-template-columns: auto minmax(0, 1fr); padding: 12px; gap: 12px; }
    .kt-play-say { grid-column: 2; justify-self: start; margin: 0; }
    .kt-player-keys { display: none; }
    .kt-tokens { grid-template-columns: 1fr 1fr; }
    .kt-token a { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 460px) {
    .kt-hero-glance { grid-template-columns: 1fr; }
    .kt-tabs { width: 100%; }
    .kt-tab { flex: 1 1 30%; grid-template-columns: 1fr; padding: 8px 10px; }
    .kt-tab-lamps { grid-column: 1; grid-row: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .kt *, .kt *::before, .kt *::after { animation: none !important; transition: none !important; }
}
.kt-saw { font-family: "Amiri", "Noto Naskh Arabic", serif; font-size: 1.2em; line-height: 1; }
