/* Mobile Shell - loaded via media="(max-width: 768px)" */

/* Hide desktop chrome on mobile */
#taskbar,
.start-menu,
.welcome-modal,
#mobile-notice {
  display: none !important;
}

/* Desktop fills full screen on mobile */
#desktop {
  bottom: 0;
  overflow: visible;
}

/* Mobile Shell */
.mobile-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

/* Home Screen */
.mobile-home {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: env(safe-area-inset-top) var(--spacing-md) env(safe-area-inset-bottom);
}

.mobile-home-header {
  text-align: center;
  padding: var(--spacing-xl) 0 var(--spacing-lg);
}

.mobile-clock {
  font-size: 48px;
  font-weight: 200;
  color: var(--text-primary);
  letter-spacing: 2px;
  line-height: 1.1;
}

.mobile-branding {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* App Grid */
.mobile-app-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--spacing-lg) var(--spacing-sm);
  padding: var(--spacing-lg) var(--spacing-sm);
  justify-items: center;
}

.mobile-app-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  padding: var(--spacing-xs);
}

.mobile-app-icon:active .mobile-icon-wrap {
  transform: scale(0.9);
  opacity: 0.7;
}

.mobile-icon-wrap {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tertiary);
  border-radius: 14px;
  color: var(--text-primary);
  transition: transform 0.1s ease, opacity 0.1s ease;
}

.mobile-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.mobile-icon-emoji {
  font-size: 26px;
  line-height: 1;
}

.mobile-icon-label {
  font-size: 11px;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.2;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* App View (full-screen module container) */
.mobile-app-view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-window);
  z-index: 100;
}

.mobile-app-bar {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  height: calc(44px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--spacing-sm) 0;
  background: var(--bg-window-header);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.mobile-back-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--accent-primary);
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
}

.mobile-back-btn:active {
  background: var(--bg-tertiary);
}

.mobile-app-title {
  font-size: var(--font-size-lg);
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-app-content {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Prevent iOS zoom on input focus */
.mobile-app-content input,
.mobile-app-content textarea,
.mobile-app-content select {
  font-size: 16px !important;
}


/* ==========================================================================
   Module-specific mobile overrides — tap-friendly sizing
   Minimum touch target: 44x44px (Apple HIG)
   ========================================================================== */

/* --- Radio --- */

.radio-play-btn,
.radio-mute-btn,
.radio-viz-btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.radio-play-btn svg {
  width: 22px;
  height: 22px;
}

.radio-mute-btn svg,
.radio-viz-btn svg {
  width: 20px;
  height: 20px;
}

.radio-volume {
  height: 20px;
  max-width: 100px;
}

.radio-controls {
  gap: 8px;
}

.radio-preset-btn {
  padding: 10px 4px;
  font-size: 11px;
  min-height: 44px;
}

.radio-preset-num {
  font-size: 14px;
}

.radio-collapse-toggle {
  display: none;
}

.radio-browse.collapsed .radio-browse-content {
  display: flex;
}

.radio-tab {
  padding: 12px 8px;
  font-size: 14px;
  min-height: 44px;
}

.radio-search-input {
  padding: 10px 12px;
  font-size: 16px;
  border-radius: 8px;
}

.radio-station-item,
.radio-search-result {
  padding: 12px;
  gap: 10px;
}

.radio-station-item-name {
  font-size: 14px;
}

.radio-station-actions {
  gap: 6px;
}

.radio-station-actions button {
  padding: 8px 12px;
  font-size: 14px;
  min-height: 36px;
  border-radius: 6px;
}


/* --- Notes --- */

.notes-layout {
  flex-direction: column;
}

.notes-sidebar {
  width: 100%;
  max-height: 140px;
  border-right: none;
  border-bottom: 1px solid var(--border-color);
}

.notes-list {
  overflow-y: auto;
}

.notes-add-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  border-radius: 8px;
}

.notes-sidebar-header {
  padding: 10px var(--spacing-md);
}

.notes-list-item {
  padding: 10px var(--spacing-md);
  min-height: 44px;
}

.notes-remove-btn {
  width: 32px;
  height: 32px;
  font-size: 18px;
  display: flex;
}


/* --- RSS --- */

.rss-layout {
  flex-direction: column;
}

.rss-sidebar {
  width: 100%;
  max-height: 160px;
  border-right: none;
  border-bottom: 1px solid var(--border-color);
}

.rss-feed-list {
  overflow-y: auto;
}

.rss-main {
  min-height: 0;
}

.rss-add-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  border-radius: 8px;
}

