/**
 * 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) {
  :root {
    --nav-h: 96px;
  }

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

  .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;
  }

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

  .home-chips-bar {
    padding: 1rem 1.15rem;
  }

  .games-hero-visual-frame {
    width: min(100%, var(--games-hero-visual-max-w, 1146px), calc(100vw - 1.5rem));
    max-width: min(var(--games-hero-visual-max-w, 1146px), 100%);
    margin-left: auto;
    margin-right: 0;
    height: 100%;
    min-height: inherit;
    aspect-ratio: 1290 / 733;
  }

  .games-hero-visual-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: right center;
  }

  /* Games list cards — altura fluida; sin posicionamiento hover de desktop */
  .games-catalog-panel {
    padding: 1.35rem 1rem 1.25rem;
  }

  .games-row {
    height: auto;
    min-height: 260px;
    max-height: none;
  }

  .games-row-bg img {
    height: 100%;
    min-height: 100%;
    object-fit: cover;
  }

  .games-row-content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem;
    min-height: 260px;
    box-sizing: border-box;
  }

  .games-row-main {
    position: static;
    top: auto;
    left: auto;
    transform: none;
    max-width: 100%;
    width: 100%;
    gap: 0.65rem;
    align-items: flex-start;
  }

  .games-row:hover .games-row-main,
  .games-row:focus-visible .games-row-main {
    left: auto;
    transform: none;
  }

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

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

  .games-row-copy {
    flex: 1;
    min-width: 0;
    width: 100%;
  }

  .games-row-title {
    font-size: clamp(0.95rem, 4.2vw, 1.35rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
    word-break: break-word;
    transform: none !important;
  }

  .games-row:hover .games-row-title,
  .games-row:focus-visible .games-row-title {
    transform: none;
  }

  .games-row-stats {
    margin-top: 0.35rem;
    max-height: none;
    opacity: 1;
    overflow: visible;
    transform: none;
    gap: 0.35rem 0.6rem;
  }

  .games-row:hover .games-row-stats {
    max-height: none;
    margin-top: 0.35rem;
  }

  .games-row-stat {
    font-size: 9px;
    white-space: nowrap;
    gap: 0.3rem;
  }

  .games-row-stat i {
    font-size: 0.85rem;
  }

  .games-row-play {
    position: static;
    align-self: flex-end;
    width: min(140px, 100%);
    height: 34px;
    margin-top: 0.15rem;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    flex-shrink: 0;
    font-size: 11px;
    border-color: rgba(255, 255, 255, 0.65);
  }

  .games-row:hover .games-row-play,
  .games-row:focus-visible .games-row-play {
    opacity: 1;
    transform: none;
  }

  .page-auth {
    --auth-panel-w: min(100%, calc(100vw - 1.5rem));
  }
}

