/* ==========================================================================
   SISGAMIA - Mobile Stylesheet (mobile.css)
   Exclusivo para Smartphones, Tablets e Telas Touch (<= 768px).
   Arquitetura de Pop-ups Modais com ZERO ROLAGEM VERTICAL:
   Tudo visível e perfeitamente proporcional à viewport móvel.
   ========================================================================== */

@media (max-width: 768px) {
  :root {
    --shadow-pop: 3px 3px 0px var(--teal-dark);
    --shadow-pop-lg: 4px 4px 0px var(--teal-dark);
    --shadow-pop-cyan: 3px 3px 0px var(--cyan-primary);
  }

  body {
    font-size: 14px;
    padding-bottom: 70px;
  }

  #app-container {
    width: 100%;
    max-width: 100%;
    min-height: 100vh;
    border-left: none;
    border-right: none;
    padding: 0;
  }

  /* ========================================================================
     BARRA SUPERIOR HUD COMPACTA (MOBILE)
     ======================================================================== */

  #game-topbar {
    padding: 6px 10px;
    gap: 6px;
    justify-content: space-between;
  }

  .topbar-left {
    gap: 6px;
    flex: 1;
    min-width: 0;
  }

  .act-badge {
    font-size: 10.5px;
    padding: 3px 6px;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .stat-box {
    padding: 3px 6px;
    gap: 4px;
  }

  .conf-bar-container {
    width: 60px;
    height: 10px;
  }

  .conf-text {
    font-size: 9.5px;
    min-width: 34px;
  }

  .topbar-right {
    gap: 5px;
  }

  .affection-meter-badge {
    padding: 3px 6px;
    gap: 4px;
  }

  .aff-label {
    display: none;
  }

  .aff-value {
    font-size: 13.5px;
  }

  .florins-badge {
    font-size: 11.5px;
    padding: 3px 5px;
    gap: 3px;
  }

  #hud-relics-list {
    max-width: 75px;
    gap: 3px;
  }

  .relic-badge {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }

  .game-screen {
    padding: 10px 8px 75px 8px;
  }

  /* ========================================================================
     MENU HERO (MOBILE)
     ======================================================================== */

  .menu-hero-wrap {
    max-width: 100%;
    padding: 6px 0;
  }

  .portrait-hero-container {
    width: 190px;
    height: 190px;
    margin-bottom: 12px;
  }

  .portrait-img {
    border-width: 3px;
  }

  .hero-bia-peek {
    width: 88px;
    height: 88px;
    right: -8px;
    bottom: -8px;
    border-width: 2px;
  }

  .logo-sisgamia {
    font-size: 40px;
    letter-spacing: 1px;
  }

  .menu-subtitle {
    font-size: 11.5px;
    margin-top: 4px;
    padding: 0 8px;
    text-align: center;
  }

  .menu-buttons-list {
    max-width: 100%;
    gap: 8px;
    padding: 0 6px;
    margin-top: 14px;
  }

  .btn-primary-pop {
    font-size: 16px;
    padding: 12px 16px;
    width: 100%;
  }

  .btn-secondary-pop {
    font-size: 13px;
    padding: 10px 12px;
    width: 100%;
  }

  /* ========================================================================
     MAPA PROCEDURAL (MOBILE)
     ======================================================================== */

  .map-header-card {
    padding: 10px 12px;
    margin-bottom: 12px;
  }

  .map-guide-banner {
    font-size: 9.5px;
    padding: 3px 6px;
    gap: 5px;
  }

  .map-header-card h2 {
    font-size: 18px;
  }

  .map-header-card p {
    font-size: 11px;
  }

  .map-floors-tree {
    gap: 12px;
  }

  .map-floor-row {
    padding: 6px 8px;
  }

  .floor-number-badge {
    font-size: 9.5px;
    padding: 2px 5px;
    min-width: 40px;
    margin-right: 6px;
  }

  .node-icon-circle {
    width: 44px;
    height: 44px;
    font-size: 17px;
  }

  .node-label {
    font-size: 9.5px;
    max-width: 70px;
  }

  /* ========================================================================
     MODAIS GLOBAIS (MOBILE - ZERO ROLAGEM)
     ======================================================================== */

  .modal-backdrop {
    padding: 6px;
  }

  .modal-window {
    max-width: 98%;
    max-height: 94vh;
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .modal-header {
    padding: 8px 12px;
  }

  .modal-header h3 {
    font-size: 15px;
  }

  .modal-body {
    padding: 10px 12px;
    gap: 8px;
    overflow: hidden;
  }

  /* ========================================================================
     POP-UP 1: ARENA DO MINIGAME (MOBILE - ZERO ROLAGEM)
     Adapta a altura vertical para caber cabeçalho + canvas + botões sem rolagem.
     ======================================================================== */

  .minigame-popup-window {
    width: 100%;
    max-width: 98%;
    max-height: 94vh;
    border-radius: var(--radius-md);
    border-width: 2.5px;
    overflow: hidden;
  }

  .mg-header-bar {
    padding: 5px 8px;
    border-bottom-width: 2px;
  }

  .mg-title-badge {
    font-size: 12.5px;
  }

  .mg-stats-pill {
    gap: 8px;
  }

  .mg-stat-item {
    font-size: 12px;
  }

  .canvas-wrapper {
    flex: 1;
    min-height: 210px;
    max-height: 340px;
    width: 100%;
  }

  #minigame-canvas {
    max-width: 100%;
    width: 100% !important;
    height: auto !important;
    max-height: 100%;
  }

  .prime-banner-overlay {
    font-size: 10.5px;
    padding: 3px 8px;
    top: 6px;
  }

  #minigame-mobile-controls {
    padding: 5px 6px;
  }

  .rhythm-controls-row {
    gap: 6px;
  }

  .rhythm-btn {
    font-size: 14px;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
  }

  .catcher-controls-row {
    gap: 6px;
  }

  .touch-ctrl-btn {
    font-size: 14px;
    padding: 10px 6px;
    border-radius: var(--radius-sm);
  }

  .pulse-touch-btn {
    font-size: 14px;
    padding: 11px;
    border-radius: var(--radius-sm);
  }

  /* ========================================================================
     POP-UP 2: DILEMA ROMÂNTICO / EVENTO (MOBILE - ZERO ROLAGEM)
     Layout compacto com avatar 48px, fala concisa e botões táteis.
     ======================================================================== */

  .event-popup-window {
    width: 100%;
    max-width: 98%;
    max-height: 94vh;
    background: var(--teal-midnight);
    border: 2.5px solid var(--rose-love);
    border-radius: var(--radius-md);
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.4), var(--shadow-pop);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScale 0.2s ease-out;
  }

  .event-popup-header {
    background: var(--teal-dark);
    padding: 8px 12px;
    border-bottom: 2px solid var(--rose-love);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }

  .event-popup-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: hidden;
  }

  .event-dialogue-split {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 68, 77, 0.45);
    border: 1px solid var(--cyan-primary);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
  }

  .event-avatar-thumb {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--rose-love);
    object-fit: cover;
    flex-shrink: 0;
  }

  .event-speech-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .event-speech-content p {
    font-size: 11px;
    color: var(--cyan-pale);
    line-height: 1.3;
  }

  .event-speech-content blockquote {
    font-size: 11.5px;
    font-style: italic;
    color: var(--white);
    border-left: 2px solid var(--rose-love);
    padding-left: 6px;
  }

  .event-choices-list-pop {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }

  .event-choice-pop-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: var(--teal-dark);
    border: 1.5px solid var(--teal-dark);
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
    text-align: left;
  }

  .event-choice-pop-btn .choice-num {
    width: 22px;
    height: 22px;
    font-size: 11.5px;
  }

  .event-choice-pop-btn .choice-text {
    font-size: 11.5px;
    line-height: 1.25;
    margin-bottom: 2px;
  }

  .event-choice-pop-btn .choice-rewards {
    font-size: 9.5px;
  }

  /* ========================================================================
     POP-UP 3: BAZAR DO CUPIDO / LOJA (MOBILE - ZERO ROLAGEM)
     Grid 2x2 ultra-compacto com todos os itens e botão de saída visíveis.
     ======================================================================== */

  .shop-popup-window {
    width: 100%;
    max-width: 98%;
    max-height: 94vh;
    background: var(--teal-midnight);
    border: 2.5px solid var(--gold-florin);
    border-radius: var(--radius-md);
    box-shadow: 0 0 25px rgba(249, 199, 79, 0.4), var(--shadow-pop);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScale 0.2s ease-out;
  }

  .shop-popup-header {
    background: var(--teal-dark);
    padding: 8px 12px;
    border-bottom: 2px solid var(--gold-florin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }

  .shop-popup-body {
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
  }

  .shop-popup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
    margin-bottom: 8px;
  }

  .shop-card-pop {
    background: rgba(0, 68, 77, 0.5);
    border: 1.5px solid var(--teal-dark);
    border-radius: var(--radius-sm);
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .shop-card-pop .shop-item-icon {
    font-size: 20px;
    margin-bottom: 2px;
    color: var(--gold-florin);
  }

  .shop-card-pop .shop-item-name {
    font-size: 11px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .shop-card-pop .shop-item-desc {
    font-size: 9.5px;
    line-height: 1.25;
    margin-bottom: 6px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .shop-card-pop .shop-buy-btn {
    font-size: 10.5px;
    padding: 4px 6px;
    width: 100%;
  }

  .btn-shop-popup-leave {
    padding: 8px 16px;
    font-size: 13.5px;
    width: 100%;
  }

  /* ========================================================================
     POP-UP 4: PAUSA ROMÂNTICA / DESCANSO (MOBILE - ZERO ROLAGEM)
     3 cartões horizontais compactos cabendo em qualquer tela móvel.
     ======================================================================== */

  .rest-popup-window {
    width: 100%;
    max-width: 98%;
    max-height: 92vh;
    background: var(--teal-midnight);
    border: 2.5px solid var(--cyan-highlight);
    border-radius: var(--radius-md);
    box-shadow: 0 0 25px rgba(0, 173, 196, 0.4), var(--shadow-pop);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScale 0.2s ease-out;
  }

  .rest-popup-header {
    background: var(--teal-dark);
    padding: 8px 12px;
    border-bottom: 2px solid var(--cyan-highlight);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }

  .rest-popup-body {
    padding: 10px 12px;
    overflow: hidden;
  }

  .rest-popup-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .rest-card-pop-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 10px;
    padding: 10px 12px;
    background: var(--teal-dark);
    border: 1.5px solid var(--teal-dark);
    border-radius: var(--radius-sm);
    color: var(--white);
    cursor: pointer;
  }

  .rest-card-pop-btn .rest-card-icon {
    font-size: 24px;
    flex-shrink: 0;
  }

  .rest-card-pop-btn h4 {
    font-size: 13px;
    margin-bottom: 2px;
  }

  .rest-card-pop-btn p {
    font-size: 11px;
    line-height: 1.3;
  }

  /* ========================================================================
     POP-UP 5: CLÍMAX DO ENCONTRO / BOSS (MOBILE - ZERO ROLAGEM)
     ======================================================================== */

  .boss-popup-window {
    width: 100%;
    max-width: 98%;
    max-height: 92vh;
    background: var(--teal-midnight);
    border: 2.5px solid var(--rose-love);
    border-radius: var(--radius-md);
    box-shadow: 0 0 25px rgba(255, 51, 102, 0.4), var(--shadow-pop);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalScale 0.2s ease-out;
  }

  .boss-popup-header {
    background: var(--teal-dark);
    padding: 8px 12px;
    border-bottom: 2px solid var(--rose-love);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }

  .boss-popup-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    overflow: hidden;
  }

  .boss-popup-avatars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
  }

  .boss-avatar-pop {
    width: 58px;
    height: 58px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--teal-dark);
  }

  .boss-climax-bubble {
    font-size: 12px;
    padding: 8px 12px;
    border-left: 3px solid var(--rose-love);
  }

  /* ========================================================================
     PRÉ-TELAS DE TUTORIAL (MOBILE)
     ======================================================================== */

  .guide-lore-box {
    padding: 8px 10px;
  }

  .guide-tips-card {
    padding: 6px 8px;
  }

  .controls-guide-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .control-box-col {
    padding: 6px 8px;
  }

  .control-box-col h4 {
    font-size: 11px;
    margin-bottom: 4px;
  }

  .key-cap {
    font-size: 10px;
    padding: 2px 4px;
  }

  .brief-rules-card {
    padding: 8px 10px;
  }

  .brief-rules-list {
    font-size: 11px;
    padding-left: 12px;
  }

  .brief-stats-row {
    padding: 5px 6px;
  }

  .brief-stat-pill {
    font-size: 11px;
  }

  /* ========================================================================
     BARRA FIXA DE ÁUDIO (MOBILE)
     ======================================================================== */

  #floating-music-bar {
    padding: 5px 8px;
    gap: 6px;
  }

  .music-disc-avatar {
    width: 28px;
    height: 28px;
  }

  .music-info {
    max-width: 115px;
  }

  .music-track-title {
    font-size: 10.5px;
  }

  .music-track-artist {
    font-size: 8.5px;
  }

  .music-vol-slider {
    display: none;
  }

  .music-visualizer-bars {
    height: 12px;
    gap: 2px;
  }

  .music-visualizer-bars span {
    width: 2px;
  }

  .music-btn {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .btn-open-lyrics {
    font-size: 9.5px;
    padding: 3px 6px;
  }

  #achievement-toast-container {
    top: 50px;
    right: 8px;
    left: 8px;
  }

  .achievement-toast {
    padding: 6px 10px;
  }
}
