/* Heartlake Sayaç — team app. Mobile first, big thumbs. */
:root {
  --bg: #f3f1fa;
  --card: #ffffff;
  --ink: #15122b;
  --ink2: #5d5a73;
  --muted: #8f8ca3;
  --line: #e6e3f0;
  --brand: #5b3fd6;
  --brand-2: #8b5cf6;
  --pink: #e0457b;
  --pink-soft: #fde7ef;
  --blue: #2a78d6;
  --blue-soft: #e3eefb;
  --teal: #1baf7a;
  --orange: #eb6834;
  --danger: #d03b3b;
  --radius: 22px;
  --shadow: 0 10px 30px rgba(43, 27, 110, 0.10);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior-y: contain;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; }
#app { max-width: 480px; margin: 0 auto; padding: 16px 16px calc(24px + var(--safe-b)); min-height: 100dvh; display: flex; flex-direction: column; }
.screen { display: flex; flex-direction: column; gap: 14px; flex: 1; }
[hidden] { display: none !important; }

/* ---- common ---- */
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 2px; }
.top .ttl { font-weight: 700; font-size: 18px; flex: 1; }
.top .who { font-size: 22px; font-weight: 700; }
.top .who-sm { font-size: 13px; color: var(--ink2); max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { width: 44px; height: 44px; border-radius: 14px; background: var(--card); box-shadow: var(--shadow); font-size: 28px; line-height: 1; padding-bottom: 4px; }
.link { color: var(--brand); font-weight: 600; padding: 10px 6px; }
.btn { display: block; width: 100%; height: 56px; border-radius: 16px; font-weight: 700; font-size: 17px; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 8px 20px rgba(91, 63, 214, .30); }
.btn-primary:active { transform: scale(.98); }
.error { color: var(--danger); font-size: 14px; margin: 0; font-weight: 600; }

/* ---- login ---- */
.hero { text-align: center; padding: 28px 0 8px; }
.logo { width: 76px; height: 76px; margin: 0 auto 14px; border-radius: 24px; background: linear-gradient(135deg, var(--pink), var(--brand)); color: #fff; font-size: 40px; line-height: 76px; box-shadow: 0 12px 28px rgba(224, 69, 123, .30); }
h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -.01em; }
.sub { color: var(--ink2); margin: 0; line-height: 1.45; font-size: 15px; }
#login-form { display: flex; flex-direction: column; gap: 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
input { height: 52px; border: 1.5px solid var(--line); border-radius: 14px; padding: 0 14px; font-size: 18px; background: #fafafe; color: var(--ink); -webkit-user-select: text; user-select: text; }
input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(91, 63, 214, .12); }

/* ---- menu ---- */
.menu-card { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-height: 104px; }
.menu-card:active { transform: scale(.985); }
.mc-icon { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; font-size: 28px; flex-shrink: 0; }
.mc-visit .mc-icon { background: #ece7fb; }
.mc-sets .mc-icon { background: #fde7ef; }
.mc-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.mc-title { font-size: 19px; font-weight: 700; }
.mc-sub { font-size: 14px; color: var(--ink2); }
.mc-arrow { font-size: 30px; color: var(--muted); }
.today { text-align: center; color: var(--ink2); font-size: 14px; margin: 6px 0 0; }

/* ---- visit counter ---- */
.bigstat { text-align: center; padding: 18px 0 4px; }
.bigstat { padding: 6px 0 0; }
.bigstat .num { font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin: 8px 0 10px; color: var(--ink); }
.bigstat .mine { color: var(--ink2); font-size: 15px; }
.plus { width: 100%; border-radius: 30px; color: #fff; font-weight: 800; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: transform .08s, background .15s, box-shadow .15s; }
.plus:active:not(:disabled) { transform: scale(.97); }
.plus-set.plus-visit { height: 132px; }
.plus-set.plus-visit .plus-sign { font-size: 64px; }
.plus.bump { animation: bump .22s ease-out; }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(.94); } 100% { transform: scale(1); } }

/* ---- undo ---- */
.undo { width: 100%; min-height: 60px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; padding: 10px 16px; text-align: left; color: var(--ink); }
.undo:disabled { color: var(--muted); box-shadow: none; background: #ebe8f4; }
.undo-icon { font-size: 24px; width: 32px; text-align: center; color: var(--danger); }
.undo:disabled .undo-icon { color: var(--muted); }
.undo-text { font-size: 14px; line-height: 1.3; }
.undo-text b { display: block; font-size: 15px; }
.undo:active:not(:disabled) { transform: scale(.985); }

/* ---- set cards ---- */
.setcard { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 10px; border-top: 5px solid var(--teal); }
.sc-skate { border-top-color: var(--orange); }
.sc-visit { border-top-color: var(--brand); }
.sc-head { display: flex; align-items: center; gap: 12px; }
.sc-head > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sc-img { width: 64px; height: 80px; object-fit: contain; flex-shrink: 0; filter: drop-shadow(0 4px 8px rgba(43, 27, 110, .18)); }
.sc-title { font-weight: 800; font-size: 18px; }
.sc-counts { font-size: 13px; color: var(--ink2); }
.sc-counts b { color: var(--ink); }
.row { display: flex; gap: 8px; }
.pick { flex: 1; height: 50px; border-radius: 14px; font-weight: 700; font-size: 16px; border: 2px solid var(--line); background: #faf9fe; color: var(--ink2); transition: background .12s, border-color .12s, color .12s; }
.pick:disabled { opacity: .45; }
.pick-girl.on { background: var(--pink); border-color: var(--pink); color: #fff; }
.pick-boy.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.pick-girl:not(.on):not(:disabled) { border-color: #f6c3d6; color: var(--pink); background: var(--pink-soft); }
.pick-boy:not(.on):not(:disabled) { border-color: #bcd4f3; color: var(--blue); background: var(--blue-soft); }
.pick-age { height: 46px; font-size: 15px; }
.pick-age.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.plus-set { height: 92px; border-radius: 22px; background: #e9e6f3; color: #b3b0c4; box-shadow: none; gap: 2px; }
.plus-set .plus-sign { font-size: 48px; line-height: 1; }
.plus-set .plus-hint { font-size: 12px; font-weight: 600; }
.plus-set.is-girl:not(:disabled) { background: linear-gradient(145deg, #ee5a8f, var(--pink)); color: #fff; box-shadow: 0 12px 28px rgba(224, 69, 123, .35); }
.plus-set.is-boy:not(:disabled) { background: linear-gradient(145deg, #4c90e6, var(--blue)); color: #fff; box-shadow: 0 12px 28px rgba(42, 120, 214, .35); }
.plus-set:not(:disabled) .plus-hint { opacity: .9; }

/* ---- toast & offline ---- */
.toast { position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); z-index: 50; max-width: calc(100% - 32px); text-align: center; animation: toast-in .18s ease-out; }
.toast.err { background: var(--danger); }
.toast.ok { background: var(--teal); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.offline { position: sticky; top: 8px; z-index: 40; background: #fff4e5; color: #8a4b00; border: 1px solid #ffd9a8; padding: 10px 14px; border-radius: 14px; font-size: 13px; font-weight: 600; text-align: center; margin-bottom: -4px; }
