:root {
  --bg: #FFF6EE;
  --bg-dots: #FBE7DA;
  --paper: #FFFFFF;
  --paper-2: #FFF9F4;
  --ink: #3D2C4B;
  --muted: #8B7F99;
  --line: #F0E4EC;
  --pink: #FF6B9D;
  --pink-dark: #E2467C;
  --pink-soft: #FFD9E6;
  --purple: #9B5DE5;
  --purple-dark: #7A3FC7;
  --purple-soft: #E9DDFF;
  --blue: #4CC9F0;
  --blue-dark: #2FA9D1;
  --blue-soft: #D9F3FD;
  --green: #3DBE6A;
  --green-dark: #2E9C55;
  --green-soft: #DAF7E4;
  --yellow: #FFD23F;
  --yellow-dark: #E4B400;
  --yellow-soft: #FFF3BF;
  --orange: #FF9F5A;
  --coin: #F5B301;
  --red: #FF5A5F;
  --shadow: 0 6px 20px rgba(61, 44, 75, 0.10);
  --shadow-lg: 0 16px 40px rgba(61, 44, 75, 0.18);
  --radius: 22px;
  --font-display: 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Nunito', 'Fredoka', 'Segoe UI', system-ui, sans-serif;
  --r-common: #8FA3B8; --r-uncommon: #3DBE6A; --r-rare: #3B82F6; --r-epic: #A855F7; --r-legendary: #F5B301; --r-mythic: #FF5EA8; --r-twin: #14B8A6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg) radial-gradient(var(--bg-dots) 1.4px, transparent 1.6px);
  background-size: 22px 22px;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 700; margin: 0 0 .35em; letter-spacing: .2px; line-height: 1.15; }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.15rem; } h4 { font-size: 1rem; }
