/* hidup.lol: one wall for every mood. A cut of seneng/happy/style.css; colors, buttons, dialogs and the
   EN | ID switch come from seneng-base.css. Notes are pastel stickers, one color per mood, from md0
   (🤬, kesel's angriest) through md5 (😐, neutral) to md10 (🥳, seneng's happiest). */
:root {
  --note-ink: #2E1A47;
  --md0: #FFD3CE; --md0-on: #CF3B33;
  --md1: #FFDCCB; --md1-on: #E8553D;
  --md2: #FFE4C6; --md2-on: #F07A2E;
  --md3: #FFEDCC; --md3-on: #F2A23A;
  --md4: #F3ECDC; --md4-on: #B59A6A;
  --md5: #ECE9F2; --md5-on: #8D84A0;
  --md6: #DDF0FF; --md6-on: #3FA9F5;
  --md7: #D6F6EA; --md7-on: #22C39A;
  --md8: #FFF0BF; --md8-on: #FFC233;
  --md9: #FFDDEB; --md9-on: #FF8EBF;
  --md10: #E8E0FF; --md10-on: #7B5CFF;
  --kesel: #1D2946; --hl: #F7E36A;
  --land: #F3E3C3;
  --land-on: #FFD877;
  --coast: #CDB58C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --land: #3A2D58; --land-on: #6B5420; --coast: #4F4170; }
}
.top {
  max-width: 1180px;
  margin: 0 auto;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 28px 0 22px; }
.badge {
  display: inline-block;
  margin: 0 0 10px;
  padding: 5px 14px;
  border: var(--line) solid var(--edge);
  border-radius: 999px;
  background: var(--sun);
  color: var(--on-color);
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 3px 0 var(--drop);
  transform: rotate(-2deg);
}
.hero h1 { font-size: clamp(46px, 9vw, 84px); font-weight: 700; letter-spacing: -.02em; }
.hero .sub { max-width: 34em; margin: 12px auto 0; font-size: 18px; color: var(--ink-soft); text-wrap: balance; }
.stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 16px;
  border: var(--line) solid var(--edge);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--drop);
  color: var(--ink);
}
button.chip { cursor: pointer; }
button.chip:hover { background: var(--bg-2); }
.chip b { font-family: var(--display); font-size: 22px; font-variant-numeric: tabular-nums; }
.chip small { font-size: 15px; font-weight: 700; color: var(--ink-soft); }

/* ---------- composer ---------- */
.compose {
  --c: var(--md5-on);
  max-width: 640px;
  margin: 0 auto 26px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border: var(--line) solid var(--edge);
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 6px 0 var(--drop), inset 0 7px 0 var(--c);
  padding-top: 24px;
}
.compose.md0 { --c: var(--md0-on); }
.compose.md1 { --c: var(--md1-on); }
.compose.md2 { --c: var(--md2-on); }
.compose.md3 { --c: var(--md3-on); }
.compose.md4 { --c: var(--md4-on); }
.compose.md5 { --c: var(--md5-on); }
.compose.md6 { --c: var(--md6-on); }
.compose.md7 { --c: var(--md7-on); }
.compose.md8 { --c: var(--md8-on); }
.compose.md9 { --c: var(--md9-on); }
.compose.md10 { --c: var(--md10-on); }
.compose textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  font: inherit;
  font-size: 19px;
  color: var(--ink);
  background: var(--bg);
  border: var(--line) solid var(--edge);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.compose textarea:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px color-mix(in srgb, var(--sky) 30%, transparent); }
