/* 같이 공부해요: a study diary you decorate. Grid paper, washi tape, sticky notes, polaroids and
   sticker buttons; Jua for titles and numbers, Gaegu for handwriting, Study Sans (Pretendard) for text. */
@font-face { font-family: 'Jua'; src: url(../assets/fonts/web/jua.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Gaegu'; src: url(../assets/fonts/web/gaegu.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Study Sans'; src: url(../assets/fonts/web/sans-400.woff2) format('woff2'); font-weight: 100 549; font-display: swap; }
@font-face { font-family: 'Study Sans'; src: url(../assets/fonts/web/sans-600.woff2) format('woff2'); font-weight: 550 649; font-display: swap; }
@font-face { font-family: 'Study Sans'; src: url(../assets/fonts/web/sans-700.woff2) format('woff2'); font-weight: 650 900; font-display: swap; }

:root {
  --sky: #eaf5fb; --grid: #d6eaf3; --note: #fffdf7;
  --ink: #4a4458; --ink2: #857c94; --ink3: #b2a8bf; --line: #e9e3f0; --lip: #ddd5e7; --wash: #f4f1f8;
  --leaf: #3fb58a; --leafD: #2b8f6b; --leafL: #e4f6ee;
  --hl: #ffe46b; --hlD: #e2bf3a; --hlL: #fff6c4;
  --berry: #ff8fab; --berryD: #e86e8f; --berryL: #ffe4ec;
  --sea: #5ab4e5; --seaD: #3d93c4; --seaL: #e2f2fb;
  --lilac: #b9a3f0; --lilacL: #efe9ff; --kraft: #c9a47a;
  --title: 'Jua', 'Study Sans', sans-serif; --hand: 'Gaegu', 'Study Sans', sans-serif;
  --sans: 'Study Sans', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --shadow: 0 12px 26px -14px rgba(74, 68, 88, .5);
  --float: 0 3px 0 var(--lip), 0 14px 30px -10px rgba(40, 30, 50, .45);
  --tapeP: repeating-linear-gradient(-45deg, rgba(255, 143, 171, .55) 0 6px, rgba(255, 255, 255, .6) 6px 12px);
  --tapeG: repeating-linear-gradient(-45deg, rgba(63, 181, 138, .45) 0 6px, rgba(255, 255, 255, .55) 6px 12px);
  --tapeB: repeating-linear-gradient(-45deg, rgba(90, 180, 229, .5) 0 6px, rgba(255, 255, 255, .55) 6px 12px);
  --tapeY: repeating-linear-gradient(90deg, rgba(255, 228, 107, .85) 0 8px, rgba(255, 244, 190, .85) 8px 16px);
  --torn: polygon(0 10%, 6% 0, 12% 12%, 18% 0, 82% 0, 88% 14%, 94% 0, 100% 10%, 100% 90%, 94% 100%, 88% 86%, 82% 100%, 18% 100%, 12% 88%, 6% 100%, 0 90%);
  font-family: var(--sans); color: var(--ink); font-synthesis: none;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { font-size: 14px; background-color: var(--sky); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; background-attachment: fixed; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; font-family: var(--title); font-weight: 400; }
small { color: var(--ink2); font-weight: 400; }
.ico { width: 22px; height: 22px; flex: none; }

/* buttons: stickers with a white rim and a darker lip underneath */
button { font: inherit; font-family: var(--title); font-size: 14px; line-height: 1.15; color: var(--ink); cursor: pointer; border: 0; border-radius: 14px; padding: 8px 14px; background: #fff; box-shadow: 0 3px 0 var(--lip);
  display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: transform .08s, box-shadow .08s, filter .15s; }
button:hover { filter: brightness(.98); }
button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--lip); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
button:focus-visible { outline: 3px solid var(--sea); outline-offset: 2px; }
.primary { background: var(--leaf); color: #fff; box-shadow: inset 0 0 0 2.5px #fff, 0 3px 0 var(--leafD), 0 6px 12px -6px rgba(43, 143, 107, .6); }
.primary:active { box-shadow: inset 0 0 0 2.5px #fff, 0 1px 0 var(--leafD); }
.yellow { background: var(--hl); color: #6b5410; box-shadow: inset 0 0 0 2.5px #fff, 0 3px 0 var(--hlD); }
.yellow:active { box-shadow: inset 0 0 0 2.5px #fff, 0 1px 0 var(--hlD); }
.tag.away { opacity: .62; }
.pfAi { font-size: .85rem; color: var(--muted, #6d6875); }
.setupCard .nickNote { margin: -4px 0 10px; font-size: .82rem; line-height: 1.45; color: var(--berry, #b4405f); }
.danger { background: var(--berryL); color: #b4405f; box-shadow: 0 3px 0 #f3c2cf; }
.ghost { background: #fff; color: var(--ink); }
.sm { padding: 5px 10px; font-size: 13px; border-radius: 11px; } .sm .ico { width: 18px; height: 18px; }
.big { padding: 13px 20px; font-size: 17px; border-radius: 18px; } .big .ico { width: 26px; height: 26px; }
.round { width: 44px; height: 44px; padding: 0; border-radius: 50%; flex: none; } .round .ico { width: 26px; height: 26px; }
.wide { padding: 7px 12px 7px 9px; }
.wideBtn { width: 100%; }
.link { background: none; box-shadow: none; padding: 0; justify-self: start; font-family: var(--sans); font-size: 12.5px; color: var(--ink2); text-decoration: underline; }
.link:active { box-shadow: none; }
button small { color: inherit; opacity: .85; display: inline-flex; align-items: center; gap: 1px; font-size: .9em; } button small .ico { width: 1.15em; height: 1.15em; }

input, select { font: inherit; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 10px 12px; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leafL); }
input::placeholder { color: var(--ink3); }
input:disabled { background: var(--wash); }
input[type=range] { accent-color: var(--leaf); padding: 0; border: 0; background: none; box-shadow: none; }

.pill { display: inline-block; min-width: 22px; padding: 1px 8px; border-radius: 99px; background: var(--hlL); color: #7a5c00; box-shadow: inset 0 0 0 1.5px var(--hl); font-family: var(--title); font-size: 12px; text-align: center; vertical-align: middle; }
.pill.fr { background: var(--leafL); color: var(--leafD); box-shadow: inset 0 0 0 1.5px #bfe8d6; }
.dot, .badgeBtn em, .tabs em { background: var(--berry); color: #fff; font-style: normal; font-family: var(--title); font-size: 11px; min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 5px; border: 2px solid #fff; }
.sd { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--sc); flex: none; }
.sj { font-family: var(--title); font-weight: 400; font-size: 11.5px; color: var(--on, #fff); background: var(--sc); padding: 1px 7px; border-radius: 99px; vertical-align: 1px; }

/* washi tape with torn ends */
.tape { position: absolute; z-index: 2; left: 50%; top: -9px; width: 64px; height: 18px; margin-left: -32px; transform: rotate(-2deg); pointer-events: none; background: var(--tapeP); clip-path: var(--torn); }
.tape.green { background: var(--tapeG); } .tape.blue { background: var(--tapeB); } .tape.yellow { background: var(--tapeY); }

/* the logo: a sticker label */
.brand { display: inline-flex; align-items: center; gap: 6px; background: #fff; padding: 5px 14px 5px 9px; border-radius: 16px; transform: rotate(-1.5deg); box-shadow: 0 3px 0 var(--lip); min-width: 0; }
.brand h1 { font-size: 21px; white-space: nowrap; }
.brand .ico { width: 28px; height: 28px; }
.brand.big { padding: 8px 18px 8px 12px; } .brand.big h1 { font-size: 30px; } .brand.big .ico { width: 40px; height: 40px; }

/* ---------------------------------------------------------------- first run */
.setup { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.setupCard { position: relative; width: min(760px, 100%); background: var(--note); border-radius: 24px; padding: 30px 26px 26px; box-shadow: var(--shadow); display: grid; gap: 16px; }
.setupCard .brand { justify-self: start; }
.lead { margin: -4px 0 0; font-family: var(--hand); font-size: 19px; letter-spacing: -.5px; line-height: 1.35; color: var(--ink2); }
.setupCard label, .label { display: grid; gap: 6px; font-family: var(--title); font-size: 15px; }
.setupCard .label { display: flex; align-items: baseline; gap: 8px; } .label small { font-family: var(--hand); font-size: 16px; letter-spacing: -.3px; } .label .tip { margin-left: auto; }
.chars { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 10px; max-height: 52vh; overflow: auto; padding: 6px 4px 10px; }
.char { position: relative; display: grid; gap: 4px; justify-items: center; padding: 6px 6px 8px; background: #fff; border-radius: 4px; font-family: var(--hand); font-size: 16px; letter-spacing: -.5px; box-shadow: 0 5px 10px -6px rgba(74, 68, 88, .5); }
.char:nth-child(3n+1) { transform: rotate(-1.2deg); } .char:nth-child(3n+2) { transform: rotate(.9deg); }
.char img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 2px; background: radial-gradient(circle at 50% 42%, #fff7e0, #ffe3ea); }
.char span { line-height: 1.15; text-align: center; }
.char.on { box-shadow: 0 0 0 3px var(--leaf), 0 6px 14px -6px rgba(43, 143, 107, .6); }
.char.locked { cursor: help; opacity: 1; }
.char.locked img { filter: brightness(0) opacity(.2); background: var(--wash); }
.char.locked span { display: flex; align-items: center; gap: 2px; font-family: var(--sans); font-size: 10.5px; letter-spacing: 0; color: var(--ink2); }
.char.locked span .ico { width: 14px; height: 14px; }
.char em { position: absolute; left: 12px; right: 12px; top: 12px; height: 6px; border-radius: 4px; background: #efe9f5; overflow: hidden; }
.char em::after { content: ''; position: absolute; inset: 0; width: var(--p); background: var(--hl); }

/* ---------------------------------------------------------------- lobby */
.lobby { height: 100%; display: flex; flex-direction: column; padding: 14px 18px 16px; gap: 14px; max-width: 1500px; margin: 0 auto; }
.top { display: flex; align-items: center; gap: 10px; }
.topR { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.goldChip { font-size: 16px; padding: 4px 12px 4px 5px; border-radius: 99px; background: var(--hlL); color: #6b5410; box-shadow: inset 0 0 0 2px var(--hl), 0 3px 0 var(--hlD); }
.goldChip:active { box-shadow: inset 0 0 0 2px var(--hl), 0 1px 0 var(--hlD); }
.goldChip .ico { width: 26px; height: 26px; } .goldChip b { font-weight: 400; }
.musicBtn.off .ico { opacity: .8; }
.badgeBtn { position: relative; } .badgeBtn em { position: absolute; top: -7px; right: -7px; }
.meCard { display: flex; align-items: center; gap: 8px; background: #fff; border-radius: 99px; padding: 4px 14px 4px 4px; box-shadow: 0 3px 0 var(--lip); cursor: pointer; }
.meCard img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--berryL); }
.meCard div { display: grid; line-height: 1.2; } .meCard b { font-family: var(--title); font-weight: 400; font-size: 15px; white-space: nowrap; } .meCard small { font-size: 12px; white-space: nowrap; }
.cols { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(340px, 430px) 1fr minmax(260px, 300px); gap: 18px; }
.panel { position: relative; min-height: 0; display: flex; flex-direction: column; gap: 12px; background: #fff; border-radius: 20px; padding: 20px 16px 16px; box-shadow: var(--shadow); }
.panel h2 { display: flex; align-items: center; gap: 6px; font-size: 17px; }
.panel h2 .ico { width: 24px; height: 24px; }
.panel h2 small { margin-left: 2px; font-family: var(--hand); font-size: 16px; letter-spacing: -.5px; }
.roomsPane { background: none; box-shadow: none; padding: 4px 8px 30px; overflow: auto; gap: 14px; }
.roomsPane > h2 { margin-top: 8px; }
.side { gap: 18px; overflow: auto; } .side > section { display: grid; gap: 9px; }
.side > .tape { top: 3px; }

/* today: a big number with a highlighter stroke for the goal */
.goalCard { padding: 4px 2px 0; }
.goalCard .today { display: flex; align-items: baseline; gap: 6px; }
.goalCard .today b { font-family: var(--title); font-weight: 400; font-size: 46px; line-height: 1; letter-spacing: -.5px; }
.goalCard .today small { font-family: var(--title); font-size: 18px; }
.hlbar { position: relative; height: 14px; margin: 12px 2px 8px; }
.hlbar::before { content: ''; position: absolute; left: 0; right: 0; top: 6px; border-bottom: 2px dashed #b8cfdb; }
.hlbar i { position: absolute; left: -4px; top: 0; bottom: 0; max-width: calc(100% + 4px); background: var(--hl); border-radius: 4px 9px 6px 10px; transform: skewX(-8deg); transition: width .6s; }
.hlbar em { position: absolute; right: 0; top: -27px; font-style: normal; font-family: var(--hand); font-size: 19px; letter-spacing: -.5px; color: var(--ink2); }
.todayInfo { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 13.5px; color: var(--ink2); }
.todayInfo span { display: inline-flex; align-items: center; gap: 4px; } .todayInfo .ico { width: 20px; height: 20px; }
.todayInfo img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; background: #ffe9d6; border: 1.5px solid #fff; }
.todayInfo .win { color: var(--leafD); font-family: var(--title); }

/* today's missions: a sticky note with a friend peeking over it */
.missionCard { position: relative; margin: 30px 6px 4px; padding: 20px 14px 10px; display: grid; gap: 1px; background: linear-gradient(#fff8b8, #fff1a0); border-radius: 2px 2px 16px 2px; transform: rotate(-1deg); box-shadow: 2px 7px 12px -6px rgba(74, 68, 88, .4); }
.missionCard h3 { font-size: 17px; margin-bottom: 4px; }
.missionCard > .tape { left: 20%; transform: rotate(3deg); }
.peek { position: absolute; right: 10px; top: -32px; width: 56px; height: 56px; border-radius: 50%; border: 3px solid #fff; background: var(--berryL); box-shadow: 0 3px 0 #e9d7a0; overflow: hidden; }
.peek img { width: 100%; height: 100%; object-fit: cover; }
.say { position: absolute; z-index: 3; right: 72px; top: -24px; max-width: calc(100% - 90px); padding: 4px 11px; background: #fff; border-radius: 14px 14px 4px 14px; font-family: var(--hand); font-size: 17px; letter-spacing: -.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 2px 0 #e3dceb; }
.mis { display: flex; align-items: center; gap: 9px; min-height: 36px; font-size: 14px; }
.mis p { margin: 0; flex: 1; min-width: 0; }
.box { position: relative; flex: none; width: 21px; height: 21px; padding: 0; border: 2.4px solid var(--ink); border-radius: 5px 6px 4px 6px; background: #fff; box-shadow: none; }
.box:active { box-shadow: none; }
.mis.done .box::after, .mis.got .box::after, .box.on::after { content: ''; position: absolute; left: 3px; top: -3px; width: 13px; height: 7px; border-left: 3px solid var(--leaf); border-bottom: 3px solid var(--leaf); transform: rotate(-48deg); }
.mis.got p { color: var(--ink2); text-decoration: line-through; text-decoration-color: rgba(74, 68, 88, .35); }
.mis em { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-family: var(--title); font-size: 14px; color: #8a6a10; }
.mis em .ico { width: 18px; height: 18px; }
.mis .yellow { padding: 4px 11px 4px 6px; font-size: 14px; } .mis .yellow .ico { width: 20px; height: 20px; }

/* rooms: polaroids taped to the page (one column filling the card: a button's grid shrank it to the room's name, so
   short names had small photos) */
.rooms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 14px; padding: 6px 2px; }
.roomCard { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; justify-items: stretch; gap: 0; text-align: left; padding: 7px 7px 9px; background: #fff; border-radius: 3px; font-family: inherit; box-shadow: 0 7px 14px -7px rgba(74, 68, 88, .55); }
.roomCard:nth-child(4n+1) { transform: rotate(-1.4deg); } .roomCard:nth-child(4n+2) { transform: rotate(1.2deg); } .roomCard:nth-child(4n+3) { transform: rotate(.7deg); } .roomCard:nth-child(4n) { transform: rotate(-.9deg); }
.roomCard:hover:not(:disabled) { filter: none; transform: translateY(-2px); box-shadow: 0 12px 18px -8px rgba(74, 68, 88, .55); }
.roomCard:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 5px 10px -6px rgba(74, 68, 88, .55); }
.roomCard:disabled { opacity: .75; }
.roomCard .tape { left: 30%; top: -8px; width: 54px; height: 16px; margin-left: -27px; }
.roomCard:nth-child(3n+2) .tape { background: var(--tapeB); } .roomCard:nth-child(3n) .tape { background: var(--tapeY); }
.thumb { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 2px; background: #e9eef3 center 58% / cover no-repeat; }
.stamp { position: absolute; z-index: 3; right: -10px; top: -10px; padding: 2px 8px; border: 2.5px solid #fff; border-radius: 99px; background: var(--leaf); color: #fff; font-family: var(--title); font-size: 12.5px; white-space: nowrap; transform: rotate(-5deg); box-shadow: 0 2px 0 var(--leafD); }
.stamp.full { background: var(--berry); box-shadow: 0 2px 0 var(--berryD); }
.stamp.empty { background: #fff; color: var(--ink2); box-shadow: 0 2px 0 var(--lip); }
.stamp.mine { background: var(--lilac); box-shadow: 0 2px 0 #9479d8; }
.roomCard > b { display: block; margin: 7px 2px 3px; font-family: var(--hand); font-weight: 400; font-size: 20px; letter-spacing: -1px; line-height: 1.1; }
.faces { display: flex; align-items: center; min-height: 25px; margin: 0 2px; }
.faces img { width: 24px; height: 24px; margin-left: -6px; border-radius: 50%; border: 2px solid #fff; background: #ffe9d6; object-fit: cover; }
.faces img:first-child { margin-left: 0; }
.faces em { margin-left: auto; font-style: normal; font-family: var(--title); font-size: 12px; color: var(--ink3); }

/* lobby chat */
.chat { padding-bottom: 14px; }
.chatLog { list-style: none; margin: 0; padding: 0 4px 0 0; flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.chatLog li { display: flex; gap: 8px; align-items: flex-start; }
.chatLog li.sys { align-self: center; max-width: 88%; padding: 3px 14px; background: var(--hlL); border-radius: 3px; transform: rotate(-1deg); font-family: var(--hand); font-size: 15px; letter-spacing: -.5px; line-height: 1.3; text-align: center; color: var(--ink2); }
.chatLog img { width: 36px; height: 36px; flex: none; border-radius: 50%; object-fit: cover; background: #ffe9d6; border: 2px solid #fff; box-shadow: 0 2px 0 var(--lip); cursor: pointer; }
.chatLog b { font-family: var(--title); font-weight: 400; font-size: 13px; cursor: pointer; } .chatLog time { font-family: var(--sans); font-size: 11px; color: var(--ink3); }
.chatLog p { display: inline-block; margin: 3px 0 0; padding: 8px 12px; background: var(--wash); border-radius: 4px 16px 16px 16px; line-height: 1.45; word-break: break-word; }
.chatLog li.mine { flex-direction: row-reverse; text-align: right; }
.chatLog li.mine p { background: var(--leafL); border-radius: 16px 4px 16px 16px; }
.chatForm { display: flex; gap: 8px; } .chatForm button { flex: none; white-space: nowrap; }

/* my record, ranking, who is here */
.tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tool { justify-content: flex-start; gap: 5px; padding: 7px 8px; font-size: 13.5px; white-space: nowrap; border-radius: 14px; box-shadow: inset 0 0 0 1.5px var(--line), 0 3px 0 var(--lip); }
.tool .ico { width: 24px; height: 24px; }
.medalStrip { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 30px; }
.medalStrip span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 15px; box-shadow: 0 0 0 2.5px var(--tc), 0 2px 0 2.5px rgba(0, 0, 0, .08); }
.medalStrip small { margin-left: 4px; font-family: var(--hand); font-size: 15px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; height: 84px; align-items: end; }
.week .bar { display: grid; grid-template-rows: 1fr auto; height: 100%; justify-items: center; gap: 4px; font-family: var(--title); font-size: 11.5px; color: var(--ink3); }
.week .bar i { position: relative; display: block; width: 72%; align-self: end; min-height: 4px; background: #d5e9f4; border-radius: 6px 6px 3px 3px; }
.week .bar i b { position: absolute; bottom: 100%; left: 50%; margin-bottom: 3px; transform: translateX(-50%); font-weight: 400; font-size: 11px; white-space: nowrap; color: var(--ink2); }
.week .bar.today i b { color: var(--ink); }
.week { padding-top: 16px; }
.week .bar.hit i { background: var(--leaf); }
.week .bar.today i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--hl); }
.week .bar.today span { color: var(--ink); }
.recSum { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink2); }
.recSum b { font-family: var(--title); font-weight: 400; font-size: 15px; color: var(--ink); }
.rTabs { display: inline-flex; gap: 3px; margin-left: auto; }
.rTabs b { padding: 3px 9px; border-radius: 99px; background: var(--wash); color: var(--ink2); font-family: var(--title); font-weight: 400; font-size: 12px; cursor: pointer; }
.rTabs b.on { background: var(--hl); color: var(--ink); box-shadow: 0 2px 0 var(--hlD); }
.people, .rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rank li { display: grid; grid-template-columns: 26px 1fr auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 10px; font-size: 13.5px; cursor: pointer; }
.rank li.me { background: var(--hlL); }
.rank em { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--wash); color: var(--ink2); font-style: normal; font-family: var(--title); font-size: 12.5px; }
.rank em.m0 { background: #ffd34d; color: #6b4b00; box-shadow: 0 2px 0 #e2a92e; } .rank em.m1 { background: #dfe3ea; color: #4b5260; box-shadow: 0 2px 0 #b9c0cc; } .rank em.m2 { background: #f2c09a; color: #6b3d1c; box-shadow: 0 2px 0 #d39a6e; }
.rank b { font-family: var(--title); font-weight: 400; } .rank span { font-family: var(--title); font-size: 13px; color: var(--ink2); }
.rank li.gap { display: block; padding: 0; text-align: center; color: var(--ink3); cursor: default; }
.rankMe { display: flex; flex-wrap: wrap; gap: 6px; }
.rankMe span { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 99px; background: var(--wash); color: var(--ink2); font-family: var(--title); font-size: 12.5px; } .rankMe .ico { width: 16px; height: 16px; }
.rankMe .up { background: var(--leafL); color: var(--leafD); } .rankMe .down { background: var(--berryL); color: #b4405f; }
.people li { display: flex; gap: 9px; align-items: center; cursor: pointer; }
.people div { display: grid; line-height: 1.25; min-width: 0; }
.people b { font-family: var(--title); font-weight: 400; font-size: 14px; } .people li.me b { color: var(--leafD); }
.people small { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people li.fr b::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 5px; border-radius: 50%; background: var(--berry); vertical-align: 2px; }
.av { position: relative; flex: none; }
.av img { display: block; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: #ffe9d6; }
.av i { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: var(--ink3); }
.av i.st { background: var(--leaf); } .av i.lb { background: var(--hl); } .av i.rm { background: var(--sea); } .av i.off { background: #d9d3e2; }
.tabs { display: none; }

/* ---------------------------------------------------------------- room */
.room { position: fixed; inset: 0; background: linear-gradient(#f6efe2, #efe4d0); }
.stage { position: absolute; inset: 0; overflow: hidden; }
.stage canvas.world { display: block; width: 100%; height: 100%; }
.tags, .pins, .emos { position: absolute; inset: 0; pointer-events: none; }
.tag { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 5px; padding: 2px 8px; white-space: nowrap; background: #fff; color: var(--ink); border-radius: 9px; font-family: var(--title); font-size: 12.5px; box-shadow: 0 2px 0 var(--lip), 0 3px 8px rgba(40, 30, 50, .22); will-change: transform; }
.tag b { font-weight: 400; } .tag span { color: var(--leafD); font-variant-numeric: tabular-nums; }
.tag.me { background: var(--hlL); box-shadow: 0 2px 0 var(--hlD), 0 3px 8px rgba(40, 30, 50, .22); }
.tag.bot { opacity: .94; }
.tag .bdg { font-style: normal; margin-right: 3px; }
.tag.fr b::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--berry); vertical-align: 1px; }
.tags[data-mode=me] .tag:not(.me), .tags[data-mode=none] .tag, .tags[data-mode=friends] .tag:not(.me):not(.fr) { display: none; }
.tags[data-info=name] .tag span { display: none; }
.emos[data-others=hide] .emo:not(.me) { display: none; }
.pin, .pin:active { position: absolute; left: 0; top: 0; width: 28px; height: 32px; padding: 0; background: none; box-shadow: none; pointer-events: auto; animation: bob 1.8s ease-in-out infinite; }
.pin i { display: block; width: 22px; height: 22px; margin: 0 auto; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2.4px solid var(--ink); background: radial-gradient(circle at 50% 50%, #fff 0 3.5px, var(--hl) 4.5px); }
.pin:hover i { background: radial-gradient(circle at 50% 50%, #fff 0 3.5px, var(--berry) 4.5px); }
@keyframes bob { 50% { margin-top: -4px; } }
.emo { position: absolute; left: 0; top: 0; transition: opacity .5s; }
.emo i { position: relative; display: block; padding: 6px 8px 7px; background: #fff; border-radius: 18px; font-style: normal; font-size: 30px; line-height: 1; transform-origin: 50% 100%; box-shadow: 0 3px 0 var(--lip), 0 6px 14px rgba(40, 30, 50, .22); }
.emo i::after { content: ''; position: absolute; left: 50%; bottom: -6px; width: 12px; height: 12px; background: #fff; transform: translateX(-50%) rotate(45deg); border-radius: 2px; }
.emo i.pop { animation: emoPop .45s cubic-bezier(.2, 1.6, .4, 1); }
.emo.fade { opacity: 0; }
@keyframes emoPop { 0% { scale: .3; } 70% { scale: 1.12; } 100% { scale: 1; } }

.hud { position: absolute; z-index: 4; left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud .round { box-shadow: 0 3px 0 var(--lip), 0 4px 10px rgba(40, 30, 50, .25); }
.hudTitle { margin-right: auto; min-width: 0; display: flex; align-items: baseline; gap: 6px; padding: 6px 14px 6px 12px; background: #fff7d6; border-radius: 3px; font-family: var(--title); font-size: 18px; transform: rotate(-2deg); box-shadow: 0 3px 8px rgba(40, 30, 50, .3); }
.hudTitle b { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hudTitle span { flex: none; font-size: 13px; color: var(--leafD); }
.viewPick { position: absolute; z-index: 6; right: 12px; top: calc(66px + env(safe-area-inset-top)); width: min(300px, calc(100% - 24px)); display: grid; gap: 10px; padding: 12px; background: var(--note); border-radius: 18px; box-shadow: var(--float); }
.viewPick > b { font-family: var(--title); font-weight: 400; font-size: 15px; }
.vpTurn { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px; background: var(--wash); border-radius: 14px; font-family: var(--title); font-size: 13px; color: var(--ink2); }
.vpTurn .round { width: 40px; height: 40px; } .vpTurn .round .ico { width: 24px; height: 24px; }
.emoBar { position: absolute; z-index: 4; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 8px; }
.emoBtns { display: grid; gap: 10px; }
.emoBtn { width: 48px; height: 48px; } .emoBtn .ico { width: 28px; height: 28px; }
.emoPick { display: flex; flex-wrap: wrap; gap: 4px; max-width: 280px; padding: 8px; background: var(--note); border-radius: 18px; box-shadow: var(--float); }
.emoPick button { padding: 4px 6px; background: none; box-shadow: none; font-family: inherit; font-size: 24px; }
.emoPick button:hover { background: var(--wash); }

/* the study timer: a desk timer with a subject tab on top and the pet beside it */
.timerCard { position: absolute; z-index: 4; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: min(440px, calc(100% - 28px)); transform: translateX(-50%); padding: 16px 16px 12px; background: #fff; border-radius: 26px; box-shadow: 0 5px 0 #dcd3e6, 0 12px 26px rgba(40, 30, 50, .3); }
.subjTab, .subjTab:active { position: absolute; left: 22px; top: -28px; height: 31px; gap: 4px; padding: 4px 12px 8px; border-radius: 12px 12px 0 0; background: var(--sc, var(--sea)); color: var(--on, #fff); font-size: 15px; box-shadow: none; transform: none; }
.subjTab .ico { width: 20px; height: 20px; }
.tRow { display: flex; align-items: center; gap: 12px; }
.tMain { display: grid; flex: 1; min-width: 0; line-height: 1.1; }
.tMain small { margin-bottom: 2px; font-family: var(--hand); font-size: 19px; letter-spacing: -.5px; color: var(--leafD); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tMain b { font-family: var(--title); font-weight: 400; font-size: 44px; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.timerCard:not(.live) .tMain b { color: var(--ink3); } .timerCard:not(.live) .tMain small { color: var(--ink2); }
.timerCard.rest .tMain small { color: #b8860b; } .timerCard.rest .tMain b { color: #c99a2e; }
.tRow button { flex: none; padding: 10px 14px; font-size: 15px; } .tRow .ico { width: 24px; height: 24px; }
.tGoal { position: relative; height: 12px; margin: 10px 2px 5px; }
.tGoal::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; border-bottom: 2px dashed #d6cde2; }
.tGoal i { position: absolute; left: -3px; top: 0; bottom: 0; width: 0; max-width: calc(100% + 3px); background: var(--hl); border-radius: 4px 10px 6px 10px; transform: skewX(-8deg); transition: width .6s; }
.tFoot { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink2); }
.tFoot .win { color: var(--leafD); font-family: var(--title); }
.petSay { position: absolute; right: 16px; top: -46px; display: flex; align-items: flex-end; pointer-events: none; }
.petSay .bubble { margin: 0 -4px 24px 0; padding: 3px 10px; background: #fff; border-radius: 14px 14px 4px 14px; font-family: var(--hand); font-size: 16px; letter-spacing: -.5px; white-space: nowrap; box-shadow: 0 2px 0 #e3dceb, 0 3px 8px rgba(40, 30, 50, .15); }
.petFace { width: 58px; height: 58px; display: grid; place-items: center; border: 3px solid #fff; border-radius: 20px; font-size: 34px; transform: rotate(8deg); box-shadow: 0 3px 0 rgba(0, 0, 0, .12), 0 4px 10px rgba(40, 30, 50, .2); }
.subjPick { position: absolute; z-index: 6; left: 50%; bottom: calc(200px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: min(92vw, 520px); display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 10px; background: var(--note); border-radius: 18px; box-shadow: var(--float); }
.subjPick button { padding: 7px 12px 7px 10px; font-size: 14px; }
.subjPick button.on { box-shadow: inset 0 0 0 2.5px var(--sc, var(--leaf)), 0 3px 0 var(--lip); }

.hint { position: absolute; z-index: 3; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); margin: 0; padding: 8px 16px; background: var(--note); color: var(--ink); border-radius: 14px; font-size: 13px; line-height: 1.55; text-align: center; white-space: pre-line; box-shadow: 0 3px 0 var(--lip), 0 8px 20px rgba(40, 30, 50, .25); transition: opacity .6s; }
.hint.dim { opacity: 0; pointer-events: none; }
.toast { position: absolute; z-index: 8; left: 50%; top: calc(70px + env(safe-area-inset-top)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); display: flex; align-items: center; gap: 6px; padding: 8px 16px; background: #fff; color: var(--ink); border-radius: 14px; font-family: var(--title); font-size: 14.5px; box-shadow: 0 3px 0 var(--lip), 0 10px 24px rgba(40, 30, 50, .3); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast.on { opacity: 1; }
.ltoast { position: fixed; z-index: 45; max-width: min(92vw, 420px); }
.fade { position: fixed; inset: 0; z-index: 50; background: #2a2430; opacity: 0; pointer-events: none; transition: opacity .26s; }
.fade.on { opacity: 1; pointer-events: auto; }
.boot { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background-color: var(--sky); background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; }
.boot > div { display: grid; justify-items: center; gap: 4px; padding: 22px 30px; background: var(--note); border-radius: 20px; box-shadow: var(--shadow); }
.boot .ico { width: 46px; height: 46px; } .boot b { font-family: var(--title); font-weight: 400; font-size: 22px; } .boot small { font-family: var(--hand); font-size: 17px; letter-spacing: -.3px; }

/* my room: the furniture catalogue */
.decor { position: absolute; z-index: 4; left: 12px; right: 12px; bottom: calc(196px + env(safe-area-inset-bottom)); display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.decor > * { pointer-events: auto; }
.catalog { width: min(900px, 100%); max-height: 40vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px; background: var(--note); border-radius: 18px; box-shadow: var(--float); }
.catItems { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 7px; }
.catItems button { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 6px 4px 7px; font-size: 12.5px; line-height: 1.15; }
.catItems button img { width: 60px; height: 60px; object-fit: contain; }
.catItems button span { min-height: 2.3em; display: grid; place-items: center; text-align: center; word-break: keep-all; }
.catItems button.on { background: var(--leaf); color: #fff; box-shadow: 0 3px 0 var(--leafD); }
.catItems button.locked { background: var(--wash); color: var(--ink2); }
.catItems button small { color: #8a6a10; font-family: var(--title); font-size: 12px; }
.catItems button.locked img { opacity: .7; }
.decorSel { display: flex; gap: 6px; padding: 6px; background: var(--note); border-radius: 16px; box-shadow: var(--float); }
.decorSel button { padding: 7px 11px; font-size: 14px; } .decorSel .ico { width: 18px; height: 18px; }

/* the beach: fishing, diving, coming back up */
.diveBtn { position: absolute; z-index: 4; left: 50%; bottom: calc(216px + env(safe-area-inset-bottom)); transform: translateX(-50%); padding: 11px 20px 11px 14px; border-radius: 99px; background: var(--sea); color: #fff; font-size: 16px; white-space: nowrap; box-shadow: inset 0 0 0 3px #fff, 0 4px 0 var(--seaD), 0 10px 22px rgba(20, 70, 110, .35); animation: hover 1.8s ease-in-out infinite; }
.diveBtn:active { transform: translate(-50%, 2px); }
.diveBtn .ico { width: 26px; height: 26px; }
.diveBtn.fish { bottom: calc(276px + env(safe-area-inset-bottom)); background: var(--hl); color: #6b5410; box-shadow: inset 0 0 0 3px #fff, 0 4px 0 var(--hlD), 0 10px 22px rgba(110, 80, 20, .3); }
.diveBtn.up { bottom: calc(24px + env(safe-area-inset-bottom)); }
@keyframes hover { 50% { transform: translate(-50%, -4px); } }
.fishGame { position: absolute; z-index: 7; left: 0; right: 0; bottom: calc(200px + env(safe-area-inset-bottom)); width: min(92vw, 380px); margin: auto; display: grid; gap: 10px; padding: 16px 14px 14px; text-align: center; background: var(--note); border-radius: 22px; box-shadow: 0 4px 0 var(--lip), 0 16px 34px -12px rgba(40, 30, 50, .5); }
.fgSea { position: relative; height: 110px; overflow: hidden; border-radius: 16px; background: linear-gradient(180deg, #a8def3, #4aa8d4); box-shadow: inset 0 0 0 3px #fff; }
.fgBob { position: absolute; left: 50%; top: 46px; width: 18px; height: 26px; margin-left: -9px; border: 2px solid var(--ink); border-radius: 9px 9px 12px 12px; background: linear-gradient(var(--berry) 50%, #fff 50%); animation: bob 1.6s ease-in-out infinite; }
.fgBob.bite { animation: bite .18s ease-in-out infinite; }
@keyframes bite { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(10px); } }
.fgBang { position: absolute; left: 50%; top: 4px; margin-left: 16px; font-family: var(--title); font-size: 36px; color: #fff; text-shadow: 0 3px 0 var(--berryD); opacity: 0; transition: opacity .1s; }
.fgBang.on { opacity: 1; }
.fgMsg { margin: 0; font-family: var(--hand); font-size: 19px; letter-spacing: -.5px; } .fgMsg b { font-family: var(--title); font-weight: 400; }
.fgBtns { display: flex; gap: 8px; justify-content: center; align-items: center; }
.fgPull { padding: 12px 30px; font-size: 18px; }

/* a new character, medal or catch: a sticker that drops in */
.unlock { position: fixed; z-index: 60; left: 50%; top: calc(18px + env(safe-area-inset-top)); transform: translate(-50%, -170%); width: max-content; max-width: calc(100% - 24px); display: flex; gap: 12px; align-items: center; padding: 12px 18px 12px 12px; background: var(--note); border-radius: 18px; box-shadow: 0 4px 0 var(--hlD), 0 16px 36px rgba(40, 30, 50, .35); transition: transform .45s cubic-bezier(.2, 1.4, .4, 1); }
.unlock.on { transform: translate(-50%, 0); }
.unlock::before { content: ''; position: absolute; left: 50%; top: -8px; width: 70px; height: 18px; margin-left: -35px; transform: rotate(-3deg); background: var(--tapeY); clip-path: var(--torn); }
.unlock img { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; background: radial-gradient(circle at 50% 42%, #fff7e0, #ffe3ea); }
.uIco { width: 60px; height: 60px; display: grid; place-items: center; flex: none; border-radius: 16px; background: var(--hlL); font-size: 34px; } .uIco .ico { width: 40px; height: 40px; }
.unlock div { display: grid; line-height: 1.25; } .unlock small { font-family: var(--hand); font-size: 16px; letter-spacing: -.3px; } .unlock b { font-family: var(--title); font-weight: 400; font-size: 19px; } .unlock div > span { font-size: 12.5px; color: var(--ink2); }

/* ---------------------------------------------------------------- sheets: a page of the planner */
.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(58, 50, 74, .42); }
.sheet { position: relative; width: min(640px, 100%); max-height: calc(100% - 32px); overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; padding: 24px 20px 24px; background: var(--note); border-radius: 22px; box-shadow: 0 24px 60px -20px rgba(40, 30, 60, .55); }
.sheet::before { content: ''; position: absolute; left: 50%; top: 2px; width: 84px; height: 18px; margin-left: -42px; transform: rotate(-2deg); background: var(--tapeP); clip-path: var(--torn); pointer-events: none; }
#settings .sheet::before, #record .sheet::before { background: var(--tapeG); } #social .sheet::before, #book .sheet::before { background: var(--tapeB); } #shop .sheet::before, #medals .sheet::before { background: var(--tapeY); }
.sheet > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.sheet > header h2 { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 22px; }
.sheet > header h2 .ico { width: 28px; height: 28px; }
.sheet > header h2 small { display: inline-flex; align-items: center; gap: 3px; font-family: var(--hand); font-size: 18px; letter-spacing: -.5px; } .sheet > header h2 small .ico { width: 20px; height: 20px; }
#castBody, #settingsBody, #socialBody, #medalsBody, #shopBody, #petBody, #bookBody, #plannerBody, #recordBody { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; min-width: 0; }
.sheet .close { width: 38px; height: 38px; } .sheet .close .ico { width: 20px; height: 20px; }
.sheet section { display: grid; gap: 9px; padding-bottom: 16px; border-bottom: 2px dashed var(--line); }
.sheet section:last-child { padding-bottom: 0; border: 0; }
.sheet h3 { display: flex; align-items: center; gap: 6px; margin-top: 2px; font-size: 17px; }
.sheet h3 .ico { width: 24px; height: 24px; } .sheet h3 small { font-family: var(--hand); font-size: 16px; }
.lbl { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; font-family: var(--title); font-size: 14px; } .lbl small { font-family: var(--sans); font-size: 12px; }
.muted { margin: 0; color: var(--ink2); font-size: 13px; line-height: 1.55; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 6px 12px; border-radius: 99px; background: #fff; font-size: 13.5px; box-shadow: inset 0 0 0 1.5px var(--line), 0 2px 0 var(--lip); }
.seg button.on { background: var(--leaf); color: #fff; box-shadow: inset 0 0 0 2px #fff, 0 2px 0 var(--leafD); }
.row { display: flex; gap: 8px; align-items: center; } .row button { flex: none; white-space: nowrap; }
.av48 { width: 46px; height: 46px; flex: none; border-radius: 50%; object-fit: cover; background: #ffe9d6; border: 2px solid #fff; box-shadow: 0 2px 0 var(--lip); }
.catTabs { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 10px; border-bottom: 2px dashed var(--line); }
.catTabs span { padding: 6px 13px; border-radius: 12px; background: var(--wash); color: var(--ink2); font-family: var(--title); font-size: 14px; cursor: pointer; }
.catTabs span.on { background: var(--hl); color: var(--ink); box-shadow: 0 2px 0 var(--hlD); }
.blockedList { display: grid; gap: 6px; } .blockedList .bl { display: flex; align-items: center; gap: 8px; } .blockedList .bl img { width: 30px; height: 30px; border-radius: 50%; } .blockedList .bl button { margin-left: auto; }

/* characters */
.castNow { display: flex; gap: 14px; align-items: center; padding: 10px; background: #fff; border-radius: 6px; box-shadow: var(--shadow); transform: rotate(-.6deg); }
.castNow img { width: 96px; height: 96px; object-fit: contain; border-radius: 4px; background: radial-gradient(circle at 50% 42%, #fff7e0, #ffe3ea); }
.castNow div { display: grid; gap: 2px; } .castNow small { font-family: var(--hand); font-size: 16px; } .castNow b { font-family: var(--title); font-weight: 400; font-size: 22px; } .castNow span { font-size: 12.5px; color: var(--ink2); }
.chars.big { max-height: none; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }

/* records */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpis div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 3px 3px 12px 3px; box-shadow: 1px 4px 8px -5px rgba(74, 68, 88, .45); }
.kpis div:nth-child(1) { background: var(--hlL); transform: rotate(-1deg); } .kpis div:nth-child(2) { background: var(--berryL); transform: rotate(.8deg); } .kpis div:nth-child(3) { background: var(--seaL); transform: rotate(-.6deg); } .kpis div:nth-child(4) { background: var(--leafL); transform: rotate(1deg); }
.kpis small { font-family: var(--hand); font-size: 15px; } .kpis b { font-family: var(--title); font-weight: 400; font-size: 20px; }
.chart { position: relative; display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 4px; height: 170px; align-items: end; }
.chart .bar { display: grid; grid-template-rows: auto 1fr auto; height: 100%; justify-items: center; gap: 3px; font-family: var(--title); font-size: 10.5px; color: var(--ink3); }
.chart .bar i { display: block; width: 74%; align-self: end; min-height: 3px; background: #d5e9f4; border-radius: 6px 6px 3px 3px; }
.chart .bar.hit i { background: var(--leaf); } .chart .bar.today i { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--hl); } .chart .bar.today span:last-child { color: var(--ink); }
.chart .bar .v { align-self: end; font-size: 10px; color: var(--ink2); }
.chart::after { content: ""; position: absolute; left: 0; right: 0; bottom: calc(18px + (100% - 36px) * var(--g)); border-top: 2px dashed rgba(255, 143, 171, .75); pointer-events: none; }
.roomBars { display: grid; gap: 7px; }
.roomBars div { display: grid; grid-template-columns: 112px 1fr 96px; gap: 8px; align-items: center; font-size: 13px; }
.roomBars div span { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roomBars div > i { height: 12px; min-width: 3px; border-radius: 4px 8px 6px 8px; background: var(--sc, var(--sea)); transform: skewX(-8deg); }
.roomBars b { text-align: right; font-family: var(--title); font-weight: 400; color: var(--ink2); white-space: nowrap; }
.sessions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sessions li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 12px; background: #fff; border-radius: 12px; font-size: 13.5px; box-shadow: 0 2px 0 var(--lip); }
.sessions b { font-weight: 600; } .sessions span { font-size: 12.5px; color: var(--ink2); } .sessions em { font-style: normal; font-family: var(--title); color: var(--leafD); }
.sessions .empty { display: block; text-align: center; color: var(--ink2); }

/* someone's profile, friends and whispers */
.sheet.small { width: min(440px, 100%); }
.pf { display: flex; gap: 16px; align-items: center; }
.pfImg { flex: none; width: 124px; height: 158px; object-fit: contain; background: radial-gradient(circle at 50% 42%, #fff7e0, #ffe3ea); border: 7px solid #fff; border-bottom-width: 24px; border-radius: 3px; box-shadow: var(--shadow); transform: rotate(-2deg); }
.pfInfo { display: grid; gap: 6px; min-width: 0; }
.pfInfo h2 { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 22px; } .pfInfo p { margin: 0; font-size: 13.5px; color: var(--ink2); }
.pfBtns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pfClose { position: absolute; top: 12px; right: 12px; }
.pfLinks { display: flex; gap: 14px; }
.repBox { display: grid; gap: 8px; margin-top: 4px; padding: 10px; background: var(--wash); border-radius: 12px; } .repBox b { font-family: var(--title); font-weight: 400; }
.pfBadge { font-family: var(--title); color: var(--leafD) !important; }
.sList { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.sList li { display: flex; gap: 9px; align-items: center; padding: 7px 9px; background: #fff; border-radius: 14px; box-shadow: 0 2px 0 var(--lip); cursor: pointer; }
.sList li > img, .sList .av img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: #ffe9d6; }
.sList li div { display: grid; min-width: 0; } .sList li b { font-family: var(--title); font-weight: 400; font-size: 15px; }
.sList li small { max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sList .sp { flex: 1; }
.dmHead { display: flex; align-items: center; gap: 8px; } .dmHead .round { width: 38px; height: 38px; } .dmHead .round .ico { width: 20px; height: 20px; }
.dmHead img { width: 36px; height: 36px; border-radius: 50%; background: #ffe9d6; } .dmHead b { font-family: var(--title); font-weight: 400; font-size: 16px; cursor: pointer; } .dmHead small { color: var(--ink2); }
.dmLog { list-style: none; margin: 0; padding: 10px; height: min(46vh, 380px); overflow: auto; display: flex; flex-direction: column; gap: 8px; background: var(--wash); border-radius: 16px; }
.dmLog li { max-width: 78%; display: grid; gap: 2px; }
.dmLog li p { margin: 0; padding: 8px 12px; background: #fff; border-radius: 4px 16px 16px 16px; line-height: 1.45; word-break: break-word; box-shadow: 0 2px 0 var(--lip); }
.dmLog li.mine { align-self: flex-end; text-align: right; } .dmLog li.mine p { background: var(--leafL); border-radius: 16px 4px 16px 16px; box-shadow: 0 2px 0 #c9e9da; }
.dmLog li time { font-size: 10.5px; color: var(--ink3); } .dmLog li.sys { align-self: center; font-family: var(--hand); font-size: 16px; color: var(--ink2); }
.dmLeft { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink2); }

/* medals and the sea book */
.medalGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.medal { display: grid; justify-items: center; gap: 4px; padding: 12px 8px 10px; background: #fff; border-radius: 16px; text-align: center; font-family: inherit; color: inherit; box-shadow: 0 2px 0 var(--lip); cursor: default; }
.medal:disabled { opacity: 1; cursor: default; }
.medal .mi { width: 56px; height: 56px; margin: 4px 0 6px; display: grid; place-items: center; border-radius: 50%; background: #fff; font-size: 30px; box-shadow: 0 0 0 4px var(--tc), 0 4px 0 4px rgba(0, 0, 0, .08); filter: grayscale(1) opacity(.4); }
.medal.got { cursor: pointer; } .medal.got .mi { filter: none; }
.medal.worn { box-shadow: 0 0 0 3px var(--leaf), 0 3px 0 3px var(--leafD); }
.medal b { font-family: var(--title); font-weight: 400; font-size: 14px; } .medal small { font-size: 11.5px; line-height: 1.35; color: var(--ink2); }
.medal em { font-style: normal; font-family: var(--title); font-size: 12px; color: var(--tc); }
.medal .price { display: inline-flex; align-items: center; gap: 2px; font-family: var(--title); color: #8a6a10; } .medal .price .ico { width: 15px; height: 15px; }
.medal .mp { display: block; width: 80%; height: 6px; overflow: hidden; border-radius: 4px; background: #efe9f5; } .medal .mp i { display: block; height: 100%; background: var(--tc); }
.bagList { display: grid; gap: 7px; }
.bagList > div { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #fff; border-radius: 14px; box-shadow: 0 2px 0 var(--lip); }
.bagList span { font-size: 24px; } .bagList b { flex: 1; font-family: var(--title); font-weight: 400; } .bagList small { color: var(--ink2); }
.bagList em { display: inline-flex; align-items: center; gap: 2px; font-style: normal; font-family: var(--title); font-size: 13px; color: #8a6a10; } .bagList em .ico { width: 16px; height: 16px; }

/* shop */
.shopGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shopItem { display: grid; justify-items: center; gap: 5px; padding: 12px 8px 10px; background: #fff; border-radius: 16px; text-align: center; box-shadow: 0 2px 0 var(--lip); }
.shopItem.owned { background: var(--leafL); box-shadow: 0 2px 0 #c9e9da; }
.shopItem .si { min-height: 36px; display: grid; place-items: center; font-size: 30px; line-height: 1.1; } .shopItem .si .ico { width: 38px; height: 38px; }
.shopItem b { font-family: var(--title); font-weight: 400; font-size: 14px; } .shopItem small { font-size: 12px; color: var(--ink2); }
.shopItem em { font-style: normal; font-family: var(--title); font-size: 12.5px; color: var(--leafD); }
.shopItem .sw { display: block; width: 52px; height: 34px; border: 3px solid #fff; border-radius: 8px; box-shadow: 0 2px 0 var(--lip); }

/* pets */
.petPick { display: flex; flex-wrap: wrap; gap: 8px; }
.petPick button { display: grid; justify-items: center; gap: 2px; min-width: 72px; padding: 8px 10px 6px; border-radius: 16px; font-family: inherit; font-size: 28px; }
.petPick button small { font-family: var(--title); font-size: 12px; color: var(--ink); opacity: 1; }
.petPick button.on { box-shadow: 0 0 0 3px var(--leaf), 0 3px 0 3px var(--leafD); } .petPick button.have { opacity: .55; }
.petColors { display: flex; gap: 10px; }
.petColors button { width: 32px; height: 32px; padding: 0; border-radius: 50%; box-shadow: inset 0 0 0 3px #fff, 0 2px 0 var(--lip); }
.petColors button.on { box-shadow: inset 0 0 0 3px #fff, 0 0 0 3px var(--ink); }
.petCard { display: flex; gap: 16px; align-items: center; }
.petAv { flex: none; width: 100px; height: 100px; display: grid; place-items: center; border: 5px solid #fff; border-radius: 30px; font-size: 58px; transform: rotate(-4deg); box-shadow: 0 5px 0 rgba(0, 0, 0, .1); }
.petCard > div { display: grid; gap: 5px; flex: 1; min-width: 0; }
.petCard input { padding: 7px 10px; font-family: var(--title); font-size: 19px; } .petCard p { margin: 0; color: var(--ink2); }
.meter { position: relative; display: block; height: 12px; margin: 2px 2px 4px; }
.meter::before { content: ''; position: absolute; left: 0; right: 0; top: 5px; border-bottom: 2px dashed #d6cde2; }
.meter > i { position: absolute; left: -2px; top: 0; bottom: 0; max-width: calc(100% + 2px); background: var(--hl); border-radius: 4px 9px 6px 9px; transform: skewX(-8deg); }
.meter.mood > i { background: var(--berry); }

/* planner: today's list on ruled paper, a diary calendar, the weekly report card */
.todoAdd { display: flex; gap: 6px; } .todoAdd input { flex: 1; min-width: 0; } .todoAdd select { width: auto; max-width: 100px; } .todoAdd button { flex: none; }
.todoList { list-style: none; margin: 0; padding: 0 2px; display: grid; background: repeating-linear-gradient(transparent 0 44px, #d9e9f1 44px 46px); }
.todoList li { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 0 4px; }
.todoList li span { flex: 1; display: grid; line-height: 1.25; }
.todoList li span small { display: flex; align-items: center; gap: 4px; font-size: 11.5px; }
.todoList li.done span { color: var(--ink2); text-decoration: line-through; text-decoration-color: rgba(74, 68, 88, .35); }
.todoList li.empty { justify-content: center; font-family: var(--hand); font-size: 17px; color: var(--ink2); }
.todoList .del { width: 32px; height: 32px; padding: 0; border-radius: 50%; background: none; box-shadow: none; } .todoList .del .ico { width: 16px; height: 16px; opacity: .6; }
.calHead { display: flex; justify-content: space-between; align-items: center; } .calHead b { font-family: var(--title); font-weight: 400; font-size: 18px; }
.calHead .round { width: 36px; height: 36px; } .calHead .round .ico { width: 18px; height: 18px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; } .cal > span { text-align: center; font-family: var(--title); font-size: 12px; color: var(--ink2); }
.cal button { position: relative; aspect-ratio: 1; display: grid; place-items: center; padding: 0; border-radius: 10px; font-size: 13px; background: #fff; box-shadow: 0 2px 0 var(--lip); }
.cal button b { font-weight: 400; } .cal button em { position: absolute; right: 2px; bottom: 0; font-style: normal; font-size: 13px; }
.cal .lv1 { background: #e4f6ee; } .cal .lv2 { background: #bfe8d6; } .cal .lv3 { background: #86d3b4; } .cal .lv4 { background: var(--leaf); color: #fff; }
.cal button.today { box-shadow: 0 0 0 2.5px var(--hl), 0 2px 0 2.5px var(--hlD); } .cal button.pick { box-shadow: 0 0 0 2.5px var(--ink); }
.dayCard { display: grid; gap: 8px; padding: 12px; background: #fff; border-radius: 16px; box-shadow: 0 2px 0 var(--lip); }
.dayCard > b { font-family: var(--title); font-weight: 400; font-size: 16px; } .dayCard > b small { font-family: var(--sans); font-size: 13px; margin-left: 4px; }
.dayCard .subs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--ink2); } .dayCard .subs span { display: inline-flex; align-items: center; gap: 4px; }
.dayCard p { margin: 0; font-family: var(--hand); font-size: 18px; }
.moodPick { display: flex; flex-wrap: wrap; gap: 4px; }
.moodPick button { padding: 3px 6px; border-radius: 10px; background: none; box-shadow: none; font-family: inherit; font-size: 22px; }
.moodPick button.on { background: var(--hlL); box-shadow: inset 0 0 0 2px var(--hl); }
.reportCv { width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow); }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 1100px) { .cols { grid-template-columns: minmax(320px, 400px) 1fr minmax(240px, 280px); } }
@media (max-width: 980px) {
  .lobby { height: auto; min-height: 100%; }
  .cols { grid-template-columns: 1fr; overflow: visible; }
  .roomsPane { overflow: visible; }
  .chat { min-height: 60vh; }
  .rooms { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .chars { grid-template-columns: repeat(4, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
/* phones: one pane at a time behind index tabs */
@media (max-width: 760px) {
  .lobby { height: 100%; min-height: 0; padding: calc(10px + env(safe-area-inset-top)) 12px 0; gap: 0; } .top { margin-bottom: 8px; }
  .brand { padding: 4px 12px 4px 8px; } .brand h1 { font-size: 19px; } .brand .ico { width: 26px; height: 26px; }
  #openSocial, #openCast, #openSettings { display: none; }
  .topR { gap: 6px; }
  .top .round { width: 40px; height: 40px; } .top .round .ico { width: 24px; height: 24px; }
  .goldChip { font-size: 15px; padding: 3px 10px 3px 4px; } .goldChip .ico { width: 24px; height: 24px; }
  .meCard { padding: 3px; } .meCard div { display: none; }
  .cols { display: block; flex: 1; min-height: 0; margin: 0 -12px; overflow: hidden; }
  .cols > .panel { display: none; height: 100%; }
  body[data-tab=rooms] .cols > [data-pane=rooms], body[data-tab=chat] .cols > [data-pane=chat], body[data-tab=record] .cols > [data-pane=record] { display: flex; }
  .roomsPane { padding: 4px 16px 24px; overflow: auto; }
  .rooms { grid-template-columns: 1fr 1fr; }
  .chat, .side { border-radius: 22px 22px 0 0; padding: 18px 14px 12px; }
  .panel > .tape { display: none; }
  .tabs { position: relative; z-index: 3; display: grid; grid-template-columns: repeat(6, 1fr); margin: 0 -12px; padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 3px solid #e3eef4; }
  .tabs button { position: relative; display: grid; justify-items: center; gap: 1px; padding: 5px 0 3px; border-radius: 16px; background: none; box-shadow: none; color: var(--ink2); font-size: 12px; }
  .tabs button .ico { width: 28px; height: 28px; }
  .tabs button.on { background: var(--leafL); color: var(--ink); transform: translateY(-9px); box-shadow: 0 4px 0 #cfeadf; }
  .tabs em { position: absolute; top: 0; left: 56%; }
  .modal { padding: 0; place-items: end stretch; }
  .sheet, .sheet.small { width: 100%; max-height: 92%; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; }
  .chars { grid-template-columns: repeat(3, 1fr); max-height: 46vh; } .chars.big { grid-template-columns: repeat(3, 1fr); }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .roomBars div { grid-template-columns: 74px minmax(36px, 1fr) auto; } .roomBars b { font-size: 12px; }
  .chart .bar .v { visibility: hidden; } .chart .bar.today .v { visibility: visible; }
  .setupCard { padding: 26px 16px 20px; } .brand.big h1 { font-size: 26px; }
  .hud { left: 10px; right: 10px; gap: 6px; } .hud .round { width: 42px; height: 42px; } .hudTitle { padding: 5px 11px; font-size: 16px; }
  .tMain b { font-size: 40px; }
  /* the line over the clock may take two lines beside the big button ('빈 자리에 앉아 보...' was cut short) */
  .tMain small { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 17px; line-height: 1.12; }
  .emoBar { right: 10px; bottom: calc(222px + env(safe-area-inset-bottom)); }
  .tag { padding: 1px 7px; font-size: 11.5px; }
}
@media (max-width: 370px) { .brand h1 { font-size: 17px; } .goldChip { font-size: 14px; } .tMain b { font-size: 36px; } .tRow button { padding: 9px 11px; font-size: 14px; } }
@media (max-width: 340px) { .top .brand h1 { display: none; } }
/* phones turned sideways: a smaller timer */
@media (max-height: 500px) and (orientation: landscape) {
  .timerCard { width: min(380px, calc(100% - 28px)); padding: 10px 14px 8px; } .tMain b { font-size: 30px; } .tMain small { font-size: 16px; }
  .emoBar { bottom: calc(18px + env(safe-area-inset-bottom)); }
  .decor, .subjPick, .diveBtn, .fishGame { bottom: calc(140px + env(safe-area-inset-bottom)); } .diveBtn.fish { bottom: calc(196px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .pin, .diveBtn, .fgBob { animation: none; } .unlock { transition: none; } }
