/* ============================================================
   MM-Play — Desktop OS
   Wallpaper + desktop icons + dock + menubar
   ============================================================ */

:root {
  --text: #3b3a52;
  --text-soft: #6b6a82;
  --muted: #9b9ab2;
  --lavender: #a78bfa;
  --lavender-deep: #8b5cf6;
  --pink: #f7a8c4;
  --mint: #7dd3c0;
  --sky: #9bc4e2;
  --butter: #ffe08a;
  --peach: #ffb5a7;
  --shadow: 0 10px 30px rgba(91, 80, 145, .18);
  --shadow-lg: 0 20px 50px rgba(91, 80, 145, .28);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ============ WALLPAPER ============ */
.desktop {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(900px 700px at 12% 18%, #d8c9fb 0%, transparent 55%),
    radial-gradient(800px 600px at 88% 25%, #fbcfe3 0%, transparent 50%),
    radial-gradient(700px 700px at 50% 95%, #c7e8f5 0%, transparent 55%),
    radial-gradient(600px 500px at 75% 75%, #ffe9c2 0%, transparent 50%),
    linear-gradient(135deg, #f4f1fb 0%, #faf0ff 50%, #f0f7ff 100%);
  display: flex;
  padding: 80px 44px 120px;
  overflow: hidden;
}

/* dekorasi wallpaper (blob melayang) */
.deco {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .35;
  animation: floatDeco 18s ease-in-out infinite;
  pointer-events: none;
}
.deco-1 { width: 260px; height: 260px; background: var(--lavender); top: 20%; right: 12%; animation-delay: 0s; }
.deco-2 { width: 200px; height: 200px; background: var(--pink); bottom: 18%; left: 8%; animation-delay: 3s; }
.deco-3 { width: 180px; height: 180px; background: var(--mint); top: 55%; right: 30%; animation-delay: 6s; }
.deco-4 { width: 160px; height: 160px; background: var(--butter); top: 12%; left: 40%; animation-delay: 9s; }
@keyframes floatDeco {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -30px) scale(1.08); }
  66% { transform: translate(-15px, 20px) scale(.95); }
}

/* ============ MENUBAR (top) ============ */
.menubar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: rgba(255, 255, 255, .5);
  backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid rgba(255, 255, 255, .7);
  z-index: 50;
  font-size: 13px;
}
.mb-left { display: flex; align-items: center; gap: 10px; }
.mb-logo { width: 20px; height: 20px; color: var(--lavender-deep); display: inline-grid; place-items: center; filter: drop-shadow(0 0 8px rgba(139, 92, 246, .5)); }
.mb-logo svg { width: 18px; height: 18px; }
.mb-brand { font-weight: 800; letter-spacing: -.2px; }
.mb-sep { width: 1px; height: 16px; background: rgba(59, 58, 82, .18); }
.mb-greeting { color: var(--text-soft); font-weight: 600; }
.mb-right { display: flex; align-items: center; gap: 10px; }
.mb-icon { width: 18px; height: 18px; color: var(--text-soft); display: inline-grid; place-items: center; }
.mb-icon svg { width: 18px; height: 18px; }
.mb-clock { font-weight: 800; font-variant-numeric: tabular-nums; font-size: 13px; }
.mb-date { color: var(--text-soft); font-weight: 600; font-size: 12px; }

/* ============ DESKTOP ICONS ============ */
.desktop-icons {
  display: flex;
  flex-direction: column;
  gap: 22px;
  width: 116px;
  z-index: 2;
}
.dicon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 10px 6px;
  border-radius: 16px;
  transition: .15s;
  cursor: pointer;
  border: 1.5px solid transparent;
}
.dicon:hover { background: rgba(255, 255, 255, .4); border-color: rgba(255, 255, 255, .6); }
.dicon:active .dicon-img { transform: scale(.94); }
.dicon-img {
  position: relative;
  width: 78px;
  height: 78px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 10px 26px rgba(91, 80, 145, .28), inset 0 -3px 6px rgba(0, 0, 0, .12);
  transition: .2s cubic-bezier(.34, 1.56, .64, 1);
  overflow: hidden;
}
.dicon:hover .dicon-img { transform: translateY(-6px) scale(1.06); box-shadow: 0 18px 40px rgba(91, 80, 145, .35); }
.dicon-img svg { width: 42px; height: 42px; position: relative; z-index: 2; }
.dicon-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; display: block; }
.dicon-img.quiz { background: linear-gradient(140deg, #b89bff 0%, #8b5cf6 55%, #6d3fe0 100%); }
.dicon-img.spin { background: linear-gradient(140deg, #8ee5d2 0%, #4fb0a3 55%, #3a9688 100%); }

/* gloss (kilau kaca di atas ikon) */
.gloss {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 100%);
  border-radius: 22px 22px 0 0;
  pointer-events: none;
  z-index: 3;
}
.dicon-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #2d2a45;
  text-align: center;
  text-shadow: 0 1px 3px rgba(255, 255, 255, .9);
  line-height: 1.2;
  max-width: 104px;
}

/* ============ DESKTOP WIDGET (jam besar pojok kanan) ============ */
.desktop-widget {
  position: absolute;
  top: 50%;
  right: 60px;
  transform: translateY(-50%);
  text-align: right;
  z-index: 1;
  pointer-events: none;
}
.dw-time {
  font-size: 84px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -3px;
  color: rgba(59, 58, 82, .85);
  text-shadow: 0 4px 30px rgba(255, 255, 255, .8);
  font-variant-numeric: tabular-nums;
}
.dw-date {
  font-size: 18px;
  font-weight: 600;
  color: rgba(107, 106, 130, .85);
  margin-top: 6px;
  text-shadow: 0 2px 12px rgba(255, 255, 255, .8);
}

/* ============ DOCK ============ */
.dock {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .55);
  backdrop-filter: blur(28px) saturate(2);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 24px;
  box-shadow: 0 16px 50px rgba(91, 80, 145, .25), inset 0 1px 0 rgba(255, 255, 255, .9);
  z-index: 40;
}
.dock-ic {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transition: .2s cubic-bezier(.34, 1.56, .64, 1);
}
.dock-ic:hover { transform: translateY(-12px) scale(1.22); }
.dock-ic:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 68px;
  left: 50%;
  transform: translateX(-50%);
  background: #2d2a45;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.dock-ic-img {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 16px rgba(91, 80, 145, .25), inset 0 -2px 5px rgba(0, 0, 0, .12);
  overflow: hidden;
}
.dock-ic-img svg { width: 28px; height: 28px; position: relative; z-index: 2; }
.dock-ic-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; display: block; }
.dock-ic-img.quiz { background: linear-gradient(140deg, #b89bff 0%, #8b5cf6 55%, #6d3fe0 100%); }
.dock-ic-img.spin { background: linear-gradient(140deg, #8ee5d2 0%, #4fb0a3 55%, #3a9688 100%); }
.dock-ic-img.about { background: linear-gradient(140deg, #7f7e9c 0%, #4a4969 100%); }
.dock-dot {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--text-soft);
  opacity: .5;
}
.dock-sep { width: 1.5px; height: 38px; background: rgba(59, 58, 82, .15); margin: 0 4px; align-self: center; }

/* ============ MODAL ============ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(45, 42, 69, .4);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  z-index: 80;
  animation: fadeIn .2s ease;
}
.modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
  position: relative;
  background: linear-gradient(180deg, #fff 0%, #faf8ff 100%);
  border-radius: 24px;
  padding: 40px 34px 32px;
  max-width: 440px;
  width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 30px 70px rgba(91, 80, 145, .35);
  animation: popIn .3s cubic-bezier(.34, 1.56, .64, 1);
  overflow: hidden;
}
@keyframes popIn { from { transform: scale(.88) translateY(20px); opacity: 0; } to { transform: scale(1) translateY(0); opacity: 1; } }
.modal-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 139, 250, .25) 0%, transparent 70%);
  pointer-events: none;
}
.modal-emoji {
  position: relative;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--lavender), var(--pink));
  border-radius: 18px;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(167, 139, 250, .45);
}
.modal-emoji svg { width: 30px; height: 30px; }
.modal-card h2 { font-size: 22px; margin-bottom: 12px; letter-spacing: -.4px; }
.modal-card p { color: var(--text-soft); font-size: 14px; line-height: 1.6; margin-bottom: 8px; }
.modal-card p b { color: var(--lavender-deep); }
.modal-sub { font-size: 12.5px !important; color: var(--muted) !important; margin-bottom: 22px !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: 12px; font-weight: 700; font-size: 14px;
  transition: .18s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--lavender), var(--lavender-deep));
  color: #fff; box-shadow: 0 8px 20px rgba(139, 92, 246, .35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(139, 92, 246, .5); }

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translate(-50%, 30px);
  background: rgba(45, 42, 69, .92);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 24px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  opacity: 0;
  transition: .3s;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ============ RESPONSIVE ============ */
@media (max-width: 760px) {
  .desktop { padding: 70px 24px 110px; }
  .desktop-icons { width: 92px; gap: 16px; }
  .dicon-img { width: 64px; height: 64px; border-radius: 18px; }
  .dicon-img svg { width: 34px; height: 34px; }
  .dicon-label { font-size: 11.5px; }
  .mb-greeting { display: none; }
  .dw-time { font-size: 54px; letter-spacing: -2px; }
  .dw-date { font-size: 14px; }
  .desktop-widget { right: 24px; }
  .dock { gap: 6px; padding: 8px 12px; }
  .dock-ic { width: 46px; height: 46px; }
  .dock-ic-img svg { width: 24px; height: 24px; }
}
