/* ===== Pembe Günlük — Y2K pembe masaüstü ===== */
:root {
  --pink: #ffb3d9;
  --pink-light: #ffd9ec;
  --pink-deep: #ff5fb0;
  --magenta: #e6007e;
  --lilac: #d9c6ff;
  --lilac-light: #efe6ff;
  --mint: #7ee8d0;
  --burgundy: #8b1a3a;
  --ink: #3a1c2e;
  --paper: #fffaf3;
  --white: #ffffff;
  --shadow: 4px 4px 0 var(--burgundy);
  --font-pixel: "Silkscreen", "Press Start 2P", monospace;
  --font-type: "Special Elite", "Courier New", Courier, monospace;
}

/* --- Bordo piksel imleçler --- */
:root {
  --cur-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 12 12' shape-rendering='crispEdges'><path fill='%23fbe3ec' d='M1 0h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h-4v1h1v1h1v1h-2v-1h-1v-1h-1v-1h-1v1h-1v1h-1v-8z'/><path fill='%238b1a3a' d='M1 1h1v1h1v1h1v1h1v1h1v1h1v1h1v1h-3v1h1v1h-1v-1h-1v-1h-1v1h-1v1h-1z'/></svg>") 2 2, auto;
  --cur-hand: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 12 12' shape-rendering='crispEdges'><path fill='%23fbe3ec' d='M4 0h2v4h1v-2h2v3h1v-1h2v6h-1v2h-6v-1h-1v-1h-1v-1h-1v-2h-1v-2h2v1h1z'/><path fill='%238b1a3a' d='M5 1h1v5h1v-3h1v3h1v-2h1v2h1v4h-1v1h-5v-1h-1v-1h-1v-2h-1v-1h1v1h1v1h1z'/></svg>") 6 2, pointer;
  --cur-text: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 12 12' shape-rendering='crispEdges'><path fill='%238b1a3a' d='M3 0h3v1h1v-1h3v2h-2v8h2v2h-3v-1h-1v1h-3v-2h2v-8h-2z'/></svg>") 12 12, text;
}
html, body, * { cursor: var(--cur-arrow); }
a, button, label[for], .btn, .mood, .cal-day, .thumb, .tb-btns i, input[type=file] { cursor: var(--cur-hand) !important; }
input[type=text], input[type=password], textarea { cursor: var(--cur-text) !important; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--font-type);
  font-size: 17px;
  line-height: 1.5;
  background-color: var(--pink-light);
  background-image:
    linear-gradient(rgba(255,255,255,.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.55) 1px, transparent 1px),
    linear-gradient(135deg, #ffd9ec 0%, #f4c9ff 50%, #ffd9ec 100%);
  background-size: 28px 28px, 28px 28px, 100% 100%;
  padding-bottom: 40px;
}
.hidden { display: none !important; }
.pixel { font-family: var(--font-pixel); letter-spacing: .02em; }
.typewriter { font-family: var(--font-type); }
.muted { color: #8a6478; }

/* --- Süsler --- */
.sparkle { position: fixed; color: var(--white); text-shadow: 0 0 6px var(--pink-deep); font-size: 34px; pointer-events: none; animation: twinkle 2.6s ease-in-out infinite; z-index: 0; }
.s1 { top: 12%; left: 4%; } .s2 { top: 30%; right: 6%; animation-delay: .8s; }
.s3 { bottom: 18%; left: 10%; animation-delay: 1.4s; } .s4 { bottom: 8%; right: 12%; animation-delay: .4s; font-size: 22px; }
@keyframes twinkle { 0%,100% { opacity: .35; transform: scale(.9); } 50% { opacity: 1; transform: scale(1.15); } }

/* --- Üst bar --- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(90deg, var(--magenta), var(--pink-deep));
  color: var(--white); padding: 8px 14px;
  border-bottom: 3px solid var(--burgundy);
  font-family: var(--font-pixel); font-size: 14px;
}
.clock { font-size: 12px; }

/* --- Pencereler --- */
.win {
  background: var(--lilac-light);
  border: 3px solid var(--burgundy);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.titlebar {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(90deg, var(--pink-deep), var(--pink));
  color: var(--white); padding: 6px 10px;
  border-bottom: 3px solid var(--burgundy);
  font-family: var(--font-pixel); font-size: 13px;
  text-shadow: 1px 1px 0 var(--burgundy);
}
.tb-btns i { display: inline-block; width: 18px; height: 18px; margin-left: 4px; background: var(--white); color: var(--burgundy); border: 2px solid var(--burgundy); border-radius: 4px; font-style: normal; font-size: 11px; line-height: 14px; text-align: center; text-shadow: none; }
.win-body { padding: 14px; }

/* --- Butonlar, alanlar --- */
.btn {
  display: inline-block;
  font-family: var(--font-pixel); font-size: 12px;
  background: var(--white); color: var(--burgundy);
  border: 2px solid var(--burgundy); border-radius: 8px;
  padding: 8px 12px; box-shadow: 3px 3px 0 var(--burgundy);
  transition: transform .05s, box-shadow .05s;
  user-select: none;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--burgundy); }
.btn.primary { background: var(--mint); }
.btn.danger { background: #ffd3d3; }
.btn.tiny { padding: 4px 8px; font-size: 11px; box-shadow: 2px 2px 0 var(--burgundy); }
.btn.on { background: var(--pink-deep); color: var(--white); }
.field {
  width: 100%; font-family: var(--font-type); font-size: 18px;
  padding: 10px 12px; border: 2px solid var(--burgundy); border-radius: 8px;
  background: var(--white); color: var(--ink); margin-bottom: 10px;
}
.field:focus, textarea:focus { outline: 3px solid var(--pink-deep); outline-offset: 1px; }

/* --- Giriş ekranı --- */
.center-stage { display: grid; place-items: center; min-height: calc(100vh - 60px); padding: 20px; position: relative; z-index: 1; }
.auth-win { width: min(440px, 100%); }
.auth-win .win-body { text-align: center; }
.auth-heart { font-size: 58px; line-height: 1; margin: 6px 0 10px; animation: bounce 1.8s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-win h1 { font-size: 18px; margin: 0 0 6px; color: var(--magenta); }
.auth-win p { margin: 0 0 14px; }
.error { color: #c62828; margin-top: 10px; }
.warning-box {
  margin-top: 18px; text-align: left; font-size: 14px;
  background: #fff3f7; border: 2px dashed var(--magenta); border-radius: 8px; padding: 10px 12px;
}

/* --- Masaüstü yerleşimi --- */
.desktop {
  position: relative; z-index: 1;
  display: grid; gap: 22px; padding: 22px 14px;
  grid-template-columns: 1fr; max-width: 1100px; margin: 0 auto;
}
@media (min-width: 900px) {
  .desktop { grid-template-columns: 1.15fr .85fr; align-items: start; }
  .day-win { grid-row: span 2; }
}

/* --- Gün penceresi --- */
.day-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.day-date { flex: 1; font-size: 18px; font-weight: bold; }
.sec-title { font-size: 13px; color: var(--magenta); margin: 10px 0 8px; }
.mood-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
@media (max-width: 420px) { .mood-grid { grid-template-columns: repeat(4, 1fr); } }
.mood {
  font-size: 28px; line-height: 1; text-align: center; padding: 8px 0;
  background: var(--white); border: 2px solid var(--burgundy); border-radius: 50%;
  box-shadow: 2px 2px 0 var(--burgundy); transition: transform .08s; aspect-ratio: 1;
  display: grid; place-items: center;
}
.mood:hover { transform: scale(1.08); }
.mood.on { background: var(--pink-deep); transform: scale(1.12); box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--magenta); }
.action-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.period-btn.on { background: #ff4d7d; }
.paper {
  background: var(--paper); border: 2px solid var(--burgundy); border-radius: 6px;
  padding: 12px 14px; white-space: pre-wrap; margin-bottom: 12px;
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(230,0,126,.15) 27px 28px);
  line-height: 28px;
}
.food-list { list-style: none; padding: 0; margin: 0 0 12px; }
.food-list li { background: var(--white); border: 2px solid var(--burgundy); border-radius: 20px; padding: 4px 12px; display: inline-flex; align-items: center; gap: 8px; margin: 0 6px 6px 0; }
.food-list li button { border: none; background: none; color: var(--magenta); font-weight: bold; font-size: 16px; padding: 0; }
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.thumb { width: 84px; height: 84px; object-fit: cover; border: 2px solid var(--burgundy); border-radius: 8px; box-shadow: 2px 2px 0 var(--burgundy); background: var(--white); }
.thumb.loading { display: grid; place-items: center; font-size: 22px; }

/* --- Takvim --- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 13px; color: var(--magenta); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { font-family: var(--font-pixel); font-size: 10px; text-align: center; color: var(--burgundy); padding: 2px 0; }
.cal-day {
  position: relative; min-height: 46px; background: var(--white);
  border: 2px solid var(--burgundy); border-radius: 8px; padding: 3px 4px;
  font-family: var(--font-pixel); font-size: 10px; text-align: left;
}
.cal-day.empty { background: transparent; border-color: transparent; }
.cal-day.today { outline: 2px dashed var(--magenta); outline-offset: 1px; }
.cal-day.sel { background: var(--lilac); }
.cal-day.period { background: #ffc2d4; border-color: #c2185b; }
.cal-day.period::after { content: "🩸"; position: absolute; right: 2px; bottom: 2px; font-size: 10px; }
.cal-day .mood-mini { display: block; font-size: 18px; line-height: 1; margin-top: 2px; font-family: sans-serif; }
.cal-day.entry::before { content: "✎"; position: absolute; right: 3px; top: 1px; font-size: 10px; color: var(--magenta); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; margin-top: 10px; }
.lg { display: inline-block; width: 12px; height: 12px; border: 1px solid var(--burgundy); vertical-align: middle; margin-right: 4px; border-radius: 3px; }
.lg.period { background: #ffc2d4; } .lg.entry { background: var(--white); }

/* --- Player süsü --- */
.player { text-align: center; }
.keys { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.keys span { font-family: var(--font-pixel); font-size: 11px; background: var(--white); border: 2px solid var(--burgundy); border-radius: 6px; padding: 8px 10px; box-shadow: 2px 3px 0 var(--burgundy); }
.player-ctrl { font-size: 22px; color: var(--burgundy); margin: 6px 0; }
.player-ctrl .heart { color: var(--magenta); font-size: 30px; margin: 0 10px; }
.progress { height: 10px; background: var(--white); border: 2px solid var(--burgundy); border-radius: 6px; margin: 8px 0 14px; overflow: hidden; }
.progress .bar { width: 38%; height: 100%; background: linear-gradient(90deg, var(--pink-deep), var(--magenta)); animation: grow 12s linear infinite alternate; }
@keyframes grow { from { width: 20%; } to { width: 85%; } }

/* --- Modallar --- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(139,26,58,.35); display: grid; place-items: center; padding: 14px; }
.modal .win { width: min(560px, 100%); max-height: 92vh; display: flex; flex-direction: column; }
.modal .win-body { overflow: auto; }
.mail-row { display: flex; gap: 8px; border-bottom: 2px dashed var(--pink); padding: 6px 2px; }
.mail-row span { color: #8a6478; min-width: 52px; }
#diaryText { width: 100%; min-height: 260px; margin-top: 10px; font-size: 18px; line-height: 28px; padding: 10px 12px; border: 2px solid var(--burgundy); border-radius: 6px; background: var(--paper); resize: vertical; background-image: repeating-linear-gradient(transparent 0 27px, rgba(230,0,126,.15) 27px 28px); }
.mail-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.food-form { display: flex; gap: 8px; margin-bottom: 10px; }
.food-form .field { margin: 0; }
.photo-body { text-align: center; }
#photoBig { max-width: 100%; max-height: 70vh; border: 3px solid var(--burgundy); border-radius: 8px; margin-bottom: 10px; }

/* --- Toast / meşgul --- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 30; background: var(--burgundy); color: var(--white); padding: 10px 16px; border-radius: 8px; font-size: 12px; box-shadow: 0 4px 0 #4d0f22; }
.busy { position: fixed; inset: 0; z-index: 40; background: rgba(255,217,236,.6); display: grid; place-items: center; }
.win.small { width: 260px; text-align: center; }
