:root {
  --ink: #040f0f;
  --muted: #1e3a3f;
  --ice: #c9fbff;
  --glass: linear-gradient(rgba(255,255,255,.6) 0%, rgba(255,255,255,.35) 50%, rgba(201,251,255,.25) 51%, rgba(201,251,255,.4) 100%);
  --gloss-dark: linear-gradient(#3a5056 0%, #1e3236 50%, #040f0f 51%, #1e3236 100%);
  --shadow: 0 4px 16px rgba(4,15,15,.18);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: #c2fcf7; }
body {
  margin: 0;
  min-height: 100vh;
  padding: 32px 24px 48px;
  background: linear-gradient(180deg, #57737a 0%, #85bdbf 40%, #c2fcf7 100%) no-repeat;
  font: 15px/1.6 "Segoe UI", "Lucida Grande", system-ui, sans-serif;
  color: var(--ink);
}
a { color: #0e3236; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }

.glass {
  background: var(--glass);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Now listening bubble */
.top { display: flex; margin-bottom: 12px; min-height: 58px; }
.bubble {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 8px; border-radius: 28px;
  text-decoration: none; color: var(--ink); max-width: 100%;
}
.disc {
  width: 40px; height: 40px; flex: none; border-radius: 50%;
  background: var(--gloss-dark);
  display: flex; align-items: center; justify-content: center;
}
.now-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.now-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
#now-song { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble.playing .disc svg { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .bubble.playing .disc svg { animation: none; } }

/* Layout */
.wrap { max-width: 680px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.hero { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; color: #fff; }
.avatar {
  width: 88px; height: 88px; border-radius: 50%; object-fit: cover;
  background: linear-gradient(#c9fbff, #85bdbf);
  border: 3px solid #fff; box-shadow: 0 2px 10px rgba(4,15,15,.35);
}
.hero h1 { margin: 0; font-size: 30px; font-weight: 600; text-shadow: 0 1px 3px rgba(4,15,15,.5); }
.hero p { margin: 0; text-shadow: 0 1px 2px rgba(4,15,15,.5); }

.tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 6px; border-radius: 22px; }
.tabs a { padding: 8px 16px; border-radius: 16px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.tabs a:hover { background: rgba(255,255,255,.5); }
.tabs a[aria-current="page"] { background: rgba(4,15,15,.85); color: var(--ice); }

/* Posts */
#feed, #gb, #gb-list { display: flex; flex-direction: column; gap: 20px; }
.card {
  border-radius: 16px; background: rgba(255,255,255,.65);
  border: 1px solid rgba(255,255,255,.9); box-shadow: 0 4px 16px rgba(4,15,15,.15);
  overflow: hidden;
}
.card-img { display: block; width: 100%; height: 260px; object-fit: cover; background: linear-gradient(#85bdbf, #57737a); }
.card-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.card.row { display: flex; align-items: center; gap: 16px; padding-left: 22px; }
.card.row .card-body { padding-left: 0; gap: 4px; }
.art {
  width: 64px; height: 64px; flex: none; border-radius: 12px;
  background: linear-gradient(#57737a, var(--ink));
  display: flex; align-items: center; justify-content: center;
}
.meta { margin: 0; font-size: 12px; color: var(--muted); }
.title { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.3; text-decoration: none; overflow-wrap: anywhere; }
.row .title { font-size: 17px; }
.text { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.link { align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; color: #0e3236; text-decoration: underline; cursor: pointer; }
.empty { text-align: center; color: var(--muted); }

.btn {
  align-self: center; min-height: 44px; padding: 0 24px; border-radius: 22px;
  border: 1px solid var(--ink); background: var(--gloss-dark); color: var(--ice);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1; cursor: pointer;
}
.btn:disabled { opacity: .6; cursor: wait; }

/* Guestbook form (also used by admin) */
.form { padding: 18px 22px; display: flex; flex-direction: column; gap: 12px; }
.form h2 { margin: 0; font-size: 20px; font-weight: 600; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
input, textarea, select {
  font: inherit; color: var(--ink); padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(4,15,15,.25); background: rgba(255,255,255,.85);
}
textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; }
.status { margin: 0; font-size: 14px; min-height: 1.6em; }

@media (max-width: 520px) {
  body { padding: 16px 16px 40px; }
  .card-img { height: 200px; }
  .tabs a { padding: 8px 12px; }
}

/* Admin */
.light { color: #fff; }
.check { flex-direction: row; align-items: center; gap: 8px; }
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid rgba(4,15,15,.1); }
.item span { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 14px; }
.item button { flex: none; padding: 6px 12px; border-radius: 8px; border: 1px solid #a33; background: #fff; color: #a33; font: inherit; font-size: 13px; cursor: pointer; }
