:root{
  --bg:#f7f7f8; --panel:#ffffff; --ink:#1f2937; --muted:#6b7280;
  --border:#e5e7eb; --ring:rgba(124,58,237,.25);
}

[data-theme="dark"]{
  --bg:#0b0f14; --panel:#121821; --ink:#e5e7eb; --muted:#94a3b8;
  --border:#1f2937; --ring:rgba(167,139,250,.25);
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:var(--bg); color:var(--ink);
  font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,Arial;
  display:flex; flex-direction:column;
}

/* ---------- Buttons & Inputs ---------- */
.btn{
  display:inline-flex; align-items:center; gap:8px; padding:8px 12px;
  border:1px solid var(--border); border-radius:10px; background:#fff;
  color:#111; cursor:pointer; text-decoration:none; white-space:nowrap;
}
[data-theme="dark"] .btn{ background:#0f141c; color:var(--ink) }

input, select{
  background:#fff; color:#111;
  border:1px solid var(--border); border-radius:10px; padding:8px 10px;
}
[data-theme="dark"] input,
[data-theme="dark"] select{ background:#0f141c; color:var(--ink) }

/* ---------- Topbar ---------- */
.topbar{
  position:sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px; border-bottom:1px solid var(--border); background:var(--panel);
}
.topbar .left, .topbar .right{
  display:flex; align-items:center; gap:8px;
}
.muted{ color:var(--muted) }

/* ---------- Board ---------- */
.board{
  position:relative; flex:1; overflow:auto;
  background:
    radial-gradient(800px 500px at 0% 0%, rgba(124,58,237,.07), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(0,0,0,.04), transparent 55%),
    var(--bg);
  padding:12px;
  touch-action: pan-y; /* dikey kaydırma serbest */
}

/* ---------- Sticky Notes ---------- */
.note{
  position:absolute; width:220px; min-width:160px; min-height:150px;
  background:#fff475;
  border:1px solid rgba(0,0,0,.15);
  border-radius:12px; box-shadow:0 10px 30px rgba(2,6,23,.15);
  display:flex; flex-direction:column; color:#111;
}
.note-header{
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  padding:6px 8px; user-select:none; font-weight:600;
  background:rgba(0,0,0,.06);
  border-top-left-radius:12px; border-top-right-radius:12px;
  touch-action: none; /* mobilde sürükleme için gerekli */
  cursor:grab;
}
.note .drag-handle{ cursor:grab }
.note .note-actions .note-btn{
  border:none; background:transparent; cursor:pointer; font-size:16px; color:inherit;
}
.note-body{
  width:100%; flex:1; border:none; outline:none;
  background:transparent; padding:8px; resize:none; font:inherit; color:inherit;
}
.note ::placeholder{ color: rgba(0,0,0,.5); }
.note.note--light ::placeholder{ color: rgba(0,0,0,.5); }
.note.note--dark  ::placeholder{ color: rgba(255,255,255,.7); }
.resize-handle{
  width:16px; height:16px; position:absolute; right:6px; bottom:6px;
  cursor:nwse-resize; border-right:2px solid currentColor;
  border-bottom:2px solid currentColor; border-radius:2px; opacity:.6;
  touch-action: none; /* mobilde boyutlandırma için gerekli */
}

/* Karanlık uyum */
[data-theme="dark"] .note{ border-color:#223042; }

/* ---------- Auth form ---------- */
.auth-form{ display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.auth-form input{ min-width:140px; }

/* ---------- Responsive ---------- */
@media (max-width: 820px){
  .topbar{ flex-wrap:wrap; gap:8px; }
  .topbar .left{ order:1; flex:1 1 100%; gap:6px; }
  .topbar .right{ order:2; flex:1 1 100%; gap:6px; justify-content:flex-start; }
  .btn{ padding:8px 10px; border-radius:12px; }
  select#color-picker{ max-width:140px; }
  .auth-form input{ min-width:130px; }
}

@media (max-width: 600px){
  .auth-form{ width:100%; gap:6px; }
  .auth-form input{ flex:1 1 100%; min-width:0; width:100%; }
  .auth-form .btn{ padding:7px 10px; }
}

@media (max-width: 480px){
  .topbar{ padding:8px; }
  .topbar .left{ gap:6px; }
  .topbar .right{ gap:6px; }
  .btn{ padding:7px 9px; }
  select#color-picker{ max-width:120px; }
  .auth-form{
    display:grid; grid-template-columns:1fr 1fr; grid-auto-rows:min-content;
    column-gap:6px; row-gap:6px;
  }
  .auth-form input[name="u"]{ grid-column:1 / -1; }
  .auth-form input[name="p"]{ grid-column:1 / -1; }
  .auth-form .btn[name="login"]{ grid-column:1 / 2; }
  .auth-form .btn[name="register"]{ grid-column:2 / 3; }
}

@media (max-width: 360px){
  .btn{ padding:6px 8px; font-size:14px; }
  input, select{ padding:7px 8px; font-size:14px; }
  select#color-picker{ max-width:110px; }
}
