body { font-family: 'Inter', sans-serif; background-color: #F4F6F9; color: #16163F; }
h1, h2, h3, h4, .font-heading { font-family: 'Plus Jakarta Sans', sans-serif; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F4F6F9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* Story (dairesel adım) menüsü */
.story-ring { background: #E11D2E; padding: 2.5px;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease; }
.story-ring-inactive { background: #E2E8F0; padding: 2px; transition: all .25s ease; }
.story-btn:hover .story-ring-inactive { background: #E11D2E; }
.story-btn:hover .story-avatar { transform: scale(1.04); }
.story-avatar { transition: transform .25s ease; }
.story-active .story-ring { background: #E11D2E; transform: scale(1.06); }
.story-disabled { opacity: .45; }

/* Sayfa kapsayıcısı: ekranın tamamını kullanır */
.page-wrap { width: 100%; margin-inline: auto; padding-inline: clamp(1rem, 2.4vw, 2.5rem); }

.tbf-hero-gradient { background: #16163F; }
.rounded-2xl { border-radius: .875rem; }

/* Başlıklar */
.section-kicker { font-size: 12px; font-weight: 600; color: #64748B; margin-bottom: .125rem; }
.section-title { font-size: 1.5rem; font-weight: 800; color: #16163F; letter-spacing: -.02em; }
@media (min-width: 640px) { .section-title { font-size: 26px; } }
.next-link { font-size: .75rem; font-weight: 700; color: #E11D2E; display: flex; align-items: center; gap: .375rem; cursor: pointer; }
.next-link:hover { color: #16163F; }

/* Form öğeleri */
.lbl { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #16163F; margin-bottom: .5rem; }
.lbl-sm { display: block; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #475569; margin-bottom: .375rem; }
.inp, .inp-white { border: 1px solid #E2E8F0; outline: none; transition: all .15s ease; }
.inp { background: #F8F9FB; }
.inp-white { background: #fff; }
.inp:focus, .inp-white:focus { background: #fff; border-color: #E11D2E; box-shadow: 0 0 0 3px rgba(225,29,46,.12); }

/* Butonlar */
.btn-red, .btn-navy, .btn-ghost { border-radius: .5rem; font-weight: 700; cursor: pointer; transition: background-color .15s ease, border-color .15s ease; }
.btn-red { background: #E11D2E; color: #fff; }
.btn-red:hover { background: #C41625; }
.btn-navy { background: #16163F; color: #fff; }
.btn-navy:hover { background: #23225C; }
.btn-ghost { border: 1px solid #E2E8F0; color: #475569; background: #fff; }
.btn-ghost:hover { background: #F8FAFC; }
button:disabled { opacity: .55; cursor: wait; }

.icon-btn { width: 2rem; height: 2rem; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center;
  color: #94A3B8; transition: all .15s ease; cursor: pointer; }
.icon-btn:hover { background: #EEF2FF; color: #16163F; }
.icon-btn.danger:hover { background: #FEF2F2; color: #E11D2E; }

.edit-badge { font-size: 10px; font-weight: 700; background: #FEECEF; color: #E11D2E; padding: .125rem .625rem; border-radius: 9999px; }
.tbl-tag { font-size: 11px; font-family: ui-monospace, monospace; background: #F1F5F9; color: #475569; padding: .25rem .625rem; border-radius: 9999px; }

.type-pill { display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .625rem; border: 2px solid #E2E8F0;
  border-radius: .75rem; cursor: pointer; transition: all .15s ease; color: #475569; font-weight: 700; font-size: .75rem; }
.type-pill:hover { background: #F8FAFC; }
.type-pill-active-red { background: #FEECEF; border-color: #E11D2E; color: #E11D2E; }
.type-pill-active-navy { background: #16163F; border-color: #16163F; color: #fff; }
.type-pill-active-red:hover { background: #FEECEF; }
.type-pill-active-navy:hover { background: #16163F; }

.flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; border: 1px solid #E2E8F0; display: inline-block; vertical-align: middle; }

.live-dot { width: .5rem; height: .5rem; border-radius: 9999px; background: #E11D2E; display: inline-block; animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.empty-box { grid-column: 1 / -1; text-align: center; padding: 2.5rem 1rem; color: #94A3B8; font-size: .75rem;
  border: 2px dashed #E2E8F0; border-radius: .75rem; }

/* SweetAlert2 — marka teması */
.swal2-container { font-family: 'Inter', sans-serif; }
.sw-popup { border-radius: 1.25rem !important; padding: 1.75rem 1.5rem 1.5rem !important; border-top: 4px solid #E11D2E; }
.sw-title { font-family: 'Plus Jakarta Sans', sans-serif !important; font-size: 1.2rem !important; font-weight: 800 !important; color: #16163F !important; }
.sw-text { font-size: .875rem !important; color: #475569 !important; line-height: 1.6 !important; }
.sw-actions { gap: .5rem; margin-top: 1.25rem !important; }
.swal2-icon { transform: scale(.8); margin: .25rem auto .5rem !important; }
.sw-toast { border-radius: .875rem !important; box-shadow: 0 12px 30px -8px rgba(21,20,70,.35) !important; border-left: 4px solid #E11D2E; }
.sw-toast .swal2-title { font-size: .8rem !important; font-weight: 700 !important; color: #16163F !important; }
.sw-toast .swal2-timer-progress-bar { background: #E11D2E; }

/* Adım menüsü: aşağı kaydırınca / form alanına yazınca gizlenir, yukarı kaydırınca açılır */
#step-nav-bar { max-height: 210px; opacity: 1; transform: translateY(0); overflow-y: hidden;
  transition: max-height .32s cubic-bezier(.4,0,.2,1), opacity .22s ease, padding .32s cubic-bezier(.4,0,.2,1), transform .32s cubic-bezier(.4,0,.2,1);
  will-change: max-height, opacity, transform; }
#step-nav-bar.nav-collapsed { max-height: 0 !important; opacity: 0; padding-top: 0 !important; padding-bottom: 0 !important;
  border-top-width: 0 !important; transform: translateY(-12px); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { #step-nav-bar { transition: none; } }

/* İndirme sayfası adım numaraları */
.step-no { flex-shrink: 0; width: 1.5rem; height: 1.5rem; border-radius: 9999px; background: #FEECEF; color: #E11D2E;
  font-size: .75rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* Kort kutuları */
.court-box { position: relative; background: #fff; border: 1px solid rgba(226,232,240,.9); border-radius: 1rem; padding: 1.25rem;
  min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 1px 2px rgba(15,23,42,.04); transition: box-shadow .15s ease; }
.court-box:hover { box-shadow: 0 6px 16px -6px rgba(15,23,42,.15); }
.court-box-edit { border: 2px solid #E11D2E; box-shadow: 0 6px 16px -6px rgba(225,29,46,.25); }
.court-lbl { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: #94A3B8; margin-bottom: .25rem; }
.court-icon, .court-x { width: 1.75rem; height: 1.75rem; border-radius: 9999px; display: inline-flex; align-items: center; justify-content: center;
  background: #F4F5F8; color: #64748B; cursor: pointer; transition: all .15s ease; }
.court-icon:hover { background: #16163F; color: #fff; }
.court-icon.danger:hover, .court-x:hover { background: #E11D2E; color: #fff; }
.court-x { position: absolute; top: .75rem; right: .75rem; }
.court-add { border-radius: 1rem; border: 2px dashed #CBD5E1; background: #F8F9FB; color: #94A3B8; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .625rem; cursor: pointer; transition: all .2s ease; }
.court-add:hover { border-color: #E11D2E; background: rgba(254,236,239,.4); color: #E11D2E; }

/* Lisans görselleri */
.lic-tile { position: relative; width: 100%; aspect-ratio: 1.585 / 1; border-radius: .75rem; overflow: hidden; }
.lic-empty { border: 2px dashed #CBD5E1; background: #F8F9FB; color: #64748B; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .25rem; font-size: .75rem; font-weight: 700; cursor: pointer; transition: all .15s ease; }
.lic-empty:hover, .lic-drop .lic-empty { border-color: #E11D2E; background: rgba(254,236,239,.5); color: #E11D2E; }
.lic-has { border: 1px solid #E2E8F0; background: #0F172A; }
.lic-has img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.lic-tag { position: absolute; left: .4rem; bottom: .4rem; font-size: 10px; font-weight: 800; color: #fff; background: rgba(22,22,63,.8);
  padding: .1rem .5rem; border-radius: 9999px; }
.lic-btn { position: absolute; top: .4rem; width: 1.6rem; height: 1.6rem; border-radius: 9999px; display: inline-flex; align-items: center;
  justify-content: center; background: rgba(255,255,255,.92); color: #16163F; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.lic-btn-x { right: .4rem; }
.lic-btn-x:hover { background: #E11D2E; color: #fff; }
.lic-btn-swap { right: 2.3rem; }
.lic-btn-swap:hover { background: #16163F; color: #fff; }
.lic-view { min-height: 180px; border: 1px solid #E2E8F0; border-radius: .75rem; background: #F8F9FB; display: flex; align-items: center;
  justify-content: center; overflow: hidden; }
.lic-view img { width: 100%; height: auto; display: block; }
.icon-btn.ok { color: #059669; }

/* Maç formu: kart genişledikçe oyuncular ve hakemler yan yana dizilir */
#match-form-card { container-type: inline-size; }
.mf-pair, .ref-grid { display: grid; grid-template-columns: 1fr; gap: .75rem; }
.mf-when { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.mf-when .mf-day { grid-column: 1 / -1; }
@container (min-width: 540px) {
  .mf-when { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr); }
  .mf-when .mf-day { grid-column: auto; }
  .mf-pair { grid-template-columns: 1fr 1fr; }
  .ref-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.ref-opt { text-transform: none; font-weight: 500; color: #94A3B8; margin-left: .125rem; }

/* Başlık: "Powered by BYB Software & Label Solutions" (dar ekranda gizli) */
.byb-brand { display: none; align-items: flex-end; gap: .45rem; font-family: 'Poppins', sans-serif; line-height: 1; user-select: none; }
@media (min-width: 1024px) { .byb-brand { display: flex; } }
.byb-powered { font-size: 9px; font-weight: 400; color: #A3A3A3; margin-right: .15rem; }
.byb-mark { font-size: 26px; font-weight: 800; color: #11118A; letter-spacing: -.01em; line-height: .76; }
.byb-name { display: flex; flex-direction: column; gap: 2px; }
.byb-sub { font-size: 6.5px; font-weight: 700; color: #A3A3A3; line-height: 1; }
.byb-main { font-size: 13px; font-weight: 400; color: #111; letter-spacing: .02em; line-height: .78; }
.byb-brand.byb-brand-always { display: flex; }

/* Giriş ekranı */
.login-screen { grid-template-columns: minmax(0, 1fr); background: #fff; overflow-y: auto; }
.login-art { display: none; }
@media (min-width: 1024px) {
  .login-screen { grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr); }
  .login-art { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
    background: #16163F; color: #fff; padding: clamp(2.5rem, 5vw, 4.5rem); }
}
.login-art-brand { display: flex; flex-direction: column; align-items: center; text-align: center; }
.login-art-logo { width: clamp(150px, 15vw, 210px); height: auto; }
.login-art-org { margin-top: 1.75rem; font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(1.75rem, 2.3vw, 2.25rem);
  font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.login-art-sub { margin-top: .5rem; font-size: 15px; color: rgba(255, 255, 255, .62); }
.login-art-tour { position: absolute; left: clamp(2.5rem, 5vw, 4.5rem); right: clamp(2.5rem, 5vw, 4.5rem); bottom: clamp(2rem, 4vh, 3rem);
  flex-direction: column; gap: .2rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.login-art-tour:not(.hidden) { display: flex; }
.login-art-tour-lbl { font-size: 12px; color: rgba(255, 255, 255, .5); }
.login-art-tour-name { font-size: 15px; font-weight: 600; }
.login-art-tour-meta { font-size: 13px; color: rgba(255, 255, 255, .62); }
.login-panel { display: flex; flex-direction: column; min-height: 100%; }
.login-main { flex: 1 0 auto; display: flex; align-items: center; justify-content: center; padding: 3rem 1.5rem 2.5rem; }
.login-box { width: 100%; max-width: 22rem; }
.login-form { display: flex; flex-direction: column; }
.login-logo { width: 4.5rem; height: 4.5rem; margin-bottom: 1.5rem; }
@media (min-width: 1024px) { .login-logo { display: none; } } /* sol panelde büyük logo var */
.login-title { font-size: 1.625rem; font-weight: 800; color: #16163F; letter-spacing: -.02em; }
.login-sub { font-size: .875rem; color: #64748B; margin-top: .25rem; }

/* Giriş: hakem uygulamasına geçiş */
.login-apps { margin-top: 2rem; }
.login-apps-title { display: flex; align-items: center; gap: .75rem; font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: #94A3B8; }
.login-apps-title::before, .login-apps-title::after { content: ''; flex: 1; height: 1px; background: #E2E8F0; }
.login-apps-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .625rem; }
.login-app { display: flex; align-items: center; justify-content: center; gap: .5rem; height: 2.75rem; padding: 0 .75rem;
  border: 1px solid #E2E8F0; border-radius: .5rem; background: #fff; color: #16163F; font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: border-color .15s ease, background-color .15s ease, color .15s ease; }
.login-app i { font-size: 14px; color: #64748B; transition: color .15s ease; }
.login-app:hover { border-color: #CBD5E1; background: #F8FAFC; }
.login-app:hover i { color: #E11D2E; }
.login-app:focus-visible { outline: none; border-color: #E11D2E; box-shadow: 0 0 0 3px rgba(225,29,46,.12); }

/* Giriş: sayfa altı (Powered by BYB) */
.login-footer { display: flex; justify-content: center; padding: 1.25rem 1.5rem 1.5rem; }

/* Sayfa alt bilgisi: "Powered by BYB" sayfanın en altında */
.site-footer { background: #fff; border-top: 1px solid #E2E8F0; }
.site-footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem;
  padding-top: 1rem; padding-bottom: 1rem; }
.site-footer-text { font-size: 12px; color: #64748B; }
@media (max-width: 639px) { .site-footer-inner { flex-direction: column; justify-content: center; text-align: center; } }

/* İşlem kayıtları */
.log-row > summary { list-style: none; }
.log-row > summary::-webkit-details-marker { display: none; }
.log-row:hover, .log-row[open] { background: #FAFBFD; }
.log-ico { width: 2rem; height: 2rem; border-radius: .625rem; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; flex-shrink: 0; }
.log-ico-ok { background: #ECFDF5; color: #059669; }
.log-ico-err { background: #FEF2F2; color: #E11D2E; }
.log-ico-edit { background: #EEF2FF; color: #16163F; }
.log-ico-warn { background: #FFFBEB; color: #D97706; }
.log-ico-point { background: #FEECEF; color: #E11D2E; }
.log-ico-muted { background: #F1F5F9; color: #64748B; }
.log-who { font-weight: 700; padding: .05rem .5rem; border-radius: 9999px; }
.log-who-admin { background: #16163F; color: #fff; }
.log-who-ref { background: #FEECEF; color: #E11D2E; }
.log-who-anon { background: #FEF3C7; color: #92400E; }
.log-changes { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #E2E8F0; border-radius: .5rem; overflow: hidden; }
.log-changes th { text-align: left; font-weight: 700; color: #475569; background: #F8FAFC; padding: .35rem .6rem; width: 34%; vertical-align: top; border-bottom: 1px solid #F1F5F9; }
.log-changes td { padding: .35rem .6rem; color: #16163F; border-bottom: 1px solid #F1F5F9; word-break: break-word; }
.log-changes tr:last-child th, .log-changes tr:last-child td { border-bottom: 0; }
.log-meta th, .log-meta td { color: #94A3B8; font-weight: 500; }
.log-old { color: #94A3B8; text-decoration: line-through; }
.log-new { font-weight: 700; }
