/* === LustNexus - Mobile Phone Mode === */
/* Este archivo SOLO contiene estilos para teléfonos/tablets.
   No afecta al diseño desktop (>768px).
   Breakpoints: 768px (tablet), 480px (phone), 380px (small phone), 360px (ultra-small)
   + landscape orientation
*/

/* ============================================
   TABLET — max-width: 768px
   ============================================ */
@media (max-width: 768px) {

  body {
    padding: .8rem;
  }

  .site-header {
    top: .8rem;
    border-radius: 18px;
    overflow: hidden;
  }

  .site-footer {
    border-radius: 18px;
  }

  /* --- Container --- */
  .container {
    padding: 0 1rem !important;
  }

  /* --- Header --- */
  .header-inner {
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.25rem 0 !important;
  }
  .logo {
    font-size: 1.05rem;
    padding-left: .25rem;
  }
  .search-form {
    order: 3;
    max-width: 100%;
    flex: 1 1 100%;
    margin-top: .75rem;
    margin-bottom: .5rem;
  }

  /* --- Navigation Tabs --- */
  .nav-tabs-bar {
    position: relative;
    padding: .25rem 0;
  }
  /* Scroll fade indicator on right edge */
  .nav-tabs-bar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(to right, transparent, rgba(6,6,15,.85));
    pointer-events: none;
    z-index: 2;
  }
  .nav-tab {
    padding: .75rem 1.15rem;
    font-size: .8rem;
  }

  /* --- Main Content --- */
  .main-content {
    padding: 2.5rem 0 !important;
  }

  /* --- Hero --- */
  .hero {
    padding: 3rem 1.25rem 3rem !important;
    margin-bottom: 2rem;
  }
  .hero-glow {
    width: 100%;
  }

  /* --- Games Grid --- */
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 1.5rem !important;
  }
  .games-grid.featured {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
  }

  /* --- Sections spacing --- */
  .games-section,
  .tags-section,
  .related-section {
    margin-bottom: 4rem !important;
  }

  /* --- Section Headers --- */
  .section-header {
    margin-bottom: 1.75rem !important;
    margin-top: .5rem;
  }

  /* --- Game Page --- */
  .game-page {
    max-width: 100%;
  }
  .game-hero-content {
    padding: 1.25rem;
  }
  .game-hero-content h1 {
    font-size: 1.3rem;
  }
  .game-desc {
    padding: .9rem 1.1rem;
    font-size: .95rem;
  }

  /* --- Play Area --- */
  .play-btn {
    padding: .85rem 2rem;
    font-size: 1rem;
    letter-spacing: 2px;
  }
  .entry-picker-title {
    font-size: 1.2rem;
  }
  .entry-option-btn {
    padding: .75rem 1.5rem;
    font-size: .92rem;
  }

  /* --- Creator Section --- */
  .creator-section {
    flex-direction: column;
    align-items: flex-start;
    gap: .75rem;
    padding: .9rem 1.1rem;
  }
  .creator-link {
    font-size: .8rem;
    padding: .45rem .9rem;
  }

  /* --- Comments --- */
  .comment-form {
    padding: 1.1rem;
  }
  .comment {
    padding: .9rem 1rem;
  }

  /* --- All Games A-Z --- */
  .az-jumper {
    padding: .7rem .9rem;
    gap: .3rem;
  }
  .az-jump-link {
    width: 1.85rem;
    height: 1.85rem;
    font-size: .7rem;
  }

  /* --- Tags Cloud --- */
  .tags-cloud {
    gap: .45rem;
  }
  .tag-link {
    padding: .4rem .85rem;
    font-size: .78rem;
  }
}


/* ============================================
   PHONE — max-width: 480px
   ============================================ */
