/* Yazı tipleri sitenin kendi sunucusundan (OFL, web/assets/font): yalnız Latin ve Latin Genişletilmiş (Türkçe) */
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/assets/font/source-sans-3-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: 'Source Sans 3';
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url('/assets/font/source-sans-3-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: 'Source Sans 3';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/font/source-sans-3-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: 'Source Sans 3';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/font/source-sans-3-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;
}

@font-face {
  font-family: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/font/cinzel-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: 'Cinzel';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('/assets/font/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;
}

:root {
  --bg: #0e0c13;
  --bg-glow: #1d1530;
  --panel: #18141f;
  --panel-2: #221c2c;
  --border: #372d44;
  --text: #efe9f5;
  --muted: #a397b3;
  --gold: #d9ad45;
  --gold-soft: #f4d88a;
  --red: #e3545c;
  --green: #4fc27a;
  --blue: #58a6e8;
  --team-a: #58a6e8;
  --team-b: #e3545c;
  --radius: 4px;
  --r-sm: 3px;
  --display: 'Cinzel', Georgia, serif;
  --ui: 'Source Sans 3', 'Segoe UI', system-ui, sans-serif;
  /* Tek çerçeve dili: bronz dış çizgi, ince altın iç çizgi, köşelerde elmas */
  --line: #4a3a26;
  --line-gold: #d9ad4566;
  /* İkinci düğme ve seçili olmayan sekme çizgisi: panel üstünde en az 3:1 (WCAG 1.4.11) */
  --line-strong: #8a6a2c;
  /* Hareket: üzerine gelme, basma, pencere açılma */
  --t-hover: 140ms ease-out;
  --t-press: 70ms ease-out;
  --t-open: 220ms ease-out;
  --frame-shadow: inset 0 0 0 1px #0000008c, inset 0 0 0 2px #d9ad4538, 0 6px 18px #00000073;
  --corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10'%3E%3Cpath d='M5 0L10 5L5 10L0 5Z' fill='%23d9ad45'/%3E%3C/svg%3E");
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(1200px 600px at 50% -10%, var(--bg-glow), var(--bg) 70%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--ui);
  font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}

/* Tek renkli ikon (web/js/ui/icon.js): yazı boyunda, yazı renginde */
.ic {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  vertical-align: -0.2em;
  flex: none;
}

/* Kaynak renkleri: ikon kendi renginde, sayı yazı renginde */
.c-altin {
  color: #e9bb4f;
}

.c-enerji {
  color: #ffc84a;
}

.c-ruh {
  color: #b48cff;
}

.c-sandik {
  color: #e0a060;
}

.c-demir {
  color: #b9c1cc;
}

.c-ates {
  color: #ff8a3c;
}

.c-xp {
  color: #9fe0ff;
}

.ic.off,
.off .ic {
  opacity: 0.28;
}

a {
  color: var(--gold-soft);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: 0.02em;
  margin: 0;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 16px;
}

.loading,
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}

.card {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 #fff0c80f, inset 0 -1px 0 #00000073, 0 10px 24px -10px #000;
  padding: 16px;
}