p { margin: 0 0 .75em; }
a { color: var(--purple); }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.bold { font-weight: 800; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; }
.hidden { display: none !important; }
.mt { margin-top: 14px; } .mb { margin-bottom: 14px; }
.stack > * + * { margin-top: 14px; }
::selection { background: var(--pink-soft); }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--paper); border-right: 3px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
}
.logo { display: flex; align-items: center; gap: 10px; padding: 6px 8px 16px; text-decoration: none; color: var(--ink); }
.logo .mark { width: 44px; height: 44px; }
.logo .name { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1; }
.logo .name small { display: block; font-size: .7rem; color: var(--muted); font-weight: 600; letter-spacing: .5px; text-transform: uppercase; margin-top: 3px; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; color: var(--ink); text-decoration: none; font-weight: 700; font-family: var(--font-display);
  transition: background .15s, transform .15s;
}
.nav a .ico { font-size: 1.25rem; width: 28px; text-align: center; }
.nav a:hover { background: var(--paper-2); transform: translateX(2px); }
.nav a.active { background: var(--purple-soft); color: var(--purple-dark); }
.nav a .badge { margin-left: auto; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: 12px 22px;
  background: rgba(255, 246, 238, .85); backdrop-filter: blur(10px); border-bottom: 2px solid rgba(240, 228, 236, .8);
}
.topbar .room { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; display: flex; align-items: center; gap: 8px; }
.topbar .spacer { flex: 1; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 6px; background: var(--paper); border: 2px solid var(--yellow); border-radius: 999px; padding: 6px 14px 6px 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; box-shadow: 0 3px 0 var(--yellow-dark); cursor: pointer; text-decoration: none; color: var(--ink);
}
.coin-pill .c { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE58A, var(--coin) 60%, #C98F00); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); }
.coin-pill.bump { animation: bump .5s; }
.avatar-btn { border: none; background: var(--paper); border-radius: 999px; padding: 3px; cursor: pointer; box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; padding-right: 12px; }
.avatar-btn .chr { display: block; }
.avatar-btn .nm { font-family: var(--font-display); font-weight: 700; }
.view { padding: 22px; max-width: 1180px; width: 100%; margin: 0 auto; }
.bottomnav { display: none; }

/* ---------- components ---------- */
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card.soft { background: var(--paper-2); box-shadow: none; border: 2px solid var(--line); }
.card.tint-pink { background: linear-gradient(135deg, #FFF0F5, #FFE1EC); }
.card.tint-purple { background: linear-gradient(135deg, #F3ECFF, #E6DAFF); }
.card.tint-blue { background: linear-gradient(135deg, #EAF7FF, #D9F0FF); }
.card.tint-green { background: linear-gradient(135deg, #EDFBF1, #DAF7E4); }
.card.tint-yellow { background: linear-gradient(135deg, #FFF9E0, #FFF0B8); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: none; cursor: pointer; text-decoration: none; white-space: nowrap;
  font-family: var(--font-display); font-weight: 700; font-size: 1rem; padding: 10px 18px; border-radius: 16px; color: #fff;
  background: var(--pink); box-shadow: 0 4px 0 var(--pink-dark); transition: transform .08s, box-shadow .08s, filter .15s;
  user-select: none;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pink-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.purple { background: var(--purple); box-shadow: 0 4px 0 var(--purple-dark); } .btn.purple:active { box-shadow: 0 1px 0 var(--purple-dark); }
.btn.blue { background: var(--blue); box-shadow: 0 4px 0 var(--blue-dark); } .btn.blue:active { box-shadow: 0 1px 0 var(--blue-dark); }
.btn.green { background: var(--green); box-shadow: 0 4px 0 var(--green-dark); } .btn.green:active { box-shadow: 0 1px 0 var(--green-dark); }
.btn.yellow { background: var(--yellow); color: var(--ink); box-shadow: 0 4px 0 var(--yellow-dark); } .btn.yellow:active { box-shadow: 0 1px 0 var(--yellow-dark); }
.btn.ghost { background: var(--paper); color: var(--ink); box-shadow: 0 4px 0 var(--line); border: 2px solid var(--line); } .btn.ghost:active { box-shadow: 0 1px 0 var(--line); }
.btn.danger { background: var(--red); box-shadow: 0 4px 0 #C93A3F; }
.btn.sm { font-size: .85rem; padding: 6px 12px; border-radius: 12px; }
.btn.lg { font-size: 1.2rem; padding: 14px 26px; border-radius: 20px; }
.btn.block { width: 100%; }
.btn .coin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFE58A, var(--coin) 60%, #C98F00); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--pink); color: #fff; font-size: .75rem; font-weight: 800; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 800; background: var(--paper-2); color: var(--muted); border: 1.5px solid var(--line); }
.chip.rarity-common { background: #EEF2F6; color: #5F6F82; border-color: #D5DEE8; }
.chip.rarity-uncommon { background: #E4F8EA; color: #2E9C55; border-color: #B9EBC8; }
.chip.rarity-rare { background: #E3EDFF; color: #2E6BE0; border-color: #BFD3FF; }
.chip.rarity-epic { background: #F1E5FF; color: #8A3FD9; border-color: #DCC6FF; }
.chip.rarity-legendary { background: #FFF4CC; color: #B37F00; border-color: #FFE38A; }
.chip.rarity-mythic { background: linear-gradient(90deg, #FFD6EA, #E0D6FF, #D6F5FF); color: #C2287A; border-color: #FFB3D9; }
.chip.rarity-twin { background: #D8F7F2; color: #0F8C7D; border-color: #A8EBE1; }
.chip.shiny { background: linear-gradient(90deg, #FFF3BF, #FFFFFF, #FFF3BF); color: #B37F00; border-color: #FFE38A; }
.input, .select, .textarea {
  width: 100%; padding: 11px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--paper); outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px var(--purple-soft); }
.textarea { resize: vertical; min-height: 80px; }
label.field { display: block; font-weight: 800; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.field-group { margin-bottom: 12px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs button { border: 2px solid var(--line); background: var(--paper); color: var(--muted); font-family: var(--font-display); font-weight: 700; padding: 8px 14px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.progress { height: 12px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--purple), var(--pink)); transition: width .4s; }
.divider { height: 2px; background: var(--line); margin: 14px 0; border-radius: 2px; }
.empty { text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .big { font-size: 3rem; margin-bottom: 6px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.stat { background: var(--paper); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat .v { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; line-height: 1; }
.stat .l { font-size: .75rem; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .4px; margin-top: 4px; }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--yellow-soft); border: 2px solid #FFE38A; font-weight: 600; font-size: .92rem; }
.notice.info { background: var(--blue-soft); border-color: #B3E4FA; }
.notice.danger { background: #FFE3E4; border-color: #FFB8BB; }
.kbd { font-family: monospace; background: var(--paper-2); border: 1.5px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .85rem; }
.copy-code { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; letter-spacing: 3px; background: var(--paper); border: 3px dashed var(--purple); border-radius: 16px; padding: 10px 18px; display: inline-block; }
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--paper-2); border: 2px solid transparent; }
.rank-row.me { border-color: var(--purple); background: var(--purple-soft); }
.rank-row .rank { font-family: var(--font-display); font-weight: 700; width: 34px; font-size: 1.1rem; text-align: center; }
.rank-row .who { flex: 1; font-weight: 800; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rank-row .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .score { font-family: var(--font-display); font-weight: 700; }
.mini-chr { width: 34px; height: 34px; display: inline-flex; overflow: hidden; border-radius: 50%; background: var(--paper-2); flex-shrink: 0; border: 2px solid var(--line); }
.mini-chr svg { width: 100%; height: 100%; display: block; }
.online-dot { width: 10px; height: 10px; border-radius: 50%; background: #C9C4D4; display: inline-block; flex-shrink: 0; }
.online-dot.on { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }

/* ---------- squishy cards ---------- */
.sq-card {
  background: var(--paper); border-radius: 20px; padding: 12px 10px 10px; text-align: center; box-shadow: var(--shadow); cursor: pointer; position: relative;
  transition: transform .15s, box-shadow .15s; border: 2px solid transparent;
}
.sq-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.sq-card.selected { border-color: var(--purple); background: var(--purple-soft); }
.sq-card .art { width: 100%; aspect-ratio: 1; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 8px; background: #F4F1F8; }
.sq-card .art svg { width: 88%; height: 88%; }
.sq-card.rarity-common .art { background: #EEF2F6; }
.sq-card.rarity-uncommon .art { background: #E4F8EA; }
.sq-card.rarity-rare .art { background: #E3EDFF; }
.sq-card.rarity-epic .art { background: #F1E5FF; }
.sq-card.rarity-legendary .art { background: radial-gradient(circle, #FFF7D6, #FFE9A3); }
.sq-card.rarity-mythic .art { background: conic-gradient(from 0deg, #FFD6EA, #E0D6FF, #D6F5FF, #DAF7E4, #FFF3BF, #FFD6EA); }
.sq-card.rarity-twin .art { background: #D8F7F2; }
.sq-card .nm { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.1; }
.sq-card .sub { font-size: .72rem; color: var(--muted); font-weight: 700; margin-top: 2px; }
.sq-card .corner { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.sq-card .corner .fav { font-size: 1.05rem; filter: drop-shadow(0 1px 1px rgba(0,0,0,.15)); }
.sq-card .price { margin-top: 8px; }
.sq-card.locked .art svg { opacity: .55; }
.sq-card.locked .nm { color: var(--muted); }
.sq.sq-mythic .sq-inner { animation: hue 8s linear infinite; }
.spk { transform-origin: center; animation: twinkle 1.6s ease-in-out infinite; }
.sq.squishing { animation: squish .55s cubic-bezier(.36,.07,.19,.97); transform-origin: 50% 90%; }
.sq.sq-epic, .sq.sq-legendary, .sq.sq-mythic { filter: drop-shadow(0 4px 10px rgba(168, 85, 247, .25)); }
.sq.sq-legendary { filter: drop-shadow(0 4px 12px rgba(245, 179, 1, .4)); }
.sq.sq-mythic { filter: drop-shadow(0 4px 14px rgba(255, 94, 168, .45)); }
.sq-silhouette { filter: none; }
.detail-art { width: 220px; height: 220px; margin: 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #F4F1F8; }
.detail-art svg { width: 90%; height: 90%; }

/* ---------- modals & toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(61, 44, 75, .45); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
.modal { background: var(--paper); border-radius: 26px; padding: 22px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow-lg); animation: pop .22s cubic-bezier(.2,.9,.3,1.3); position: relative; }
.modal.wide { max-width: 860px; }
.modal .close { position: absolute; top: 12px; right: 12px; border: none; background: var(--paper-2); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 700; box-shadow: var(--shadow-lg); animation: rise .25s; max-width: 90vw; text-align: center; }
.toast.good { background: var(--green); }
.toast.bad { background: var(--red); }
.toast.coin { background: var(--coin); color: var(--ink); }

/* ---------- auth screen ---------- */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; position: relative; overflow: hidden; }
.auth .floaters { position: absolute; inset: 0; pointer-events: none; }
.auth .floaters svg { position: absolute; animation: float 6s ease-in-out infinite; opacity: .9; }
.auth-card { width: 100%; max-width: 480px; position: relative; z-index: 1; }
.auth-title { text-align: center; margin-bottom: 14px; }
.auth-title h1 { font-size: 2.6rem; background: linear-gradient(90deg, var(--pink), var(--purple), var(--blue)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.starters .sq-card .art { background: #F4F1F8; }

/* ---------- school map ---------- */
.school-map { width: 100%; max-width: 980px; margin: 0 auto; display: block; }
.school-map .room { cursor: pointer; transition: transform .15s; transform-box: fill-box; transform-origin: center; }
.school-map .room:hover { transform: scale(1.03); }
.school-map .room:hover .door { fill: #FFD23F; }
.school-map text { font-family: var(--font-display); font-weight: 700; pointer-events: none; }
.school-map .lbl { font-size: 18px; fill: var(--ink); }
.school-map .sub { font-size: 11px; fill: #7A6E8A; font-family: var(--font-body); font-weight: 800; }
.school-map .kid { animation: bob 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: bottom center; }
.school-map .kid text { font-size: 10px; fill: var(--ink); font-family: var(--font-body); font-weight: 800; }

/* ---------- room scenes ---------- */
.scene { width: 100%; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: block; background: #fff; }
.scene .hot { cursor: pointer; }
.scene .hot .hl { fill: transparent; stroke: transparent; transition: all .15s; }
.scene .hot:hover .hl { fill: rgba(255, 210, 63, .18); stroke: var(--yellow); stroke-width: 3; }
.scene text { font-family: var(--font-display); font-weight: 700; pointer-events: none; }
.scene .kid { transform-box: fill-box; transform-origin: bottom center; animation: bob 2.6s ease-in-out infinite; }
.scene .kid text { font-family: var(--font-body); font-weight: 800; font-size: 9px; fill: var(--ink); }

/* ---------- chat ---------- */
.chat-layout { display: grid; grid-template-columns: 250px 1fr; gap: 14px; min-height: 60vh; }
.chat-list { display: flex; flex-direction: column; gap: 6px; }
.chat-list button { display: flex; align-items: center; gap: 10px; border: 2px solid transparent; background: var(--paper); border-radius: 14px; padding: 8px 10px; cursor: pointer; text-align: left; font-weight: 800; }
.chat-list button.active { border-color: var(--purple); background: var(--purple-soft); }
.chat-list button .badge { margin-left: auto; }
.chat-box { display: flex; flex-direction: column; height: 62vh; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 8px 4px; display: flex; flex-direction: column; gap: 6px; }
.msg { max-width: 75%; padding: 8px 14px; border-radius: 18px; background: var(--paper-2); border: 2px solid var(--line); font-weight: 600; word-wrap: break-word; }
.msg.me { align-self: flex-end; background: var(--purple-soft); border-color: #D8C7FF; }
.msg .t { display: block; font-size: .68rem; color: var(--muted); margin-top: 2px; font-weight: 700; }
.chat-input { display: flex; gap: 8px; margin-top: 8px; }
.quick-chat { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick-chat button { border: 2px solid var(--line); background: var(--paper); border-radius: 999px; padding: 4px 10px; font-weight: 800; cursor: pointer; font-size: .85rem; }
.quick-chat button:hover { background: var(--paper-2); }

/* ---------- trade builder ---------- */
.trade-sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: start; }
.trade-sides .arrow { font-size: 2rem; align-self: center; }
.trade-pick { max-height: 340px; overflow-y: auto; padding: 4px; }
.trade-pick .grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.trade-pick .sq-card { padding: 8px 6px 6px; }
.trade-pick .sq-card .nm { font-size: .85rem; }
.fair { padding: 10px 14px; border-radius: 14px; font-weight: 800; text-align: center; }
.fair.good { background: var(--green-soft); color: var(--green-dark); }
.fair.meh { background: var(--yellow-soft); color: #9A6F00; }
.fair.bad { background: #FFE3E4; color: #C93A3F; }
.trade-card .side { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.trade-card .side .mini { width: 56px; height: 56px; border-radius: 50%; background: var(--paper-2); display: flex; align-items: center; justify-content: center; }
.trade-card .side .mini svg { width: 90%; height: 90%; }

/* ---------- clicker ---------- */
.clicker { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.clicker .stage { text-align: center; position: relative; user-select: none; overflow: hidden; background: linear-gradient(180deg, #F3F8FF, #FFFFFF 60%); }
.clicker .stage > :not(.rain):not(.floaty):not(.golden) { position: relative; z-index: 1; }
.clicker .stage .floaty { z-index: 3; }
.clicker .stage .rain { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; opacity: .75; }
.clicker .counter { font-family: var(--font-display); font-weight: 700; font-size: 2.4rem; line-height: 1; }
.clicker .sps { color: var(--muted); font-weight: 800; }
.click-target { display: inline-block; cursor: pointer; margin: 10px auto; transition: transform .06s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.click-target:active { transform: scale(.92); }
.click-target svg { width: min(300px, 70vw); height: min(300px, 70vw); filter: drop-shadow(0 12px 20px rgba(61,44,75,.18)); }
.floaty { position: absolute; font-family: var(--font-display); font-weight: 700; color: var(--purple); pointer-events: none; animation: floatUp .9s ease-out forwards; font-size: 1.3rem; text-shadow: 0 2px 0 #fff; }
.golden { position: absolute; cursor: pointer; animation: goldenDrift 8s linear forwards; z-index: 5; filter: drop-shadow(0 0 12px #FFD23F); }
.golden svg { width: 80px; height: 80px; }
.shop-list { display: flex; flex-direction: column; gap: 8px; }
.shop-item { display: flex; align-items: center; gap: 10px; background: var(--paper-2); border: 2px solid var(--line); border-radius: 16px; padding: 8px 12px; cursor: pointer; transition: transform .1s; text-align: left; width: 100%; font-family: inherit; }
.shop-item:hover { transform: translateX(2px); border-color: var(--purple-soft); }
.shop-item:disabled { opacity: .5; cursor: not-allowed; }
.shop-item .em { font-size: 1.7rem; width: 40px; text-align: center; }
.shop-item .info { flex: 1; min-width: 0; }
.shop-item .info b { font-family: var(--font-display); font-weight: 700; }
.shop-item .info small { display: block; color: var(--muted); font-weight: 700; }
.shop-item .cost { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }
.shop-item .cnt { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 9px; font-weight: 800; font-size: .8rem; }
.shop-item.owned { background: var(--green-soft); border-color: #B9EBC8; }
.boost-bar { height: 10px; background: var(--line); border-radius: 999px; overflow: hidden; }
.boost-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FF6B9D, #FFD23F); }

/* ---------- memory game ---------- */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 480px; margin: 0 auto; }
.mem-card { aspect-ratio: 1; border-radius: 16px; perspective: 600px; cursor: pointer; }
.mem-card .inner { position: relative; width: 100%; height: 100%; transition: transform .35s; transform-style: preserve-3d; }
.mem-card.flipped .inner, .mem-card.matched .inner { transform: rotateY(180deg); }
.mem-card .face { position: absolute; inset: 0; border-radius: 16px; backface-visibility: hidden; display: flex; align-items: center; justify-content: center; }
.mem-card .back { background: linear-gradient(135deg, var(--purple), var(--pink)); color: #fff; font-size: 2rem; }
.mem-card .front { background: var(--paper); transform: rotateY(180deg); border: 3px solid var(--purple-soft); }
.mem-card .front svg { width: 85%; height: 85%; }
.mem-card.matched .front { border-color: var(--green); background: var(--green-soft); }

/* ---------- character editor ---------- */
.editor { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.editor .preview { text-align: center; position: sticky; top: 80px; }
.editor .preview svg { width: 100%; max-width: 260px; height: auto; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--line); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 3px var(--purple); transform: scale(1.1); }
.opt-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.opt { border: 2px solid var(--line); background: var(--paper); border-radius: 12px; padding: 6px 12px; font-weight: 800; cursor: pointer; font-family: var(--font-display); display: inline-flex; align-items: center; gap: 6px; }
.opt.active { background: var(--purple-soft); border-color: var(--purple); color: var(--purple-dark); }
.opt.locked { opacity: .8; }

/* ---------- irl shelf ---------- */
.irl-card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.irl-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 16px; }
.irl-card .twin { background: #D8F7F2; border-radius: 16px; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; }
.irl-card .twin svg { width: 90%; height: 90%; }
.photo-drop { display: block; border: 3px dashed var(--line); border-radius: 16px; padding: 16px; text-align: center; cursor: pointer; background: var(--paper-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.photo-drop img { max-height: 140px; border-radius: 12px; }

/* ---------- reveal ---------- */
.reveal { text-align: center; padding: 10px; }
.reveal .bag { font-size: 6rem; cursor: pointer; display: inline-block; animation: wiggle 1s ease-in-out infinite; }
.reveal .bag.opening { animation: bagpop .5s forwards; }
.reveal .result { animation: pop .5s cubic-bezier(.2,.9,.3,1.4); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 150; overflow: hidden; }
.confetti i { position: absolute; top: -10px; width: 10px; height: 14px; border-radius: 3px; animation: confetti 2.2s linear forwards; }

/* ---------- daily checklist ---------- */
.check-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; margin-top: 10px; }
.check-item { display: flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--paper-2); border-radius: 14px; padding: 8px 10px; cursor: pointer; font-family: inherit; font-weight: 800; font-size: .9rem; text-align: left; color: var(--ink); }
.check-item .em { font-size: 1.3rem; }
.check-item .tick { margin-left: auto; color: var(--muted); font-weight: 900; }
.check-item.done { background: var(--green-soft); border-color: #B9EBC8; color: var(--green-dark); text-decoration: line-through; }
.check-item.done .tick { color: var(--green-dark); }

/* ---------- clicker extras ---------- */
.milestone { max-width: 360px; margin: 10px auto 0; text-align: left; }
.milestone .progress { height: 10px; margin-top: 4px; }
.combo { min-height: 1.3em; font-family: var(--font-display); font-weight: 700; color: var(--orange); animation: pop .2s; }
.mute-btn { position: absolute !important; top: 10px; right: 10px; z-index: 4 !important; border: 2px solid var(--line); background: var(--paper); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 1.1rem; }
.chip.best { background: var(--yellow-soft); color: #9A6F00; border-color: #FFE38A; }
.shop-item.owned { background: var(--paper-2); border-color: var(--line); }
.shop-item.owned .cnt { background: var(--green); }

/* ---------- mystery bag build-up ---------- */
.luck { background: rgba(255,255,255,.55); border-radius: 12px; padding: 6px 8px; }
.luck-dots { display: flex; gap: 5px; justify-content: center; margin: 4px 0; }
.luck-dots i { width: 14px; height: 14px; border-radius: 50%; background: rgba(0,0,0,.1); }
.luck-dots i.on { background: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.reveal .bag.shaking { animation: shake .35s ease-in-out infinite; }
.reveal .bag.glowing { transition: filter .4s; }
.flash { position: fixed; inset: 0; z-index: 140; pointer-events: none; opacity: .75; animation: flashout .7s ease-out forwards; }

/* ---------- badges & more sheet ---------- */
.badge-burst { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.badge-big { background: var(--yellow-soft); border: 3px solid #FFE38A; border-radius: 22px; padding: 14px 18px; min-width: 150px; animation: pop .5s cubic-bezier(.2,.9,.3,1.4); }
.badge-big .em { font-size: 3rem; line-height: 1; }
.badge-big .nm { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; margin-top: 4px; }
.more-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.more-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--paper-2); border: 2px solid var(--line); text-decoration: none; color: var(--ink); font-family: var(--font-display); font-weight: 700; }
.more-item .ico { font-size: 1.4rem; }
.more-item .badge { margin-left: auto; }

/* ---------- animations ---------- */
@keyframes shake { 0%, 100% { transform: rotate(-10deg) scale(1.05); } 50% { transform: rotate(10deg) scale(1.1); } }
@keyframes flashout { from { opacity: .75; } to { opacity: 0; } }
@keyframes twinkle { 0%, 100% { opacity: .35; transform: scale(.8) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(20deg); } }
@keyframes hue { to { filter: hue-rotate(360deg); } }
@keyframes squish { 0% { transform: scale(1, 1); } 30% { transform: scale(1.18, .72); } 55% { transform: scale(.92, 1.12); } 75% { transform: scale(1.06, .95); } 100% { transform: scale(1, 1); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-18px) rotate(4deg); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes floatUp { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-70px); opacity: 0; } }
@keyframes goldenDrift { from { transform: translateX(0) rotate(0); } to { transform: translateX(var(--dx, 300px)) rotate(360deg); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes bagpop { 0% { transform: scale(1); } 50% { transform: scale(1.4); opacity: 1; } 100% { transform: scale(0); opacity: 0; } }
@keyframes confetti { to { transform: translateY(110vh) rotate(720deg); opacity: .9; } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .view { padding: 14px 12px 90px; }
  .topbar { padding: 10px 12px; }
  .topbar .room { font-size: 1.05rem; }
  .avatar-btn .nm { display: none; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--paper); border-top: 3px solid var(--line); z-index: 30; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: .68rem; font-weight: 800; padding: 4px 8px; border-radius: 12px; position: relative; }
  .bottomnav a .ico { font-size: 1.4rem; }
  .bottomnav a.active { color: var(--purple-dark); background: var(--purple-soft); }
  .bottomnav a .badge { position: absolute; top: 0; right: 0; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-list { flex-direction: row; overflow-x: auto; padding-bottom: 6px; }
  .chat-list button { flex-shrink: 0; }
  .clicker { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; }
  .editor .preview { position: static; }
  .trade-sides { grid-template-columns: 1fr; }
  .trade-sides .arrow { text-align: center; transform: rotate(90deg); }
  .grid.two, .grid.three { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
}
