/* Phone layout (body.droid is set by android.js at ≤ 700px).
   Android 1.0 structure — status bar, home screen, app drawer, Back/Home keys —
   drawn with the same Windows 98 design system as the computer version. */
#droid { display: none; }

body.droid > #desktop, body.droid > .taskbar, body.droid > .startmenu, body.droid > .win { display: none !important; }

body.droid #droid {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Status bar (Win98 tray look) ---------- */
.d-status {
  flex: none; height: 26px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px;
  background: var(--grey);
  border-bottom: 2px solid var(--darker);
  box-shadow: inset 0 -1px var(--dark), inset 0 1px #fff;
  font: 11px var(--pixel); -webkit-font-smoothing: none;
  cursor: pointer; user-select: none; touch-action: none;
}
.d-notes { display: flex; gap: 6px; font-size: 13px; }
.d-notes i { font-style: normal; }
.d-sys {
  display: flex; align-items: center; gap: 6px; height: 20px; padding: 0 6px;
  border: 1px solid; border-color: var(--dark) #fff #fff var(--dark);
}
.d-3g { font-size: 10px; }
.d-signal { display: flex; align-items: flex-end; gap: 1px; height: 11px; }
.d-signal i { width: 3px; background: #000; }
.d-signal i:nth-child(1) { height: 3px; } .d-signal i:nth-child(2) { height: 5px; }
.d-signal i:nth-child(3) { height: 8px; } .d-signal i:nth-child(4) { height: 11px; }
.d-battery { position: relative; width: 9px; height: 13px; border: 1px solid #000; }
.d-battery::before { content: ""; position: absolute; top: -3px; left: 2px; width: 3px; height: 2px; background: #000; }
.d-battery i { position: absolute; inset: 2px 1px 1px; background: #008000; }

/* ---------- Home screen: same wallpaper as the computer ---------- */
.d-area { position: relative; flex: 1; min-height: 0; }
.d-home { position: absolute; inset: 0; overflow-y: auto; padding: 12px 10px; }
.d-widgets { display: flex; justify-content: center; align-items: flex-start; gap: 10px; }
.d-analog { flex: none; width: 104px; height: 104px; margin-top: 4px; filter: drop-shadow(2px 2px 0 rgba(0, 0, 0, .5)); }

/* Desktop icons: same pixel icons + white labels as on the computer */
.d-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 2px; margin-top: 18px; }
.d-app {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 0; padding: 6px 2px; background: none; border: 1px dotted transparent; color: #fff; cursor: pointer;
}
.d-app svg { width: 40px; height: 40px; flex: none; }
.d-app span {
  max-width: 100%; padding: 0 3px;
  font: 11px var(--pixel); -webkit-font-smoothing: none;
  text-shadow: 1px 1px #000, 0 0 3px #000; overflow-wrap: anywhere;
}
.d-app:active span, .d-app:focus-visible span { background: var(--navy); text-shadow: none; }
.d-app:active svg, .d-app:focus-visible svg { filter: brightness(.75) sepia(1) hue-rotate(190deg) saturate(3); }
.d-app:focus-visible { outline: none; border-color: #fff; }

/* ---------- App drawer (opened by Start) ---------- */
.d-drawer {
  position: absolute; inset: 0; z-index: 5; overflow-y: auto;
  padding: 10px 10px 16px;
  background: linear-gradient(rgba(0, 0, 0, .2), rgba(0, 0, 0, .2)), #3b8de0 url("../assets/meadow/meadow-photo.jpg") center / cover no-repeat;
  animation: d-up .15s steps(3);
}
.d-drawer-head {
  padding: 4px 8px; color: #fff; font: 700 11px var(--pixel); -webkit-font-smoothing: none;
  background: linear-gradient(90deg, var(--navy), var(--blue));
}
.d-drawer .d-grid { margin-top: 12px; }
@keyframes d-up { from { transform: translateY(20%); } }

/* ---------- Notification shade (Start-menu look) ---------- */
.d-shade {
  position: absolute; inset: 0 0 auto; z-index: 6; max-height: 100%; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 2px;
  background: var(--grey);
  border: 2px solid; border-color: #fff var(--darker) var(--darker) #fff;
  box-shadow: inset -1px -1px var(--dark), inset 1px 1px var(--light), 0 4px 0 rgba(0, 0, 0, .35);
  animation: d-down .15s steps(3);
}
@keyframes d-down { from { transform: translateY(-30%); } }
.d-shade-head {
  display: flex; justify-content: space-between; padding: 4px 8px;
  background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff;
  font: 700 11px var(--pixel); -webkit-font-smoothing: none;
}
.d-shade-sep { margin: 4px 2px 0; padding: 2px 6px; font: 11px var(--pixel); color: var(--darker); border-bottom: 1px solid var(--dark); box-shadow: 0 1px #fff; }
.d-note {
  display: flex; align-items: flex-start; gap: 10px; width: 100%;
  padding: 8px; text-align: start; color: #000; cursor: pointer;
  background: none; border: 0;
}
.d-note:active, .d-note:focus-visible { background: var(--navy); color: #fff; outline: none; }
.d-note:active small, .d-note:focus-visible small { color: #ddd; }
.d-note-ico svg { width: 32px; height: 32px; flex: none; }
.d-note-ico { flex: none; display: grid; }
.d-note b { display: block; font-size: 14px; }
.d-note small { display: block; color: #444; font-size: 13px; }
.d-shade-close { display: grid; place-items: center; height: 22px; margin-top: 4px; border: 0; background: none; cursor: pointer; }
.d-shade-close span { width: 40px; height: 6px; border: 1px solid; border-color: var(--dark) #fff #fff var(--dark); }

/* ---------- Bottom keys (taskbar look, Start opens all programs) ---------- */
.d-keys {
  flex: none; height: 48px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 6px;
  padding: 4px;
  border-left: 0; border-right: 0; border-bottom: 0;
}
.d-keys .btn { height: 100%; min-height: 0; padding: 0 12px; }
.d-keys .btn svg { width: 22px; height: 22px; }
.d-keys .start { padding: 0 16px; font: 700 11px var(--pixel); -webkit-font-smoothing: none; }
.d-keys .start svg { width: 20px; height: 20px; }

/* ---------- App screens: full-screen Win98 windows ---------- */
.d-stack { position: absolute; inset: 0; pointer-events: none; }
.d-screen {
  position: absolute; inset: 0; pointer-events: auto;
  display: flex; flex-direction: column;
  padding: 3px;
  animation: d-in .15s steps(3);
}
@keyframes d-in { from { transform: translateY(6%); } }
.d-screen .titlebar { flex: none; background: linear-gradient(90deg, var(--dark), #b5b5b5); color: var(--light); cursor: default; padding: 5px 6px; }
.d-screen.active .titlebar { background: linear-gradient(90deg, var(--navy), var(--blue)); color: #fff; }
.d-screen .titlebar svg { width: 16px; height: 16px; }
.d-screen .win-body { flex: 1; min-height: 0; }
.d-screen .statusbar { flex: none; }
.d-screen .win-body.viewer iframe { flex: 1; height: auto; min-height: 0; }
.d-screen .wiz-side { display: none; }
/* Pinball on phones: scoreboard on top, table fills what is left, buttons always visible */
.d-pinball .statusbar { display: none; } /* keyboard hints are useless on a touchscreen */
.d-screen .win-body.pinball { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.d-screen .pb-game { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column-reverse; align-items: center; }
.d-screen .pb-panel { flex: none; }
.d-screen .pb-mission p { font-size: 11px; line-height: 1.25; }
.d-screen .pinball canvas { flex: 1 1 0; min-height: 0; height: auto; width: auto; max-width: 100%; aspect-ratio: 360 / 560; }
.d-screen .pb-controls { flex: none; }
.d-screen .pb-controls .btn { min-height: 44px; }

/* Quick view CV keeps the status bar and keys visible */
body.droid .cv-overlay { inset: 26px 0 48px; z-index: 50; padding: 10px 8px 24px; }
body.droid .cv { padding: 22px 16px; }

@media (prefers-reduced-motion: reduce) {
  .d-screen, .d-drawer, .d-shade { animation: none; }
}

/* Language chip in the phone status bar */
.d-lang {
  display: inline-flex; align-items: center; gap: 2px;
  height: 18px; padding: 0 5px; margin-inline-end: 2px;
  background: var(--navy); color: #fff; border: 0; cursor: pointer;
  font: 700 11px var(--pixel); -webkit-font-smoothing: none;
}
[dir="rtl"] [data-key="back"] svg { transform: scaleX(-1); }
[dir="rtl"] .d-status, [dir="rtl"] .d-drawer-head, [dir="rtl"] .d-shade-head, [dir="rtl"] .d-shade-sep { font-family: Tahoma, "Segoe UI", sans-serif; }
.d-shade-langs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 6px 2px; }
.d-shade-langs .lang-pick { flex-direction: column; justify-content: center; gap: 2px; min-height: 48px; padding: 4px 2px; font-size: 12px; }
