@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700;900&display=swap');

.container {
  max-width: 1250px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  width: 100%;
  box-sizing: border-box;
}

body {
  background: #fff;
  font-family: 'Inter', 'SF Pro Display', Arial, sans-serif;
  color: #222;
  margin: 0;
  padding: 0;
  line-height: 1.7;
  font-size: 14px;
}
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* ===== HEADER ===== */
header {
  background: #000;
  color: #fff;
  position: sticky;
  top: 0; left: 0; width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 16px #0002;
}
.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  height: 72px;
  padding: 0 40px;
  box-sizing: border-box;
}
.logo {
  font-size: 2.1rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: .97;
}
.header-right {
  display: flex;
  align-items: center;
  margin-left: auto;
}

/* ===== MENU ===== */
.menu {
  display: flex;
  gap: 32px;
  align-items: center;
  font-size: 15px;
}
.menu a, .menu .menu-item {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  border-radius: 6px;
  padding: 7px 16px;
  transition: background .18s, color .18s;
  position: relative;
  opacity: 0.88;
  cursor: pointer;
  font-size: 15px;
}
.menu a:hover, .menu .menu-item:hover, .menu .menu-item.open {
  background: #181b23;
  opacity: 1;
}
.menu-login {
  margin-left: 14px;
  font-weight: 600;
  color: #8c206e;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
  min-width: 90px;
  max-width: 150px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.menu-login:focus, .menu-login:hover {
  outline: none !important;
  box-shadow: none !important;
  color: #d77aac;
}
.menu-dropdown {
  display: none;
  position: absolute;
  left: 0; top: 110%;
  background: #fff;
  color: #222;
  border-radius: 10px;
  min-width: 190px;
  box-shadow: 0 6px 32px #0003;
  padding: .5rem 0;
  z-index: 10;
}
.menu-item.open .menu-dropdown { display: block; }
.menu-dropdown a {
  display: block; color: #1c1833;
  padding: .8rem 1.4rem;
  border-radius: 7px;
  text-decoration: none;
  font-weight: 500;
  opacity: .94;
  font-size: 14px;
}
.menu-dropdown a:hover { background: #fafafd; color: #8c206e; }

/* ===== BUTTONS ===== */
.button {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  border: 1px solid #a184e6;
  color: #a184e6;
  padding: 12px 32px;
  border-radius: 40px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  margin-top: 1.3rem;
  box-shadow: 0 2px 12px #8c206e12;
  text-decoration: none;
}
.button:hover {
  background: linear-gradient(90deg, #8c206e 0%, #142e8c 100%);
  color: #fff;
  border: none;
  box-shadow: 0 6px 18px #8c206e21;
}

/* ===== MAIN ===== */
.banner {
  background: linear-gradient(90deg, #8c206e 0%, #142e8c 100%);
  color: #fff;
  border-radius: 16px;
  padding: 56px 44px 60px 44px;
  margin: 44px auto 0 auto;
  max-width: 1200px;
  box-shadow: 0 4px 32px rgba(50,0,70,0.08);
  position: relative;
  overflow: hidden;
}
.banner .wave {
  position: absolute; left: 0; bottom: 0; width: 100%; height: 58px;
  pointer-events: none; z-index: 2;
}
.banner h1 {
  font-size: 2.1rem; font-weight: 900; letter-spacing: -1px; margin-bottom: 1.1rem;
}
.banner p {
  font-size: 14px;
  max-width: 580px;
  opacity: .96;
}
.section {
  background: #fafafd;
  border-radius: 20px;
  max-width: 1200px;
  margin: 32px auto;
  padding: 44px 24px;
  text-align: center;
  box-shadow: 0 2px 12px #0001;
  font-size: 14px;
}
.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 2.2rem;
  letter-spacing: -0.5px;
}
.turnyrai-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px,1fr));
  gap: 2.3rem;
  margin-top: 2.5rem;
  padding: 0;
}
.turnyras-card {
  background: #fff;
  border-radius: 1.2rem;
  box-shadow: 0 2px 14px #0001;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .14s;
}
.turnyras-card:hover {
  transform: translateY(-7px) scale(1.01);
  box-shadow: 0 6px 32px #0002;
}
.turnyras-img {
  height: 170px; width: 100%; object-fit: cover;
  background: #ddd;
}
.turnyras-info {
  padding: 1.5rem 1.2rem 1.2rem 1.2rem;
  flex: 1 1 auto;
  display: flex; flex-direction: column; gap: 0.6rem;
  font-size: 14px;
}
.turnyras-title {
  font-size: 1.15rem; font-weight: 700; margin-bottom: .08rem;
  color: #171c2d;
}
.turnyras-datos, .turnyras-busena {
  color: #444; font-size: 14px;
}
.turnyras-busena { color: #8c206e; font-weight: 700; }

footer {
  background: #181b23;
  color: #fff;
  padding: 40px 0 16px 0;
  text-align: center;
  margin-top: 44px;
  font-size: 14px;
  letter-spacing: .2px;
}
footer .footer-wrap {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 2.5rem;
  font-size: 14px;
}
footer .footer-links, footer .footer-contact {
  display: flex; flex-direction: column; gap: .7rem; font-size: 14px;
  align-items: flex-start;
}
footer .footer-links a {
  color: #eee;
  text-decoration: none;
  opacity: .82;
  transition: color .13s;
}
footer .footer-links a:hover {
  color: #ff99cc;
}
footer .footer-social {
  display: flex; gap: 1rem; margin-top: 1.1rem;
}
footer .footer-social a {
  color: #fff; font-size: 1.5rem;
  opacity: .82;
  transition: color .13s;
}
footer .footer-social a:hover { color: #8c206e; }

/* ======= MOBILE ======= */
.header-burger { display: none; }
.mobile-menu { display: none; }

@media (min-width: 701px) {
  .menu, .header-right { display: flex !important; }
  .header-burger, .mobile-menu { display: none !important; }
}

@media (max-width: 700px) {
  .header-wrap {
    display: flex !important;
    height: 56px;
    padding: 0 7px;
    align-items: center;
    position: relative;
    box-sizing: border-box;
    width: 100vw;
  }
  .logo {
    font-size: 1.28rem;
    gap: 0.25rem;
  }
  .menu, .header-right { display: none !important; }
  .header-burger { 
    display: flex !important; 
    align-items: center; 
    justify-content: center;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 7px 0 0 !important;
    margin: 0 4px 0 0 !important;
    font-size: 2rem !important;
    color: #fff !important;
    width: 34px; height: 34px;
    position: absolute;
    right: 7px;
    top: 11px;
  }
  .header-burger span {
    display: block;
    width: 22px;
    height: 3.5px;
    background: #fff;
    border-radius: 2px;
    margin: 4px 0;
  }
  .mobile-menu {
    display: block !important;
    position: fixed;
    top: 0; right: 0;
    width: 85vw;
    max-width: 320px;
    height: 100vh;
    background: #181b23;
    color: #fff;
    z-index: 1100;
    box-shadow: -2px 0 22px #0003;
    padding: 32px 20px 10px 20px;
    font-size: 14px;
    transform: translateX(100%);
    transition: transform 0.2s;
  }
  .mobile-menu.open { transform: translateX(0); }
  .mobile-menu .menu-item, .mobile-menu a {
    display: block;
    margin-bottom: 1.1rem;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: 8px 0;
    border-radius: 7px;
    font-size: 14px;
    transition: background .14s;
  }
  .mobile-menu a:hover, .mobile-menu .menu-item:hover { background: #222234; }
  .mobile-menu-close {
    position: absolute;
    top: 13px; right: 18px;
    background: none; border: none;
    color: #fff; font-size: 2rem; cursor: pointer;
    z-index: 1110;
  }
  .banner, .section, .footer, .turnyrai-grid, .footer-wrap, .turnyras-card, .banner .wave {
    padding-left: 7px !important;
    padding-right: 7px !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .banner { padding: 20px 2px 20px 2px; margin-top: 14px; }
  .banner h1 { font-size: 1.2rem; padding: 0; }
  .banner p { font-size: 14px; }
  .section { padding: 18px 2px; }
  .section-title { font-size: 1.04rem; margin-bottom: 1.2rem; }
  .turnyrai-grid { grid-template-columns: 1fr; gap: 8px !important; margin-top: 1.5rem; }
  .turnyras-title { font-size: 1.02rem; }
  .turnyras-info { padding: 1.1rem 0.7rem 0.7rem 0.7rem; }
  .button { font-size: 14px; padding: 8px 16px; margin-top: 1rem; }
  input, select, textarea, .input, .button {
    font-size: 15px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  footer { font-size: 13px; padding: 24px 0 11px 0; margin-top: 24px; }
  footer .footer-links, footer .footer-contact { font-size: 13px; }
  body, html {
    padding-left: 0 !important;
    padding-right: 0 !important;
    overflow-x: hidden !important;
    width: 100vw !important;
  }
  .turnyras-card { margin-left: 0 !important; margin-right: 0 !important; }
}
/* Užtikrinam, kad JS nepakeistų burgerio display */
#headerBurger[style] { display: flex !important; }
/* PROFILIO AVATARAS */
.profile-avatar {
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 3.5px solid #f7f7fa;
  box-shadow: 0 2px 12px #0001;
  background: #fff;
}

/* THROBBER/LOADER animacija */
.loader {
  border: 4px solid #eee;
  border-top: 4px solid #191926;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 1s linear infinite;
  display: inline-block;
  vertical-align: middle;
  margin-right: 7px;
}
@keyframes spin {
  100% { transform: rotate(360deg);}
}

/* CROP MODAL profilio nuotraukai */
#crop-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(12,15,20,0.78);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}
#crop-modal .modal-content {
  background: #fff;
  padding: 24px 24px 18px 24px;
  border-radius: 11px;
  box-shadow: 0 6px 44px #0002;
  min-width: 280px;
  max-width: 96vw;
}
#crop-modal.show { display: flex !important; }

/* ===== ADMIN TURNYRŲ SĄRAŠAS (GRID 4 KORTELĖS) ===== */
.tournament-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-top: 32px;
  margin-bottom: 38px;
}
@media (max-width: 1200px) {
  .tournament-grid { grid-template-columns: repeat(3, 1fr);}
}
@media (max-width: 900px) {
  .tournament-grid { grid-template-columns: repeat(2, 1fr);}
}
@media (max-width: 600px) {
  .tournament-grid { grid-template-columns: 1fr;}
}
.tournament-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 2px 18px #0001, 0 0.5px 0 #eee;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .13s, box-shadow .13s;
  min-height: 385px;
  border: 1.5px solid #f2eafd;
}
.tournament-card:hover {
  transform: translateY(-5px) scale(1.013);
  box-shadow: 0 7px 30px #8c206e12;
  border-color: #d7b9f6;
}
.tournament-img {
  width: 100%;
  aspect-ratio: 9/16;
  object-fit: cover;
  background: #eae7f5;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  min-height: 150px;
  max-height: 260px;
}
.tournament-content {
  padding: 20px 20px 8px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.tournament-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  color: #171c2d;
}
.tournament-status {
  font-size: 0.98em;
  font-weight: 600;
  margin: 10px 0 0 0;
  display: inline-block;
  padding: 6px 18px;
  border-radius: 7px;
  color: #fff;
  background: #a184e6;
  letter-spacing: 0.01em;
  box-shadow: 0 1px 7px #8c206e13;
}
.tournament-status.draft { background: #999;}
.tournament-status.upcoming { background: #4799f7;}
.tournament-status.ongoing { background: #38ca6a;}
.tournament-status.finished { background: #fcbb33; color: #222;}
.tournament-actions {
  display: flex;
  gap: 13px;
  margin-top: 10px;
}
.tournament-actions .edit-btn,
.tournament-actions .delete-btn {
  padding: 10px 28px;
  border-radius: 40px;
  border: 1.5px solid #a184e6;
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  color: #a184e6;
  transition: background 0.18s, color 0.16s, border 0.16s;
  box-shadow: 0 2px 12px #8c206e0e;
  text-decoration: none;
  outline: none;
}
.tournament-actions .edit-btn:hover {
  background: linear-gradient(90deg, #8c206e 0%, #142e8c 100%);
  color: #fff;
  border: none;
}
.tournament-actions .delete-btn {
  border: 1.5px solid #ffd5e2;
  color: #d1004f;
}
.tournament-actions .delete-btn:hover {
  background: linear-gradient(90deg, #ff90e2 0%, #ffd5e2 100%);
  color: #fff;
  border: none;
}
/* Paieškos laukų ir mygtukų dizainas */
.search-input {
    padding: 11px 16px;
    border: 1.6px solid #a184e6;
    border-radius: 18px;
    background: #f6f3ff;
    font-size: 1.05em;
    transition: border 0.15s, box-shadow 0.16s;
    outline: none;
    box-shadow: 0 2px 10px #a184e610;
    color: #32245d;
    margin-right: 8px;
}

.search-input:focus {
    border-color: #8c206e;
    background: #fff;
    box-shadow: 0 4px 18px #a184e626;
}

.search-btn {
    padding: 11px 22px;
    border-radius: 18px;
    border: none;
    background: linear-gradient(90deg, #a184e6 0%, #8c206e 100%);
    color: #fff;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    box-shadow: 0 2px 12px #8c206e18;
    transition: background 0.15s, color 0.15s;
}

.search-btn:hover {
    background: linear-gradient(90deg, #8c206e 0%, #142e8c 100%);
    color: #fff;
}

@media (max-width: 600px) {
    .search-input, .search-btn {
        width: 100%;
        margin-bottom: 7px;
        font-size: 1em;
        padding: 10px 14px;
    }
}

/* ========== UNIVERSALIOS KORTELIŲ IR PAIEŠKOS KLASĖS ========== */
/* Naudok jas visur vietoje .team-card, .player-card ir pan. */

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 3px;
}
.card-scroll { /* alternatyvus pavadinimas scrollui */
    max-height: 500px;
    overflow-y: auto;
    padding-right: 3px;
}
.card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 9px 0;
    border-bottom: 1px solid #f1edfa;
    background: none;
}
.card:last-child { border-bottom: none; }
.avatar {
    width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid #e3e3ef;
}
.card .avatar + .avatar { margin-left: -13px; }
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.card-title {
    font-weight: 700;
    font-size: 1.04em;
    color: #222;
    margin-bottom: 0;
}
.card-title a {
    color: #232069;
    text-decoration: none;
}
.card-title a:hover { color: #8c206e; text-decoration: underline; }
.meta, .card-meta {
    font-size: .98em;
    color: #445;
    margin-top: 3px;
}
.meta-small {
    font-size: .91em;
    color: #888;
}
.main-btn {
    border: none;
    border-radius: 24px;
    padding: 9px 21px;
    background: linear-gradient(90deg,#a184e6 0%,#8c206e 100%);
    color: #fff;
    font-weight: 600;
    font-size: .99em;
    cursor: pointer;
    transition: background .18s;
    box-shadow: 0 2px 8px #9f9cf826;
    margin-left: 2px;
    white-space: nowrap;
    text-decoration: none;
}
.main-btn:hover {
    background: linear-gradient(90deg,#8c206e 0%,#a184e6 100%);
    color: #fff;
}
.search-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.search-bar input[type="text"] {
    flex: 1 1 180px;
    border-radius: 24px;
    border: 1.2px solid #d4d0e2;
    background: #f7f7fa;
    padding: 9px 14px 9px 39px;
    font-size: 1em;
    transition: border .19s;
    outline: none;
    min-width: 0;
    box-shadow: 0 2px 8px #9f9cf82b inset;
    background-image: url('/assets/search.svg');
    background-repeat: no-repeat;
    background-size: 19px 19px;
    background-position: 11px 50%;
}
.search-bar input[type="text"]:focus { border-color: #a184e6; }

@media (max-width: 850px) {
    .card-list, .card-scroll { max-height: 320px; }
    .search-bar { flex-direction: column; gap: 8px; align-items: stretch; }
}
