/* Nestly — Clean Up desk: fling junk into the Trash */

.desk-section { --dc-bg: #ffffff; --glass: rgba(255,255,255,.5); --glass-2: rgba(214,220,232,.42); --glass-edge: rgba(0,0,0,.12); --mouth: #3a3d4a; --note-bg: rgba(22,22,30,.92); }
@media (prefers-color-scheme: dark) {
  .desk-section { --dc-bg: #221D19; --glass: rgba(255,255,255,.12); --glass-2: rgba(255,255,255,.05); --glass-edge: rgba(255,255,255,.16); --mouth: #050507; --note-bg: rgba(245,245,247,.95); }
}

.desk {
  position: relative; isolation: isolate; height: 600px; overflow: hidden;
  border-radius: 30px; border: 1px solid var(--card-border);
  background:
    radial-gradient(60% 50% at 50% 100%, rgba(108,99,255,.10), transparent 70%),
    radial-gradient(var(--art-dot) 1.1px, transparent 1.5px) 0 0 / 22px 22px,
    var(--card);
  -webkit-user-select: none; user-select: none;
}

/* ---- HUD ---- */
.desk-hud { position: absolute; z-index: 40; top: 18px; left: 20px; right: 20px; display: flex; align-items: center; gap: 16px; pointer-events: none; }
.desk-hud > * { pointer-events: auto; }
.hud-freed { display: flex; flex-direction: column; line-height: 1.1; }
.hud-label { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.hud-freed b { font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; min-width: 6.2ch; }
.hud-meter { flex: 1; max-width: 240px; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.hud-meter i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--green)); transition: width .7s var(--ease-out); }
.desk-hud .btn { margin-left: auto; }
.desk-hud .btn:disabled { opacity: .45; cursor: default; }

/* ---- File cards ---- */
.dcard {
  position: absolute; left: 0; top: 0; z-index: 10; width: 168px; padding: 9px 9px 11px;
  border-radius: 16px; background: var(--dc-bg); cursor: grab; touch-action: none; will-change: transform;
  box-shadow: 0 0 0 1px var(--card-border), 0 1px 2px rgba(0,0,0,.06), 0 10px 24px -10px rgba(20,20,60,.28);
  transition: box-shadow .25s var(--ease-out), border-radius .35s var(--ease-out), filter .35s;
  outline: none;
}
.dcard.lift { cursor: grabbing; box-shadow: 0 0 0 1px var(--card-border), 0 30px 50px -18px rgba(20,20,60,.45); }
.dcard:focus-visible { box-shadow: 0 0 0 3px var(--accent), 0 10px 24px -10px rgba(20,20,60,.28); }
.dcard.crumple { border-radius: 42%; filter: saturate(.5) brightness(1.04); }
.dcard.crumple > * { opacity: .35; transition: opacity .3s; }

.dc-thumb { position: relative; height: 84px; border-radius: 10px; display: grid; place-items: center; overflow: hidden; background: var(--card-2); }
.dc-name { display: block; margin-top: 8px; font-size: 13px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-meta { display: block; font-size: 11.5px; color: var(--text-3); }
.dc-why { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 3px 7px; border-radius: 99px; font-size: 10.5px; font-weight: 600; line-height: 1.2; }
.dc-why.junk { background: rgba(232,120,12,.12); color: var(--orange); }
.dc-why.keep { background: rgba(34,163,90,.12); color: var(--green); }
.dc-why svg { width: 10px; height: 10px; }
.th-ext { position: absolute; right: 7px; bottom: 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .04em; color: var(--text-3); }

.t-mov  { background: linear-gradient(135deg, #2b2d5c, #b14e8b 60%, #f59e61); }
.t-mov2 { background: linear-gradient(160deg, #f7c59f, #e07a5f 55%, #3d405b); }
.t-img  { background: linear-gradient(175deg, #a8dbf5 0 46%, #74b375 46%, #3f7d4a); }
.t-shot { background: #e6e9f1; }
.th-play { width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.88); position: relative; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
.th-play::after { content: ""; position: absolute; left: 12px; top: 9px; border: 6px solid transparent; border-left: 9px solid #222; border-right: 0; }
.t-img::after { content: ""; position: absolute; right: 22px; top: 12px; width: 16px; height: 16px; border-radius: 50%; background: #fff3c4; }
.th-win { width: 76%; height: 66%; border-radius: 6px; background: #fff; box-shadow: 0 3px 10px rgba(0,0,0,.15); display: flex; gap: 3px; padding: 5px 6px; align-items: flex-start; }
.th-win i { width: 6px; height: 6px; border-radius: 50%; background: #ff5f57; } .th-win i:nth-child(2) { background: #febc2e; } .th-win i:nth-child(3) { background: #28c840; }
.th-folder { position: relative; width: 58px; height: 42px; border-radius: 6px; background: linear-gradient(#7cc4ff, #4aa3f5); margin-top: 6px; }
.th-folder::before { content: ""; position: absolute; left: 0; top: -7px; width: 24px; height: 10px; border-radius: 4px 4px 0 0; background: #58aef7; }

/* ---- Trash can (split in two layers so cards fall *between* them) ---- */
.bin { position: absolute; left: calc(50% - 75px); bottom: 46px; width: 150px; height: 178px; }
.bin-back, .bin-front { position: absolute; inset: 0; transform-origin: 50% 100%; transition: transform .25s var(--ease-out); }
.bin-back { z-index: 1; }
.bin-front { z-index: 3; pointer-events: none; }
.bin-mouth {
  position: absolute; left: 0; right: 0; top: 0; height: 30px; border-radius: 50%;
  background: radial-gradient(70% 60% at 50% 45%, var(--mouth), color-mix(in srgb, var(--mouth) 70%, transparent));
  box-shadow: 0 0 0 3px var(--glass), 0 0 0 4px var(--glass-edge);
  transition: box-shadow .25s var(--ease-out);
}
.bin-stuff { position: absolute; left: 14px; right: 14px; top: 16px; bottom: 6px; overflow: hidden; }
.bin-body {
  position: absolute; left: 0; right: 0; top: 15px; bottom: 0;
  clip-path: polygon(0 0, 100% 0, 89% 100%, 11% 100%);
  background:
    repeating-linear-gradient(90deg, transparent 0 13px, rgba(255,255,255,.35) 13px 15px, transparent 15px 20px, var(--glass-edge) 20px 21px),
    linear-gradient(180deg, var(--glass), var(--glass-2));
  -webkit-backdrop-filter: blur(3px) saturate(140%); backdrop-filter: blur(3px) saturate(140%);
}
.bin-body::after { content: ""; position: absolute; inset: 0 0 auto; height: 14px; background: linear-gradient(var(--glass-edge), transparent); }
.bin-label { position: absolute; left: -40px; right: -40px; bottom: -30px; text-align: center; font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.bin.hot .bin-back, .bin.hot .bin-front { transform: scale(1.07); }
.bin.hot .bin-mouth { box-shadow: 0 0 0 3px var(--accent-2), 0 0 28px 6px rgba(91,140,255,.45); }
.bin.full .bin-mouth { box-shadow: 0 0 0 3px var(--green), 0 0 28px 6px rgba(50,208,116,.35); }

.ball {
  position: absolute; width: 34px; height: 30px; border-radius: 46% 54% 50% 48% / 52% 44% 56% 48%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,.9), transparent 40%),
    conic-gradient(from 40deg, #f4f4f7, #d9dbe3, #fafafc, #cfd2dc, #f4f4f7);
  box-shadow: inset -3px -4px 6px rgba(0,0,0,.14), 0 2px 3px rgba(0,0,0,.12);
}
.ball::after { content: ""; position: absolute; left: 30%; top: 40%; width: 40%; height: 4px; border-radius: 2px; background: var(--fleck, #8a8a92); opacity: .75; transform: rotate(-18deg); }

/* ---- Hint, note, particles ---- */
.desk-hint { position: absolute; left: 0; right: 0; bottom: 244px; z-index: 5; text-align: center; font-size: 14px; color: var(--text-3); pointer-events: none; transition: opacity .4s; }
.desk-hint span { display: inline-block; animation: deskBob 1.6s ease-in-out infinite; }
.desk-hint.off { opacity: 0; }
@keyframes deskBob { 50% { transform: translateY(5px); } }
.desk-note {
  position: absolute; left: 50%; bottom: 248px; z-index: 45; width: max-content; max-width: min(360px, calc(100% - 32px));
  padding: 10px 14px; border-radius: 12px; background: var(--note-bg); color: var(--bg); font-size: 13.5px; line-height: 1.4; text-align: center;
  opacity: 0; transform: translate(-50%, 8px) scale(.97); pointer-events: none; transition: opacity .25s, transform .35s var(--ease-out);
}
.desk-note.on { opacity: 1; transform: translate(-50%, 0) scale(1); }
.dust { position: absolute; left: 0; top: 0; z-index: 20; width: 6px; height: 9px; border-radius: 1.5px; pointer-events: none; }

@media (max-width: 700px) {
  .desk { height: 700px; border-radius: 24px; }
  .dcard { width: 128px; padding: 7px 7px 9px; border-radius: 13px; }
  .dc-thumb { height: 58px; }
  .dc-name { font-size: 12px; } .dc-meta { font-size: 10.5px; }
  .dc-why { font-size: 9.5px; padding: 2px 6px; }
  .th-folder { transform: scale(.8); }
  .hud-freed b { font-size: 20px; }
  .hud-meter { display: none; }
}
