/*
 * Kor Diyarı — "Altın ve Kor" TEK DEĞER DOSYASI (ALAZ-UI-TOKEN-01 · maket v2, Murat onaylı 08.11)
 *
 * Oyunun bütün arayüz değerleri buradan gelir: renk, altın kenar, köşe taşı, doku, boşluk, gölge/ışıma,
 * dokunma hedefi, yazı, hareket. Yeni CSS ham renk/ölçü YAZMAZ, `var(--ko-…)` kullanır. Eski iki set
 * (uiTheme.css içindeki `--kd-*` ve geriye dönük `--bg-deep`, `--glass-*`, `--border-*` köprüsü) bu değerlere
 * bağlıdır: değer burada değişince bütün oyun değişir.
 *
 * v2 dili: koyu kızıl-kahve zemin, işlenmiş altın çift çizgi, köşelerde altın yuvalı kor yakutu (köşe taşı),
 * içten sıcak kor ışıması, boyalı oyun ikonları (uiIcons.mjs), fantastik serif başlık. Düz kutu / çizgi ikon /
 * modern sans YOK. Ortak parçalar: uiParts.css + uiParts.mjs. Vitrin: /src/client/dev/vitrin.html
 *
 * SANAT KİTİ (ALAZ-UI-SANAT-01) gelince: yalnız `--ko-frame-src` (9 dilim çerçeve), `--ko-stud`, `--ko-stud-m`
 * ve `--ko-tex` bir PNG/WebP adresine çevrilir; parçalar ve yerleşim değişmez. Kit gelene kadar bunlar
 * aşağıdaki SVG taslaklarıdır (data: URI, CSP `img-src 'self' data:` izinli).
 *
 * Yazı tipleri oyunla birlikte gelir, dış CDN yok (CSP `font-src 'self'`):
 *   Cinzel (başlık) — SIL OFL 1.1, assets/fonts/OFL-Cinzel.txt. Roma yazıtı harfleri: antik, savaşsal,
 *     küçük boyda da okunur (Grenze gibi kırık harf değil, Türkçe büyük İ/Ş/Ğ temiz).
 *   Alegreya (metin) — SIL OFL 1.1, assets/fonts/OFL-Alegreya.txt. Kitap serifi: uzun metinde okunur,
 *     sayıları düz (lining) ve eşit genişlikte yazılabilir; modern sans (Fira, Inter) havası vermez.
 * İkisi de değişken yazı (400–900 tek dosya), latin + latin-ext alt kümesi: ı/İ/ğ/ş/ç/ö/ü var.
 * Alegreya `size-adjust: 105%`: aynı px'te x-yüksekliği eski sistem yazısından %10 küçük (0,456 / 0,508),
 * genişliği %4 dar (ölçüm 08.11). %105 ile genişlik eski yazıya eşitlenir (+%0,8), küçük harf %5 büyür:
 * oyundaki 12–13 px yazılar okunur kalır, yerleşim tabana yakın kalır.
 */