.card > h2 {
  font-size: 20px;
  color: var(--gold-soft);
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.card > h2 small {
  font: 14px var(--ui);
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 16px;
}

.cols {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: start;
}

.muted {
  color: var(--muted);
}

/* Klavye odağı her yerde aynı: altın halka, dışında koyu boşluk */
:focus-visible {
  outline: 2px solid var(--gold-soft);
  outline-offset: 2px;
}

/* ---- Düğmeler (arayüz kiti): ana altın, ikinci koyu altın çizgili, tehlike kırmızı, kapalı gri ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #000;
  border-radius: var(--r-sm);
  font: 700 14px/1.1 var(--ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: #241605;
  text-shadow: 0 1px 0 #fff0c880;
  background: linear-gradient(#f4d88a, #d9ad45 55%, #a87b26);
  box-shadow: inset 0 1px 0 #fff5d2b3, 0 0 0 1px #d9ad4573, 0 3px 8px #00000080;
  transition: filter var(--t-hover), transform var(--t-press), box-shadow var(--t-hover);
}

.btn:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 0 0 1px #d9ad4573, 0 1px 3px #00000080;
}

/* Kapalı düğme: türü ne olursa olsun düz koyu zemin, soluk yazı, ince çizgi (gri kutu gibi değil). Durum, türün
   (ghost, danger, sayfaya özgü küçük düğme) renklerini ezmeli: bu yüzden !important */
.btn:disabled,
.k-btn:disabled {
  filter: none !important;
  cursor: not-allowed;
  color: #8a7f98 !important;
  text-shadow: none !important;
  background: #17121c !important;
  box-shadow: inset 0 0 0 1px #4a3a2699 !important;
  transform: none !important;
}

.btn:disabled .ic,
.k-btn:disabled .ic {
  color: inherit;
}

.btn .ic {
  width: 18px;
  height: 18px;
}

/* Dolu altın düğmede ikonlar koyu (altın üstünde altın görünmez) */
.btn:not(.ghost, .danger) .ic,
.k-btn:not(.ghost, .danger) .ic {
  color: #3a2508;
}

.btn.ghost {
  color: var(--gold-soft);
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(#251d2c, #17121c);
  box-shadow: inset 0 1px 0 #f4d88a1f, 0 0 0 1px var(--line-strong), 0 3px 8px #00000066;
}

.btn.danger {
  color: #fff1f0;
  text-shadow: 0 1px 2px #000;
  background: linear-gradient(#b8323a, #7d1d24);
  box-shadow: inset 0 1px 0 #ffc8c859, 0 0 0 1px #e3545c80, 0 3px 8px #00000080;
}

.btn.small {
  min-height: 34px;
  padding: 4px 12px;
  font-size: 13px;
}

.bar {
  height: 8px;
  border-radius: 2px;
  background: #2b2336;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width 0.35s ease;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  background: linear-gradient(#251d2c, #17121c);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  z-index: 50;
  max-width: calc(100vw - 32px);
  box-shadow: 0 10px 30px #0008;
}

.toast.error {
  border-left-color: var(--red);
}

/* Sonuç penceresindeki ödül etiketleri */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 4px 12px;
  font-weight: 600;
  white-space: nowrap;
}

/* Sayfa altındaki küçük bağlantı (Emeği geçenler); sayfa yüklenirken görünmez */
.site-foot {
  position: relative;
  padding: 8px 16px 20px;
  text-align: center;
  font-size: 13px;
}

.site-foot a {
  color: var(--muted);
}

main:has(> .loading:only-child) + .site-foot {
  visibility: hidden;
}

/* ---- Açılış ekranı (ui/boot.js): bütün pencereyi örter; amblem, "Biliyor muydun?", ipucu, durum satırı.
   İçerik kısa bir gecikmeyle belirir: hızlı açılışta (önbellek) hiç görünmeden kalkar ---- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse 60% 45% at 50% 42%, #2a1a0e, transparent 70%),
    radial-gradient(ellipse at 50% 50%, #140d08, #070504);
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}

.boot.out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

html:has(> body > .boot:not(.out)) {
  overflow: hidden;
}

.boot-in {
  display: grid;
  justify-items: center;
  width: min(100%, 440px);
  text-align: center;
  opacity: 0;
  animation: boot-in 0.45s ease 0.22s forwards;
}

.boot-mark {
  width: 120px;
  height: 120px;
  filter: drop-shadow(0 6px 18px #000c);
}

.boot-kick {
  margin: 26px 0 8px;
  font: 700 12px/1 var(--ui);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.boot-tip {
  min-height: 3em;
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: #eadfc6;
  text-wrap: balance;
}

.boot-step {
  margin: 22px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.boot-slow {
  margin: 10px 0 0;
  font-size: 13px;
  color: #d9c9a6;
}

.boot-slow .btn {
  margin-left: 8px;
}

@keyframes boot-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Ortak üst çubuk (ui/nav.js): Şehir · Karargah · Harita · Arena, cüzdan ve ses çipi ----
   Tek şerit: solda sekme biçimli bağlantılar, sağda bölmeli cüzdan. Cüzdan ve çip görünüşü karargah.css'te
   (.k-res, .k-chip, .k-status, .k-voice); nav'lı sayfa ikisini de yükler. */

.nav {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: space-between;
  gap: 0 12px;
  padding: 0 6px;
  background: linear-gradient(#1a1320f2, #0f0b13f2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: inset 0 1px 0 #f4d88a14, 0 6px 16px #00000080;
}

.nav > * {
  min-width: 0;
}

/* Bağlantılarla aynı satıra sığmazsa cüzdan alt satırda sağa yaslanır */
.nav-res {
  margin-left: auto;
}

.nav-links {
  display: flex;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 10px 12px 8px;
  font: 600 14px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  text-shadow: 0 1px 2px #000;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--t-hover), background var(--t-hover);
}

.nav-link .ic {
  width: 20px;
  height: 20px;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link.on {
  color: var(--gold-soft);
  border-bottom-color: var(--gold);
  background: linear-gradient(transparent, #d9ad451f);
}

.nav-link:focus-visible {
  outline-offset: -2px;
}

/* Ses çipinin kısa metni yalnız telefonda */
.nav-short {
  display: none;
}

@media (max-width: 560px) {
  /* Dört bağlantı tek satırda eşit: ikon üstte, kısa ad altta */
  .nav-links {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 100%;
  }

  .nav-link {
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 52px;
    padding: 6px 2px 4px;
    font-size: 12px;
    letter-spacing: 0.04em;
  }

  .nav-link span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-res {
    width: 100%;
  }

  .nav-full {
    display: none;
  }

  .nav-short {
    display: inline;
  }
}

/* Hareketi azalt: geçişler ve döngüler kapanır, bilgi kaybolmaz */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
