/*
 * Karven II - rehber (wiki) and forum, one site. The look is the game's own: basalt panels with a
 * gold hairline, the game's map pictures behind headings, and the two kingdoms facing each other in
 * the front page's banner (Valen blue from the west, Kazar red from the east). The banner is the one
 * loud thing; everything under it is for reading and lookup.
 *
 *   kw-*  the frame every page shares and the wiki article
 *   kp-*  the front page (rehber + forum together)
 *   kf-*  the forum
 */

:root {
  color-scheme: dark;
  --kw-basalt: #0c0a08;
  --kw-slab: #15110d;
  --kw-slab-2: #1d1711;
  --kw-raise: #261e15;
  --kw-line: #3b2f20;
  --kw-line-soft: #2a2118;
  --kw-ink: #efe6d2;
  --kw-dim: #b5a88d;
  --kw-gold: #e2b552;
  --kw-gold-hi: #ffdc8c;
  --kw-ember: #e8683f;
  --kw-valen: #8fb8ff;
  --kw-kazar: #ff8f84;
  --kw-ok: #6fdc97;
  --kw-head: 'Cinzel', 'Palatino Linotype', 'Times New Roman', serif;
  --kw-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --kw-data: 'Rajdhani', 'Inter', system-ui, sans-serif;
  --kw-wide: 80rem;
  --kw-pad: clamp(1rem, 4vw, 2.5rem);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5.5rem; -webkit-text-size-adjust: 100%; }
body.kw { margin: 0; color: var(--kw-ink); font: 400 1.0625rem/1.65 var(--kw-body); background: var(--kw-basalt); min-height: 100vh; touch-action: manipulation; }
/*
 * The backdrop: the blood moon of the login screen behind every page, dark in the middle where the
 * text is and open towards the edges, with a glow of embers rising from the bottom. Fixed: the page
 * scrolls over it. (Two layers below everything; the body's own colour shows until the picture loads.)
 */
