/* Bluddy Pool — bright, cheerful, mobile-first */
:root {
  --sun: #ffc93c; --coral: #ff6b6b; --pink: #ff8fab; --mint: #2ec4b6; --sky: #4cc9f0;
  --grape: #7b61ff; --leaf: #52b788;
  --ink: #2b2d42; --muted: #6c7086; --line: #f0e6d8;
  --bg: #fff9ef; --card: #ffffff; --soft: #fff3dc;
  --good: #1f9d55; --bad: #e5484d;
  --radius: 18px; --shadow: 0 6px 20px rgba(255, 140, 60, .12), 0 1px 3px rgba(0,0,0,.05);
  --nav-h: 66px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: "Nunito", system-ui, -apple-system, Segoe UI, sans-serif; color: var(--ink);
  background: radial-gradient(1200px 600px at 100% -10%, #ffe1ec 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 10%, #dff9f4 0%, transparent 55%), var(--bg);
  min-height: 100vh; padding-bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
}
a { color: var(--grape); text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5rem; line-height: 1.2; }
h1 { font-size: 1.5rem; font-weight: 900; }
h2 { font-size: 1.15rem; font-weight: 800; }
h3 { font-size: 1rem; font-weight: 800; }
small, .muted { color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; padding: 16px; }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: linear-gradient(110deg, var(--sun), var(--coral) 55%, var(--pink));
  color: #fff; border-radius: 0 0 24px 24px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 1.2rem; color: #fff; }
.brand .logo { width: 34px; height: 34px; border-radius: 50%; background: #fff; display: grid; place-items: center;
  font-size: 1.2rem; box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); }
