/* ==========================================
   mobile.css — Responsive overrides for
   مقهى اللاعبين (Gamers Caffe)
   Covers all breakpoints: 768px and 480px
   ========================================== */

/* ==========================================
   HAMBURGER BUTTON (injected by nav.js)
   ========================================== */
.nav-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1.15rem;
  transition: border-color 0.2s, background 0.2s;
  flex-shrink: 0;
  z-index: 201;
}

.nav-hamburger:hover {
  border-color: var(--primary-color);
  background: rgba(102, 192, 244, 0.08);
}

/* Mobile auth button — hidden on desktop, shown on mobile */
#mobile-auth-btn {
  display: none;
}

/* ==========================================
   768px — TABLETS AND PHONES
   ========================================== */
@media (max-width: 768px) {

  /* ── CONTAINER ──────────────────────────── */
  .container {
    padding: 0 14px;
  }

  /* ── NAVBAR ──────────────────────────────── */
  .nav-content {
    min-height: 64px;
    padding: 8px 0;
    position: relative;
    flex-wrap: nowrap;
    align-items: center;
  }

  /* Shrink logo image */
  .logo img {
    height: 44px !important;
    top: 0 !important;
    position: static !important;
  }

  .logo span {
    font-size: 1rem;
  }

  /* Show hamburger */
  .nav-hamburger {
    display: flex;
  }

  /* Show mobile auth button */
  #mobile-auth-btn {
    display: inline-flex !important;
  }

  /* Collapse nav links into a slide-down panel */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background-color: rgba(22, 32, 45, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 8px 16px 18px;
    gap: 0;
    z-index: 200;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }

  /* JS toggles this class to open/close the menu */
  .nav-links.nav-open {
    display: flex;
  }

  /* Links inside the mobile menu */
  .nav-links > a,
  .nav-links > .nav-friends-wrapper,
  .nav-links > .nav-upload-link {
    padding: 13px 8px;
    border-bottom: 1px solid rgba(61, 82, 105, 0.35);
    font-size: 0.98rem;
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100%;
    color: var(--text-secondary);
  }

  /* The <a> inside the friends wrapper fills the wrapper fully */
  .nav-links > .nav-friends-wrapper > a {
    flex: 1;
    color: var(--text-secondary);
    font-size: 0.98rem;
  }

  .nav-links > .nav-friends-wrapper:last-of-type,
  .nav-links > a:last-of-type,
  .nav-links > .nav-upload-link {
    border-bottom: none;
  }

  .nav-links > .nav-friends-wrapper > a.active,
  .nav-links > .nav-friends-wrapper > a:hover,
  .nav-links > a.active,
  .nav-links > a:hover {
    color: var(--text-primary);
  }

  /* Search form inside mobile menu — full width */
  .nav-links .search-form {
    width: 100%;
    margin: 8px 0;
    border-radius: 10px;
    order: -1;
  }

  .nav-links .search-form input {
    width: 100% !important;
    flex: 1;
  }

  /* Language toggle */
  .nav-links .lang-toggle-btn {
    margin-top: 10px;
    align-self: flex-start;
  }

  /* ── HERO ───────────────────────────────── */
  .hero {
    padding: 30px 0 22px;
  }

  .hero h1 {
    font-size: 1.75rem;
    line-height: 1.3;
  }

  .hero p {
    font-size: 0.98rem;
  }

  /* ── SECTION TITLE ──────────────────────── */
  .section-title {
    font-size: 1.25rem;
    margin-bottom: 16px;
  }

  /* ── GAMES GRID ─────────────────────────── */
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 36px;
  }

  .game-title {
    font-size: 0.95rem;
  }

  .game-developer {
    font-size: 0.82rem;
    margin-bottom: 10px;
  }

  /* ── CATEGORY FILTER BAR ────────────────── */
  .cat-filter-wrap {
    margin-bottom: 12px;
  }

  .cat-filter-btn {
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  /* ── GAME PAGE ──────────────────────────── */
  .game-header {
    flex-direction: column-reverse;
    gap: 16px;
    margin-top: 20px;
    margin-bottom: 20px;
  }

  .game-header-details h1 {
    font-size: 1.5rem;
  }

  .game-header-details .developer {
    font-size: 0.92rem;
    margin-bottom: 12px;
  }

  .game-header-details .description {
    font-size: 0.95rem;
    margin-bottom: 18px;
  }

  /* ── DOWNLOAD SECTION ───────────────────── */
  .download-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
  }

  .btn-download {
    font-size: 1rem;
    padding: 12px 20px;
    width: 100%;
    justify-content: center;
  }

  .btn-small {
    width: 100%;
    justify-content: center;
    padding: 10px 16px;
  }

  /* Owner edit + delete buttons */
  #owner-actions-wrap > div {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  #owner-actions-wrap a,
  #owner-actions-wrap button {
    width: 100%;
    justify-content: center;
  }

  /* ── SCREENSHOTS GALLERY (game page) ─────── */
  .screenshots-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
  }

  /* ── CHAT PAGE ──────────────────────────── */
  .chat-container {
    flex-direction: column;
    height: auto;
    min-height: 82vh;
    margin-top: 16px;
  }

  .chat-sidebar {
    width: 100%;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    max-height: 160px;
  }

  .chat-sidebar h3 {
    padding: 10px 14px;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color);
  }

  .room-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    flex-grow: 0;
  }

  .room-list::-webkit-scrollbar {
    display: none;
  }

  .room-list li {
    border-bottom: none;
    white-space: nowrap;
    padding: 10px 14px;
    font-size: 0.88rem;
    flex-shrink: 0;
  }

  .user-profile {
    padding: 8px 14px;
  }

  .chat-messages {
    padding: 10px 12px;
    gap: 10px;
  }

  .message {
    max-width: 90%;
  }

  .chat-input-area {
    padding: 10px;
  }

  /* ── AUTH BOX ───────────────────────────── */
  .auth-box {
    padding: 26px 18px;
  }

  /* ── PROFILE PAGE ───────────────────────── */
  .profile-hero-body {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 0 16px 22px;
  }

  .profile-avatar-wrapper {
    margin-top: -50px;
  }

  .profile-hero-info h1 {
    font-size: 1.35rem;
  }

  .profile-edit-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 28px;
  }

  .profile-card-body {
    padding: 16px;
  }

  /* Save buttons full width */
  .profile-card-body > .btn-download,
  #save-nickname-btn,
  #save-avatar-btn,
  #profile-logout-btn,
  #profile-goto-chat-btn {
    width: 100%;
    justify-content: center;
  }

  /* Danger zone action row */
  #profile-logout-btn,
  #profile-goto-chat-btn {
    margin: 0;
  }

  /* ── ADMIN PAGE ─────────────────────────── */
  .admin-page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 18px;
  }

  .admin-page-title h1 {
    font-size: 1.25rem;
  }

  .admin-toolbar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .admin-search-wrap {
    min-width: unset;
  }

  .admin-filter-tabs {
    overflow-x: auto;
    padding-bottom: 4px;
    gap: 6px;
  }

  .admin-filter-btn {
    font-size: 0.78rem;
    padding: 6px 11px;
  }

  .admin-table td,
  .admin-table th {
    padding: 10px 10px;
    font-size: 0.82rem;
  }

  /* Hide email and last-seen columns to save space */
  .admin-table th:nth-child(2),
  .admin-table td:nth-child(2),
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) {
    display: none;
  }

  .admin-user-uid {
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-role-btn {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  /* ── UPLOAD / EDIT PAGE ─────────────────── */
  .upload-page-header {
    gap: 12px;
    margin-bottom: 18px;
  }

  .upload-page-header h1,
  .upload-page-header [data-i18n="edit.title"],
  .upload-page-header [data-i18n="upload.title"] {
    font-size: 1.3rem !important;
  }

  .upload-card-body {
    padding: 16px;
  }

  .upload-fields-row {
    grid-template-columns: 1fr;
  }

  .screenshots-upload-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .upload-submit-row {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .upload-submit-btn {
    width: 100%;
    justify-content: center;
  }

  .cat-pill {
    padding: 5px 10px;
    font-size: 0.8rem;
  }

  .back-to-game-link {
    font-size: 0.85rem;
  }

  .edit-thumb-actions {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* ── REVIEWS ────────────────────────────── */
  .reviews-summary-card {
    flex-direction: column;
    padding: 18px 14px;
    gap: 16px;
  }

  .reviews-summary-left {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    min-width: unset;
  }

  .reviews-avg-score {
    font-size: 2.8rem;
  }

  .star-picker-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .star-input {
    font-size: 1.8rem;
  }

  .review-form-section {
    padding: 16px 14px;
  }

  .review-form-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .review-form-footer .btn-download {
    width: 100%;
    justify-content: center;
  }

  .review-card {
    padding: 14px 12px;
  }

  .review-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* ── DELETE MODAL ───────────────────────── */
  .delete-modal-box {
    padding: 26px 16px 20px;
  }

  .delete-modal-actions {
    flex-direction: column;
    gap: 10px;
  }

  .delete-modal-btn {
    width: 100%;
    justify-content: center;
  }

  /* ── ABOUT PAGE ─────────────────────────── */
  .about-section {
    padding: 24px 16px;
  }
}

/* ==========================================
   480px — VERY SMALL PHONES
   ========================================== */
@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.45rem;
  }

  .games-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .game-title {
    font-size: 0.88rem;
  }

  .game-price {
    font-size: 0.78rem;
    padding: 3px 8px;
  }

  .logo span {
    font-size: 0.88rem;
  }

  .game-header-details h1 {
    font-size: 1.3rem;
  }

  .profile-avatar-ring {
    width: 88px;
    height: 88px;
  }

  .admin-icon-wrap {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    border-radius: 10px;
  }

  .reviews-avg-score {
    font-size: 2.3rem;
  }

  .star-input {
    font-size: 1.55rem;
  }

  .delete-modal-box {
    padding: 22px 14px 16px;
  }

  .delete-modal-title {
    font-size: 1.1rem;
  }

  .section-title {
    font-size: 1.1rem;
  }
}