@media (max-width: 480px) {

  body {
    padding: .65rem;
  }

  .site-header {
    top: .65rem;
    border-radius: 16px;
  }

  .site-footer {
    border-radius: 16px;
  }

  /* --- Container --- */
  .container {
    padding: 0 .9rem !important;
  }

  /* --- Header --- */
  .header-inner {
    gap: 1rem;
    padding: 1.1rem 0 !important;
  }
  .logo {
    font-size: .95rem;
    padding-left: .15rem;
  }
  .search-form {
    margin-bottom: .5rem;
    margin-top: .5rem;
  }
  .search-form input {
    padding: .5rem 1rem;
    font-size: .85rem;
  }
  .search-form button {
    padding: .5rem .9rem;
  }

  /* --- Navigation --- */
  .nav-tab {
    padding: .6rem 1rem;
    font-size: .78rem;
  }

  /* --- Main Content --- */
  .main-content {
    padding: 2rem 0 !important;
  }

  /* --- Hero --- */
  .hero {
    padding: 2.5rem 1rem 2.5rem !important;
    margin-bottom: 1.75rem;
  }
  .hero h1 {
    font-size: 1.7rem;
  }
  .hero p {
    font-size: .9rem;
  }

  /* --- Games Grid --- */
  .games-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }
  .games-grid.featured {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .game-card {
    border-radius: var(--radius-sm);
  }
  .game-card:hover {
    transform: none;
    box-shadow: none;
  }
  .game-info {
    padding: .75rem;
  }
  .game-info h3 {
    font-size: .82rem;
  }
  .game-cat {
    font-size: .62rem;
    padding: .1rem .5rem;
  }
  .game-tags {
    margin-top: .3rem;
  }
  .mini-tag {
    font-size: .6rem;
    padding: .05rem .3rem;
  }

  /* --- Game Page --- */
  .game-hero {
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
  }
  .game-hero-content {
    padding: 1rem;
  }
  .game-hero-content h1 {
    font-size: 1.15rem;
    margin-bottom: .5rem;
  }
  .game-meta {
    gap: .4rem;
  }
  .game-desc {
    padding: .85rem 1rem;
    font-size: .9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
  }

  /* --- Play Area (vertical) --- */
  .game-play-area {
    margin-bottom: 1.25rem;
  }
  .game-iframe-wrapper {
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
  }
  .play-btn {
    padding: .75rem 1.5rem;
    font-size: .9rem;
    letter-spacing: 2px;
    border-radius: var(--radius-sm);
  }
  .entry-picker-title {
    font-size: 1.1rem;
  }
  .entry-picker-options {
    gap: .65rem;
    padding: 0 .5rem;
  }
  .entry-option-btn {
    padding: .7rem 1.2rem;
    font-size: .85rem;
    border-radius: var(--radius-sm);
  }
  .fs-toggle {
    width: 38px;
    height: 38px;
    bottom: 8px;
    right: 8px;
    border-radius: 10px;
  }

  /* --- Creator Section --- */
  .creator-section {
    padding: .85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: var(--radius-sm);
  }
  .creator-link {
    font-size: .78rem;
    padding: .4rem .85rem;
    gap: .35rem;
  }

  /* --- Star Rating (Touch friendly ≥44px) --- */
  .rating-section {
    gap: .6rem;
    margin-top: .65rem;
  }
  .star {
    font-size: 2rem;
    padding: .15rem;
    /* Ensure min touch target */
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .star:hover {
    transform: none; /* No hover effect on touch */
  }
  .rating-avg {
    font-size: 1rem;
  }
  .rating-count {
    font-size: .72rem;
  }

  /* --- Comments --- */
  .comments-section > h2 {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  .comment-form {
    padding: 1rem;
    border-radius: var(--radius-sm);
  }
  .comment-form-title {
    font-size: .72rem;
    margin-bottom: .65rem;
  }
  /* Prevent iOS auto zoom on focus */
  .form-row input,
  .form-row textarea {
    font-size: 16px;
  }
  .form-row textarea {
    min-height: 80px;
  }
  .comment-form .btn-primary {
    width: 100%;
    padding: .75rem;
    font-size: .9rem;
    justify-content: center;
  }
  .comment {
    padding: .85rem 1rem;
    border-radius: 8px;
  }
  .comment-author {
    font-size: .85rem;
  }
  .comment-date {
    font-size: .7rem;
  }
  .comment-body {
    font-size: .88rem;
    line-height: 1.55;
  }

  /* --- Sections spacing --- */
  .games-section,
  .tags-section,
  .related-section {
    margin-bottom: 3.5rem !important;
  }

  /* --- Section Headers --- */
  .section-header {
    margin-bottom: 1.5rem !important;
    margin-top: .5rem;
  }
  .section-title {
    font-size: .95rem;
  }

  /* --- Tags Cloud --- */
  .tags-cloud {
    gap: .35rem;
  }
  .tag-link {
    padding: .35rem .75rem;
    font-size: .75rem;
  }
  .tag-count {
    font-size: .62rem;
  }

  /* --- All Games A-Z --- */
  .az-jumper {
    padding: .6rem .75rem;
    gap: .25rem;
    border-radius: var(--radius-sm);
  }
  .az-jump-link {
    width: 1.75rem;
    height: 1.75rem;
    font-size: .68rem;
    border-radius: 6px;
  }
  .az-letter {
    font-size: 1.3rem;
  }

  /* --- Search & Category Pages --- */
  .search-page h1,
  .category-page h1 {
    font-size: 1.3rem;
  }
  .search-info {
    font-size: .85rem;
    margin-bottom: 1rem;
  }

  /* --- Error & Empty State --- */
  .error-page {
    padding: 3rem 1rem;
  }
  .error-page h1 {
    font-size: 4rem;
  }
  .error-page p {
    font-size: 1rem;
    margin: .75rem 0 1.5rem;
  }
  .empty-state {
    padding: 2.5rem 1rem;
  }
  .empty-state h2 {
    font-size: 1.15rem;
  }

  /* --- Footer --- */
  .site-footer {
    padding: 1.5rem 0;
    font-size: .75rem;
    margin-top: 2rem;
  }

  /* --- Buttons touch-friendly --- */
  .btn {
    padding: .5rem 1rem;
    font-size: .85rem;
    min-height: 44px;
  }
  .btn-sm {
    padding: .35rem .75rem;
    font-size: .8rem;
    min-height: 36px;
  }
  .btn-large {
    padding: .75rem 1.8rem;
    font-size: .95rem;
  }

  /* --- Admin Comments --- */
  .admin-comment {
    padding: .9rem 1rem;
    border-radius: 8px;
  }
  .admin-comment-header {
    gap: .35rem;
  }
  .admin-comment-actions {
    flex-wrap: wrap;
  }

  /* Disable hover animations on touch devices */
  .game-card::before {
    display: none;
  }
  .game-thumb::after {
    display: none;
  }
}


/* ============================================
   SMALL PHONE — max-width: 380px
   ============================================ */
@media (max-width: 380px) {

  body {
    padding: .5rem;
  }

  .site-header {
    top: .5rem;
    border-radius: 14px;
  }

  .container {
    padding: 0 .8rem !important;
  }
  .logo {
    font-size: .88rem;
  }
  .search-form input {
    padding: .45rem .85rem;
    font-size: .82rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }
  .hero p {
    font-size: .85rem;
  }

  .games-grid {
    gap: .4rem;
  }
  .game-card {
    border-radius: 8px;
  }
  .game-info {
    padding: .5rem;
  }
  .game-info h3 {
    font-size: .78rem;
  }
  .game-cat {
    font-size: .58rem;
  }

  .game-hero-content h1 {
    font-size: 1.05rem;
  }

  .play-btn {
    padding: .65rem 1.25rem;
    font-size: .82rem;
    letter-spacing: 1.5px;
  }
  .entry-option-btn {
    padding: .6rem 1rem;
    font-size: .8rem;
  }
  .entry-picker-title {
    font-size: 1rem;
  }

  .creator-section {
    padding: .75rem .85rem;
  }
  .creator-link {
    font-size: .72rem;
    padding: .35rem .7rem;
  }

  .section-title {
    font-size: .85rem;
    letter-spacing: .5px;
  }

  .comment-form {
    padding: .85rem;
  }
  .comment {
    padding: .75rem .85rem;
  }

  .az-jump-link {
    width: 1.6rem;
    height: 1.6rem;
    font-size: .62rem;
  }

  .error-page h1 {
    font-size: 3.5rem;
  }
}


/* ============================================
   ULTRA-SMALL PHONE — max-width: 320px
   ============================================ */
@media (max-width: 320px) {

  body {
    padding: .4rem;
  }

  .site-header {
    top: .4rem;
  }

  .container {
    padding: 0 .65rem !important;
  }

  .games-grid {
    gap: .3rem;
  }
  .game-info {
    padding: .4rem;
  }
  .game-info h3 {
    font-size: .72rem;
  }

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

  .nav-tab {
    padding: .55rem .75rem;
    font-size: .72rem;
  }
}


/* ============================================
   LANDSCAPE PHONE — short viewport
   ============================================ */
@media (orientation: landscape) and (max-height: 500px) {

  body {
    padding: .75rem;
  }

  .site-header {
    top: .75rem;
    border-radius: 16px;
    overflow: hidden;
  }

  .site-footer {
    border-radius: 16px;
    margin-top: 1.5rem;
    padding: 1rem 0;
  }

  .container {
    padding: 0 1rem !important;
  }

  .header-inner {
    gap: .85rem;
    padding: .95rem 0 !important;
  }

  .search-form {
    max-width: 100%;
  }

  .nav-tabs-bar {
    padding: .15rem 0;
  }

  .nav-tab {
    padding: .7rem 1rem;
  }

  /* --- Hero compact --- */
  .hero {
    padding: 1.6rem 1rem 1.5rem;
    margin-bottom: 1.4rem;
  }
  .hero h1 {
    font-size: 1.4rem;
    margin-bottom: .4rem;
  }
  .hero p {
    font-size: .85rem;
  }
  .hero-glow {
    height: 200px;
  }

  /* --- Main spacing reduced --- */
  .main-content {
    padding: 1.35rem 0 !important;
  }
  .games-section,
  .tags-section,
  .related-section {
    margin-bottom: 2rem !important;
  }

  .section-header {
    margin-bottom: 1.1rem !important;
  }

  /* --- Play area landscape optimized --- */
  .game-iframe-wrapper {
    aspect-ratio: 16/9;
    max-height: 78vh;
  }
  .game-play-area {
    margin-bottom: 1rem;
  }

  /* --- Fullscreen prominent --- */
  .fs-toggle {
    width: 46px;
    height: 46px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border-color: transparent;
    opacity: .9;
    animation: pulse-fs 2s ease-in-out infinite;
  }
  @keyframes pulse-fs {
    0%, 100% { box-shadow: 0 0 12px var(--accent-glow); }
    50% { box-shadow: 0 0 28px var(--accent-glow), 0 0 8px var(--accent); }
  }

  /* --- Game hero compact --- */
  .game-hero-content {
    padding: .85rem 1.1rem;
  }
  .game-hero-content h1 {
    font-size: 1.1rem;
    margin-bottom: .35rem;
  }
  .game-desc {
    margin-bottom: .75rem;
  }
  .game-hero {
    margin-bottom: .75rem;
  }

  /* --- Creator compact --- */
  .creator-section {
    padding: .65rem .85rem;
    margin-bottom: 1rem;
  }

  /* --- Comments compact --- */
  .comments-section > h2 {
    margin-bottom: .75rem;
  }
  .comment-form {
    margin-bottom: 1rem;
  }

  /* --- Grid keeps more columns in landscape --- */
  .games-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: .9rem !important;
  }
  .games-grid.featured {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}


/* ============================================
   LANDSCAPE + NARROW HEIGHT (very small phones)
   ============================================ */
@media (orientation: landscape) and (max-height: 400px) {

  body {
    padding: .55rem;
  }

  .site-header {
    top: .55rem;
    border-radius: 14px;
  }

  .container {
    padding: 0 .85rem !important;
  }

  .header-inner {
    padding: .75rem 0 !important;
  }

  .hero {
    padding: 1rem .85rem;
  }
  .hero h1 {
    font-size: 1.2rem;
    margin-bottom: .25rem;
  }
  .hero p {
    display: none; /* Hide subtitle to save space */
  }

  .game-iframe-wrapper {
    max-height: 82vh;
  }

  .main-content {
    padding: .85rem 0 !important;
  }
}


/* ============================================
   TOUCH-SPECIFIC — hover: none
   ============================================ */
@media (hover: none) and (pointer: coarse) {

  /* Remove hover-dependent effects on touch devices */
  .game-card:hover {
    transform: none;
    box-shadow: 0 4px 16px rgba(0,0,0,.3), 0 0 0 1px var(--border);
  }
  .game-card:hover .game-thumb img {
    transform: none;
  }
  .game-card::before {
    display: none;
  }
  .game-thumb::after {
    display: none;
  }
  .tag-link:hover {
    transform: none;
  }
  .creator-link:hover {
    transform: none;
  }
  .play-btn:hover {
    transform: none;
  }
  .star:hover {
    transform: none;
  }
  .star.hovered {
    transform: none;
  }

  /* Active states for touch feedback */
  .game-card:active {
    transform: scale(.98);
    transition: transform .1s;
  }
  .btn:active,
  .play-btn:active,
  .tag-link:active,
  .nav-tab:active {
    opacity: .8;
    transition: opacity .1s;
  }
  .star:active {
    transform: scale(1.3);
    transition: transform .1s;
  }
}
