/*
 * phone.css: phone mode (html.phone), switched on by js/wm.js on small
 * screens. Windows are full screen; controls are sized for fingers.
 */

html.phone { -webkit-touch-callout: none; }
html.phone body { touch-action: manipulation; }   /* no double-tap zoom */

/* full-screen windows can't be un-maximized on a phone: hide maximize buttons */
html.phone .wm-window.maximized:not(.fixed) .wm-btn-max,
html.phone .wm-window.maximized:not(.fixed) .wm-gem-max { display: none; }

/* menus: taller items */
html.phone .wm-menu { min-width: 210px; }
html.phone .wm-menu-item { padding-top: 10px; padding-bottom: 10px; }
html.phone .wm-menubar-item { padding: 8px 12px; }

/* Task List: bigger rows */
html.phone .tl-item { padding: 10px 8px; gap: 12px; font-size: 16px; }
html.phone .tl-item .icon-img, html.phone .tl-item .icon-img img { width: 32px; height: 32px; line-height: 32px; }
html.phone .tasklist button { min-height: 40px; }

/* the Task List button, bottom right */
html.phone #tasklist-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  z-index: 99995;
  right: calc(12px + env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  padding: 0;
  background: var(--face);
  border: 2px solid var(--frame);
  box-shadow: inset -2px -2px var(--shadow), inset 2px 2px var(--hilite), 0 2px 6px rgba(0, 0, 0, 0.4);
  cursor: pointer;
}
html.phone #tasklist-btn span,
html.phone #tasklist-btn span::before,
html.phone #tasklist-btn span::after {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--button-text);
}
html.phone #tasklist-btn span { position: relative; }
html.phone #tasklist-btn span::before,
html.phone #tasklist-btn span::after { content: ""; position: absolute; left: 0; }
html.phone #tasklist-btn span::before { top: -7px; }
html.phone #tasklist-btn span::after { top: 7px; }
html.phone.decor-neon #tasklist-btn { border-radius: 0; clip-path: var(--ps); box-shadow: inset 0 0 0 2px var(--hilite); }

/* keep the desktop (and so every full-screen window) clear of the notch,
   rounded corners and gesture bar. --kb-top / --kb-h are set by js/wm.js
   while the on-screen keyboard is open, so windows end above it. */
html.phone #desktop {
  top: calc(var(--kb-top, 0px) + env(safe-area-inset-top));
  left: env(safe-area-inset-left);
  right: env(safe-area-inset-right);
  bottom: env(safe-area-inset-bottom);
}
html.phone.kb-open #desktop { bottom: auto; height: calc(var(--kb-h) - env(safe-area-inset-top)); }
html.phone.kb-open #tasklist-btn { display: none; }   /* don't float over the text box */

/* ---------- Windows 3.1-Inspired ---------- */
html.phone.decor-win31 .wm-titlebar { height: 34px; }
html.phone.decor-win31 .wm-title { line-height: 32px; font-size: 14px; }
html.phone.decor-win31 .wm-ctlbox,
html.phone.decor-win31 .wm-btn { width: 34px; font-size: 13px; }
html.phone.decor-win31 .wm-ctlbox::after { left: 8px; right: 8px; top: 13px; height: 6px; }

/* ---------- BeOS-Inspired ---------- */
html.phone.decor-beos .wm-tabrow { height: 32px; }
html.phone.decor-beos .wm-titlebar { height: 32px; gap: 8px; padding: 0 6px; font-size: 14px; }
html.phone.decor-beos .wm-title { line-height: 30px; }
html.phone.decor-beos .wm-ctlbox,
html.phone.decor-beos .wm-btn { width: 22px; height: 22px; }
html.phone.decor-beos .wm-btn-min::after { left: 4px; right: 4px; bottom: 4px; height: 3px; }
html.phone.decor-beos .wm-btn-max::before { left: 6px; top: 6px; right: 2px; bottom: 2px; }
html.phone.decor-beos .wm-btn-max::after { left: 2px; top: 2px; width: 9px; height: 9px; }
html.phone.decor-beos .wm-window { padding-top: 37px; }
html.phone.decor-beos .wm-window::before { top: 31px; }
html.phone.decor-beos .wm-window.maximized { padding-top: 32px; }

/* ---------- Neon Arcade ---------- */
html.phone.decor-neon .wm-tabrow { height: 40px; }
html.phone.decor-neon .wm-titlebar { height: 40px; font-size: 12px; }
html.phone.decor-neon .wm-titlebar.back { height: 34px; }
html.phone.decor-neon .wm-ctlbox { width: 26px; }
html.phone.decor-neon .wm-gems { top: 0; gap: 8px; }
html.phone.decor-neon .wm-gem { width: 40px; height: 40px; }
html.phone.decor-neon .wm-gem svg { width: 16px; height: 16px; }
html.phone.decor-neon .wm-window { padding-top: 48px; }
html.phone.decor-neon .wm-window::before { top: 18px; }
html.phone.decor-neon .wm-window.maximized { padding-top: 48px; }
html.phone.decor-neon { --tab-reserve: 170px; }