.rss-sidebar-header {
  padding: 10px var(--spacing-md);
}

.rss-feed-item {
  padding: 10px var(--spacing-md);
  min-height: 44px;
}

.rss-remove-btn {
  width: 32px;
  height: 32px;
  font-size: 18px;
  display: flex;
}

.rss-refresh-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.rss-main-header {
  padding: 10px var(--spacing-md);
}

.rss-article-link {
  padding: var(--spacing-md);
  min-height: 44px;
}

.rss-article-title {
  font-size: 15px;
}

.rss-reader-back {
  padding: 8px 14px;
  font-size: 14px;
  min-height: 36px;
}

.rss-url-input {
  padding: 10px 12px;
  font-size: 16px;
}

.rss-dialog-actions button {
  padding: 10px var(--spacing-md);
  font-size: 14px;
  min-height: 40px;
}


/* --- Stock Tracker --- */

.stocktracker-layout {
  flex-direction: column;
}

.stocktracker-sidebar {
  width: 100%;
  max-height: 180px;
  border-right: none;
  border-bottom: 1px solid var(--border-color);
}

.stocktracker-list {
  overflow-y: auto;
}

.stocktracker-add-btn {
  width: 36px;
  height: 36px;
  font-size: 20px;
  border-radius: 8px;
}

.stocktracker-sidebar-header {
  padding: 10px var(--spacing-md);
}

.stocktracker-item {
  padding: 10px var(--spacing-md);
  min-height: 48px;
}

.stocktracker-remove-btn {
  width: 32px;
  height: 32px;
  font-size: 18px;
  display: flex;
}

.stocktracker-refresh-btn {
  padding: 8px var(--spacing-md);
  font-size: 14px;
  min-height: 40px;
}


/* --- Art World (metmuseum) --- */

.metmuseum-tab {
  padding: 10px var(--spacing-md);
  font-size: 14px;
  min-height: 44px;
}

.metmuseum-refresh-btn {
  width: 40px;
  height: 40px;
}

.metmuseum-refresh-btn svg {
  width: 18px;
  height: 18px;
}

.metmuseum-select,
.metmuseum-provider-select {
  padding: 10px var(--spacing-sm);
  font-size: 14px;
}

.metmuseum-link,
.metmuseum-collect-btn {
  padding: 10px var(--spacing-md);
  font-size: 14px;
  min-height: 40px;
}

.metmuseum-retry-btn {
  padding: 10px var(--spacing-md);
  font-size: 14px;
  min-height: 40px;
}

.metmuseum-collection-remove {
  width: 32px;
  height: 32px;
  font-size: 18px;
  opacity: 1;
}

