:root {
  --pink: #ff8fb1;
  --pink-dark: #e85d8a;
  --pink-soft: #ffe3ec;
  --bg: #fff5f8;
  --text: #4a2c3a;
  --muted: #9a7887;
  --card: #ffffff;
  --radius: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(circle at 20% 0%, #ffe0ec 0, transparent 50%), radial-gradient(circle at 100% 100%, #fde7ff 0, transparent 50%), var(--bg);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: .85rem; }
.center { text-align: center; }
.error { color: #d23a5f; min-height: 1.2em; margin: .5rem 0 0; }
h1, h2 { margin: .2rem 0 .6rem; }
h2 { font-size: 1.15rem; }

.screen { min-height: 100%; }
.card {
  background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: 0 4px 18px rgba(232, 93, 138, .10); margin-bottom: 12px;
}
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

input, textarea {
  font: inherit; color: inherit; width: 100%;
  border: 2px solid var(--pink-soft); border-radius: 12px; padding: 10px 12px; background: #fffafc; outline: none;
}
input:focus, textarea:focus { border-color: var(--pink); }
label { display: block; text-align: left; margin-bottom: 10px; font-weight: 600; font-size: .9rem; }
label input { margin-top: 4px; font-weight: 400; }

.btn {
  font: inherit; font-weight: 700; border: 0; border-radius: 999px; padding: 10px 18px; cursor: pointer;
  background: var(--pink-soft); color: var(--pink-dark); transition: transform .1s;
}
.btn:active { transform: scale(.95); }
.btn.primary { background: linear-gradient(135deg, #ff9dbb, var(--pink-dark)); color: #fff; }
.btn.small { padding: 7px 12px; font-size: .9rem; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; }

/* Login */
#login { display: grid; place-items: center; padding: 20px; }
.login-card { width: min(380px, 100%); text-align: center; padding: 28px 22px; }
.login-card .btn { width: 100%; margin-top: 6px; }
.big-heart { font-size: 3.2rem; animation: beat 1.4s infinite; }

/* App layout */
#app { max-width: 560px; margin: 0 auto; padding: 0 12px calc(80px + env(safe-area-inset-bottom)); }
.top { display: flex; justify-content: space-between; align-items: center; padding: 14px 4px 10px; }
.title { font-weight: 800; font-size: 1.25rem; color: var(--pink-dark); }
.online { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; font-size: .85rem; }
.online span { background: #fff; border-radius: 999px; padding: 3px 9px; box-shadow: 0 2px 8px rgba(0,0,0,.05); }
.online span.on::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #3ccf7a; margin-right: 5px; }
.online span.off { opacity: .55; }
.online span.off::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #ccc; margin-right: 5px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; gap: 10px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px); padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 18px rgba(232, 93, 138, .12);
}
.tabs button {
  font: inherit; font-size: 1.4rem; border: 0; background: none; border-radius: 14px; padding: 6px 26px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; color: var(--muted);
}
.tabs button span { font-size: .75rem; font-weight: 700; }
.tabs button.active { background: var(--pink-soft); color: var(--pink-dark); }

/* Game */
.game-bar { display: flex; flex-direction: column; gap: 8px; }
.game-msg { font-size: 1.05rem; }
.game-msg b { color: var(--pink-dark); }
.hint { letter-spacing: .35em; font-family: ui-monospace, monospace; font-weight: 700; }
.canvas-wrap { padding: 6px; }
canvas { display: block; width: 100%; aspect-ratio: 1 / 1; background: #fff; border-radius: 12px; touch-action: none; border: 2px dashed var(--pink-soft); }
canvas.can-draw { border-style: solid; border-color: var(--pink); cursor: crosshair; }
.tools { display: flex; flex-direction: column; gap: 10px; }
.tools > .row { justify-content: space-between; }
.colors button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #eee; cursor: pointer; padding: 0; }
.colors button.sel { box-shadow: 0 0 0 3px var(--pink-dark); }
.colors button.eraser { background: #fff; font-size: 1rem; }
.sizes button { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--pink-soft); cursor: pointer; display: grid; place-items: center; }
.sizes button i { display: block; background: var(--text); border-radius: 50%; }
.sizes button.sel { background: var(--pink); }
#guess-form input { flex: 1; width: auto; }
.score { font-weight: 700; margin-bottom: 6px; }
.guesses { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow: auto; display: flex; flex-direction: column-reverse; }
.guesses li { padding: 4px 0; border-bottom: 1px dashed #f3dbe4; }
.guesses li.ok { color: #1f9d55; font-weight: 700; }

/* Us */
.countdown { font-size: 2rem; font-weight: 800; color: var(--pink-dark); margin: 6px 0; font-variant-numeric: tabular-nums; }
.countdown small { font-size: .9rem; font-weight: 600; color: var(--muted); margin: 0 6px 0 2px; }
.edit-meetup { margin-top: 10px; }
.edit-meetup summary { cursor: pointer; color: var(--muted); }
.edit-meetup .row { margin-top: 8px; justify-content: center; }
.edit-meetup input { width: auto; flex: 1; min-width: 200px; }
.heart-btn {
  font-size: 4rem; border: 0; background: var(--pink-soft); width: 120px; height: 120px; border-radius: 50%;
  cursor: pointer; animation: beat 1.6s infinite; box-shadow: 0 8px 24px rgba(232, 93, 138, .3);
}
.heart-btn:active { transform: scale(.9); }
#note-form { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
#note-form .btn { align-self: flex-end; }
.notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.notes li { background: #fff7fa; border-radius: 14px; padding: 10px 12px; border-left: 4px solid var(--pink); position: relative; }
.notes li.mine { border-left-color: #b79cff; background: #faf7ff; }
.notes .text { white-space: pre-wrap; word-wrap: break-word; }
.notes .meta { font-size: .78rem; color: var(--muted); margin-top: 4px; }
.notes .del { position: absolute; top: 6px; right: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 1rem; }

/* Toast + floating hearts */
.toast {
  position: fixed; left: 50%; top: 16px; transform: translate(-50%, -150%); background: #fff; color: var(--pink-dark);
  font-weight: 700; padding: 12px 18px; border-radius: 999px; box-shadow: 0 8px 24px rgba(232, 93, 138, .3);
  transition: transform .3s; z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.hearts-layer { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.float-heart { position: absolute; bottom: -40px; animation: floatUp 3s ease-in forwards; }
@keyframes floatUp {
  0% { transform: translateY(0) scale(.6); opacity: 1; }
  100% { transform: translateY(-110vh) scale(1.3) rotate(20deg); opacity: 0; }
}
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
