/* Warm Nest · base styles: fonts, tokens, the 844 × 390 stage, and the shared kit (docs/07-art-and-audio.md §7.1–7.2) */

/* Baloo 2 (SIL Open Font License), bundled so the app works offline */
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 600; src: url(../../assets/fonts/baloo-2-vietnamese-600-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 700; src: url(../../assets/fonts/baloo-2-vietnamese-700-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 800; src: url(../../assets/fonts/baloo-2-vietnamese-800-normal.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 600; src: url(../../assets/fonts/baloo-2-latin-ext-600-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 700; src: url(../../assets/fonts/baloo-2-latin-ext-700-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 800; src: url(../../assets/fonts/baloo-2-latin-ext-800-normal.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 600; src: url(../../assets/fonts/baloo-2-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 700; src: url(../../assets/fonts/baloo-2-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-display: swap; font-weight: 800; src: url(../../assets/fonts/baloo-2-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --ink: #2B2622;
  --paper: #F3ECDF;
  --paper-home: #F5F1EA;
  --card: #FFFBF2;
  --honey: #F2C94C;
  --honey-soft: #FFF3C9;
  --muted: #6B625A;
  --label: #8A7A6A;
  --coral: #D98A6A;
  --sage: #A9C4AE;
  --alert: #D9432F;
  --disabled: #EDE6DA;
  --dots: #E2D6C2;
  --edge: 0 3px 0 var(--ink);
  --font: 'Baloo 2', system-ui, -apple-system, sans-serif;
  /* the stage is drawn at 844 × 390 and scaled to the screen (src/core/stage.js) */
  --stage-scale: 1;
  --stage-x: 0px;
  --stage-y: 0px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); font-family: var(--font); }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; overscroll-behavior: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
button, input, textarea, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { overflow: visible; }

/* ---------------------------------------------------------------- the stage */
#stage {
  position: absolute; left: 0; top: 0; width: 844px; height: 390px; overflow: hidden;
  transform-origin: 0 0; transform: translate(var(--stage-x), var(--stage-y)) scale(var(--stage-scale));
  background: var(--paper);
}
.screen {
  position: absolute; inset: 0; overflow: hidden; color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dots) 1px, transparent 1.2px); background-size: 14px 14px;
}
.screen.home { background: var(--paper-home); }
.screen-enter { animation: screenIn .22s ease-out both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .screen-enter { animation: fadeIn .15s both; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* every control gets at least a 44 pt target (docs/08-language-and-accessibility.md §8.5) */
button, a, label.tap { position: relative; }
button::after, a::after, label.tap::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%);
}
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink) !important; }

/* ---------------------------------------------------------------- the kit */
.card { background: var(--card); border: 2px solid var(--ink); border-radius: 14px; box-shadow: var(--edge); }
.label { font-size: 11px; font-weight: 800; letter-spacing: 0.06em; color: var(--label); text-transform: uppercase; }
.muted { font-size: 11px; font-weight: 700; color: var(--muted); }
.btn {
  height: 40px; padding: 0 18px; border-radius: 20px; border: 2px solid var(--ink); box-shadow: var(--edge);
  background: var(--card); color: var(--ink); font-size: 14px; font-weight: 800; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none;
  transition: transform .06s, box-shadow .06s;
}
.btn.primary { background: var(--honey); }
.btn.danger { background: #FBEDEA; border-color: #B55A3C; color: #B55A3C; } /* "tap again to call it off" */
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled, .btn.off { background: var(--disabled); color: var(--label); box-shadow: none; cursor: default; }
.btn.big { height: 46px; font-size: 16px; border-radius: 23px; }
.round-btn {
  width: 40px; height: 40px; border-radius: 20px; border: 2px solid var(--ink); background: var(--card); color: var(--ink);
  box-shadow: 0 2px 0 var(--ink); display: flex; align-items: center; justify-content: center; padding: 0;
}
.round-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--ink); }
.back { position: absolute; left: 48px; top: 10px; }
.titleblock { position: absolute; left: 98px; top: 8px; line-height: 1.05; }
.titleblock .title { display: flex; align-items: center; gap: 6px; font-size: 21px; font-weight: 800; }
.titleblock .sub { font-size: 11px; font-weight: 700; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titleblock .title .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* a long typed name inside a button: cut with … rather than spill out */
.btn .clip { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topright { position: absolute; right: 16px; top: 11px; display: flex; align-items: center; gap: 8px; }
.coinchip {
  display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 7px; background: var(--card);
  border: 2px solid var(--ink); border-radius: 18px; font-size: 15px; font-weight: 800; white-space: nowrap;
}
.chip {
  height: 34px; padding: 0 12px; border-radius: 14px; border: 2px solid var(--ink); background: #FFFFFF; color: var(--ink);
  font-size: 12px; font-weight: 800; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--honey); }
.seg { display: flex; align-items: center; gap: 4px; padding: 3px; border-radius: 18px; border: 2px solid var(--ink); background: var(--card); box-shadow: var(--edge); }
.seg > button { height: 28px; padding: 0 12px; border-radius: 14px; border: 2px solid transparent; background: transparent; font-size: 13px; font-weight: 800; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.seg > button.on { background: var(--honey); border-color: var(--ink); }
.count { min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; background: var(--disabled); color: var(--label); }
.count.on { background: var(--ink); color: var(--card); }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; border-radius: 10px; background: var(--alert); color: #FFFFFF;
  border: 2px solid var(--ink); font-size: 11px; font-weight: 800; line-height: 16px; text-align: center; padding: 0 3px; pointer-events: none;
}
.field {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 14px; border: 2px solid var(--ink); background: #FFFFFF;
  font-size: 15px; font-weight: 700; color: var(--ink);
}
textarea.field { height: auto; padding: 10px 14px; resize: none; line-height: 1.35; }
.field::placeholder { color: #9C8F80; }
.hearts { display: inline-flex; gap: 2px; }
/* a reaction on the corner of an answer (Ask, Album): the bubble makes room for it below */
.has-react { position: relative; margin-bottom: 12px; }
.ask-bubble.has-react, .al-bub.has-react, .al-cb.has-react { padding-bottom: 15px; } /* (the badge never covers the words) */
.react-badge {
  position: absolute; right: 10px; bottom: -13px; width: 26px; height: 26px; border-radius: 13px; background: var(--card);
  border: 1.5px solid var(--ink); display: flex; align-items: center; justify-content: center; animation: react-pop 0.32s ease-out;
}
@keyframes react-pop { from { transform: scale(0.4); } 70% { transform: scale(1.15); } to { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .react-badge { animation: none; } }
.portrait { flex: none; border-radius: 50%; overflow: hidden; display: block; border: 2px solid var(--ink); }
.portrait.noring { border: none; }
.dish-tile { display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1.5px solid var(--ink); border-radius: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* idle loops shared by the room and screens (docs/07 §7.7) */
.bob { animation: bob 1.6s ease-in-out infinite; }
.bob2 { animation: bob 1.9s ease-in-out infinite; }
.steam { animation: steam 2.2s ease-in-out infinite; }
.jarglow { animation: jarglow 1.8s ease-in-out infinite; }
.twinkle { animation: twinkle 1.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes steam { 0% { opacity: 0; transform: translateY(3px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-7px); } }
@keyframes jarglow { 0%, 100% { opacity: .45; } 50% { opacity: 1; } }
@keyframes twinkle { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .bob, .bob2, .steam, .jarglow, .twinkle { animation: none; }
}

/* ---------------------------------------------------------------- notices from the other phone (in-app stand-in for pushes) */
#notices { position: absolute; left: 48px; right: 16px; top: 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 50; }
.notice {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 6px 14px 6px 6px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 18px; box-shadow: var(--edge);
  animation: noticeIn .3s cubic-bezier(.2, .9, .3, 1) both;
}
.notice.out { animation: noticeOut .25s ease-in both; }
.notice .ntitle { font-size: 13px; font-weight: 800; line-height: 1.1; }
.notice .nbody {
  font-size: 11px; font-weight: 700; color: var(--muted); line-height: 1.15; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.notice .ntitle { overflow-wrap: anywhere; }
.notice.error { background: #FCEBE6; }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes noticeOut { to { opacity: 0; transform: translateY(-10px); } }
@media (prefers-reduced-motion: reduce) { .notice, .notice.out { animation-name: fadeIn; } .notice.out { animation-direction: reverse; } }

/* no connection: the house is never played offline (owner, 3 Oct 2026); it covers everything until it is back */
#offline { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 0 16px 21px 48px; background: rgba(43, 38, 34, 0.45); }
#offline[hidden] { display: none; }
#offline .card { width: 380px; padding: 18px 22px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }

/* the look choices in setup sit close together: each target is 44 pt tall and meets its neighbours halfway */
.pl-opt::after { width: calc(100% + 4px); }
