/* ===== هدر ===== */
.main-header {
  position: fixed;
  top: 0;
  width: 100%;
  max-width: 500px;
  height: 56px;
  background: var(--background);
  border-bottom: 1px solid #222;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  z-index: 1000;
}

.header-content {
  width: 100%;
  padding: 12px 14px 0 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo-img {
  height: 48px;
  padding: 12px 14px 0 0px;
  width: auto;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.avatar-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--primary);
}

.username {
  font-size: 14px;
  color: var(--text-primary);
}

/* ===== بنر ===== */
.tournament-banner {
  margin-top: 86px;
  max-width: 500px;
  margin-inline: auto;
  padding: 0 16px; /* فاصله استاندارد از دو طرف */
}


.tournament-banner img {
  width: 100%;
  border-radius: 12px;
}

/* ===== بازی‌ها ===== */
.games-section {
  max-width: 500px;
  margin: 20px auto 80px;
  padding: 0 16px; /* فاصله از چپ و راست */
}


.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.game-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.game-item img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  display: block; /* مهم! باعث می‌شه overlay دقیق بشینه */
}

/* گرادیانت و اسم بازی */
.game-overlay {
  position: absolute;
  bottom: 0;
  height: 40%;
  width: 100%;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 10px;
}

.game-title {
  font-size: 14px;
  font-weight: 700;
  color: white;
}

/* ===== فضای پایین ===== */
body {
  padding-bottom: 80px;
}

/* ===== نوبار ===== */
.bottom-navbar {
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 500px;
  left: 50%;
  transform: translateX(-50%);
  height: 70px;
  background: #111;
  border-top: 1px solid #222;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 1001;
}

.nav-item {
  text-align: center;
  color: #aaa;
  font-size: 12px;
}

.nav-item.active .nav-text {
  font-weight: bold;
  color: #fff;
}

.nav-icon {
  width: 26px;
  height: 26px;
  margin-bottom: 4px;
}

.nav-item.active img {
  filter: invert(100%) brightness(200%);
}


.games-section {
    padding: 16px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.section-heading {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
}

.section-link {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: 0.8rem;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.section-arrow {
    width: 16px;
    height: 16px;
    filter: brightness(0) invert(1);
}

.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
}

.bottom-sheet-overlay.active {
  display: flex !important;
}

.bottom-sheet-box {
  width: 100%;
  max-width: 480px;
  background: #1f1f1f;
  border-radius: 22px 22px 0 0;
  padding: 32px 26px 26px;
  box-shadow: 0 -4px 18px rgba(0,0,0,0.6);
  animation: slide-up 0.28s ease-out;
  text-align: center;
  position: relative;
  color: #fff;
}

.sheet-close-btn {
  position: absolute;
  top: 14px;
  right: 16px;     /* ←← از left به right تغییر کرد */
  width: 34px;
  height: 34px;
  background: none; /* بکگراند حذف شد */
  border: none;
  font-size: 28px;
  font-weight: 400;
  color: #fff;      /* کاملاً سفید */
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}


.sheet-handle {
  width: 45px;
  height: 5px;
  background: #444;
  border-radius: 10px;
  margin: 0 auto 18px auto;
}

.sheet-game-img {
  width: 110px;
  height: 110px;
  border-radius: 18px;
  object-fit: cover;
  margin-bottom: 18px;
}

.sheet-title {
  font-size: 22px;
  font-weight: bold;
  margin-bottom: 22px;
  color: #fff;
}

.sheet-info-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  margin-bottom: 14px;
  color: #ddd;
}

.sheet-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;

  filter: brightness(0) invert(1);
}


.sheet-value {
  font-weight: bold;
  color: #fff;
}

.sheet-start-btn {
  width: 100%;
  padding: 14px;
  font-size: 18px;
  font-weight: bold;
  color: white;
  background: #6C47FF;
  border-radius: 14px;
  border: none;
  margin-top: 24px;
  cursor: pointer;
}

@keyframes slide-up {
  from {
    transform: translateY(120px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.login-btn {
    background:#8b4dff;
    border:none;
    padding:8px 20px;
    font-size:15px;
    border-radius:10px;
    color:#fff;
    margin-bottom:10px;
}