/* Fellowship Hall — GodlyGaming (the Holy Grounds Café) */
:root {
  --ink: #3a2210;
  --panel: rgba(46, 27, 13, .93);
  --panel-solid: #34200f;
  --line: rgba(255, 226, 170, .16);
  --text: #fff8ec;
  --muted: #ecd8b8;
  --cream: #fff6e3;
  --gold: #ffcf3d;
  --gold-hi: #fff1a8;
  --gold-lo: #f0a51e;
  --teal: #2f9e9a;
  --teal-hi: #7fe0d6;
  --font-fun: "Fredoka", "Baloo 2", "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #24150b; color: var(--text); font-family: var(--font-body); -webkit-tap-highlight-color: transparent; }
body { overflow: hidden; overscroll-behavior: none; }
button, input { font: inherit; }
[hidden] { display: none !important; }
a { color: var(--gold-hi); }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* ---------- buttons & cards ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 2px solid transparent; font-weight: 800; font-size: 16px; line-height: 1.15; color: #fff; text-decoration: none; cursor: pointer; transition: transform .08s, filter .15s, background .15s; text-align: center; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: default; filter: grayscale(.3); }
.btn-gold { color: #3b1a00; background: linear-gradient(180deg, #fff1a8, #ffcf3d 55%, #f0a51e); box-shadow: 0 4px 0 #b86e09, 0 10px 24px rgba(255, 191, 59, .3); }
.btn-gold:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost { background: rgba(255, 240, 210, .08); border-color: rgba(255, 230, 190, .26); }
.btn-ghost:hover { background: rgba(255, 240, 210, .16); }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn-big { flex-direction: column; gap: 2px; width: 100%; min-height: 62px; padding: 10px 18px; font-family: var(--font-fun); font-size: 21px; font-weight: 600; }
.btn-big small { font-family: var(--font-body); font-size: 13px; font-weight: 700; opacity: .85; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 20px 60px rgba(20, 8, 0, .5); }
.back-link { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border-radius: 999px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); color: #fff; font-weight: 800; font-size: 14px; text-decoration: none; cursor: pointer; }
.coins-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 6px; border-radius: 999px; background: rgba(30, 16, 6, .78); border: 1px solid rgba(255, 207, 61, .45); font-weight: 900; font-size: 15px; color: var(--gold-hi); }
.coins-pill.bump { animation: bump .5s ease 0.6s; }
@keyframes bump { 50% { transform: scale(1.18); } }
.coin, .flycoin { display: inline-block; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6c4, #ffd23b 45%, #d68a0c 100%); box-shadow: inset 0 0 0 2px rgba(150, 80, 0, .45); }
.flycoin { position: fixed; z-index: 80; pointer-events: none; transition: transform .9s cubic-bezier(.5, -0.2, .4, 1), opacity .9s; }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 20; display: none; overflow-y: auto; touch-action: pan-y; background: radial-gradient(120% 80% at 50% 0%, rgba(120, 70, 30, .55), rgba(28, 15, 6, .96) 70%), #24150b; }
.screen.on { display: block; }
#sBoot.on, #sGate.on { display: grid; place-items: center; }
.boot-card { text-align: center; font-weight: 800; color: var(--muted); }
.spinner { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .15); border-top-color: var(--gold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.gate { width: min(760px, calc(100% - 32px)); margin: 24px auto; display: grid; gap: 14px; }
.gate-art { width: 100%; height: auto; border-radius: 20px; display: block; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.gate-card { padding: 18px 20px 22px; text-align: center; }
.gate-card h1 { margin: 4px 0 6px; font-family: var(--font-fun); font-weight: 700; font-size: 30px; color: var(--gold-hi); }
.gate-card p { margin: 0 0 16px; color: var(--muted); font-weight: 700; line-height: 1.45; }

.entry, .mapscreen { width: min(1100px, 100%); margin: 0 auto; padding: max(12px, env(safe-area-inset-top)) 16px 28px; }
.entry-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.map-title { font-family: var(--font-fun); font-weight: 700; font-size: 22px; color: var(--gold-hi); text-align: center; flex: 1; }
.banner { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.banner img { display: block; width: 100%; height: auto; }
.banner-enter { position: absolute; left: 38.5%; top: 87.4%; width: 24%; height: 10%; border: 0; border-radius: 999px; background: transparent; cursor: pointer; animation: glowring 2.2s ease-in-out infinite; }
.banner-enter:hover, .banner-enter:focus-visible { background: rgba(255, 240, 180, .18); outline: none; box-shadow: 0 0 0 3px rgba(255, 220, 120, .8), 0 0 30px rgba(255, 210, 90, .7); }
@keyframes glowring { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 220, 120, 0); } 50% { box-shadow: 0 0 0 4px rgba(255, 220, 120, .55), 0 0 26px rgba(255, 210, 90, .55); } }
.entry-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 14px; margin-top: 14px; }
.me-card { display: flex; align-items: center; gap: 12px; padding: 14px; }
.me-card canvas { width: 150px; height: 170px; flex-shrink: 0; border-radius: 18px; background: radial-gradient(circle at 50% 75%, rgba(255, 200, 110, .3), transparent 62%); }
.me-text .hi { margin: 0 0 4px; font-family: var(--font-fun); font-size: 24px; font-weight: 600; }
.me-text .hi b { color: var(--gold-hi); }
.me-text p { margin: 0 0 10px; font-weight: 700; line-height: 1.4; font-size: 14px; }
.enter-card { padding: 16px; }
.today { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.today li, .todo li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 14px; background: rgba(255, 240, 210, .06); border: 1px solid var(--line); font-weight: 800; font-size: 14px; }
.today li small, .todo li small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; margin-top: 2px; }
.today li.done, .todo li.done { opacity: .78; }
.ti { font-size: 20px; text-align: center; }
.safe-note { margin: 14px 0 0; color: var(--muted); font-size: 13px; font-weight: 700; line-height: 1.45; }
.ban-note { margin: 10px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 90, 90, .15); border: 1px solid rgba(255, 120, 120, .45); font-weight: 800; font-size: 14px; }