/* ── Yazı tipleri ─────────────────────────────────────────────────────────── */
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../../assets/fonts/cinzel-latin.woff2") format("woff2");
  /* RAKAMLAR (U+0030-0039) bilerek dışarıda: Cinzel'in "1"i Roma "I"sine benziyor (V1 → "VI", 31 → "3I").
     Rakamlar yığındaki sonraki yazıdan, Alegreya'dan çizilir; başlıkta da "+7", "41.036" net okunur. */
  unicode-range: U+0000-002F, U+003A-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Cinzel";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../../assets/fonts/cinzel-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  size-adjust: 105%;
  src: url("../../assets/fonts/alegreya-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  size-adjust: 105%;
  src: url("../../assets/fonts/alegreya-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  size-adjust: 105%;
  src: url("../../assets/fonts/alegreya-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Alegreya";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  size-adjust: 105%;
  src: url("../../assets/fonts/alegreya-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Değerler ─────────────────────────────────────────────────────────────── */
:root {
  /* Zemin: koyu kızıl-kahve (koyudan açığa). Eski obsidyen morunun yerini sıcak toprak aldı. */
  --ko-ground-990: #0e0504; /* en dip: tuval arkası, sahne (PWA theme-color ile aynı) */
  --ko-ground-950: #120604; /* çukur: giriş alanı, çubuk yatağı */
  --ko-ground-900: #170906; /* pencere zemini */
  --ko-ground-800: #22100a; /* kart / levha */
  --ko-ground-700: #33170d; /* kontrol */
  --ko-ground-600: #4a2214; /* kontrol üzerinde / pasif çerçeve */
  --ko-socket: #100503;       /* gömülü yuva (eşya/yetenek) */
  --ko-socket-hover: #2a120a;
  --ko-ink: #1a0904;          /* koyu kontur: ikon, köşe taşı, düğme dış çizgisi */

  /* İşlenmiş altın: çerçeve, başlık, dikiş */
  --ko-gold-50: #fff6d6;
  --ko-gold-100: #f7dc98;
  --ko-gold-300: #e6b45a;
  --ko-gold-500: #b98330;
  --ko-gold-700: #7a5019;
  --ko-gold-900: #3d260b;
  --ko-bronze: #8a5a22;       /* ikinci derece kenar (rozet, giriş alanı) */
  --ko-bronze-dim: #6b4520;   /* pasif kenar, ince ayraç */

  /* Kor: vurgu, eylem, odak, ışıma */
  --ko-ember-100: #ffdcae;
  --ko-ember-200: #ffc87a;
  --ko-ember-300: #ffa552;
  --ko-ember-500: #f06a24;
  --ko-ember-600: #d4561c;
  --ko-ember-700: #a8361a;
  --ko-on-ember: #2a0c03; /* kor zemin üstündeki yazı */

  /* Metin */
  --ko-parchment: #f4e6c8; /* ana metin */
  --ko-sand: #e6d4b4;      /* ikincil metin */
  --ko-ash: #c4ab8a;       /* soluk metin, etiket */
  --ko-ash-2: #8f7a60;     /* pasif */

  /* Durum */
  --ko-ok: #9bdc6e;
  --ko-warn: #ffc04d;
  --ko-bad: #ff6b4d;
  --ko-online: #9bdc6e;
  --ko-delta-up: #9bdc6e;
  --ko-delta-down: #ff8a6a;

  /* Kaynak çubukları (üst → alt renk) */
  --ko-hp-hi: #ff9a80;  --ko-hp-mid: #e8341f;  --ko-hp-lo: #8e120a;
  --ko-mp-hi: #b2dcff;  --ko-mp-mid: #3388ea;  --ko-mp-lo: #123d8a;
  --ko-xp-hi: #ffe9a0;  --ko-xp-lo: #d9a030;

  /* Nadirlik: çerçeve / metin / ışıma / ikon yuvası zemini */
  --ko-rarity-common: #8a7a62;    --ko-rarity-common-text: #cfc2ad;    --ko-rarity-common-glow: rgba(168, 150, 120, 0.16);  --ko-rarity-common-bg: #2e1c10;
  --ko-rarity-rare: #4fa8ff;      --ko-rarity-rare-text: #7cc4ff;      --ko-rarity-rare-glow: rgba(79, 168, 255, 0.45);     --ko-rarity-rare-bg: #13304f;
  --ko-rarity-epic: #b46bff;      --ko-rarity-epic-text: #d7a6ff;      --ko-rarity-epic-glow: rgba(180, 107, 255, 0.5);     --ko-rarity-epic-bg: #3e1a5c;
  --ko-rarity-legendary: #f2b441; --ko-rarity-legendary-text: #ffcf6a; --ko-rarity-legendary-glow: rgba(242, 180, 65, 0.5); --ko-rarity-legendary-bg: #4a2a08;
  --ko-rarity-mythic: #ff5a3a;    --ko-rarity-mythic-text: #ffb3a2;    --ko-rarity-mythic-glow: rgba(255, 90, 58, 0.56);    --ko-rarity-mythic-bg: #4a0f08;

  /* Saydam katmanlar */
  --ko-veil: rgba(14, 5, 4, 0.76);          /* pencere arkası perde */
  --ko-veil-strong: rgba(10, 3, 2, 0.84);   /* odaklı pencere arkası (koyu) */
  --ko-glass: rgba(23, 9, 6, 0.94);          /* yarı saydam levha */
  --ko-line: rgba(230, 180, 90, 0.42);       /* ince altın ayraç */
  --ko-line-faint: rgba(230, 180, 90, 0.2);
  --ko-hover-wash: rgba(255, 165, 82, 0.12);

  /* Altın kenar: border-image ve dolgu olarak (üstte parlak, ortada koyu, altta yine parlak: işlenmiş metal) */
  --ko-gold-edge: linear-gradient(180deg, #fff3c4 0%, #f0c464 20%, #a8701f 48%, #e2ae4e 70%, #6e4310 100%);
  --ko-bronze-edge: linear-gradient(180deg, #e4b46a 0%, #a2692a 40%, #5e3a14 100%);
  --ko-gold-text: linear-gradient(180deg, #fff6d6 10%, #f2c768 55%, #b47a2a 95%);
  --ko-ember-text: linear-gradient(180deg, #fff8dc 8%, #ffd27a 45%, #f08a34 92%);
  /* Levha dolgusu: tepeden sızan kor + koyu kızıl-kahve */
  --ko-plate-fill: radial-gradient(130% 80% at 50% -10%, rgba(120, 46, 22, 0.55), transparent 60%), linear-gradient(180deg, rgba(40, 18, 11, 0.97), rgba(20, 8, 5, 0.97));
  --ko-btn-fill: linear-gradient(180deg, #5c2b16, #331509 60%, #240d06);
  --ko-btn-fill-hover: linear-gradient(180deg, #7a3a1c, #45200e 60%, #2e1108);
  --ko-btn-fill-press: linear-gradient(180deg, #1e0a05, #33150a);
  --ko-molten: linear-gradient(180deg, #ffd98a 0%, #f7943a 28%, #d4561c 68%, #8e2a0c 100%);
  --ko-molten-hover: linear-gradient(180deg, #ffe7a8 0%, #ffa94a 28%, #e8682a 68%, #a3360f 100%);
  --ko-molten-press: linear-gradient(180deg, #c9561c, #8e2a0c);
  --ko-tab-on-fill: linear-gradient(180deg, #7e3c19, #3c1a0b 75%);
  --ko-well: linear-gradient(#0a0302, #2a120a); /* çubuk/giriş yatağı */

  /* Köşe: v2'de pah yok, levhalar dövme metal gibi keskin; eski border-radius yerleri için küçük yuvarlatma. */
  --ko-radius-control: 2px;
  --ko-radius-panel: 3px;
  --ko-radius-window: 4px;

  /* Boşluk ölçeği */
  --ko-space-1: 4px;
  --ko-space-2: 8px;
  --ko-space-3: 12px;
  --ko-space-4: 16px;
  --ko-space-5: 24px;
  --ko-space-6: 32px;

  /* Dokunma hedefi */
  --ko-hit: 38px;        /* masaüstü (maket v2 düğme boyu) */
  --ko-hit-touch: 44px;  /* telefon */
  --ko-hit-lg: 50px;     /* ana eylem */

  /* Gölge ve ışıma */
  --ko-glow: 0 0 22px rgba(255, 140, 50, 0.22);
  --ko-glow-ember: 0 0 18px rgba(255, 150, 60, 0.5);
  --ko-glow-strong: 0 0 28px rgba(255, 160, 60, 0.7);
  --ko-shadow-window: 0 0 0 1px #0b0302, 0 0 22px rgba(255, 140, 50, 0.22), 0 24px 64px rgba(0, 0, 0, 0.84);
  --ko-shadow-panel: 0 0 0 1px #0b0302, 0 12px 26px rgba(0, 0, 0, 0.55);
  --ko-shadow-inner: inset 0 0 0 1px #160703, inset 0 0 0 2px rgba(247, 220, 152, 0.22), inset 0 0 28px rgba(240, 106, 36, 0.13);
  --ko-shadow-socket: inset 0 3px 7px rgba(0, 0, 0, 0.9), inset 0 0 0 1px rgba(255, 220, 150, 0.06), 0 1px 0 rgba(230, 180, 90, 0.2);
  --ko-shadow-tooltip: 0 0 0 1px #0b0302, 0 20px 48px rgba(0, 0, 0, 0.92), 0 0 24px rgba(240, 106, 36, 0.28);

  /* Altın çizgi: dikey ayraç; köz dikişi: levhanın üst kenarındaki imza çizgisi */
  --ko-brass-line: linear-gradient(180deg, rgba(247, 220, 152, 0), rgba(230, 180, 90, 0.85) 30%, rgba(230, 180, 90, 0.85) 70%, rgba(247, 220, 152, 0));
  --ko-seam: linear-gradient(90deg, transparent, var(--ko-ember-300) 30%, var(--ko-ember-100) 50%, var(--ko-ember-300) 70%, transparent);
  --ko-rule: linear-gradient(90deg, transparent, rgba(230, 180, 90, 0.45), transparent); /* yatay ayraç */

  /*
   * SANAT YUVALARI (kit gelince PNG/WebP ile değişir).
   * --ko-frame-src: 9 dilim çerçeve kaynağı, 72×72, dilim 24 (köşe = altın yuvada kor yakutu, kenar = çift
   *   altın şerit). Kenar gradyanı kenara DİK çizilir; gerildiğinde bozulmaz. Orta boş: dolguyu parça verir.
   */
  --ko-frame-slice: 24;
  --ko-frame-src: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='72' viewBox='0 0 72 72'%3E%3Cdefs%3E%3ClinearGradient id='v' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23fff3c4'/%3E%3Cstop offset='.3' stop-color='%23f0c464'/%3E%3Cstop offset='.65' stop-color='%23a8701f'/%3E%3Cstop offset='1' stop-color='%236e4310'/%3E%3C/linearGradient%3E%3ClinearGradient id='h' x1='0' y1='0' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='%23fff3c4'/%3E%3Cstop offset='.3' stop-color='%23f0c464'/%3E%3Cstop offset='.65' stop-color='%23a8701f'/%3E%3Cstop offset='1' stop-color='%236e4310'/%3E%3C/linearGradient%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff3c4'/%3E%3Cstop offset='.4' stop-color='%23e2ae4e'/%3E%3Cstop offset='.75' stop-color='%238a5716'/%3E%3Cstop offset='1' stop-color='%23f0c464'/%3E%3C/linearGradient%3E%3CradialGradient id='r' cx='.4' cy='.35' r='.7'%3E%3Cstop offset='0' stop-color='%23ffd2a0'/%3E%3Cstop offset='.35' stop-color='%23f06a24'/%3E%3Cstop offset='1' stop-color='%236a1408'/%3E%3C/radialGradient%3E%3Cg id='s'%3E%3Cpath d='M10 .8L19.2 10 10 19.2 .8 10z' fill='url(%23g)' stroke='%231a0904' stroke-width='1.1'/%3E%3Cpath d='M10 4.8L15.2 10 10 15.2 4.8 10z' fill='url(%23r)' stroke='%233d1204' stroke-width='.8'/%3E%3Cpath d='M8.6 7.2L10 5.9 11 6.9 9.4 8.4z' fill='%23fff4dc' opacity='.9'/%3E%3C/g%3E%3C/defs%3E%3Cg fill='%230b0302'%3E%3Crect x='9' y='9' width='54' height='1'/%3E%3Crect x='9' y='62' width='54' height='1'/%3E%3Crect x='9' y='9' width='1' height='54'/%3E%3Crect x='62' y='9' width='1' height='54'/%3E%3C/g%3E%3Crect x='10' y='10' width='52' height='3' fill='url(%23v)'/%3E%3Crect x='10' y='59' width='52' height='3' fill='url(%23v)' transform='rotate(180 36 60.5)'/%3E%3Crect x='10' y='10' width='3' height='52' fill='url(%23h)'/%3E%3Crect x='59' y='10' width='3' height='52' fill='url(%23h)' transform='rotate(180 60.5 36)'/%3E%3Crect x='13' y='13' width='46' height='46' fill='none' stroke='%23160703' stroke-width='1'/%3E%3Crect x='15.5' y='15.5' width='41' height='41' fill='none' stroke='%23e6b45a' stroke-opacity='.3' stroke-width='1'/%3E%3Cuse href='%23s'/%3E%3Cuse href='%23s' x='52'/%3E%3Cuse href='%23s' y='52'/%3E%3Cuse href='%23s' x='52' y='52'/%3E%3C/svg%3E");
  /* köşe taşı: altın yuvada kor yakutu (20×20) */
  --ko-stud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff3c4'/%3E%3Cstop offset='.4' stop-color='%23e2ae4e'/%3E%3Cstop offset='.75' stop-color='%238a5716'/%3E%3Cstop offset='1' stop-color='%23f0c464'/%3E%3C/linearGradient%3E%3CradialGradient id='r' cx='.4' cy='.35' r='.7'%3E%3Cstop offset='0' stop-color='%23ffd2a0'/%3E%3Cstop offset='.35' stop-color='%23f06a24'/%3E%3Cstop offset='1' stop-color='%236a1408'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M10 .6L19.4 10 10 19.4 .6 10z' fill='url(%23g)' stroke='%231a0904' stroke-width='1.1'/%3E%3Cpath d='M10 4.6L15.4 10 10 15.4 4.6 10z' fill='url(%23r)' stroke='%233d1204' stroke-width='.8'/%3E%3Cpath d='M8.6 7.2L10 5.9 11 6.9 9.4 8.4z' fill='%23fff4dc' opacity='.9'/%3E%3C/svg%3E");
  /* orta pul: düz altın elmas (16×16) */
  --ko-stud-m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cdefs%3E%3CradialGradient id='g' cx='.38' cy='.32' r='.75'%3E%3Cstop offset='0' stop-color='%23fff6d6'/%3E%3Cstop offset='.45' stop-color='%23e2ae4e'/%3E%3Cstop offset='1' stop-color='%236e4310'/%3E%3C/radialGradient%3E%3C/defs%3E%3Cpath d='M8 .8L15.2 8 8 15.2 .8 8z' fill='url(%23g)' stroke='%231a0904' stroke-width='1'/%3E%3Ccircle cx='8' cy='8' r='2' fill='%237a3a12' stroke='%232a0e04' stroke-width='.6'/%3E%3C/svg%3E");
  /* doku: ince sıcak gren (deri/taş hissi; 180×180 döşenir) */
  --ko-tex: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .95  0 0 0 0 .62  0 0 0 0 .32  0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* Yazı */
  --ko-font-display: "Cinzel", "Alegreya", "Times New Roman", serif; /* rakamlar Alegreya (yukarıdaki not) */
  --ko-font-body: "Alegreya", "Iowan Old Style", Georgia, serif;
  --ko-font-mono: ui-monospace, Menlo, Consolas, monospace;
  --ko-fs-xs: 13px;   /* en küçük okunur boy (Sade Ekran Kuralı: 13 altı yok) */
  --ko-fs-sm: 14px;
  --ko-fs-md: 15px;
  --ko-fs-lg: 16px;
  --ko-fs-xl: 20px;
  --ko-fs-2xl: 24px;
  --ko-fs-title: 24px; /* pencere başlığı (Cinzel; geniş harf, 26 yerine 24) */

  /* Hareket */
  --ko-dur-fast: 120ms;
  --ko-dur-base: 180ms;
  --ko-dur-slow: 320ms;
  --ko-ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