body.kw::before, body.kw::after { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body.kw::before {
  background:
    radial-gradient(ellipse 62% 115% at 50% 45%, rgba(12, 10, 8, 0.93) 0%, rgba(12, 10, 8, 0.82) 55%, rgba(12, 10, 8, 0.34) 100%),
    linear-gradient(180deg, rgba(12, 10, 8, 0.35) 0%, rgba(12, 10, 8, 0.1) 30%, rgba(12, 10, 8, 0.75) 100%),
    url('/branding/login-bg.jpg') center top / cover no-repeat;
}
body.kw::after {
  background:
    radial-gradient(60rem 22rem at 12% 108%, rgba(232, 104, 63, 0.22), transparent 70%),
    radial-gradient(60rem 22rem at 88% 108%, rgba(226, 181, 82, 0.16), transparent 70%),
    radial-gradient(1.5px 1.5px at 6% 22%, rgba(255, 190, 110, 0.7), transparent 70%),
    radial-gradient(2px 2px at 13% 64%, rgba(255, 150, 80, 0.6), transparent 70%),
    radial-gradient(1.5px 1.5px at 22% 41%, rgba(255, 210, 150, 0.5), transparent 70%),
    radial-gradient(2px 2px at 81% 30%, rgba(255, 190, 110, 0.6), transparent 70%),
    radial-gradient(1.5px 1.5px at 90% 71%, rgba(255, 150, 80, 0.7), transparent 70%),
    radial-gradient(2px 2px at 96% 48%, rgba(255, 210, 150, 0.5), transparent 70%);
}
.kw a { color: var(--kw-gold); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.kw a:hover { color: var(--kw-gold-hi); }
.kw :focus-visible { outline: 2px solid var(--kw-gold-hi); outline-offset: 2px; border-radius: 3px; }
.kw img { max-width: 100%; height: auto; }
.kw h1, .kw h2, .kw h3 { text-wrap: balance; }
.kw-skip { position: absolute; left: -999px; top: 0; background: var(--kw-gold); color: #1a1206 !important; padding: 0.5rem 1rem; z-index: 30; font-weight: 700; }
.kw-skip:focus { left: 0.5rem; top: 0.5rem; }
.kw-svg { width: 1.5rem; height: 1.5rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- header: the same on every page ---- */
.kw-top { position: sticky; top: 0; z-index: 20; background: rgba(14, 11, 8, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--kw-line); box-shadow: 0 1px 0 rgba(226, 181, 82, 0.12), 0 10px 30px -20px #000; }
.kw-top__in { display: flex; align-items: center; gap: clamp(0.6rem, 2.5vw, 2rem); max-width: var(--kw-wide); margin: 0 auto; padding: 0.45rem var(--kw-pad); }
.kw-brand { display: flex; align-items: center; gap: 0.6rem; font: 700 1.3rem/1 var(--kw-head); letter-spacing: 0.05em; color: var(--kw-ink) !important; text-decoration: none; white-space: nowrap; }
.kw-brand img { display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6)); }
.kw-tabs { display: flex; align-items: stretch; gap: 0.25rem; margin-right: auto; }
.kw-tabs a { display: flex; align-items: center; gap: 0.45rem; padding: 0.55rem 0.9rem; border-radius: 5px; color: var(--kw-dim); font-weight: 600; text-decoration: none; white-space: nowrap; }
.kw-tabs a .kw-svg { width: 1.2rem; height: 1.2rem; }
.kw-tabs a:hover { color: var(--kw-ink); background: var(--kw-slab-2); }
.kw-tabs a[aria-current] { color: var(--kw-gold-hi); background: linear-gradient(180deg, #2c2114, #1c150e); box-shadow: inset 0 -2px 0 var(--kw-gold); }
.kw a.kw-play, .kw button.kw-play {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; color: #1d1304; background: linear-gradient(180deg, #f6d27a, #c9952f);
  padding: 0.6rem 1.25rem; border-radius: 5px; font: 700 1rem/1.2 var(--kw-body); text-decoration: none; border: 1px solid #f9e2a4; cursor: pointer; white-space: nowrap;
  box-shadow: 0 0 0 1px #5b3f0d, 0 6px 18px -8px rgba(226, 181, 82, 0.7); transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.kw a.kw-play:hover, .kw button.kw-play:hover { background: linear-gradient(180deg, #ffe39c, #dba93f); color: #1d1304; box-shadow: 0 0 0 1px #5b3f0d, 0 8px 24px -8px rgba(255, 210, 110, 0.9); }
.kw a.kw-play:active, .kw button.kw-play:active { transform: translateY(1px); }
.kw button.kw-play:disabled { filter: grayscale(0.7); opacity: 0.6; cursor: not-allowed; }
.kw a.kw-ghost, .kw button.kw-ghost { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.6rem 1.15rem; border-radius: 5px; border: 1px solid #6d5a3a; background: rgba(12, 10, 8, 0.55); color: var(--kw-ink); font: 600 1rem/1.2 var(--kw-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.kw a.kw-ghost:hover, .kw button.kw-ghost:hover { border-color: var(--kw-gold); color: var(--kw-gold-hi); }
.kw-top__acts { display: flex; align-items: center; gap: 0.6rem; }
.kw-top__acts .kw-ghost { max-width: 14rem; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
/* The forum's sign-in window. */
.kf-modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 1rem; background: rgba(6, 4, 3, 0.78); backdrop-filter: blur(4px); overscroll-behavior: contain; overflow-y: auto; }
.kf-modal__box { position: relative; width: min(30rem, 100%); }
.kf-modal__box .kf-form { margin: 0; border-color: #6d5a3a; box-shadow: inset 0 2px 0 var(--kw-gold), 0 30px 80px -20px #000; }
.kf-modal__box .kf-form input { max-width: none; }
.kf-modal__close { position: absolute; top: 0.5rem; right: 0.6rem; z-index: 1; width: 2.2rem; height: 2.2rem; border: 0; background: none; color: var(--kw-dim); font-size: 1.6rem; line-height: 1; cursor: pointer; border-radius: 5px; }
.kf-modal__close:hover { color: var(--kw-gold-hi); background: var(--kw-raise); }

/* ---- shared pieces ---- */
.kw input[type='search'], .kw input[type='text'], .kw input[type='password'], .kw textarea, .kw select { width: 100%; background: #090705; color: var(--kw-ink); border: 1px solid var(--kw-line); border-radius: 5px; padding: 0.65rem 0.8rem; font: inherit; }
.kw input:focus, .kw textarea:focus, .kw select:focus { border-color: var(--kw-gold); outline: none; box-shadow: 0 0 0 3px rgba(226, 181, 82, 0.2); }
.kw textarea { min-height: 10rem; resize: vertical; line-height: 1.55; }
.kw input::placeholder, .kw textarea::placeholder { color: #84775f; }
.kw-search { position: relative; }
.kw-search label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.kw-hits { position: absolute; left: 0; right: 0; top: 100%; z-index: 15; list-style: none; margin: 0.35rem 0 0; padding: 0.35rem; background: #1b150f; border: 1px solid #5b4a2f; border-radius: 6px; box-shadow: 0 18px 40px -12px #000; text-align: left; max-height: 22rem; overflow-y: auto; }
.kw-hits li { margin: 0; }
.kw-hits a { display: block; padding: 0.45rem 0.6rem; border-radius: 4px; text-decoration: none; color: var(--kw-ink); font-weight: 600; }
.kw-hits a:hover, .kw-hits a:focus-visible { background: var(--kw-raise); color: var(--kw-gold-hi); }
.kw-hits small { display: block; color: var(--kw-dim); font-weight: 400; }
.kw-hits li.kw-hits__none { padding: 0.45rem 0.6rem; color: var(--kw-dim); }
.kw-crumbs { font-size: 0.9rem; color: var(--kw-dim); }
.kw-crumbs a { color: var(--kw-dim); }
.kw-crumbs__sep { margin: 0 0.45rem; opacity: 0.6; }
.kw kbd { font: 600 0.85em/1 var(--kw-data); background: #2a2218; border: 1px solid #55452f; border-bottom-width: 2px; border-radius: 4px; padding: 0.2em 0.5em; white-space: nowrap; }
.kw code { font-size: 0.92em; background: #2a2218; padding: 0.1em 0.35em; border-radius: 3px; }

/* A panel: the basalt slab every list sits on. */
.kp-panel { background: linear-gradient(180deg, #1b150f, #14100c); border: 1px solid var(--kw-line); border-radius: 8px; box-shadow: inset 0 1px 0 rgba(255, 222, 150, 0.07), 0 18px 40px -28px #000; overflow: hidden; }
.kp-panel__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.85rem 1.15rem; border-bottom: 1px solid var(--kw-line); background: linear-gradient(180deg, rgba(226, 181, 82, 0.08), transparent); }
.kp-panel__head h2, .kp-panel__head h3 { display: flex; align-items: center; gap: 0.6rem; margin: 0; font: 700 1.2rem/1.2 var(--kw-head); letter-spacing: 0.02em; color: var(--kw-ink); }
.kp-panel__head h2::before, .kp-panel__head h3::before { content: ''; width: 0.55rem; height: 0.55rem; background: var(--kw-gold); transform: rotate(45deg); flex: none; }
.kp-panel__head a { font-size: 0.95rem; font-weight: 600; }
.kp-panel__body { padding: 1rem 1.15rem; }

/* ---- front page ---- */
.kp { max-width: var(--kw-wide); margin: 0 auto; padding: 0 var(--kw-pad) 4rem; }
.kp-hero { position: relative; margin: 1.25rem 0 1.5rem; border: 1px solid #5b4a2f; border-radius: 10px; overflow: hidden; isolation: isolate; background: #0a0806; box-shadow: 0 30px 60px -40px #000; }
.kp-hero__side { position: absolute; inset: 0; z-index: -2; background-size: cover; background-position: center 40%; }
.kp-hero__side--valen { clip-path: polygon(0 0, 56% 0, 44% 100%, 0 100%); background-image: linear-gradient(90deg, rgba(20, 44, 92, 0.55), rgba(20, 44, 92, 0.2)), url('/loading/valen_capital.jpg'); }
.kp-hero__side--kazar { clip-path: polygon(56% 0, 100% 0, 100% 100%, 44% 100%); background-image: linear-gradient(270deg, rgba(110, 22, 14, 0.6), rgba(110, 22, 14, 0.25)), url('/loading/kazar_capital.jpg'); }
.kp-hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 90% at 50% 45%, rgba(8, 6, 4, 0.9) 0%, rgba(8, 6, 4, 0.72) 45%, rgba(8, 6, 4, 0.25) 100%), linear-gradient(180deg, transparent 55%, rgba(8, 6, 4, 0.95)); }
.kp-hero__in { display: flex; flex-direction: column; align-items: center; text-align: center; padding: clamp(1.5rem, 4vw, 2.75rem) var(--kw-pad) clamp(1.5rem, 4vw, 2.5rem); }
.kp-hero__crest { filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.8)); }
.kp-hero__logo { width: min(24rem, 72%); filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.8)); }
.kp-hero h1 { font: 700 clamp(1.5rem, 3.4vw, 2.3rem)/1.2 var(--kw-head); margin: 0.6rem 0 0.4rem; letter-spacing: 0.02em; text-shadow: 0 2px 12px #000; }
.kp-hero__say { max-width: 44rem; margin: 0 0 1.3rem; color: #e0d5bd; font-size: 1.1rem; text-shadow: 0 1px 8px #000; }
.kp-hero__sides { display: flex; justify-content: space-between; width: 100%; font: 700 0.95rem/1 var(--kw-head); letter-spacing: 0.12em; margin-bottom: 0.4rem; }
.kp-hero__sides span:first-child { color: var(--kw-valen); }
.kp-hero__sides span:last-child { color: var(--kw-kazar); }
.kp-search { width: min(38rem, 100%); z-index: 5; }
.kp-search input[type='search'] { padding: 0.9rem 1.1rem; font-size: 1.08rem; border-color: #6d5a3a; background: rgba(9, 7, 5, 0.88); border-radius: 7px; }
.kp-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.kp-hero__go { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem; margin: 1.3rem 0 0; }

.kp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.75rem; padding: 0; list-style: none; }
.kp-tile { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 11.5rem; padding: 1rem 1.1rem; border-radius: 8px; border: 1px solid var(--kw-line); overflow: hidden; isolation: isolate; text-decoration: none !important; color: var(--kw-ink) !important; background: var(--kw-slab); }
.kp-tile::before { content: ''; position: absolute; inset: 0; z-index: -2; background: var(--art) center / cover; transition: transform 0.4s ease; }
.kp-tile::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(12, 10, 8, 0.1) 0%, rgba(12, 10, 8, 0.75) 55%, rgba(12, 10, 8, 0.96) 100%); }
.kp-tile:hover { border-color: var(--kw-gold); }
.kp-tile:hover::before { transform: scale(1.06); }
.kp-tile strong { font: 700 1.2rem/1.2 var(--kw-head); letter-spacing: 0.01em; }
.kp-tile span { color: #d9cdb4; font-size: 0.93rem; line-height: 1.4; margin-top: 0.25rem; }
.kp-tile em { align-self: flex-start; margin-bottom: auto; font: 700 0.85rem/1 var(--kw-data); font-style: normal; letter-spacing: 0.05em; padding: 0.3rem 0.55rem; border-radius: 4px; background: rgba(12, 10, 8, 0.8); color: var(--kw-gold-hi); border: 1px solid #5b4a2f; }

.kp-cols { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 1.5rem; align-items: start; margin-bottom: 2rem; }
.kp-side { display: grid; gap: 1.5rem; }
.kp-h { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.4rem 1rem; margin: 2.5rem 0 1rem; }
.kp-h h2 { font: 700 clamp(1.4rem, 3vw, 1.8rem)/1.2 var(--kw-head); margin: 0; letter-spacing: 0.02em; }
.kp-h p { margin: 0; color: var(--kw-dim); }
.kp-groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.kp-group ul { list-style: none; margin: 0; padding: 0.4rem; }
.kp-group li a { display: block; padding: 0.5rem 0.75rem; border-radius: 5px; text-decoration: none; }
.kp-group li a:hover { background: var(--kw-raise); }
.kp-group li a strong { display: block; font-weight: 600; color: var(--kw-ink); }
.kp-group li a:hover strong { color: var(--kw-gold-hi); }
.kp-group li a small { color: var(--kw-dim); font-size: 0.88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kp-group .kp-panel__head .kw-svg { color: var(--kw-gold); margin-left: auto; }
.kp-group .kp-panel__head h3 { flex: 1; }
.kp-steps { margin: 0; padding: 0; list-style: none; counter-reset: step; }
.kp-steps li { counter-increment: step; display: grid; grid-template-columns: 2rem 1fr; gap: 0.7rem; padding: 0.6rem 0; border-top: 1px solid var(--kw-line-soft); font-size: 0.97rem; line-height: 1.45; }
.kp-steps li:first-child { border-top: 0; padding-top: 0; }
.kp-steps li::before { content: counter(step); display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: #2c2114; border: 1px solid #6d5a3a; color: var(--kw-gold-hi); font: 700 1rem/1 var(--kw-data); }

/* ---- forum ---- */
.kf { max-width: var(--kw-wide); margin: 0 auto; padding: 0 var(--kw-pad) 4rem; min-height: 70vh; }
.kf-page { max-width: 62rem; margin: 0 auto; padding-top: 1.5rem; }
.kf h1 { font: 700 clamp(1.6rem, 3.6vw, 2.2rem)/1.2 var(--kw-head); margin: 0.5rem 0 0.4rem; overflow-wrap: anywhere; }
.kf h1.kf-title { font: 700 clamp(1.4rem, 3.2vw, 1.9rem)/1.3 var(--kw-body); }
.kf-sub { color: var(--kw-dim); margin: 0 0 1rem; }
.kf-head { position: relative; isolation: isolate; border: 1px solid var(--kw-line); border-radius: 8px; overflow: hidden; padding: 1.3rem 1.4rem; margin: 1rem 0; display: flex; gap: 1.1rem; align-items: center; }
.kf-head::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(12, 10, 8, 0.95) 30%, rgba(12, 10, 8, 0.6)), var(--art, none) center / cover; }
.kf-head h1 { margin: 0 0 0.2rem; }
.kf-head .kf-sub { margin: 0; }
.kf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; margin: 1rem 0; }
.kf-me { display: flex; flex-wrap: wrap; align-items: center; gap: 0.7rem; font-size: 0.95rem; color: var(--kw-dim); min-height: 2.4rem; }
.kf-me select { width: auto; padding: 0.35rem 0.6rem; }
.kf button.kf-quiet { background: none; border: 1px solid var(--kw-line); color: var(--kw-ink); padding: 0.4rem 0.8rem; border-radius: 5px; cursor: pointer; font: inherit; font-size: 0.95rem; }
.kf button.kf-quiet:hover { border-color: var(--kw-gold); }

.kf-emblem { display: grid; place-items: center; width: 3rem; height: 3rem; flex: none; border-radius: 8px; color: var(--kw-gold-hi); background: radial-gradient(circle at 50% 30%, #3a2a14, #1b140c); border: 1px solid #6d5a3a; box-shadow: inset 0 1px 0 rgba(255, 222, 150, 0.15); }
.kf-emblem--news { color: #1d1304; background: linear-gradient(180deg, #f6d27a, #c9952f); border-color: #f9e2a4; }
.kf-boards, .kf-threads { list-style: none; margin: 0; padding: 0; }
.kf-board, .kf-thread { display: grid; gap: 0.3rem 1.1rem; align-items: center; padding: 0.85rem 1.15rem; border-top: 1px solid var(--kw-line-soft); position: relative; }
.kf-board:first-child, .kf-thread:first-child { border-top: 0; }
.kf-board:hover, .kf-thread:hover { background: rgba(226, 181, 82, 0.05); }
.kf-board { grid-template-columns: 3rem minmax(0, 1fr) 5.5rem 13.5rem; }
.kf-thread { grid-template-columns: 2.75rem minmax(0, 1fr) 5.5rem 11rem; }
.kf-board__name, .kf-thread__title { font-weight: 600; font-size: 1.08rem; line-height: 1.35; overflow-wrap: anywhere; text-decoration: none; color: var(--kw-ink) !important; }
/* The whole row opens the board or the thread; the links inside it stay reachable above the row's own. */
.kf-board__name::after, .kf-thread__title::after { content: ''; position: absolute; inset: 0; }
.kf-board:hover .kf-board__name, .kf-thread:hover .kf-thread__title { color: var(--kw-gold-hi) !important; }
.kf-board__blurb, .kf-thread__by { color: var(--kw-dim); font-size: 0.92rem; line-height: 1.45; margin: 0.1rem 0 0; }
.kf-count { font: 600 0.95rem/1.3 var(--kw-data); color: var(--kw-dim); text-align: center; font-variant-numeric: tabular-nums; }
.kf-count b { display: block; font-size: 1.35rem; color: var(--kw-ink); }
.kf-count span { display: block; }
.kf-count span + span { font-size: 0.85rem; }
.kf-last { font-size: 0.9rem; line-height: 1.4; color: var(--kw-dim); overflow-wrap: anywhere; position: relative; z-index: 1; }
.kf-last a { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.kf-last--none { font-style: italic; }
.kf-recent { list-style: none; margin: 0; padding: 0; }
.kf-recent li { display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: 0.7rem; padding: 0.7rem 1.15rem; border-top: 1px solid var(--kw-line-soft); align-items: center; }
.kf-recent li:first-child { border-top: 0; }
.kf-recent a { font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-decoration: none; color: var(--kw-ink); }
.kf-recent a:hover { color: var(--kw-gold-hi); }
.kf-recent small { display: block; color: var(--kw-dim); font-size: 0.85rem; }

/* The writer's shield: the kingdom's colour and the first letter of the character's name. */
.kf-ava { display: grid; place-items: center; width: 2.75rem; height: 3rem; flex: none; font: 700 1.25rem/1 var(--kw-head); color: #fff; background: linear-gradient(180deg, #6b5a40, #3a2f20); clip-path: polygon(50% 0, 100% 12%, 100% 58%, 50% 100%, 0 58%, 0 12%); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
.kf-ava--k1 { background: linear-gradient(180deg, #5d8fe6, #1f3f85); }
.kf-ava--k2 { background: linear-gradient(180deg, #e5665a, #7d1c14); }
.kf-ava--staff { background: linear-gradient(180deg, #f6d27a, #b07d1e); color: #1d1304; text-shadow: none; }
.kf-ava--sm { width: 2.25rem; height: 2.5rem; font-size: 1.05rem; }
.kf-ava--lg { width: 3.5rem; height: 3.9rem; font-size: 1.6rem; }

.kf-tag { display: inline-block; font: 700 0.78rem/1 var(--kw-data); letter-spacing: 0.04em; padding: 0.24rem 0.5rem; border-radius: 3px; margin-right: 0.45rem; vertical-align: 0.12em; background: #2a2218; color: var(--kw-dim); }
.kf-tag--pin { background: #3a2c10; color: var(--kw-gold-hi); }
.kf-tag--lock { background: #3a1a12; color: #ff9c80; }
.kf-tag--staff { background: var(--kw-gold); color: #1a1206; }
.kf-tag--gm { background: #5a1414; color: #ffd0c8; }
.kf-tag--k1 { background: #172a52; color: var(--kw-valen); }
.kf-tag--k2 { background: #4a1712; color: var(--kw-kazar); }

.kf-post { display: grid; grid-template-columns: 10.5rem minmax(0, 1fr); margin-bottom: 1rem; }
.kf-post__who { padding: 1.1rem 0.8rem; border-right: 1px solid var(--kw-line); font-size: 0.9rem; color: var(--kw-dim); display: flex; flex-direction: column; align-items: center; gap: 0.35rem; text-align: center; background: rgba(0, 0, 0, 0.18); }
.kf-post__who strong { font-size: 1.05rem; color: var(--kw-ink); overflow-wrap: anywhere; }
.kf-post__who .kf-tag { margin: 0; }
.kf-post--first { border-color: #6d5a3a; box-shadow: inset 0 2px 0 var(--kw-gold), 0 18px 40px -28px #000; }
.kf-post__body { padding: 1.1rem 1.3rem; min-width: 0; display: flex; flex-direction: column; }
.kf-post__text { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 1rem; flex: 1; max-width: 46rem; }
.kf-post__meta { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.85rem; color: var(--kw-dim); border-top: 1px solid var(--kw-line-soft); padding-top: 0.6rem; }
.kf-post__meta button { background: none; border: 0; color: var(--kw-dim); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.kf-post__meta button:hover { color: var(--kw-ember); }
.kf-post--gone .kf-post__text { color: var(--kw-dim); font-style: italic; }
.kf-form { padding: 1.25rem; margin: 1.2rem 0; }
.kf-form h2 { font: 700 1.25rem/1.3 var(--kw-head); margin: 0 0 0.6rem; }
.kf-form label { display: block; font-weight: 600; margin: 0 0 0.9rem; }
.kf-form label > span { display: block; margin-bottom: 0.3rem; }
.kf-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem; color: var(--kw-dim); font-size: 0.9rem; }
.kf-error { color: #ffb0a0; background: #2a1310; border-left: 3px solid var(--kw-ember); padding: 0.6rem 0.9rem; margin: 0.8rem 0; border-radius: 0 4px 4px 0; }
.kf-empty { color: var(--kw-dim); padding: 1.5rem 1.15rem; margin: 0; }
.kf-empty--box { border: 1px dashed var(--kw-line); border-radius: 8px; margin: 1rem 0; }
.kf-pages { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1.2rem 0; }
.kf-pages a, .kf-pages span { min-width: 2.4rem; text-align: center; padding: 0.35rem 0.75rem; border: 1px solid var(--kw-line); border-radius: 5px; text-decoration: none; font: 600 1rem/1.4 var(--kw-data); }
.kf-pages span { background: var(--kw-gold); color: #1a1206; border-color: var(--kw-gold); }
.kf-rules { font-size: 0.93rem; color: var(--kw-dim); margin: 0; padding-left: 1.2rem; }
.kf-rules li { margin-bottom: 0.35rem; }
p.kf-rules { padding: 0; margin: 0 0 1rem; max-width: 44rem; }
.kf-form input[type='text'], .kf-form input[type='password'] { max-width: 28rem; display: block; }
.kf-form input[name='baslik'] { max-width: none; }
.kf-h2 { font: 700 1.3rem/1.3 var(--kw-head); margin: 2rem 0 0.8rem; }

/* ---- wiki article ---- */
.kw-frame { display: grid; grid-template-columns: 16rem minmax(0, 1fr) 14rem; gap: clamp(1.25rem, 3vw, 2.5rem); max-width: 90rem; margin: 0 auto; padding: 1.5rem var(--kw-pad) 4rem; align-items: start; }
.kw-frame--plain { grid-template-columns: 16rem minmax(0, 1fr); max-width: var(--kw-wide); }
.kw-menu { font-size: 0.95rem; position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; padding-right: 0.4rem; }
.kw-menu__fold > summary { display: none; }
.kw-menu__group h2,
.kw-menu__title { font: 700 0.92rem/1.3 var(--kw-head); color: var(--kw-gold); margin: 1.4rem 0 0.4rem; letter-spacing: 0.05em; }
.kw-menu ul { list-style: none; margin: 0; padding: 0; }
.kw-menu li a { display: block; padding: 0.3rem 0.75rem; color: var(--kw-dim); text-decoration: none; border-left: 2px solid var(--kw-line); border-radius: 0 4px 4px 0; }
.kw-menu li a:hover { color: var(--kw-ink); border-left-color: var(--kw-dim); background: var(--kw-slab); }
.kw-menu li a[aria-current] { color: var(--kw-gold-hi); border-left-color: var(--kw-gold); background: var(--kw-slab-2); font-weight: 600; }
.kw-main { min-width: 0; max-width: 54rem; }
.kw-pagehead { position: relative; isolation: isolate; border: 1px solid var(--kw-line); border-radius: 8px; overflow: hidden; padding: 1.4rem 1.5rem 1.3rem; margin-bottom: 1.5rem; }
.kw-pagehead::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(12, 10, 8, 0.96) 25%, rgba(12, 10, 8, 0.7) 60%, rgba(12, 10, 8, 0.35)), var(--art) center 35% / cover; }
.kw-pagehead h1 { font: 700 clamp(1.8rem, 4vw, 2.6rem)/1.15 var(--kw-head); margin: 0.5rem 0 0.6rem; letter-spacing: 0.01em; text-shadow: 0 2px 10px #000; }
.kw-lead { font-size: 1.15rem; line-height: 1.55; color: #e0d5bd; margin: 0; max-width: 44rem; text-shadow: 0 1px 6px #000; }
.kw-main h2 { font: 700 1.5rem/1.25 var(--kw-head); margin: 2.6rem 0 0.8rem; padding-top: 1.1rem; border-top: 1px solid var(--kw-line); display: flex; align-items: center; gap: 0.6rem; }
.kw-main h2::before { content: ''; width: 0.55rem; height: 0.55rem; background: var(--kw-gold); transform: rotate(45deg); flex: none; }
.kw-main h3 { font: 600 1.15rem/1.3 var(--kw-body); margin: 1.8rem 0 0.5rem; color: var(--kw-gold); }
.kw-main p, .kw-main ul, .kw-main ol { margin: 0 0 1rem; }
.kw-main li { margin-bottom: 0.4rem; }
.kw-main li::marker { color: var(--kw-gold); }
.kw-toc { font-size: 0.92rem; position: sticky; top: 5rem; max-height: calc(100vh - 6rem); overflow-y: auto; border-left: 1px solid var(--kw-line); padding-left: 1rem; }
.kw-toc strong { display: block; font: 700 0.92rem/1.3 var(--kw-head); color: var(--kw-gold); letter-spacing: 0.05em; margin-bottom: 0.5rem; }
.kw-toc ol { list-style: none; margin: 0; padding: 0; }
.kw-toc li { margin-bottom: 0.45rem; line-height: 1.35; }
.kw-toc a { color: var(--kw-dim); text-decoration: none; }
.kw-toc a:hover { color: var(--kw-gold-hi); }
.kw-note { display: grid; grid-template-columns: auto 1fr; gap: 0.2rem 0.9rem; padding: 0.9rem 1.15rem; margin: 1.2rem 0; background: var(--kw-slab); border: 1px solid var(--kw-line-soft); border-left: 3px solid var(--kw-dim); border-radius: 0 6px 6px 0; }
.kw-note > strong { font-family: var(--kw-head); }
.kw-note--ipucu { border-left-color: var(--kw-ok); }
.kw-note--ipucu > strong { color: var(--kw-ok); }
.kw-note--dikkat { border-left-color: var(--kw-ember); }
.kw-note--dikkat > strong { color: var(--kw-ember); }
.kw-note--bilgi { border-left-color: var(--kw-valen); }
.kw-note--bilgi > strong { color: var(--kw-valen); }
.kw-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 3rem 0 1rem; }
.kw-pager a { display: block; padding: 0.9rem 1.1rem; border: 1px solid var(--kw-line); border-radius: 8px; background: var(--kw-slab); text-decoration: none; }
.kw-pager a:hover { border-color: var(--kw-gold); }
.kw-pager small { display: block; color: var(--kw-dim); font-size: 0.85rem; }
.kw-pager strong { font-family: var(--kw-head); font-size: 1.05rem; }
.kw-pager__next { text-align: right; grid-column: 2; }
.kw-ask { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 1.5rem; padding: 1.1rem 1.3rem; margin: 1rem 0; }
.kw-ask p { margin: 0; }
.kw-ask strong { display: block; font: 700 1.1rem/1.3 var(--kw-head); }
.kw-ask span { color: var(--kw-dim); font-size: 0.95rem; }
.kw-updated { margin-top: 1.5rem; font-size: 0.9rem; color: var(--kw-dim); }

/* ---- tables: the reason people open a wiki ---- */
.kw-table { overflow-x: auto; margin: 1rem 0 1.4rem; border: 1px solid var(--kw-line); border-radius: 8px; background: var(--kw-slab); }
.kw-table table { border-collapse: collapse; width: 100%; font-size: 0.95rem; line-height: 1.4; }
.kw-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.kw-table th { text-align: left; background: #261d12; color: var(--kw-gold-hi); font: 600 0.95rem/1.3 var(--kw-body); padding: 0.65rem 0.85rem; white-space: nowrap; border-bottom: 1px solid var(--kw-line); }
.kw-table td { padding: 0.55rem 0.85rem; border-top: 1px solid var(--kw-line-soft); vertical-align: middle; }
.kw-table tbody tr:nth-child(even) { background: rgba(0, 0, 0, 0.2); }
.kw-table tbody tr:hover { background: var(--kw-raise); }
.kw-table .kw-num { text-align: right; font: 600 1.02rem/1.4 var(--kw-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
.kw-icon { vertical-align: middle; margin-right: 0.6rem; border-radius: 5px; background: #090705; border: 1px solid var(--kw-line); }

.kw-foot { border-top: 1px solid var(--kw-line); background: #0a0806; }
.kw-foot__in { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 1.5rem 2rem; max-width: var(--kw-wide); margin: 0 auto; padding: 2rem var(--kw-pad) 2.5rem; color: var(--kw-dim); font-size: 0.93rem; }
.kw-foot h2 { font: 700 0.92rem/1.3 var(--kw-head); color: var(--kw-gold); letter-spacing: 0.05em; margin: 0 0 0.6rem; }
.kw-foot ul { list-style: none; margin: 0; padding: 0; }
.kw-foot li { margin-bottom: 0.35rem; }
.kw-foot a { color: var(--kw-dim); text-decoration: none; }
.kw-foot a:hover { color: var(--kw-gold-hi); }
.kw-foot p { margin: 0.6rem 0 0; max-width: 26rem; }

@media (max-width: 1180px) {
  .kw-frame { grid-template-columns: 16rem minmax(0, 1fr); }
  .kw-toc { display: none; }
  .kp-cols { grid-template-columns: minmax(0, 1fr); }
  .kp-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .kp-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .kw-top__in { flex-wrap: wrap; row-gap: 0.3rem; }
  .kw-tabs { order: 3; margin: 0 calc(var(--kw-pad) * -1); padding: 0 var(--kw-pad); width: calc(100% + var(--kw-pad) * 2); overflow-x: auto; scrollbar-width: none; }
  .kw-tabs a { padding: 0.5rem 0.6rem; font-size: 0.95rem; gap: 0.35rem; }
  .kw-brand { margin-right: auto; }
  .kw a.kw-play { padding: 0.5rem 1rem; }
  .kw-top__acts .kw-ghost { padding: 0.5rem 0.8rem; max-width: 9rem; }
  .kw-frame, .kw-frame--plain { grid-template-columns: minmax(0, 1fr); gap: 1rem; padding-top: 1rem; }
  .kw-menu { position: static; max-height: none; padding: 0; }
  .kw-menu__fold { background: var(--kw-slab); border: 1px solid var(--kw-line); border-radius: 8px; padding: 0.75rem 1rem; }
  .kw-menu__fold > summary { display: block; font-weight: 700; cursor: pointer; }
  .kw-menu__fold[open] > summary { margin-bottom: 0.8rem; }
  .kp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
  .kp-tile { min-height: 9.5rem; }
  .kp-side { grid-template-columns: minmax(0, 1fr); }
  .kf-board { grid-template-columns: 3rem minmax(0, 1fr) auto; }
  .kf-thread { grid-template-columns: 2.75rem minmax(0, 1fr) auto; }
  .kf-board .kf-last, .kf-thread .kf-last { grid-column: 2 / -1; }
  .kf-count { text-align: right; }
  .kf-count b { display: inline; font-size: 1.05rem; margin-right: 0.25rem; }
  .kf-count span + span { display: none; }
  .kf-post { grid-template-columns: 1fr; }
  .kf-post__who { border-right: 0; border-bottom: 1px solid var(--kw-line); flex-direction: row; flex-wrap: wrap; justify-content: flex-start; text-align: left; gap: 0.4rem 0.7rem; padding: 0.7rem 1rem; }
  .kf-post__who .kf-ava { width: 2.25rem; height: 2.5rem; font-size: 1.05rem; }
  .kw-foot__in { grid-template-columns: 1fr 1fr; }
  .kw-foot__in > div:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .kp-groups { grid-template-columns: minmax(0, 1fr); }
  .kp-hero__side--valen { clip-path: polygon(0 0, 100% 0, 100% 40%, 0 60%); }
  .kp-hero__side--kazar { clip-path: polygon(0 60%, 100% 40%, 100% 100%, 0 100%); }
  .kw-pager { grid-template-columns: 1fr; }
  .kw-pager__next { grid-column: 1; }
  .kw-brand span { display: none; }
  .kf-emblem { width: 2.5rem; height: 2.5rem; }
  .kf-board { grid-template-columns: 2.5rem minmax(0, 1fr) auto; padding: 0.8rem 0.9rem; }
  .kf-thread { padding: 0.8rem 0.9rem; }
  .kp-hero__sides { font-size: 0.8rem; }
}
/*
 * ---- motion ----
 * Everything that moves is here, and only for a reader who has not asked for less motion. The banner
 * carries the show (embers, the light running along the border of the two kingdoms, the title arriving);
 * below it things answer the pointer: a row lights up, a button catches the light, a shield glints.
 * Only transform, opacity and filter are animated, except two small gradient sweeps.
 */
.kp-hero__embers, .kp-hero__seam { position: absolute; inset: 0; pointer-events: none; }
.kp-hero__embers { z-index: -1; overflow: hidden; -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 100%); mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 100%); }
.kp-hero__embers::before, .kp-hero__embers::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 200%;
  background-image:
    radial-gradient(3px 3px at 7% 12%, #ffd9a0 0, rgba(255, 150, 60, 0.55) 45%, transparent 75%),
    radial-gradient(2.5px 2.5px at 19% 43%, #ffb070 0, rgba(255, 110, 40, 0.5) 45%, transparent 75%),
    radial-gradient(4px 4px at 31% 27%, #ffe2b0 0, rgba(255, 160, 70, 0.5) 45%, transparent 75%),
    radial-gradient(2.5px 2.5px at 44% 8%, #ff9a5a 0, rgba(255, 90, 30, 0.5) 45%, transparent 75%),
    radial-gradient(3px 3px at 58% 36%, #ffd9a0 0, rgba(255, 150, 60, 0.55) 45%, transparent 75%),
    radial-gradient(2.5px 2.5px at 69% 19%, #ffb070 0, rgba(255, 110, 40, 0.5) 45%, transparent 75%),
    radial-gradient(4px 4px at 81% 46%, #ffe2b0 0, rgba(255, 160, 70, 0.5) 45%, transparent 75%),
    radial-gradient(2.5px 2.5px at 93% 30%, #ff9a5a 0, rgba(255, 90, 30, 0.5) 45%, transparent 75%);
  background-size: 100% 50%; opacity: 0;
}
.kp-hero__embers::after { background-size: 73% 50%; background-position: 40% 0; }
.kp-hero__seam { z-index: -2; clip-path: polygon(56% 0, 56.35% 0, 44.35% 100%, 44% 100%); background: linear-gradient(180deg, transparent 0%, rgba(255, 220, 140, 0.95) 50%, transparent 100%) 0 0 / 100% 300% no-repeat, rgba(226, 181, 82, 0.28); }
.kf-board::before, .kf-thread::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, var(--kw-gold-hi), var(--kw-ember)); transform: scaleY(0); transform-origin: 50% 100%; }
.kf-board:hover::before, .kf-thread:hover::before, .kf-board:focus-within::before, .kf-thread:focus-within::before { transform: scaleY(1); }
.kf-board:hover .kf-emblem { box-shadow: inset 0 1px 0 rgba(255, 222, 150, 0.25), 0 0 18px -2px rgba(255, 190, 90, 0.75); border-color: var(--kw-gold); }
.kp-tile:hover, .kw-pager a:hover { box-shadow: 0 0 0 1px rgba(226, 181, 82, 0.35), 0 18px 40px -18px rgba(255, 170, 70, 0.55); }
.kp-panel { position: relative; }
.kp-panel::after { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 220, 140, 0.8), transparent); opacity: 0.55; pointer-events: none; }
.kw a.kw-play, .kw button.kw-play { position: relative; overflow: hidden; }
.kw a.kw-play::after, .kw button.kw-play::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.65), transparent); transform: translateX(-130%) skewX(-18deg); pointer-events: none; }
.kf-ava { position: relative; overflow: hidden; }
.kf-ava::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.55) 50%, transparent 65%); transform: translateX(-120%); pointer-events: none; }

@media (max-width: 560px) {
  .kp-hero__seam { clip-path: polygon(0 60%, 100% 40%, 100% 40.5%, 0 60.5%); background: linear-gradient(90deg, transparent 0%, rgba(255, 220, 140, 0.95) 50%, transparent 100%) 0 0 / 300% 100% no-repeat, rgba(226, 181, 82, 0.28); }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* The banner. */
  .kp-hero__embers::before { animation: kp-rise 17s linear infinite; }
  .kp-hero__embers::after { animation: kp-rise 27s linear -9s infinite; }
  .kp-hero__seam { animation: kp-seam 5.5s ease-in-out infinite; }
  .kp-hero__in > * { animation: kp-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .kp-hero__in > :nth-child(2) { animation-delay: 0.08s; }
  .kp-hero__in > :nth-child(3) { animation-delay: 0.16s; }
  .kp-hero__in > :nth-child(4) { animation-delay: 0.24s; }
  .kp-hero__in > :nth-child(5) { animation-delay: 0.32s; }
  .kp-hero__in > :nth-child(6) { animation-delay: 0.4s; }
  .kp-hero__in > :nth-child(7) { animation-delay: 0.48s; }
  .kp-hero__in > .kp-hero__crest { animation: kp-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both, kp-glow 4.5s ease-in-out 0.9s infinite; }
  .kp-hero__in > .kp-hero__logo { animation: kp-in 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both, kp-glow 4.5s ease-in-out 0.9s infinite; }
  .kp-hero h1 { background: linear-gradient(100deg, var(--kw-ink) 35%, #ffd27a 50%, var(--kw-ink) 65%) 100% 0 / 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 2px 8px #000); animation: kp-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) 0.16s both, kp-sheen 7s ease-in-out 1.2s infinite; }
  .kp-tiles > li { animation: kp-in 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .kp-tiles > li:nth-child(1) { animation-delay: 0.45s; }
  .kp-tiles > li:nth-child(2) { animation-delay: 0.53s; }
  .kp-tiles > li:nth-child(3) { animation-delay: 0.61s; }
  .kp-tiles > li:nth-child(4) { animation-delay: 0.69s; }

  /* Things that answer the pointer. */
  .kf-board::before, .kf-thread::before { transition: transform 0.22s ease; }
  .kf-board, .kf-thread { transition: background-color 0.2s ease; }
  .kf-emblem { transition: transform 0.25s cubic-bezier(0.3, 1.6, 0.5, 1), box-shadow 0.25s ease, border-color 0.25s ease; }
  .kf-board:hover .kf-emblem { transform: scale(1.1) rotate(-4deg); }
  .kp-tile, .kw-pager a { transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; }
  .kp-tile:hover, .kw-pager a:hover { transform: translateY(-4px); }
  .kw a.kw-play:hover::after, .kw button.kw-play:hover:not(:disabled)::after { animation: kp-shine 0.75s ease; }
  .kf-thread:hover .kf-ava::after, .kf-recent li:hover .kf-ava::after, .kf-post:hover .kf-ava::after { animation: kp-glint 0.7s ease; }
  .kw-brand img { transition: transform 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
  .kw-brand:hover img { transform: rotate(-8deg) scale(1.08); }
  .kw-tabs a { transition: color 0.15s ease, background-color 0.15s ease; }
  .kp-group li a, .kw-menu li a { transition: background-color 0.15s ease, transform 0.15s ease; }
  .kp-group li a:hover { transform: translateX(4px); }
  .kp-panel::after { animation: kp-line 6s ease-in-out infinite; }
  body.kw::after { animation: kp-breathe 9s ease-in-out infinite; }
  .kf-post--first { animation: kp-in 0.5s ease both, kp-first 1.6s ease-out 0.3s 1; }

  /* What is written in a thread arrives one after the other. */
  .kf-post { animation: kp-in 0.45s ease both; }
  .kf-modal__box { animation: kp-in 0.28s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  .kf-post:nth-of-type(2) { animation-delay: 0.06s; }
  .kf-post:nth-of-type(3) { animation-delay: 0.12s; }
  .kf-post:nth-of-type(4) { animation-delay: 0.18s; }
  .kf-post:nth-of-type(n + 5) { animation-delay: 0.24s; }
  .kf-head, .kw-pagehead { animation: kp-in 0.5s ease both; }
  .kf-head::before, .kw-pagehead::before { animation: kp-drift 30s ease-in-out infinite alternate; }

  /* Panels further down rise into place as they are scrolled to (where the browser can tie an animation to scrolling). */
  @supports (animation-timeline: view()) {
    .kp-cols > .kp-panel, .kp-side > .kp-panel, .kp-groups > .kp-panel, .kw-table, .kw-note, .kw-ask {
      animation: kp-up linear both; animation-timeline: view(); animation-range: entry 0% entry 35%;
    }
  }
}
@keyframes kp-breathe { 0%, 100% { opacity: 0.65; } 50% { opacity: 1; } }
@keyframes kp-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes kp-up { from { opacity: 0.15; transform: translateY(28px) scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes kp-drift { from { transform: scale(1.02); } to { transform: scale(1.1) translateY(-1.5%); } }
@keyframes kp-rise { 0% { transform: translateY(0); opacity: 0; } 8% { opacity: 0.9; } 92% { opacity: 0.9; } 100% { transform: translateY(-50%); opacity: 0; } }
@keyframes kp-seam { 0% { background-position: 0 100%, 0 0; opacity: 0.5; } 50% { opacity: 1; } 100% { background-position: 0 0, 0 0; opacity: 0.5; } }
@keyframes kp-glow { 0%, 100% { filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 0 rgba(255, 110, 40, 0)); } 50% { filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 26px rgba(255, 120, 50, 0.55)); } }
@keyframes kp-sheen { 0%, 55% { background-position: 100% 0; } 85%, 100% { background-position: 0 0; } }
@keyframes kp-shine { from { transform: translateX(-130%) skewX(-18deg); } to { transform: translateX(330%) skewX(-18deg); } }
@keyframes kp-glint { from { transform: translateX(-120%); } to { transform: translateX(120%); } }
@keyframes kp-line { 0%, 100% { opacity: 0.25; transform: scaleX(0.6); } 50% { opacity: 0.8; transform: scaleX(1); } }
@keyframes kp-first { 0% { box-shadow: inset 0 2px 0 var(--kw-gold), 0 0 0 0 rgba(255, 200, 90, 0.55); } 100% { box-shadow: inset 0 2px 0 var(--kw-gold), 0 0 0 18px rgba(255, 200, 90, 0); } }
@media print {
  body.kw::before, body.kw::after { display: none; }
  .kw-top, .kw-menu, .kw-foot, .kw-toc, .kw-pager, .kw-ask { display: none; }
  body.kw { background: #fff; color: #000; }
  .kw-frame { display: block; }
  .kw-pagehead::before { display: none; }
}

/* A translated legal page says under its heading that the Turkish text is the one that binds (site/localize.ts). */
.kw-legalnote { margin: 1.2rem 0; padding: 0.8rem 1.1rem; font-size: 0.95em; color: var(--kw-dim); background: var(--kw-slab); border: 1px solid var(--kw-line-soft); border-left: 3px solid var(--kw-gold); border-radius: 0 6px 6px 0; }

/* Under a machine-translated message: that it is one, and the way back to what was written (forum/main.tsx PostText). */
.kf-said { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin: 0.45rem 0 0; font-size: 0.82rem; color: var(--kw-dim); }
.kf-said span::before { content: '\2248\00a0'; }
.kf-said button { padding: 0; font: inherit; color: var(--kw-gold); background: none; border: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.kf-said button:hover { color: var(--kw-gold-hi); }

/*
 * The language chooser of the site, the forum and the game's login screen (kural 89): a flag and the language's
 * own name. One file for the three: the rehber's pages get it at the end of /wiki/site.css (vite.config.ts
 * `karvenSiteFiles`), the forum and the game import it.
 *
 * The flags are drawn here (3:2, no picture file to fetch); the page's policy allows `data:` pictures.
 * A flag is only a sign beside the NAME: the name is what says which language it is.
 */
.kv-flag {
  display: inline-block;
  flex: none;
  width: 1.5em;
  height: 1em;
  border-radius: 2px;
  background: #3a2f20 center / cover no-repeat;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22);
  vertical-align: -0.12em;
}
.kv-flag--tr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23e30a17' d='M0 0h30v20H0z'/%3E%3Ccircle cx='11.25' cy='10' r='5' fill='%23fff'/%3E%3Ccircle cx='12.5' cy='10' r='4' fill='%23e30a17'/%3E%3Cpath fill='%23fff' d='M14.7 10l1.73-.56V7.62l1.07 1.47 1.72-.56L18.16 10l1.06 1.47-1.72-.56-1.07 1.47v-1.82z'/%3E%3C/svg%3E"); }
.kv-flag--en { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23012169' d='M0 0h30v20H0z'/%3E%3Cpath d='M0 0l30 20M30 0L0 20' stroke='%23fff' stroke-width='4'/%3E%3Cpath d='M0 0l30 20M30 0L0 20' stroke='%23c8102e' stroke-width='1.4'/%3E%3Cpath d='M15 0v20M0 10h30' stroke='%23fff' stroke-width='6.6'/%3E%3Cpath d='M15 0v20M0 10h30' stroke='%23c8102e' stroke-width='4'/%3E%3C/svg%3E"); }
.kv-flag--de { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath d='M0 0h30v20H0z'/%3E%3Cpath fill='%23dd0000' d='M0 6.67h30V20H0z'/%3E%3Cpath fill='%23ffce00' d='M0 13.33h30V20H0z'/%3E%3C/svg%3E"); }
.kv-flag--pt-BR { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23009c3b' d='M0 0h30v20H0z'/%3E%3Cpath fill='%23ffdf00' d='M15 2.4L27.2 10 15 17.6 2.8 10z'/%3E%3Ccircle cx='15' cy='10' r='4.3' fill='%23002776'/%3E%3Cpath d='M10.9 9.1c2.9-.6 5.9.1 8.2 1.9' fill='none' stroke='%23fff' stroke-width='.8'/%3E%3C/svg%3E"); }
.kv-flag--pl { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23fff' d='M0 0h30v20H0z'/%3E%3Cpath fill='%23dc143c' d='M0 10h30v10H0z'/%3E%3C/svg%3E"); }
.kv-flag--fr { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23fff' d='M0 0h30v20H0z'/%3E%3Cpath fill='%230055a4' d='M0 0h10v20H0z'/%3E%3Cpath fill='%23ef4135' d='M20 0h10v20H20z'/%3E%3C/svg%3E"); }
.kv-flag--es { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23aa151b' d='M0 0h30v20H0z'/%3E%3Cpath fill='%23f1bf00' d='M0 5h30v10H0z'/%3E%3C/svg%3E"); }
.kv-flag--it { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23fff' d='M0 0h30v20H0z'/%3E%3Cpath fill='%23009246' d='M0 0h10v20H0z'/%3E%3Cpath fill='%23ce2b37' d='M20 0h10v20H20z'/%3E%3C/svg%3E"); }
.kv-flag--ru { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23fff' d='M0 0h30v20H0z'/%3E%3Cpath fill='%230039a6' d='M0 6.67h30V20H0z'/%3E%3Cpath fill='%23d52b1e' d='M0 13.33h30V20H0z'/%3E%3C/svg%3E"); }
.kv-flag--ro { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23fcd116' d='M0 0h30v20H0z'/%3E%3Cpath fill='%23002b7f' d='M0 0h10v20H0z'/%3E%3Cpath fill='%23ce1126' d='M20 0h10v20H20z'/%3E%3C/svg%3E"); }
.kv-flag--id { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 20'%3E%3Cpath fill='%23fff' d='M0 0h30v20H0z'/%3E%3Cpath fill='%23ce1126' d='M0 0h30v10H0z'/%3E%3C/svg%3E"); }

/* ---- the chooser: the language in use, and under it the list of all eleven ---- */
.kv-lang {
  position: relative;
  flex: none;
  font: 600 0.84rem / 1.2 Inter, system-ui, sans-serif;
  letter-spacing: 0;
  text-transform: none;
}
.kv-lang > summary {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.1rem;
  padding: 0.3rem 0.6rem;
  list-style: none;
  color: #e6d3a8;
  background: rgba(14, 11, 8, 0.86);
  border: 1px solid #5a4320;
  border-radius: 5px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.kv-lang > summary::-webkit-details-marker { display: none; }
.kv-lang > summary::after {
  content: '';
  margin: 0.3rem 0 0 0.1rem;
  border: 0.28rem solid transparent;
  border-top-color: currentColor;
  opacity: 0.75;
}
.kv-lang > summary:hover,
.kv-lang[open] > summary { border-color: #d9b56a; color: #fff1cf; }
.kv-lang > summary:focus-visible { outline: 2px solid #d9b56a; outline-offset: 2px; }
.kv-lang__list {
  position: absolute;
  top: calc(100% + 5px);
  right: 0;
  z-index: 80;
  display: grid;
  gap: 1px;
  min-width: 13.5rem;
  max-height: min(70vh, 27rem);
  margin: 0;
  padding: 0.3rem;
  overflow: auto;
  list-style: none;
  background: #15100b;
  border: 1px solid #5a4320;
  border-radius: 6px;
  box-shadow: 0 16px 36px -10px #000;
}
.kv-lang__list li { margin: 0; padding: 0; }
.kv-lang__list a,
.kv-lang__list button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-height: 2.2rem;
  padding: 0.35rem 0.6rem;
  font: inherit;
  text-align: left;
  text-decoration: none;
  color: #d8c7a0;
  background: none;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}
.kv-lang__list a:hover,
.kv-lang__list button:hover,
.kv-lang__list a:focus-visible,
.kv-lang__list button:focus-visible { color: #fff1cf; background: #2a1f12; outline: none; }
.kv-lang__list [aria-current='true'] { color: #ffd98a; background: #231a0f; box-shadow: inset 2px 0 0 #d9b56a; }
/* (the login screen keeps its chooser at the foot of the form: the list opens upward, in the middle) */
.kv-lang--up .kv-lang__list { top: auto; right: auto; bottom: calc(100% + 5px); left: 50%; transform: translateX(-50%); }
/* On a phone the site's top strip has room for the flag only; the name stays there for a screen reader. */
@media (max-width: 760px) {
  .kw-top .kv-lang > summary .kv-lang__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}