.topbar form button { background: rgba(255,255,255,.25); color: #fff; border: 0; }

/* navigation: bottom bar on mobile */
.nav { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: #fff; display: flex; justify-content: space-around;
  border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(0,0,0,.05); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: .72rem; font-weight: 700; }
.nav a .ic { font-size: 1.35rem; line-height: 1; }
.nav a.on { color: var(--coral); }
.nav a.on .ic { transform: translateY(-2px); }

/* layout */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.card.sun { background: linear-gradient(135deg, #fff7d6, #ffe9b8); }
.card.mint { background: linear-gradient(135deg, #e3fbf6, #c9f3ea); }
.card.pink { background: linear-gradient(135deg, #ffeef3, #ffd9e4); }
.card.sky { background: linear-gradient(135deg, #e6f7ff, #cdeeff); }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 10px; }
.desktop-only { display: none; }

/* balls & tiles */
.balls { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ball { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 900;
  color: #fff; font-size: 1rem; box-shadow: inset 0 -4px 0 rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.12); }
.ball.sm { width: 28px; height: 28px; font-size: .8rem; }
.ball.r1 { background: var(--coral); } .ball.r2 { background: #ff9f1c; } .ball.r3 { background: var(--leaf); }
.ball.r4 { background: var(--sky); } .ball.r5 { background: var(--grape); }
.ball.add { background: #fff; color: var(--ink); border: 3px dashed var(--pink); }
.plus { font-weight: 900; color: var(--muted); }
.tile { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 800; background: var(--soft);
  border-radius: 10px; padding: 4px 8px; letter-spacing: 2px; display: inline-block; }
.tile.big { font-size: 1.6rem; padding: 6px 12px; background: #fff; box-shadow: var(--shadow); }
.prize3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.prize3 .lbl { font-size: .72rem; color: var(--muted); font-weight: 800; text-transform: uppercase; }
.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.tiles .tile { text-align: center; padding: 4px 0; font-size: .85rem; letter-spacing: 1px; }

/* chips, badges */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--soft);
  font-size: .8rem; font-weight: 700; }
.chip.hot { background: #ffe1e1; color: #c0392b; } .chip.cold { background: #dff3ff; color: #1e6fa8; }
.chip.due { background: #efe9ff; color: #5a3fd8; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.badge.none { background: #eef0f4; color: #596079; } .badge.weak { background: #fff1c2; color: #8a6100; }
.badge.watch { background: #ffe0e6; color: #b4234a; } .badge.special { background: var(--grape); color: #fff; }
.badge.won { background: #d9f7e6; color: var(--good); } .badge.lost { background: #fde2e2; color: var(--bad); }
.badge.pending { background: #eef0f4; color: var(--muted); }

/* stats */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: #fff; border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow); }
.kpi .v { font-size: 1.25rem; font-weight: 900; }
.kpi .k { font-size: .72rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pos { color: var(--good); } .neg { color: var(--bad); }
.countdown { font-weight: 900; font-size: 1.3rem; font-variant-numeric: tabular-nums; }

/* tables */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-size: .72rem; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* collapsible sections */
details.sec { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
details.sec > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 800; display: flex;
  justify-content: space-between; align-items: center; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::after { content: "＋"; color: var(--coral); font-weight: 900; }
details.sec[open] > summary::after { content: "－"; }
details.sec > .body { padding: 0 16px 16px; }

/* forms */
label { display: block; font-size: .8rem; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; padding: 11px 12px; border-radius: 12px; border: 2px solid var(--line);
  font: inherit; background: #fff; color: var(--ink); min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--sun); }
input[type=checkbox] { width: auto; min-height: 0; }
.fields { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.fields .full { grid-column: 1 / -1; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px;
  min-height: 42px; border-radius: 12px; border: 0; font: inherit; font-weight: 800; cursor: pointer;
  background: linear-gradient(135deg, var(--coral), #ff8e53); color: #fff; box-shadow: 0 3px 10px rgba(255,107,107,.3); }
button.ghost, .btn.ghost { background: #fff; color: var(--ink); border: 2px solid var(--line); box-shadow: none; }
button.mint { background: linear-gradient(135deg, var(--mint), #49d6a0); box-shadow: 0 3px 10px rgba(46,196,182,.3); }
button.small, .btn.small { min-height: 32px; padding: 4px 10px; font-size: .8rem; }
button:disabled { opacity: .6; cursor: wait; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--line); }
.toggle:last-child { border-bottom: 0; }
.switch { position: relative; width: 50px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #e3e5ec; border-radius: 999px; transition: .2s; }
.switch span::before { content: ""; position: absolute; width: 22px; height: 22px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::before { transform: translateX(22px); }
.flash { padding: 10px 14px; border-radius: 12px; font-weight: 700; margin-bottom: 12px; }
.flash.ok { background: #d9f7e6; color: #11663a; } .flash.err { background: #fde2e2; color: #9b1c1c; }
.fab { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom)); z-index: 15;
  width: 58px; height: 58px; border-radius: 50%; font-size: 1.8rem; padding: 0; }
.dropzone { border: 3px dashed var(--pink); border-radius: var(--radius); padding: 18px; text-align: center;
  background: #fff7fa; cursor: pointer; }
.dropzone.drag { background: #ffe3ec; }
.note { font-size: .82rem; background: var(--soft); border-radius: 12px; padding: 10px 12px; }
.chart-box { position: relative; height: 220px; }
.chart-box.tall { height: 300px; }
.pick { border: 2px solid var(--line); border-radius: 16px; padding: 12px; background: #fff; }
.pick.top { border-color: var(--sun); background: linear-gradient(135deg, #fffdf3, #fff4d1); }
.bar { height: 8px; background: #eef0f4; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--sky)); }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; text-align: center; }
.login .logo-big { font-size: 3.2rem; }

/* ---------- desktop ---------- */
@media (min-width: 768px) {
  body { padding-bottom: 24px; padding-left: 92px; }
  .nav { top: 0; bottom: 0; right: auto; width: 84px; height: auto; flex-direction: column; justify-content: flex-start;
    gap: 6px; padding-top: 18px; border-top: 0; border-right: 1px solid var(--line); }
  .nav a { flex: none; height: 64px; }
  .topbar { border-radius: 0 0 24px 24px; margin: 0 16px; }
  .grid.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .desktop-only { display: block; }
  .mobile-only { display: none; }
  .fab { bottom: 24px; }
  .chart-box { height: 260px; } .chart-box.tall { height: 340px; }
  .fields { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1100px) {
  .grid.c3w { grid-template-columns: 2fr 1fr; }
}
.topbar .btn.ghost { background: rgba(255,255,255,.25); color: #fff; border: 0; }