.meter { border: 0; margin: 0; padding: 0; min-width: 0; }
.meter legend { padding: 0; margin-bottom: 8px; font-weight: 800; }
/* Eleven faces in one row: kesel on the left, neutral in the middle, seneng on the right. */
.meter legend b { margin-left: 6px; padding: 1px 10px; border-radius: 999px; background: var(--c); color: #fff; font-size: 14px; }
.levels { display: grid; grid-template-columns: repeat(var(--n-moods, 11), minmax(0, 1fr)); gap: 4px; }
.lvl {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-height: 56px;
  max-width: 100%;
  padding: 0;
  border: var(--line) solid var(--edge);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
}
.lvl span { font-size: clamp(18px, 4.6vw, 26px); line-height: 1; }
.lvl.md5 { border-style: dashed; }
.scale { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.lvl:hover { background: var(--bg-2); }
.lvl[aria-pressed="true"] { color: var(--note-ink); box-shadow: 0 3px 0 var(--drop); transform: translateY(-2px); }
.lvl.md0[aria-pressed="true"] { background: var(--md0); }
.lvl.md1[aria-pressed="true"] { background: var(--md1); }
.lvl.md2[aria-pressed="true"] { background: var(--md2); }
.lvl.md3[aria-pressed="true"] { background: var(--md3); }
.lvl.md4[aria-pressed="true"] { background: var(--md4); }
.lvl.md5[aria-pressed="true"] { background: var(--md5); }
.lvl.md6[aria-pressed="true"] { background: var(--md6); }
.lvl.md7[aria-pressed="true"] { background: var(--md7); }
.lvl.md8[aria-pressed="true"] { background: var(--md8); }
.lvl.md9[aria-pressed="true"] { background: var(--md9); }
.lvl.md10[aria-pressed="true"] { background: var(--md10); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.row select { appearance: none; cursor: pointer; }
.foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cnt { color: var(--ink-soft); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rule { margin: 0; font-size: 14px; color: var(--ink-soft); }
.rule .link-btn { padding: 0; font-size: 14px; }
.warn {
  padding: 10px 14px;
  border: var(--line) solid var(--coral);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--coral) 12%, var(--card));
  font-weight: 700;
}

/* ---------- the tabs: Kesel · Hidup · Seneng ---------- */
.tabs {
  position: sticky; top: 0; z-index: 5;
  display: flex; justify-content: center;
  padding: 10px 16px; margin-bottom: 4px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.tabs > div {
  display: flex; gap: 4px; width: 100%; max-width: 460px; padding: 4px;
  border: var(--line) solid var(--edge); border-radius: 999px; background: var(--card); box-shadow: 0 3px 0 var(--drop);
}
.tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px; border: 0; border-radius: 999px; background: none;
  font-weight: 800; font-size: 15px; color: var(--ink-soft); cursor: pointer; white-space: nowrap;
}
.tab small { font-weight: 700; font-size: 12px; opacity: .8; font-variant-numeric: tabular-nums; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--note-ink); }
.tab.k[aria-selected="true"] { background: var(--md1); font-family: "Caveat Brush", var(--display); font-size: 19px; font-weight: 400; }
.tab.h[aria-selected="true"] { background: var(--md5); }
.tab.s[aria-selected="true"] { background: var(--md8); font-family: var(--display); }

/* ---------- brand: hid·up.lol ---------- */
.brand { display: inline-flex; align-items: center; gap: 2px; text-decoration: none; font-size: 26px; line-height: 1; }
.brand img { width: 34px; height: 34px; margin-right: 6px; }
.brand .hid { font-family: "Caveat Brush", cursive; font-size: 1.1em; color: var(--kesel); background: linear-gradient(transparent 40%, var(--hl) 40% 90%, transparent 90%); padding: 0 2px; }
.brand .up { font-family: var(--display); font-weight: 700; color: var(--note-ink); background: var(--sun); border-radius: 10px; padding: 0 5px; margin-left: 2px; }
.brand .lol { font-weight: 800; font-size: .6em; color: var(--ink-soft); }

/* ---------- country pills ---------- */
.pills {
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 4px 16px 8px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none;
  padding: 6px 14px;
  border: var(--line) solid var(--edge);
  border-radius: 999px;
  background: var(--card);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.pill:hover { background: var(--bg-2); }
.pill.on { background: var(--ink); color: var(--bg); }

/* ---------- the wall ---------- */
.wall { columns: 270px; column-gap: 18px; padding-bottom: 12px; }
.note {
  --n: var(--md5);
  break-inside: avoid;
  margin: 0 0 18px;
  padding: 16px 16px 12px;
  border: var(--line) solid var(--edge);
  border-radius: 18px 18px 18px 6px;
  background: var(--n);
  color: var(--note-ink);
  box-shadow: 0 5px 0 var(--drop);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.note.md0 { --n: var(--md0); }
.note.md1 { --n: var(--md1); }
.note.md2 { --n: var(--md2); }
.note.md3 { --n: var(--md3); }
.note.md4 { --n: var(--md4); }
.note.md5 { --n: var(--md5); }
.note.md6 { --n: var(--md6); }
.note.md7 { --n: var(--md7); }
.note.md8 { --n: var(--md8); }
.note.md9 { --n: var(--md9); }
.note.md10 { --n: linear-gradient(135deg, var(--md10), var(--md9) 55%, var(--md8)); }
/* Kesel notes keep a bit of kesel.lol: notebook ink and a hand-written name. */
.note.from-k { border-radius: 6px 18px 10px 16px / 16px 8px 18px 10px; }
.note.from-k .by b { font-family: "Patrick Hand", var(--body); font-size: 17px; }
.note .lvname .src { opacity: .6; font-weight: 700; text-transform: none; letter-spacing: 0; }
.note.r0 { transform: rotate(-1.4deg); } .note.r1 { transform: rotate(-.8deg); } .note.r2 { transform: rotate(-.3deg); }
.note.r3 { transform: rotate(.3deg); } .note.r4 { transform: rotate(.8deg); } .note.r5 { transform: rotate(1.2deg); } .note.r6 { transform: rotate(1.6deg); }
.note .face { position: absolute; top: -16px; right: 14px; font-size: 30px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(46, 26, 71, .35)); }
.note .lvname {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.note .txt { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; white-space: pre-wrap; }
.note .tr { align-self: flex-start; font-size: 13px; font-weight: 700; color: rgba(46, 26, 71, .65); }
.note .tr:hover { color: var(--note-ink); }
.by { display: flex; align-items: flex-end; gap: 6px; padding-top: 8px; border-top: 2px dashed rgba(46, 26, 71, .18); }
.by > div { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 8px; font-size: 13px; color: rgba(46, 26, 71, .72); }
.by b { flex-basis: 100%; font-size: 15px; color: var(--note-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.by button {
  flex: none;
  min-width: 36px;
  height: 34px;
  padding: 0 10px;
  border: 2px solid var(--note-ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, .75);
  color: var(--note-ink);
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
}
.by button:hover { background: #fff; }
.by .cheer.on { background: var(--sun); animation: boing .4s cubic-bezier(.3, 1.8, .5, 1); }
.by .del, .by .rep { padding: 0; width: 34px; font-size: 15px; }
@keyframes boing { 40% { transform: scale(1.25) rotate(-6deg); } }
.note.new { animation: land .5s cubic-bezier(.25, 1.6, .45, 1) both; }
.note.new:nth-child(2) { animation-delay: 40ms; } .note.new:nth-child(3) { animation-delay: 80ms; } .note.new:nth-child(4) { animation-delay: 120ms; }
.note.new:nth-child(5) { animation-delay: 160ms; } .note.new:nth-child(6) { animation-delay: 200ms; } .note.new:nth-child(n+7) { animation-delay: 240ms; }
@keyframes land { from { opacity: 0; translate: 0 -18px; scale: .9; } }
.empty { column-span: all; text-align: center; padding: 40px 16px; color: var(--ink-soft); font-size: 18px; font-weight: 700; }

footer { text-align: center; color: var(--ink-soft); font-size: 15px; padding: 18px 0 calc(30px + env(safe-area-inset-bottom, 0px)); }
footer p { margin: 4px 0; }
footer .link-btn { padding: 0; font-size: 15px; }

/* ---------- dialogs ---------- */
/* The box is padded by .dlg, so a click on the dialog element itself is a click on the backdrop. */
dialog.sheet { padding: 0; }
dialog.sheet.wide { width: min(760px, calc(100vw - 32px)); }
.dlg { padding: 24px 22px 20px; }
.dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.dhead h2 { margin: 0 0 4px !important; }
.dhead p { margin: 0; color: var(--ink-soft); }
.dhead .x-btn { flex: none; }
.dlg ul { margin: 0 0 12px; padding-left: 20px; }
.dlg li { margin-bottom: 6px; }
.dlg h3 { margin: 16px 0 4px; font-size: 20px; }
.dlg p { margin: 0 0 10px; }
.dlg a:not(.btn) { color: var(--coral); font-weight: 700; }

.mapbox { min-height: 120px; padding: 8px; border: var(--line) solid var(--edge); border-radius: var(--r-sm); background: color-mix(in srgb, var(--sky) 14%, var(--card)); }
.mapbox svg { display: block; width: 100%; height: auto; }
.land { fill: var(--land); stroke: var(--coast); stroke-width: .6; vector-effect: non-scaling-stroke; }
.land.has { fill: var(--land-on); cursor: pointer; }
.bub { fill: var(--coral); fill-opacity: .92; stroke: var(--edge); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: pointer; }
.bub.sel { fill: var(--grape); stroke-width: 2.5; }
.num { fill: #FFF; font-family: var(--body); font-weight: 800; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; margin: 10px 2px 4px; color: var(--ink-soft); }
.pick b { color: var(--ink); }
.pick .btn { flex: none; padding: 9px 16px; font-size: 16px; }
.rank { display: grid; gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; }
.rank button { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 4px 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; font-weight: 700; }
.rank button:hover { background: var(--bg-2); }
.rank .nm { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rank .ct { text-align: right; font-variant-numeric: tabular-nums; }
.rank .bar { grid-column: 1 / -1; height: 8px; border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.rank .bar i { display: block; height: 100%; min-width: 8px; border-radius: 999px; background: linear-gradient(90deg, var(--sun), var(--coral)); }

@media (max-width: 520px) {
  .brand { font-size: 22px; }
  .brand img { width: 28px; height: 28px; }
  .tab { font-size: 14px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .compose { padding: 20px 14px 14px; }
  .dlg { padding: 20px 16px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .note.r0, .note.r1, .note.r2, .note.r3, .note.r4, .note.r5, .note.r6 { transform: none; }
}

/* The game poster (ads.js): just the image, as large as the screen allows at its 4:5 shape. */
dialog.ad { position: fixed; inset: 0; margin: auto; width: min(calc(100% - 24px), 440px, calc((100dvh - 76px) * .8)); max-width: none; max-height: none; padding: 0; border: 0; background: none; box-shadow: none; overflow: visible; }
dialog.ad::backdrop { background: rgba(30, 14, 50, .55); backdrop-filter: blur(2px); }
dialog.ad[open] { animation: pop .3s cubic-bezier(.3, 1.5, .6, 1); }
dialog.ad a { display: block; text-decoration: none; cursor: pointer; border-radius: 22px; }
dialog.ad img { display: block; width: 100%; height: auto; border: var(--line) solid var(--edge); border-radius: 22px; box-shadow: 0 8px 0 var(--drop); }
.adtag { display: block; width: fit-content; margin: 0 auto 10px; padding: 6px 14px; border-radius: 99px; background: #FFF6E5; color: #2E1A47; font: 600 13px var(--body); }
dialog.ad a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* The ✕ sits on the poster's top corner, big enough for a thumb. */
dialog.ad .x { position: absolute; top: 44px; right: 8px; width: 40px; height: 40px; border: 2px solid #fff; border-radius: 50%; background: #2E1A47; color: #fff; font-size: 16px; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }

/* ---------- hidup's own look ----------
   seneng-base.css gives the parts (buttons, dialogs, EN | ID); these give hidup.lol its own feel: a very
   light yellow page, soft butter-yellow fills (never black), always light, also when the device is in dark mode, flat cards instead of stickers, a grotesque
   for headings, and one accent, the mood stripe, running from kesel red through neutral grey to
   seneng's colours (the same order as the mood picker). */
:root {
  --bg: #FFFBEA;
  --bg-2: #FFF3CC;
  --card: #FFFFFF;
  --fill: #FFF4C4;          /* selected tabs, chips and buttons */
  --fill-edge: #F3DE8C;
  --ink: #33302A;
  --ink-soft: #7A7466;
  --edge: #F1E3A8;
  --drop: rgba(120, 96, 20, .14);
  --note-ink: #33302A;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --line: 1.5px;
  --r: 18px;
  --r-sm: 12px;
  --spectrum: linear-gradient(90deg, #CF3B33, #F07A2E 22%, #A9A6B3 50%, #22C39A 75%, #7B5CFF);
}
body { background: var(--bg); min-height: 100vh; }
/* The stripe across the very top of the page. */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: 4px; background: var(--spectrum); z-index: 10; }
h1, h2, h3 { font-weight: 800; letter-spacing: -.02em; }

.badge { background: var(--fill); color: var(--ink); border-color: var(--fill-edge); box-shadow: none; transform: none; letter-spacing: .02em; }
.hero h1 { font-size: clamp(44px, 8.5vw, 80px); }
.hero h1::after { content: ""; display: block; width: min(220px, 50%); height: 6px; margin: 12px auto 0; border-radius: 999px; background: var(--spectrum); }
.chip, .langs, .pill-btn, .x-btn { box-shadow: none; }
.chip b { font-family: var(--display); font-weight: 800; }
.langs button[aria-pressed="true"] { background: var(--fill); color: var(--ink); }
a:hover, .link-btn:hover { color: var(--ink); }
.dlg a:not(.btn) { color: var(--ink); }

.btn, .btn.coral { background: var(--fill); color: var(--ink); border-color: var(--fill-edge); box-shadow: 0 3px 0 var(--drop); font-weight: 700; }
.btn:hover, .btn.coral:hover { color: var(--ink); }
.btn.post { background: var(--spectrum); color: #fff; border: 0; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.btn.post:hover { color: #fff; }
.toast { background: var(--fill); color: var(--ink); border-color: var(--fill-edge); }

.compose { box-shadow: 0 10px 30px -18px var(--drop), inset 0 5px 0 var(--c); }
.compose textarea, .input { background: var(--bg); }
.lvl { border-color: var(--bg-2); }
.lvl[aria-pressed="true"] { border-color: var(--ink-soft); box-shadow: none; transform: translateY(-2px); }

.tabs > div { box-shadow: none; }
.tab.h[aria-selected="true"] { background: var(--fill); color: var(--ink); }

.pill { box-shadow: none; }
.pill.on { background: var(--fill); color: var(--ink); border-color: var(--fill-edge); }

/* Notes: flat cards that keep their mood colour, upright (hidup doesn't tilt). */
.note { border-width: var(--line); border-color: rgba(51, 48, 42, .18); border-radius: 14px; box-shadow: 0 2px 0 var(--drop); }
.note.r0, .note.r1, .note.r2, .note.r3, .note.r4, .note.r5, .note.r6 { transform: none; }
.note .face { filter: none; }
/* A nod to where each note lives: kesel notes on ruled paper, seneng notes a little rounder. */
.note.from-k { background: repeating-linear-gradient(transparent 0 25px, rgba(29, 41, 70, .1) 25px 26px), var(--n); border-radius: 4px 14px 14px 4px; }
.note.from-s { border-radius: 22px; }
.by { border-top-style: solid; border-top-width: 1px; }
.by button { border-width: 1.5px; border-color: rgba(51, 48, 42, .35); }
.by .cheer.on { background: var(--fill); }

/* ---------- account: Sign in / @username in the header ---------- */
.tools { display: flex; align-items: center; gap: 8px; min-width: 0; }
/* A signed-in note: its writer's username, with a tick. The name box shows it and can't be changed. */
.by .ok { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 2px; border-radius: 50%; background: var(--note-ink); color: #fff; font-size: 10px; vertical-align: 1px; }
.compose .input:disabled { opacity: .75; cursor: not-allowed; }
.rule.signed { font-weight: 800; color: var(--ink); }
.providers { display: grid; gap: 10px; margin-top: 8px; }
.providers .btn { width: 100%; }
#uForm label { display: block; font-weight: 800; margin: 6px 0; }
#uForm input { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: var(--line) solid var(--edge); border-radius: var(--r-sm); padding: 11px 14px; }
