/**
 * RoccOS Mobile Springboard
 * Retro: bigger icons, solid surfaces, visible borders, uppercase labels
 */

/* ── Mobile Springboard (only visible < 768px) ── */
.mobile-springboard {
  display: none;
}

@media (max-width: 767px) {
  /* Hide desktop on mobile — !important: required — override JS inline display styles */
  .desktop { display: none !important; }
  .crt-glare { display: none; }

  .mobile-springboard {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--os-desktop-bg);
    font-family: var(--font-system);
    color: var(--os-text);
  }

  /* Status bar */
  .mobile-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 var(--sp-4);
    flex-shrink: 0;
    border-bottom: 2px solid var(--os-menu-border);
    background: var(--os-menu-bg);
    color: var(--os-menu-text);
  }

  .mobile-clock {
    font-size: var(--text-sm);
    font-weight: var(--weight-bold);
    font-variant-numeric: tabular-nums;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* App grid */
  .mobile-app-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-4);
    padding: var(--sp-6) var(--sp-4);
    align-content: start;
    overflow-y: auto;
  }

  .mobile-app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-app-icon-img {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    border: 2px solid var(--os-border);
    box-shadow: var(--shadow-sm);
  }

  .mobile-app-icon-label {
    font-size: 10px;
    color: var(--os-text);
    text-align: center;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: var(--weight-semibold);
  }

  /* Full-screen app view */
  .mobile-app-view {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--os-surface);
    overflow: auto;
    animation: slideUp 0.3s var(--ease-out) both;
  }

  .mobile-app-view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 2px solid var(--os-border);
    background: var(--os-surface-raised);
  }

  .mobile-app-back {
    border: 2px solid var(--os-accent);
    background: none;
    color: var(--os-accent);
    font-size: var(--text-sm);
    font-family: var(--font-system);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: var(--sp-1) var(--sp-2);
    border-radius: var(--radius-sm);
    cursor: pointer;
  }

  .mobile-app-view-title {
    font-size: var(--text-base);
    font-weight: var(--weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }

  .mobile-app-view-content {
    padding: var(--sp-4);
    overflow: auto;
    height: calc(100vh - 48px);
  }

  /* Gio on mobile */
  .mobile-gio {
    position: fixed;
    bottom: var(--sp-4);
    right: var(--sp-4);
    z-index: 50;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    background: var(--os-surface);
    border: 2px solid var(--os-border);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    animation: gentleBob 4s ease-in-out infinite;
  }

  .mobile-gio img {
    border-radius: var(--radius-md);
  }

  /* Greta on mobile */
  .mobile-greta {
    position: fixed;
    bottom: var(--sp-4);
    left: var(--sp-4);
    z-index: 50;
    width: 48px;
    height: 40px;
  }

  /* Hide desktop Gio and Greta on mobile — !important: required — override JS inline display styles */
  .gio,
  .greta,
  .greta-menu {
    display: none !important;
  }

  /* Touch target minimums (44x44px) */
  .mobile-app-back {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-app-icon {
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-gio {
    min-width: 48px;
    min-height: 48px;
  }
}

/* ── Landscape phone ── */
@media (max-width: 767px) and (orientation: landscape) {
  .mobile-app-grid {
    grid-template-columns: repeat(6, 1fr);
    gap: var(--sp-3);
    padding: var(--sp-3);
  }

  .mobile-app-icon-img {
    width: 48px;
    height: 48px;
  }
}