.metmuseum-collection-grid {
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.metmuseum-swap-cancel {
  padding: 10px var(--spacing-md);
  font-size: 14px;
  min-height: 40px;
}

.metmuseum-image-container {
  max-height: none;
}


/* --- Settings --- */

.settings-row {
  padding: 12px;
  gap: var(--spacing-sm);
}

.settings-select {
  padding: 10px var(--spacing-sm);
  font-size: 14px;
  min-height: 40px;
}

.settings-btn {
  padding: 10px var(--spacing-md);
  font-size: 14px;
  min-height: 40px;
}

.settings-btn-small {
  padding: 8px var(--spacing-sm);
  min-height: 36px;
}

.settings-input {
  padding: 10px var(--spacing-sm);
  font-size: 16px;
  min-height: 40px;
}

.settings-checkbox {
  width: 24px;
  height: 24px;
}

.settings-color {
  width: 56px;
  height: 40px;
}

.settings-file::file-selector-button {
  padding: 8px var(--spacing-sm);
  font-size: 14px;
}

.settings-input-group {
  flex-direction: column;
}

.settings-btn-group {
  flex-direction: column;
}


/* --- Snake --- */

.snake-btn {
  padding: 12px 24px;
  font-size: 16px;
  min-height: 44px;
  border-radius: 8px;
}

.snake-controls {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.snake-hint {
  font-size: 13px;
  text-align: center;
}


/* --- Bubble Wrap --- */

.bubblewrap-reset {
  padding: 10px var(--spacing-md);
  font-size: 14px;
  min-height: 40px;
  border-radius: 8px;
}

.bubblewrap-header {
  padding: var(--spacing-xs) 0;
}

.bubblewrap-counter {
  font-size: 14px;
}


/* --- Help --- */

.help-app {
  padding: 12px;
  min-height: 48px;
}

.help-app-icon {
  width: 40px;
  height: 40px;
}

.help-app-icon svg {
  width: 28px;
  height: 28px;
}

.help-app-emoji {
  font-size: 28px;
}

.help-app-info strong {
  font-size: 14px;
}

.help-app-info span {
  font-size: 13px;
}


/* --- Do Something --- */

.ds-stop-btn {
  padding: 8px 18px;
  font-size: 13px;
  min-height: 36px;
  border-radius: 18px;
}

.ds-start-btn {
  padding: 14px 36px;
  font-size: 17px;
  min-height: 48px;
}

.ds-notification {
  padding: 16px;
}

.ds-popup-close-btn {
  width: 28px;
  height: 28px;
  font-size: 14px;
  top: 8px;
  right: 10px;
}

.ds-terms-scroll {
  max-height: 200px;
}

.ds-terms-agree {
  padding: 10px 24px;
  font-size: 14px;
  min-height: 40px;
}

.ds-switch {
  width: 52px;
  height: 32px;
}

.ds-switch-slider::before {
  width: 26px;
  height: 26px;
}

.ds-captcha-checkbox {
  width: 36px;
  height: 36px;
}

.ds-unsub-input {
  font-size: 16px;
  padding: 12px 14px;
}

.ds-unsub-btn {
  padding: 12px 28px;
  min-height: 44px;
}

.ds-wifi-network {
  padding: 14px 16px;
  min-height: 48px;
  font-size: 16px;
}

.ds-reply-input {
  font-size: 16px;
  padding: 10px 14px;
}

.ds-reply-send {
  width: 40px;
  height: 40px;
}

.ds-delete-x {
  width: 28px;
  height: 28px;
  font-size: 14px;
  top: -8px;
  left: -8px;
}

.ds-delete-dialog-actions button {
  min-height: 44px;
}

.ds-rate-star {
  font-size: 40px;
  padding: 6px;
}

.ds-trash-empty-btn {
  padding: 14px;
  min-height: 48px;
}

.ds-trash-dialog-actions button {
  min-height: 44px;
}

.ds-password-input {
  font-size: 16px;
  padding: 12px 14px;
}

.ds-cookies-buttons {
  flex-direction: column;
}

.ds-cookies-buttons button {
  min-height: 40px;
  font-size: 14px;
}

.ds-skipad-skip {
  padding: 10px 18px;
  font-size: 14px;
  min-height: 40px;
}

.ds-alarm-buttons button {
  padding: 16px 32px;
  font-size: 17px;
  min-height: 48px;
}

.ds-chat-widget-close {
  width: 36px;
  height: 36px;
  font-size: 18px;
}

.ds-notifperm-actions button {
  padding: 10px 16px;
  font-size: 14px;
  min-height: 40px;
}

.ds-tutorial-next {
  padding: 12px 28px;
  font-size: 16px;
  min-height: 44px;
}

.ds-tutorial-skip {
  font-size: 15px;
  padding: 8px 12px;
  min-height: 36px;
}

.ds-email-item {
  padding: 16px;
  min-height: 48px;
}

.ds-email-verify-btn {
  padding: 14px 32px;
  font-size: 16px;
  min-height: 48px;
}

.ds-email-back {
  padding: 8px 12px;
  min-height: 36px;
}

.ds-update-btn {
  padding: 14px 32px;
  font-size: 16px;
  min-height: 48px;
}

.ds-sort-item {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.ds-loader-ring {
  width: 180px;
  height: 180px;
}