/* 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,
  .page-game-hints,
  .page-game-play,
  .page-commercial-demo,
  .page-account,
  .page-auth {
    --home-chips-w: calc(100vw - 1.5rem);
    --home-panel-w: calc(100vw - 1.5rem);
    --games-hero-w: calc(100vw - 1.5rem);
    --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;
  }

  /* 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;
  }

  /* Game play / hints / commercial demo */
  .game-play-wrap,
  .commercial-demo-wrap {
    width: calc(100vw - 1.5rem);
  }

  .game-hints-main,
  .game-play-main {
    padding: 1.25rem 0 2rem;
  }

  .game-hints-section {
    min-height: 0;
    border-radius: 14px;
  }

  .game-hints-wrap {
    width: calc(100vw - 1.5rem);
    padding: 1.25rem 0.75rem;
  }

  .game-hints-panel.game-page-panel {
    padding: 1.15rem 0.85rem 1.25rem;
    border-radius: 16px;
  }

  .page-game-hints .game-hints-main {
    padding: 0;
    min-height: calc(100vh - var(--nav-h));
  }

  .page-game-hints .game-hints-section {
    min-height: calc(100vh - var(--nav-h));
    border-radius: 0;
  }

  .page-game-hints .game-hints-wrap {
    width: 100%;
    padding: 0.85rem 0.75rem 1rem;
  }

  .page-game-hints .game-hints-panel.game-page-panel {
    border-radius: 12px;
    padding: 1rem 0.85rem 1.15rem;
  }

  .game-play-hero .game-play-panel {
    aspect-ratio: 580 / 326;
    min-height: max(calc((100vw - 1.5rem) * 326 / 580), 380px);
    max-height: none;
    padding: clamp(0.85rem, 3vw, 1.35rem);
    border-radius: 14px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .game-play-hero {
    border-radius: 14px;
  }

  .game-play-title,
  .game-hints-panel .game-play-title {
    font-size: clamp(1.25rem, 5.5vw, 1.85rem);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .game-play-access-code {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .game-play-access-code strong {
    font-size: clamp(0.85rem, 4vw, 1.1rem);
    word-break: break-all;
  }

  .game-play-links-secondary,
  .game-hints-footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .game-hints-chapter-summary {
    padding: 0.85rem 0.75rem;
    gap: 0.65rem;
  }

  .game-hints-chapter-title {
    font-size: 0.72rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .game-hints-chapter-body {
    padding: 0 0.75rem 0.85rem;
  }

  .game-hints-step-summary {
    align-items: flex-start;
  }

  .game-hints-step-title {
    min-width: 0;
    flex: 1 1 auto;
  }

  .commercial-demo-main {
    padding: 0.5rem 0 1rem;
    min-height: 0;
  }

  .commercial-demo-section {
    padding: 0 0.75rem;
  }

  .commercial-demo-video {
    max-height: min(calc(100dvh - var(--nav-h) - 7.5rem), 56.25vw);
    border-radius: 12px;
  }

  /* Modals */
  .game-checkout-modal,
  .game-gallery-modal,
  .game-trailer-modal,
  .account-review-modal {
    padding: 0.75rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }

  .game-checkout-modal-panel,
  .account-modal-panel {
    padding: 1.35rem 1rem 1.15rem;
    border-radius: 14px;
  }

  .game-checkout-modal-close,
  .account-review-modal-close {
    top: 0.5rem;
    right: 0.5rem;
  }

  .game-checkout-modal-title {
    font-size: 1rem;
    padding-right: 1.75rem;
  }

  .game-checkout-modal-option {
    min-height: 64px;
  }

  .game-gallery-dialog,
  .game-trailer-dialog {
    width: calc(100vw - 1rem);
    padding: 0.85rem;
    border-radius: 12px;
  }

  .game-gallery-stage {
    aspect-ratio: 16 / 9;
  }

  .game-gallery-nav {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .game-gallery-prev {
    left: 0.35rem;
  }

  .game-gallery-next {
    right: 0.35rem;
  }

  .game-gallery-title {
    margin-right: 2rem;
    font-size: clamp(0.85rem, 3.5vw, 1rem);
  }

  .account-review-modal-dialog,
  .experience-lang-modal-dialog {
    width: calc(100vw - 1.5rem);
    max-height: calc(100dvh - 1.5rem);
  }

  /* Info / about */
  .info-hero-inner {
    padding: 2rem 1rem 1.5rem;
  }

  .info-hero-title {
    font-size: clamp(1.5rem, 7vw, 2.25rem);
    overflow-wrap: anywhere;
  }

  .info-hero-lead {
    font-size: 14px;
  }

  .info-panel {
    border-radius: 16px;
    padding: 1rem 0.85rem;
  }

  .page-about .about-hero-inner {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* Game detail refinements */
  .game-hero-title {
    font-size: clamp(1.35rem, 5.5vw, 2rem);
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .game-hero-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .game-reviews-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .game-review-send-btn {
    width: 100%;
    max-width: none;
  }

  .game-inline-title,
  .game-panel-title {
    font-size: clamp(1rem, 4.5vw, 1.25rem);
    overflow-wrap: anywhere;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  main.container.hero {
    padding: 2rem 1rem 3rem;
  }
}

@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;
  }

  .page-account .account-wrap {
    padding: 0 0.65rem;
  }

  .account-purchase-receipt-dialog {
    width: calc(100vw - 1.5rem);
  }

  .account-acquisition-score {
    flex-direction: column;
    align-items: flex-start;
  }
}

@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 {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .games-row-copy {
    flex: 1 1 calc(100% - 72px);
    min-width: 0;
  }

  .games-row-content {
    min-height: 280px;
  }

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

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

  .games-row-title {
    font-size: clamp(0.88rem, 4.8vw, 1.15rem);
  }

  .games-row-stat {
    font-size: 8px;
  }

  .games-row-play {
    width: min(128px, 100%);
    height: 32px;
    font-size: 10px;
  }

  .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;
  }

  .nav-user-chevron {
    display: none;
  }

  .btn-nav-outline {
    padding: 0 0.55rem;
    font-size: 10px;
  }

  .site-header-minimal .brand img {
    width: 132px !important;
    height: 60px !important;
  }

  .site-header-minimal .btn-nav-outline {
    min-width: 0;
    padding: 0 0.65rem;
    font-size: 11px;
  }

  .commercial-demo-title-game {
    font-size: clamp(1.15rem, 5.5vw, 1.65rem);
  }

  .commercial-demo-video {
    max-height: min(calc(100dvh - var(--nav-h) - 6.5rem), 52vw);
  }

  .game-hints-score-ring {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  .game-hints-score-value {
    font-size: 1.25rem;
  }

  .game-hints-step-body {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .games-hero-title {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }

  .games-hero-subtitle {
    font-size: 13px;
  }
}

/* Touch: stats visibles (layout mobile ya en ≤900px) */
@media (hover: none) and (pointer: coarse) {
  .games-row-stats {
    opacity: 1;
    max-height: none;
  }

  .games-row-play {
    opacity: 1;
    transform: none;
  }

  .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;
  }
}
