/* Apps that live inside windows: player, folder, notepad, contact, trash. */

.ext { margin-left: 4px; vertical-align: -1px; }

/* ---------- player ---------- */
.player { display: flex; gap: 8px; padding: 6px 4px 4px; min-height: 0; }
.pl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pl-stage { display: grid; place-items: center; padding: 2px; background: #000; box-shadow: var(--sunken); }
.pl-frame {
  --ar: 1.3333;
  position: relative; overflow: hidden; background: #000;
  width: min(100%, calc((100vh - 190px) * var(--ar)));
}
.pl-frame > video, .pl-frame > iframe, .pl-frame > canvas, .pl-poster { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pl-frame > video { object-fit: contain; background: #000; cursor: pointer; }
.pl-frame > canvas { image-rendering: pixelated; }
.pl-poster { object-fit: cover; }
.pl-poster.is-empty { background: repeating-conic-gradient(#2b2b33 0 25%, #1c1c22 0 50%) 0 0 / 16px 16px; }
.pl-watch { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-decoration: none; color: var(--ink); white-space: nowrap; font-size: var(--fs-m); padding: 8px 18px; }
.pl-watch:active { transform: translate(-50%, -50%); }

.pl-controls { display: flex; align-items: center; gap: 4px; }
.pl-btn { width: 32px; min-height: 26px; padding: 0; display: grid; place-items: center; }
.pl-btn:active { padding: 1px 0 0 1px; }
.pl-time { min-width: 42px; text-align: right; font-size: var(--fs-s); }
.pl-seek { flex: 1; min-width: 40px; height: 22px; margin: 0 4px; background: none; -webkit-appearance: none; appearance: none; }
.pl-seek::-webkit-slider-runnable-track { height: 6px; background: var(--paper); box-shadow: var(--field); }
.pl-seek::-moz-range-track { height: 6px; background: var(--paper); box-shadow: var(--field); }
.pl-seek::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 20px; margin-top: -7px; background: var(--chrome); box-shadow: var(--raised); }
.pl-seek::-moz-range-thumb { width: 11px; height: 20px; border: 0; border-radius: 0; background: var(--chrome); box-shadow: var(--raised); }

.pl-credits { width: 210px; flex: none; padding: 4px 6px 6px; display: flex; flex-direction: column; gap: 10px; }
.pl-title { margin: 0; font-size: var(--fs-l); font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.pl-credits dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; margin: 0; font-size: var(--fs-s); }
.pl-credits dt { color: var(--muted-ink); }
.pl-credits dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pl-desc { margin: 0; font-size: var(--fs-s); max-width: 34ch; }
.pl-orig { align-self: flex-start; text-decoration: none; color: var(--ink); margin-top: auto; }
.pl-soon {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0;
  padding: 6px 14px; background: var(--chrome); box-shadow: var(--raised); white-space: nowrap; font-size: var(--fs-m);
}

/* ---------- folder ---------- */
.folder-view { flex: 1; min-height: 0; overflow: auto; }
.tiles {
  list-style: none; margin: 0; padding: 12px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 14px 12px;
}
.tile {
  display: flex; flex-direction: column; gap: 2px; width: 100%; padding: 4px 4px 6px;
  border: 0; background: none; text-align: left;
}
.tile-thumb {
  position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 5px; overflow: hidden;
  background: #000; box-shadow: 0 0 0 1px var(--ink), 3px 3px 0 rgb(0 0 0 / .3);
}
.tile-thumb img, .tile-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; }
.tile-blank {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 8px; text-align: center;
  color: #d6d6e2; font-size: var(--fs-s);
  background: repeating-conic-gradient(#2b2b33 0 25%, #1c1c22 0 50%) 0 0 / 16px 16px;
}
.tile-title { font-size: var(--fs-m); font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.tile-meta { font-size: var(--fs-s); color: var(--muted-ink); }
.tile:hover .tile-thumb, .tile:focus-visible .tile-thumb { box-shadow: 0 0 0 1px var(--ink), 0 0 0 3px var(--select), 3px 3px 0 3px rgb(0 0 0 / .3); }
.tile:focus-visible { outline: none; }
.tile:focus-visible .tile-title, .tile:focus-visible .tile-meta { background: var(--select); color: var(--light); }
.folder-empty { margin: 0; padding: 24px 16px; font-size: var(--fs-m); }

/* ---------- notepad (About_Me) ---------- */
.np-page { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.np-figure { float: left; margin: 2px 16px 8px 0; width: 170px; }
.np-photo { display: block; width: 100%; height: auto; image-rendering: auto; box-shadow: 0 0 0 1px var(--ink); }
.np-photo-blank {
  aspect-ratio: 4 / 5; display: grid; place-items: center; padding: 10px; text-align: center;
  background: #d9d9d9; color: var(--muted-ink); font-size: var(--fs-s); box-shadow: 0 0 0 1px var(--shade);
}
.np-text { font: 22px/1.25 var(--font-doc); max-width: 62ch; }
.np-text p { margin: 0 0 14px; }

/* ---------- outtakes (trash) ---------- */
.trash-view { flex: 1; min-height: 0; padding: 14px 16px; font-size: var(--fs-m); }
.trash-view p { margin: 0; }

/* ---------- contact: flip phone + links ---------- */
.contact { display: flex; gap: 22px; align-items: flex-start; padding: 14px 14px 16px; overflow: auto; }
.phone {
  --metal-hi: #f1f3f6; --metal: #bfc5cd; --metal-lo: #7d8590;
  width: 300px; flex: none; display: flex; flex-direction: column; align-items: center;
  filter: drop-shadow(4px 4px 0 rgb(0 0 0 / .3));
}
.phone-lid, .phone-base {
  width: 100%; background: linear-gradient(90deg, var(--metal-lo), var(--metal-hi) 18%, var(--metal) 60%, var(--metal-lo));
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 1px rgb(255 255 255 / .5);
}
.phone-lid { border-radius: 26px 26px 6px 6px; padding: 14px 16px 16px; }
.phone-speaker { width: 54px; height: 6px; margin: 0 auto 10px; background: repeating-linear-gradient(90deg, #2b2f36 0 3px, transparent 3px 6px); }
.phone-screen {
  background: #bfe0ff; color: #0a1840;
  box-shadow: inset 0 0 0 2px var(--ink), inset 3px 3px 0 2px #6f9fd6, inset 0 0 18px rgb(255 255 255 / .6);
  padding: 12px 12px 10px; min-height: 300px;
}
.phone-form { display: flex; flex-direction: column; gap: 6px; }
.phone-form label { display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-s); }
.phone-form .field { font-size: var(--fs-s); background: #f4faff; }
.phone-form textarea.field { resize: vertical; min-height: 72px; font-family: var(--font-ui); }
.phone-form [aria-invalid="true"] { background: #ffe9e6; }
.phone-to { margin: 0 0 2px; font-weight: 600; font-size: var(--fs-m); }
.phone-status { margin: 0; min-height: 1.3em; font-size: var(--fs-s); }
.phone-status[data-kind="error"] { color: #a10f0f; font-weight: 600; }
.phone-send { align-self: flex-end; }
.phone-send:disabled { color: var(--shade); }
.phone-sent { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding-top: 30px; font-size: var(--fs-m); }
.phone-sent p { margin: 0; }
.phone-sent-title { font-size: var(--fs-l); font-weight: 600; }
.phone-sent:not([hidden]) .phone-sent-title { animation: sent-blink 900ms steps(2) 2; }
@keyframes sent-blink { 50% { opacity: 0; } }
.phone-hinge { width: 74%; height: 14px; background: linear-gradient(#5a616b, #c6ccd4 40%, #5a616b); box-shadow: inset 0 0 0 2px var(--ink); }
.phone-base { border-radius: 6px 6px 30px 30px; padding: 14px 26px 22px; }
.phone-nav { width: 64px; height: 30px; margin: 0 auto 12px; border-radius: 50%; background: radial-gradient(circle, #e8edf2 30%, #9aa3ae 32%, #e8edf2 70%); box-shadow: 0 0 0 2px var(--ink); }
.phone-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px 12px; }
.phone-keys span {
  display: grid; place-items: center; height: 20px; border-radius: 9px; font-size: var(--fs-xs); font-weight: 600;
  background: linear-gradient(#ffffff, #c9cfd6); box-shadow: 0 0 0 1px var(--ink), inset 0 -2px 0 #9aa3ae; color: #1b2a5c;
}

.contact-links { display: flex; flex-direction: column; align-items: stretch; gap: 10px; min-width: 200px; flex: 1; padding-top: 6px; }
.contact-links h2 { margin: 0 0 4px; font-size: var(--fs-l); font-weight: 600; }
.contact-links .btn { display: flex; align-items: center; gap: 10px; min-height: 44px; text-decoration: none; color: var(--ink); font-size: var(--fs-m); }
.contact-links .btn img { width: 32px; height: 32px; }
.contact-links .btn.is-highlight { background: #ffe680; animation: hl-pulse 700ms steps(2) 3; }
@keyframes hl-pulse { 50% { background: var(--chrome); } }

/* A click on a background player lands on its window first (bringing it forward). */
.win:not(.is-active) .pl-frame iframe { pointer-events: none; }