/* ---------- map ---------- */
.map-wrap { position: relative; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.map-wrap img { display: block; width: 100%; height: auto; }
.spot { position: absolute; border: 0; border-radius: 18px; background: transparent; cursor: pointer; transition: background .15s, box-shadow .15s; }
.spot:hover, .spot:focus-visible { background: rgba(255, 236, 170, .16); box-shadow: inset 0 0 0 3px rgba(255, 214, 110, .85), 0 0 24px rgba(255, 200, 80, .5); outline: none; }
.spot-count { position: absolute; transform: translate(-50%, -50%); padding: 3px 9px; width: auto; height: auto; border-radius: 999px; background: rgba(40, 22, 8, .85); border: 1px solid rgba(255, 207, 61, .6); color: #fff; font-weight: 900; font-size: 13px; white-space: nowrap; pointer-events: none; }
.spot-count.zero { opacity: .72; }
.map-hint { margin: 10px 4px; color: var(--muted); font-weight: 700; font-size: 14px; text-align: center; }
.area-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.area-btn { display: grid; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 10px 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); color: #fff; text-align: left; cursor: pointer; }
.area-btn:hover { border-color: var(--gold); }
.area-btn .ai { grid-row: span 2; font-size: 26px; text-align: center; }
.area-btn .at b { display: block; font-family: var(--font-fun); font-weight: 600; font-size: 17px; }
.area-btn .at small { display: block; color: var(--muted); font-weight: 700; font-size: 12px; line-height: 1.3; }
.area-btn .ac { grid-column: 2; justify-self: start; margin-top: 4px; font-size: 12px; font-weight: 900; color: var(--gold-hi); }
.area-btn .ac.zero { color: var(--muted); opacity: .8; }

/* ---------- inside an area ---------- */
body.in-area { touch-action: none; }
.area { position: fixed; inset: 0; z-index: 10; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; background: #24150b; }
.stage { position: relative; grid-row: 1; grid-column: 1; min-height: 0; overflow: hidden; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
.topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 2; display: flex; align-items: center; gap: 8px; padding: max(8px, env(safe-area-inset-top)) 10px 8px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(255, 230, 190, .3); background: rgba(30, 16, 6, .78); color: #fff; font-weight: 900; font-size: 15px; cursor: pointer; }
.chip-btn:hover { border-color: var(--gold); }
.area-chip { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 14px; border-radius: 999px; background: rgba(30, 16, 6, .78); border: 1px solid rgba(255, 230, 190, .3); font-weight: 900; min-width: 0; }
.area-chip b { font-family: var(--font-fun); font-weight: 600; font-size: 17px; color: var(--gold-hi); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.area-chip span { font-size: 14px; white-space: nowrap; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.music-btn { width: 40px; padding: 0; justify-content: center; font-size: 18px; }
.music-btn.is-on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 207, 61, .25); }
.music-btn.need-tap { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(255, 207, 61, .35); } }
.walk-hint, .act-tip { position: absolute; left: 50%; top: calc(max(8px, env(safe-area-inset-top)) + 54px); transform: translateX(-50%); z-index: 2; margin: 0; padding: 6px 14px; border-radius: 999px; background: rgba(30, 16, 6, .78); color: var(--cream); font-weight: 800; font-size: 13px; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.walk-hint.gone, .act-tip.gone { opacity: 0; }

.dock { grid-row: 2; grid-column: 1; display: flex; align-items: center; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(180deg, #3d2615, #2a180c); border-top: 1px solid rgba(255, 220, 160, .2); min-width: 0; }
.round { position: relative; flex-shrink: 0; width: 48px; height: 48px; border-radius: 50%; border: 2px solid rgba(255, 230, 190, .3); background: rgba(255, 240, 210, .08); font-size: 22px; cursor: pointer; color: #fff; }
.round:hover { border-color: var(--gold); }
.badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #e8463c; color: #fff; font-style: normal; font-size: 11px; font-weight: 900; line-height: 20px; }
.acts { display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; touch-action: pan-x; }
.acts::-webkit-scrollbar { display: none; }
.acts button { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 56px; height: 48px; padding: 0 6px; border-radius: 14px; border: 2px solid rgba(255, 230, 190, .2); background: rgba(255, 240, 210, .06); color: #fff; cursor: pointer; }
.acts button i { font-style: normal; font-size: 20px; line-height: 1.1; }
.acts button span { font-size: 11px; font-weight: 900; }
.acts button[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 207, 61, .2); }
.tool-btn { flex-shrink: 0; min-height: 48px; font-size: 16px; }

.panel { grid-row: 1; grid-column: 1; z-index: 3; justify-self: end; align-self: stretch; width: min(410px, 44vw); margin: calc(max(8px, env(safe-area-inset-top)) + 54px) 10px 10px 0; display: flex; flex-direction: column; min-height: 0; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); transform: translateX(calc(100% + 20px)); visibility: hidden; transition: transform .25s ease, visibility .25s; }
.panel.open { transform: none; visibility: visible; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-fun); font-size: 19px; color: var(--gold-hi); }
.x { border: 0; background: none; color: #fff; font-size: 18px; cursor: pointer; min-width: 36px; min-height: 36px; }
.panel-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 14px 18px; touch-action: pan-y; }
.panel-body h2 { margin: 2px 0 4px; font-family: var(--font-fun); font-weight: 600; font-size: 22px; color: var(--gold-hi); }
.panel-body h3 { margin: 18px 0 8px; font-family: var(--font-fun); font-weight: 600; font-size: 18px; color: var(--gold-hi); }
.note { margin: 8px 0; color: var(--muted); font-weight: 700; font-size: 13px; line-height: 1.45; }
.ok { margin: 8px 0; padding: 8px 12px; border-radius: 12px; background: rgba(80, 200, 140, .15); border: 1px solid rgba(110, 220, 160, .45); font-weight: 800; font-size: 14px; }
.loading { padding: 20px 0; text-align: center; color: var(--muted); font-weight: 800; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.verse { margin: 12px 0; padding: 12px 14px; border-radius: 16px; background: var(--cream); color: var(--ink); box-shadow: inset 0 0 0 1px rgba(150, 100, 40, .25); }
.verse small { display: block; margin-bottom: 4px; color: #8a5a20; font-weight: 900; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.verse p { margin: 0 0 6px; font-family: Georgia, "Times New Roman", serif; font-size: 16px; line-height: 1.5; }
.verse cite { font-style: normal; font-weight: 900; font-size: 13px; color: #8a5a20; }
.how { margin: 0; padding-left: 4px; list-style: none; display: grid; gap: 6px; font-weight: 700; font-size: 14px; line-height: 1.4; }
.todo { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.drinks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.drink { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 16px; border: 2px solid rgba(255, 230, 190, .2); background: rgba(255, 240, 210, .07); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.drink .di { font-size: 30px; }
.drink:hover, .drink.on { border-color: var(--gold); background: rgba(255, 207, 61, .16); }

.study-head small { color: var(--muted); font-weight: 900; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.study-head .ref { margin: 0; color: var(--muted); font-weight: 800; font-size: 13px; }
.passage { margin: 12px 0; padding: 14px 16px; border-radius: 16px; background: var(--cream); color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 17px; line-height: 1.6; }
.passage p { margin: 0 0 6px; }
.passage sup { font-family: var(--font-body); font-weight: 900; font-size: 11px; color: #a06a24; }
.q { margin: 10px 0; padding: 10px 12px; border-radius: 14px; background: rgba(255, 240, 210, .06); border: 1px solid var(--line); }
.q > p { margin: 0 0 8px; font-weight: 800; line-height: 1.4; }
.q.right { border-color: rgba(110, 220, 160, .7); background: rgba(80, 200, 140, .12); }
.q.wrong { border-color: rgba(255, 130, 120, .7); background: rgba(255, 90, 80, .1); }
.q small { display: block; margin-top: 6px; font-weight: 800; color: var(--muted); }
.q small.bad { color: #ffb4a8; }
.q small.good { color: #a8f0c8; }
.opts { display: grid; gap: 6px; }
.opt { min-height: 42px; padding: 8px 12px; border-radius: 12px; border: 2px solid rgba(255, 230, 190, .22); background: rgba(255, 240, 210, .06); color: #fff; font-weight: 800; font-size: 14px; text-align: left; cursor: pointer; }
.opt:hover { border-color: rgba(255, 207, 61, .7); }
.opt[aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 207, 61, .2); }
.opts.big .opt { min-height: 52px; font-size: 16px; }
.tq-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-weight: 800; }
.progress { height: 8px; margin: 8px 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #ffcf3d, #f0a51e); }
.tq { font-size: 20px !important; line-height: 1.35; }
.score { text-align: center; }
.score .stars { margin: 6px 0 0; font-size: 30px; letter-spacing: 2px; }
.trivia-intro p { margin: 6px 0 12px; font-weight: 700; line-height: 1.45; }

.wall { display: grid; gap: 8px; }
.pr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 240, 210, .07); border: 1px solid var(--line); }
.pr.mine { border-color: rgba(255, 207, 61, .5); }
.pr .pi { font-size: 24px; text-align: center; }
.pr p { margin: 0; font-weight: 800; font-size: 14px; line-height: 1.35; }
.pr small { color: var(--muted); font-weight: 700; font-size: 12px; }
.prayed { font-weight: 900; font-size: 12px; color: var(--gold-hi); text-align: right; }
.reqs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
.req { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 2px solid rgba(255, 230, 190, .2); background: rgba(255, 240, 210, .07); color: #fff; font-weight: 800; font-size: 13px; text-align: left; cursor: pointer; line-height: 1.3; }
.req span { font-size: 20px; }
.req:hover { border-color: var(--gold); }

.now { padding: 12px 14px; border-radius: 16px; background: linear-gradient(135deg, rgba(47, 158, 154, .3), rgba(255, 207, 61, .12)); border: 1px solid rgba(127, 224, 214, .4); }
.now small { display: block; color: var(--teal-hi); font-weight: 900; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.now b { display: block; font-family: var(--font-fun); font-weight: 600; font-size: 20px; }
.now span { color: var(--muted); font-weight: 700; font-size: 14px; }
.vol { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.vol input { flex: 1; accent-color: #ffcf3d; }

.verses { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.vbtn { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 12px; border: 2px solid rgba(255, 230, 190, .2); background: var(--cream); color: var(--ink); text-align: left; cursor: pointer; }
.vbtn b { font-size: 13px; color: #8a5a20; }
.vbtn span { font-family: Georgia, serif; font-size: 13px; line-height: 1.35; }
.vbtn:hover { border-color: var(--gold); }
.bless { display: grid; gap: 6px; }
.bl { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; background: rgba(255, 240, 210, .06); border: 1px solid var(--line); font-weight: 800; }
.kind-card { padding: 14px 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(255, 207, 61, .22), rgba(255, 120, 150, .14)); border: 1px solid rgba(255, 207, 61, .45); }
.kind-card small { font-weight: 900; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-hi); }
.kind-card p { margin: 6px 0 0; font-family: var(--font-fun); font-size: 21px; font-weight: 600; line-height: 1.3; }

/* ---------- messages, say, player card ---------- */
.chat { position: fixed; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; width: min(360px, calc(100% - 24px)); max-height: min(480px, calc(100% - 150px)); display: flex; flex-direction: column; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.chat header { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; border-bottom: 1px solid var(--line); font-family: var(--font-fun); font-size: 17px; }
.msgs { list-style: none; margin: 0; padding: 8px 12px; overflow-y: auto; flex: 1; min-height: 80px; touch-action: pan-y; }
.msgs li { margin: 4px 0; font-size: 14px; line-height: 1.35; word-wrap: break-word; }
.msgs li b { color: var(--gold-hi); }
.msgs li.me b { color: var(--teal-hi); }
.msgs li.sys { color: var(--muted); font-style: italic; font-size: 13px; }
.msgs li .big { font-size: 22px; vertical-align: middle; }
.msgs li.k-verse span { font-family: Georgia, serif; }
.chat-note { margin: 0; padding: 0 12px 10px; font-size: 12px; color: var(--muted); font-weight: 700; line-height: 1.4; }
.popover { position: fixed; left: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 30; width: min(360px, calc(100% - 24px)); border-radius: 20px; background: var(--panel); border: 1px solid var(--line); box-shadow: 0 20px 50px rgba(0, 0, 0, .5); }
.phrases { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; max-height: 170px; overflow-y: auto; touch-action: pan-y; }
.phrases button { border: 1px solid rgba(255, 230, 190, .25); border-radius: 999px; padding: 7px 12px; background: rgba(255, 240, 210, .08); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.phrases button:hover { background: rgba(255, 207, 61, .25); border-color: var(--gold); }
.emojis { display: flex; flex-wrap: wrap; gap: 2px; padding: 8px 10px; }
.emojis button { width: 40px; height: 40px; border: 0; border-radius: 12px; background: none; font-size: 23px; cursor: pointer; }
.emojis button:hover { background: rgba(255, 255, 255, .12); }
.player-card { position: fixed; z-index: 35; min-width: 200px; max-width: 250px; padding: 12px; border-radius: 18px; background: var(--panel-solid); border: 1px solid rgba(255, 207, 61, .45); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); }
.player-card > b { display: block; margin-bottom: 8px; font-family: var(--font-fun); font-size: 19px; font-weight: 600; color: var(--gold-hi); text-align: center; }
.pc-actions, .pc-report { display: grid; gap: 6px; }
.pc-report p { margin: 0 0 2px; font-weight: 800; color: var(--muted); font-size: 13px; text-align: center; }
.pc-note { margin: 8px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; text-align: center; line-height: 1.35; }
.toast { position: fixed; left: 50%; top: 16%; z-index: 90; transform: translateX(-50%); width: max-content; max-width: min(440px, calc(100% - 32px)); padding: 12px 18px; border-radius: 16px; background: var(--panel-solid); border: 1px solid rgba(255, 207, 61, .5); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); font-weight: 800; text-align: center; line-height: 1.4; }

/* ---------- modals: quiet time, style editor ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 12px; background: rgba(20, 8, 0, .62); overflow-y: auto; touch-action: pan-y; }
.quiet-card { width: min(460px, 100%); padding: 22px; text-align: center; background: linear-gradient(180deg, rgba(56, 34, 18, .98), rgba(36, 21, 10, .98)); }
.quiet-card h2 { margin: 0 0 10px; font-family: var(--font-fun); font-weight: 600; color: var(--gold-hi); }
.breath { display: grid; place-items: center; height: 150px; }
.breath span { width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 240, 190, .95), rgba(255, 207, 61, .35) 60%, rgba(255, 207, 61, 0) 72%); animation: breathe 8s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(.8); } 50% { transform: scale(1.55); } }
.quiet-step { min-height: 3em; margin: 6px 0; font-family: var(--font-fun); font-size: 21px; font-weight: 600; line-height: 1.35; }
.quiet-verse { margin: 4px 0 14px; color: var(--muted); font-family: Georgia, serif; font-size: 15px; line-height: 1.5; }
.quiet-bar { height: 6px; margin: 0 0 16px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.quiet-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7fe0d6, #ffcf3d); transition: width .5s linear; }
.editor-card { width: min(880px, 100%); max-height: calc(100% - 8px); display: flex; flex-direction: column; padding: 0 18px 16px; background: rgba(44, 26, 12, .98); }
.ed-top { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; margin: 0 -18px 10px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #2f1c0d; border-radius: 22px 22px 0 0; }
.ed-top h2 { margin: 0; text-align: center; font-family: var(--font-fun); font-weight: 600; font-size: 24px; color: var(--gold-hi); }
.ed-kinds { display: flex; justify-content: center; gap: 8px; margin-bottom: 10px; }
.ed-kinds [aria-pressed="true"] { border-color: var(--gold); background: rgba(255, 207, 61, .2); }
.editor-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 14px; min-height: 0; flex: 1; }
.editor-grid canvas { width: 220px; height: 254px; align-self: center; background: radial-gradient(circle at 50% 70%, rgba(255, 200, 110, .3), transparent 60%); border-radius: 18px; }
.ed-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; align-self: center; text-align: center; }
.ed-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ed-rows { overflow-y: auto; padding-right: 4px; display: grid; gap: 10px; align-content: start; }
.ed-row b { display: block; margin-bottom: 5px; font-size: 13px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.ed-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.ed-opt { min-width: 38px; height: 38px; padding: 0 10px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .07); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; }
.ed-opt.sw { width: 38px; padding: 0; }
.ed-opt[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(255, 207, 61, .35); }

/* ---------- phones and narrow screens ---------- */
@media (max-width: 860px) {
  .entry-grid { grid-template-columns: minmax(0, 1fr); }
  .area-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* tall screens (phones held upright): the room on top, the area's activity below it */
@media (orientation: portrait), (max-aspect-ratio: 1/1) {
  .area { grid-template-rows: auto auto minmax(0, 1fr); }
  .stage { height: min(56vh, 120vw); height: min(56dvh, 120vw); }
  .dock { grid-row: 2; }
  .panel { grid-row: 3; width: auto; margin: 0; justify-self: stretch; border-radius: 0; border: 0; box-shadow: none; transform: none; visibility: visible; background: #2f1c0d; }
  .panel-head { padding: 8px 14px; }
  .panel-head .x, .tool-btn { display: none; }
  .chat, .popover { bottom: auto; top: calc(min(56dvh, 120vw) + 70px); max-height: calc(100dvh - min(56dvh, 120vw) - 84px); }
}
@media (max-width: 560px) {
  .entry, .mapscreen { padding-left: 10px; padding-right: 10px; }
  .me-card canvas { width: 110px; height: 125px; }
  .area-chip b { font-size: 15px; }
  .map-title { font-size: 18px; }
  .spot-count { font-size: 10px; padding: 1px 6px; }
  .chip-btn span { display: none; }
  .topbar { gap: 6px; padding-left: 8px; padding-right: 8px; }
  .area-chip { padding: 0 10px; gap: 6px; }
  .coins-pill { font-size: 14px; padding-right: 10px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr); }
  .editor-grid canvas { width: 160px; height: 185px; }
  .ed-top h2 { font-size: 19px; }
  .ed-top .btn { padding: 0 12px; }
  .acts button { min-width: 50px; }
}
@media (prefers-reduced-motion: reduce) { .banner-enter, .breath span, .music-btn.need-tap, .coins-pill.bump { animation: none; } }
