/* ==========================================================================
   KaleCraft — tekrar kullanılan parçalar: butonlar, paneller, sekmeler,
   bayrak/avatar/rozetler, form alanları, pencere (modal), bildirim (toast).
   ========================================================================== */

/* ---------- 3D oyun butonları ---------- */
.btn {
  font: 400 17px/1 var(--fd);
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 24px;
  border-radius: 12px;
  border: 3px solid var(--lip);
  background: linear-gradient(var(--p1), var(--p2));
  color: #fff;
  box-shadow: 0 5px 0 var(--lip), inset 0 2px 0 rgba(255, 255, 255, .12);
  cursor: pointer;
  text-decoration: none;
  transition: transform .08s, box-shadow .08s, filter .15s;
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--lip); }
.btn:focus-visible, .tab:focus-visible, .cat:focus-visible, .like:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.btn[disabled] { opacity: .6; cursor: progress; }
.btn.gold {
  background: linear-gradient(var(--gold2), var(--gold));
  border-color: var(--goldLip);
  box-shadow: 0 5px 0 var(--goldLip), inset 0 2px 0 rgba(255, 255, 255, .5);
  color: var(--goldInk);
}
.btn.gold:active { box-shadow: 0 1px 0 var(--goldLip); }
.btn.bl {
  background: linear-gradient(#7480ff, var(--blurple));
  border-color: var(--blLip);
  box-shadow: 0 5px 0 var(--blLip), inset 0 2px 0 rgba(255, 255, 255, .3);
}
.btn.bl:active { box-shadow: 0 1px 0 var(--blLip); }
.btn.blk { background: #0b0b0f; border-color: #2a2a35; box-shadow: 0 5px 0 #000; }
.btn.sq { padding: 0; width: 52px; }
.btn.sm { min-height: 42px; padding: 0 16px; font-size: 15px; }

/* ---------- panel (lacivert kutu) ---------- */
.panel {
  background: linear-gradient(var(--p1), var(--p2));
  border: 3px solid var(--lip);
  border-radius: 14px;
  box-shadow: 0 6px 0 var(--lip), inset 0 2px 0 rgba(255, 255, 255, .08);
  padding: 20px;
}
a.panel { text-decoration: none; color: #fff; }
a.panel:hover { filter: brightness(1.1); }

/* ---------- sekme çubuğu ---------- */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  background: linear-gradient(var(--p1), var(--p2));
  border: 3px solid var(--lip);
  border-radius: 14px;
  box-shadow: 0 5px 0 var(--lip);
  padding: 6px;
  margin-top: clamp(28px, 5vw, 56px);
}
.tab {
  font: 400 15px/1 var(--fd);
  text-transform: uppercase;
  color: var(--muted);
  border-radius: 10px;
  padding: 0 14px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.tab:hover { color: #fff; }
.tab[aria-current="page"] {
  background: linear-gradient(var(--gold2), var(--gold));
  color: var(--goldInk);
  box-shadow: 0 4px 0 var(--goldLip);
}
.tabs .sep { width: 2px; background: var(--lip); margin: 6px; }
@media (max-width: 760px) { .tabs { justify-content: center; } .tabs .sep { display: none; } }

/* ---------- bölüm başlığı ---------- */
.section { margin-top: 28px; }
.vhead { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.vhead h2 { font-size: clamp(28px, 4vw, 40px); }
.vhead p { color: var(--muted); max-width: 36em; margin-top: 6px; font-weight: 600; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.rows { display: grid; gap: 10px; }

/* ---------- klan bayrağı, avatar, rozetler ---------- */
.banner {
  width: 46px;
  height: 58px;
  margin: 0 auto;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  display: grid;
  place-items: center;
  font: 400 13px var(--fd);
  color: #fff;
  box-shadow: inset 0 6px 0 rgba(0, 0, 0, .25);
  flex: none;
}
.banner.sm { width: 32px; height: 40px; margin: 0; font-size: 10px; }
.banner.lg { width: 84px; height: 106px; font-size: 22px; margin: 0; }

.av {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  font: 400 18px var(--fd);
  color: #fff;
  border: 3px solid rgba(0, 0, 0, .3);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .25), inset 0 3px 0 rgba(255, 255, 255, .2);
  text-transform: uppercase;
}
.av.staff { background: var(--gold); color: var(--goldInk); }

.pill {
  font: 400 11px var(--fd);
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 6px;
  margin-right: 6px;
  vertical-align: 2px;
  color: #14203a;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .25);
}
.tbadge {
  font: 400 12px var(--fd);
  text-transform: uppercase;
  padding: 5px 8px;
  border-radius: 7px;
  color: #111;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
  white-space: nowrap;
}
.form { display: flex; gap: 3px; }
.form i {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  font: 400 11px/20px var(--fd);
  text-align: center;
  font-style: normal;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .25);
}
.w { background: var(--em); color: #08361f; }
.l { background: var(--red); color: #4a0b0d; }
.up { color: var(--em); }
.down { color: var(--red); }

/* ---------- form alanları ---------- */
.field {
  width: 100%;
  font: 700 16px var(--fb);
  background: var(--lip);
  border: 3px solid var(--lip2);
  color: #fff;
  border-radius: 12px;
  padding: 12px 14px;
}
.field:focus { outline: 3px solid var(--gold); outline-offset: 0; }
textarea.field { min-height: 130px; resize: vertical; line-height: 1.5; }
.field::placeholder { color: #6f7fa3; }
.search { min-height: 48px; padding-block: 0; width: min(280px, 100%); }
.flabel { display: block; font: 400 13px var(--fd); text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.hint { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 6px; }
.err { color: var(--red); font-size: 14px; min-height: 1.5em; margin-top: 8px; }

/* ---------- boş / yükleniyor / hata durumu ---------- */
.state { text-align: center; color: var(--muted); padding: 28px 20px; }
.state .ms { font-size: 36px; display: block; margin: 0 auto 8px; color: var(--muted); }
.skel { background: linear-gradient(90deg, var(--p2), var(--p1), var(--p2)); background-size: 200% 100%; animation: skel 1.2s linear infinite; border-radius: 14px; min-height: 76px; border: 3px solid var(--lip); }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- pencere ---------- */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(5, 10, 22, .72); display: grid; place-items: center; padding: 16px; }
.modal > .panel { width: min(580px, 100%); max-height: calc(100svh - 32px); overflow: auto; position: relative; }
.modal .close { position: absolute; top: 12px; right: 12px; }

/* ---------- bildirim ---------- */
.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  font: 400 15px var(--fd);
  text-transform: uppercase;
  background: var(--lip);
  border: 3px solid var(--lip2);
  border-radius: 12px;
  padding: 12px 18px;
  box-shadow: 0 5px 0 #050a16;
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: calc(100% - 32px);
}
.toast.ok .ms { color: var(--em); }
.toast.bad .ms { color: var(--red); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .skel { animation: none; }
}
@media (max-width: 480px) {
  .btn { padding: 0 16px; font-size: 15px; }
  .btn.sq { padding: 0; }
}
