/**
 * OUT23-V2 — ajustes solo mobile (no altera desktop).
 * Cargar después de mvp.css / account.css / auth.css.
 */

/* Home hero: desde tablet hacia abajo (desktop >900px mantiene px Figma) */
@media (max-width: 900px) {
  .page-home .home-hero {
    overflow: visible;
  }

  .page-home .home-hero-inner {
    box-sizing: border-box;
    padding-left: clamp(0.65rem, 3vw, 1rem);
    padding-right: clamp(0.65rem, 3vw, 1rem);
  }

  .page-home .home-hero-bg {
    left: clamp(0.5rem, 2vw, 0.75rem);
    right: clamp(0.5rem, 2vw, 0.75rem);
    border-radius: 16px;
  }

  .home-hero-bg-image,
  .home-hero-bg-shade {
    border-radius: 16px;
  }

  .home-hero-copy {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .home-kicker {
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.4;
  }

  .home-brand {
    line-height: 1.12;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
  }

  .home-subtitle {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .home-hero-visual {
    width: 100%;
    min-height: 0;
    justify-content: center;
    align-items: center;
  }

  .home-hero-visual-frame {
    width: 100%;
    max-width: 100%;
  }

  .home-hero-visual-frame img {
    width: 100% !important;
    max-width: 100%;
    height: auto !important;
    object-fit: contain;
  }
}

/* Contacto — formulario completo visible (desktop >960px sin cambios) */
@media (max-width: 960px) {
  .page-contact {
    --contact-panel-h: auto;
    --contact-inner-h: auto;
    --contact-panel-w: calc(100vw - 1.5rem);
  }

  .page-contact .contact-wrap {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
  }

  .contact-section {
    padding-top: 1.5rem;
    padding-bottom: 1rem;
  }

  .contact-panel {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    padding: 1rem 0.85rem;
  }

  .contact-inner {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    grid-template-columns: 1fr !important;
  }

  .contact-info {
    min-height: 0 !important;
    padding: 1.25rem 1rem;
  }

  .contact-info-footer {
    margin-top: 1rem;
  }

  .contact-form-box {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  .contact-form {
    height: auto !important;
    min-height: 0 !important;
    padding: 1.25rem 1rem 1.5rem;
  }

  .contact-form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }

  .contact-message-group {
    flex: none !important;
    margin-top: 0.5rem;
  }

  .page-contact .contact-form textarea.form-control {
    flex: none !important;
    min-height: 120px !important;
    height: auto !important;
    resize: vertical;
    padding-bottom: 0.75rem;
  }

  .contact-subjects {
    margin-top: 0.5rem;
  }

  .contact-subjects-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .contact-send {
    width: 100%;
    min-width: 0;
    margin-top: 1rem;
  }
}

@media (max-width: 768px) {
  html,
  body {
    overflow-x: hidden;
  }

  .page-home,
  .page-games,
  .page-about,
  .page-contact,
  .page-info,
  .page-game {
    --home-chips-w: calc(100vw - 1.5rem);
    --home-panel-w: calc(100vw - 1.5rem);
    --games-hero-collage-w: 100%;
    --game-page-w: calc(100vw - 1.5rem);
  }

  .container {
    width: min(1180px, calc(100% - 1.25rem));
  }

  /* Header */
  .header-inner {
    align-items: center;
    row-gap: 0.35rem;
  }

  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
    max-width: 100%;
  }

  .btn-nav-outline {
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0 0.7rem;
    font-size: 11px;
    letter-spacing: 0;
  }

  .lang-switch {
    padding: 0.3rem 0.5rem;
    font-size: 0.72rem;
  }

  .main-nav.open {
    width: 100%;
    flex-basis: 100%;
    order: 10;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 0.25rem;
    padding-top: 0.75rem;
  }

  .nav-user-dropdown {
    width: min(350px, calc(100vw - 1.5rem));
    height: auto;
    max-height: min(500px, calc(100dvh - var(--nav-h) - 1rem));
    padding: 1.25rem 1rem 1.5rem;
    overflow-y: auto;
    border-radius: 12px;
  }

  .nav-user-dropdown-grid {
    width: 100%;
    height: auto;
    gap: 1.15rem;
  }

  /* Home (refinamiento ≤768px) */
  .page-home .home-hero {
    padding-top: 0.75rem;
  }

  .page-home .home-hero-inner,
  .page-home .home-games-wrap,
  .page-home .home-stats-wrap,
  .page-home .home-partners-wrap {
    width: calc(100vw - 1.5rem);
    max-width: calc(100vw - 1.5rem);
  }

  .page-home .home-hero-inner {
    padding-top: 1.35rem;
    padding-bottom: 1.15rem;
  }

  .page-home .home-hero-top {
    gap: 1.25rem;
    margin-bottom: 1.15rem;
  }

  .home-kicker {
    margin-bottom: 0.65rem;
    font-size: 11px;
  }

  .home-brand {
    margin-bottom: 0.85rem;
    font-size: clamp(1.35rem, 6.8vw, 2rem) !important;
  }

  .home-subtitle {
    margin-bottom: 1.1rem;
    font-size: 11px;
    line-height: 1.45;
  }

  .home-hero-visual-frame img {
    border-radius: 14px;
  }

  .home-chips-bar {
    padding: 1rem 1rem 0.9rem;
    min-height: 0;
  }

  .home-cta,
  .home-more-games,
  .contact-send {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }

  .home-stats-heading {
    font-size: clamp(1.35rem, 6vw, 2rem);
  }

  /* Games list */
  .games-hero-inner {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .games-row,
  .games-row-bg img {
    height: auto;
    min-height: 220px;
    max-height: none;
  }

  .games-row-bg img {
    min-height: 220px;
  }

  .games-row-main {
    left: 1rem;
    transform: translate(0, -50%);
    max-width: calc(100% - 5.5rem);
    gap: 0.75rem;
  }

  .games-row-thumb {
    flex: 0 0 88px;
    width: 88px;
    height: 88px;
  }

  .games-row-thumb img {
    width: 88px;
    height: 88px;
  }

  .games-row-title {
    font-size: clamp(1.1rem, 5.5vw, 1.65rem);
    word-break: break-word;
  }

  .games-row-play {
    right: 0.85rem;
    bottom: 0.85rem;
    width: 130px;
    height: 36px;
    padding: 0;
    border-radius: 10px;
    font-size: 12px;
  }

  .games-row-stats {
    margin-top: 0.35rem;
    max-height: 48px;
    opacity: 1;
    transform: none;
  }

  .games-row-stat {
    font-size: 10px;
    white-space: normal;
  }

  /* Badges — evitar overflow horizontal */
  .games-row,
  .game-hero-gallery,
  .home-game-media {
    overflow: hidden;
  }

  .experience-badge,
  .games-row .experience-badge,
  .games-row .experience-badge--week,
  .game-hero-gallery .experience-badge,
  .game-hero-gallery .experience-badge--week,
  .home-game-media .experience-badge,
  .home-game-media .experience-badge--week {
    right: 0.5rem !important;
    top: 0.65rem !important;
    width: auto !important;
    max-width: calc(100% - 1rem);
    padding-right: 0.5rem !important;
    font-size: 8px !important;
    letter-spacing: 0.04em !important;
    transform: rotate(0deg);
  }

  /* Game detail */
  .game-page-wrap,
  .game-related-wrap,
  .page-game .home-partners-wrap {
    width: calc(100vw - 1.5rem);
  }

  .game-page-panel {
    padding: 1.15rem 0.85rem 1.35rem;
  }

  .game-hero-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .game-btn {
    width: 100%;
    min-width: 0;
  }

  .game-hero-stats {
    gap: 0.75rem 1rem;
  }

  .game-hero-stats li {
    font-size: 11px;
  }

  .game-all-comments {
    max-width: none;
  }

  /* About panels */
  .page-about .about-story-wrap,
  .page-about .home-games-wrap,
  .page-about .home-partners-wrap,
  .page-info .info-wrap,
  .page-info .home-partners-wrap {
    width: calc(100vw - 1.5rem);
  }

  /* Footer */
  .footer-links-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .footer-logo {
    max-width: min(240px, 70vw);
    height: auto;
  }

  .footer-legal-row {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 768px) {
  /* Account */
  .page-account .account-wrap {
    width: calc(100vw - 1.25rem);
  }

  .page-account-tabbed .account-figma-tabs {
    gap: 0.25rem;
  }

  .page-account-tabbed .account-figma-tabs .account-tag {
    min-width: 0;
    flex: 1 1 calc(50% - 0.25rem);
    height: 42px;
    padding: 0 0.5rem;
    font-size: 0.58rem;
    text-align: center;
  }

  .page-account .account-figma-panel-surface,
  .page-account .account-figma-tab-panel {
    border-radius: 14px;
  }

  .account-field--profile .form-control,
  .account-input-wrap .form-control {
    min-height: 56px;
    height: auto;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  .account-save-btn,
  .account-profile-btn,
  .page-account-purchases .account-see-more {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .page-account-events .account-event-card {
    grid-template-columns: 1fr;
  }

  .page-account-events .account-event-media,
  .page-account-events .account-event-media img {
    min-height: 160px;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-h: 88px;
  }

  body {
    padding-top: var(--nav-h);
  }

  .brand img {
    width: 148px !important;
    height: 68px !important;
  }

  .header-inner {
    min-height: var(--nav-h) !important;
  }

  .page-home .home-hero-inner {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .home-brand {
    font-size: clamp(1.2rem, 6.2vw, 1.75rem) !important;
  }

  .home-kicker {
    font-size: 10px;
  }

  .home-subtitle {
    font-size: 10px;
  }

  .home-chip-title {
    font-size: 14px;
  }

  .home-chip-sub {
    font-size: 11px;
  }

  .games-row-main {
    left: 0.75rem;
    max-width: calc(100% - 4.75rem);
  }

  .games-row-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
  }

  .games-row-thumb img {
    width: 72px;
    height: 72px;
  }

  .game-hero-thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .game-data-grid {
    grid-template-columns: 1fr;
  }

  .auth-flip-card,
  .auth-flip-face {
    min-height: 460px;
  }
}

/* Touch: contenido que en desktop depende de :hover */
@media (hover: none) and (pointer: coarse) {
  .games-row-main {
    left: 1rem;
    transform: translate(0, -50%);
  }

  .games-row-stats {
    margin-top: 0.35rem;
    max-height: 56px;
    opacity: 1;
    transform: none;
  }

  .games-row-play {
    right: 0.85rem;
    bottom: 0.85rem;
  }

  .home-game-card .home-game-meta {
    position: static;
    opacity: 1;
    visibility: visible;
    max-height: none;
    height: auto;
    margin-top: 0.35rem;
  }

  .home-game-card .home-game-play {
    opacity: 1;
    max-height: 48px;
    margin-top: 0.5rem;
    padding: 0.45rem 1rem;
    border-color: var(--out23-cyan);
    transform: none;
    pointer-events: auto;
  }

  .home-game-card .home-game-overlay {
    justify-content: flex-end;
    align-items: flex-start;
    text-align: left;
    padding: 1rem;
  }

  .home-game-card .home-game-hover-preview {
    display: none;
  }
}
