:root {
  color-scheme: light;
  --paper: #f3efe2;
  --paper-light: #fffdf5;
  --paper-deep: #e5dcc8;
  --teal: #527d78;
  --teal-dark: #355e5a;
  --teal-pale: #dce9e0;
  --coral: #c56f58;
  --coral-dark: #995442;
  --ink: #2c3734;
  --muted: #697570;
  --line: #d8d2c1;
  --gold: #c9a767;
  --success: #4c785e;
  --warning: #976746;
  --shadow: 0 18px 50px rgba(48, 62, 55, .09);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Noto Sans TC', 'PingFang TC', 'Microsoft JhengHei', sans-serif;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(ellipse at 88% 4%, rgba(82,125,120,.09), transparent 28rem), linear-gradient(180deg,#f4f0e4 0%,var(--paper) 55%,#ece4d2 100%); }
button,input,select,textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
a { color: inherit; }
[hidden] { display: none !important; }
.page-shell { width: min(1160px,calc(100% - 44px)); margin: 0 auto; padding-bottom: 28px; }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(82,125,120,.24); }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; box-shadow: 0 5px 13px rgba(82,125,120,.18); }
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-family: 'Noto Serif TC','Songti TC',serif; font-size: 17px; letter-spacing: .08em; font-weight: 650; }
.brand-copy small { color: var(--muted); font-size: 10px; letter-spacing: .07em; }
.connection-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; background: rgba(255,253,245,.78); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #a49c8d; box-shadow: 0 0 0 3px rgba(164,156,141,.13); }
.connection-pill[data-state="connected"] { color: var(--success); border-color: rgba(76,120,94,.4); }
.connection-pill[data-state="connected"] .status-dot { background: #4c956b; box-shadow: 0 0 0 3px rgba(76,149,107,.13); }
.connection-pill[data-state="connecting"] .status-dot { background: #c18d4f; animation: pulse 1.6s ease-in-out infinite; }
.connection-pill[data-state="failed"] { color: var(--coral-dark); border-color: rgba(197,111,88,.48); }
.connection-pill[data-state="failed"] .status-dot { background: var(--coral); }
.hero { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(290px,.9fr); gap: 40px; align-items: center; padding: 46px 0 36px; }
.hero-copy { max-width: 640px; }
.eyebrow { margin: 0; color: var(--teal-dark); font-size: 10px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.hero .eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow-rule { width: 26px; height: 1px; background: var(--teal); display: inline-block; }
h1,h2,h3,p { margin-top: 0; }
h1,h2,h3 { font-family: 'Noto Serif TC','Songti TC',serif; }
.hero h1 { margin: 18px 0 14px; font-size: clamp(32px,5vw,54px); line-height: 1.3; letter-spacing: .025em; font-weight: 520; }
.hero h1 em { color: var(--teal); font-style: normal; }
.hero-description { max-width: 560px; color: var(--muted); font-size: 13px; line-height: 1.95; margin-bottom: 18px; }
.promise-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: var(--teal-dark); font-size: 10px; letter-spacing: .04em; }
.promise-line i { width: 3px; height: 3px; border-radius: 50%; background: #a7a18e; }
.hero-town { position: relative; height: 258px; overflow: hidden; border: 1px solid rgba(82,125,120,.22); border-radius: 46% 46% 12px 12px/22% 22% 12px 12px; background: linear-gradient(180deg,#d7e7dd 0%,#e9e5d2 52%,#d4ddc0 100%); box-shadow: inset 0 0 0 9px rgba(255,253,245,.32),var(--shadow); }
.hero-town::before { content: ''; position: absolute; inset: 16px; border: 1px solid rgba(82,125,120,.13); border-radius: inherit; pointer-events: none; }
.hero-sun { position: absolute; top: 14%; right: 20%; width: 45px; height: 45px; border-radius: 50%; background: #f3d99c; box-shadow: 0 0 28px rgba(238,206,133,.32); }
.hero-cloud { position: absolute; z-index: 1; width: 64px; height: 12px; border-radius: 30px; background: rgba(255,253,245,.62); }
.hero-cloud::before,.hero-cloud::after { content: ''; position: absolute; bottom: 3px; width: 24px; height: 22px; border-radius: 50%; background: inherit; }
.hero-cloud::before { left: 9px; }.hero-cloud::after { right: 9px; width: 19px; height: 18px; }
.cloud-one { left: 16%; top: 25%; }.cloud-two { right: 13%; top: 39%; transform: scale(.7); }
.hero-hill { position: absolute; left: -8%; right: -8%; bottom: 17%; height: 42%; border-radius: 50% 50% 0 0; }
.hill-back { background: #a9bf9a; transform: translate(12%,-12%) rotate(-3deg); }
.hill-front { bottom: 7%; background: #8ca88a; transform: translate(-7%,12%) rotate(3deg); }
.hero-road { position: absolute; z-index: 2; bottom: -17%; left: 40%; width: 32%; height: 76%; border: 20px solid #d6c9ad; border-bottom: 0; border-radius: 50% 50% 0 0; transform: rotate(26deg); opacity: .9; }
.hero-house { position: absolute; z-index: 3; bottom: 24%; width: 48px; height: 48px; border: 2px solid rgba(66,87,74,.12); border-radius: 4px 4px 0 0; background: #f3e4c8; box-shadow: 0 5px 0 rgba(62,84,70,.12); }
.hero-house::before { content: ''; position: absolute; left: -8px; top: -23px; width: 58px; height: 35px; background: #a66350; clip-path: polygon(50% 0,100% 100%,0 100%); }
.hero-house i { position: absolute; bottom: 0; left: 17px; width: 12px; height: 21px; background: #758e7b; }
.house-one { left: 22%; transform: scale(.83); }.house-two { left: 43%; bottom: 31%; transform: scale(1.12); background: #e5d4ad; }.house-two::before { background: #768d77; }.house-three { right: 16%; bottom: 21%; transform: scale(.73); background: #e5c9ad; }
.hero-caption { position: absolute; z-index: 4; right: 22px; bottom: 16px; color: rgba(44,55,52,.68); font-size: 9px; letter-spacing: .1em; }
.panel,.content-card,.resident-card,.action-card-panel,.scene-card { border: 1px solid rgba(82,125,120,.18); border-radius: 13px; background: rgba(255,253,245,.85); box-shadow: var(--shadow); }
.panel { position: relative; margin: 0 0 19px; padding: 28px clamp(18px,4vw,42px) 33px; }
.welcome-panel { max-width: 730px; }
.section-heading { display: flex; align-items: center; gap: 15px; margin-bottom: 13px; }
.step-number { width: 41px; height: 41px; display: grid; place-items: center; border: 1px solid rgba(82,125,120,.4); border-radius: 50%; color: var(--teal-dark); font-family: 'Noto Serif TC','Songti TC',serif; font-size: 13px; }
.section-heading h2 { margin: 4px 0 0; font-size: 22px; font-weight: 550; letter-spacing: .02em; }
.section-intro { margin: 0 0 19px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.resident-form { display: grid; gap: 10px; max-width: 480px; }
.field-label { display: block; color: var(--teal-dark); font-size: 11px; font-weight: 750; letter-spacing: .04em; }
input,select,textarea { width: 100%; min-height: 45px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: rgba(255,253,245,.96); outline: none; font-size: 13px; }
textarea { min-height: 75px; resize: vertical; overflow-wrap: anywhere; line-height: 1.55; }
input:focus,select:focus,textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(82,125,120,.11); }
input::placeholder,textarea::placeholder { color: #a29d8e; }
.button { min-height: 43px; padding: 10px 17px; border-radius: 7px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 11px; font-size: 12px; font-weight: 750; letter-spacing: .03em; transition: transform .16s ease,background .16s ease,box-shadow .16s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible,.text-button:focus-visible,.life-action:focus-visible,.scene-reset:focus-visible { outline: 3px solid rgba(82,125,120,.28); outline-offset: 2px; }
.button-primary { color: #fffaf0; background: var(--teal); box-shadow: 0 7px 16px rgba(53,94,90,.15); }
.button-primary:hover:not(:disabled) { background: var(--teal-dark); }
.button-secondary { color: var(--teal-dark); border-color: rgba(82,125,120,.36); background: #edf2e8; }
.button-secondary:hover:not(:disabled) { background: #e2ecdf; }
.button-quiet { color: var(--muted); border-color: var(--line); background: transparent; }
.button-wide { width: 100%; margin-top: 6px; }
.text-button { border: 0; padding: 8px 0; color: var(--teal-dark); background: transparent; font-size: 11px; font-weight: 750; text-decoration: underline; text-decoration-color: rgba(82,125,120,.4); text-underline-offset: 4px; }
.notice { padding: 12px 14px; border-left: 3px solid var(--warning); border-radius: 4px; background: #f4ead9; color: #70543e; font-size: 11px; line-height: 1.7; }
.notice-warm { margin-top: 15px; }
.action-stack { display: grid; gap: 12px; max-width: 560px; }
.server-lobby { max-width: 820px; }
.lobby-name-form { max-width: 620px; margin: 0 0 18px; }
.lobby-name-form .microcopy { margin: 0; }
.lobby-name-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.lobby-name-row .button { min-width: 138px; }
.online-roster { margin: 16px 0 0; }
.online-roster .eyebrow { margin-bottom: 3px; }
.online-roster #online-scope-note { margin: 10px 0 0; }
.divider-label { display: flex; align-items: center; gap: 10px; color: #9d9b8d; font-size: 10px; }
.divider-label::before,.divider-label::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.join-form { display: grid; gap: 9px; }
#practice-button { justify-self: start; }
.room-tools { display: grid; gap: 14px; }
.room-id-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 13px 15px; border: 1px dashed rgba(82,125,120,.35); border-radius: 7px; background: rgba(220,233,224,.42); }
.room-id-row strong { color: var(--teal-dark); font-family: 'Noto Serif TC','Songti TC',serif; font-size: 18px; letter-spacing: .15em; }
.room-status-text { margin-left: auto; color: var(--muted); font-size: 10px; }
.link-card { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,245,.76); }
.link-card textarea { margin-top: 8px; font-size: 10px; }
.microcopy { color: var(--muted); font-size: 10px; line-height: 1.75; }
.link-card .microcopy { margin: 7px 0 11px; }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.roster-card { margin-top: 5px; padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: rgba(229,220,200,.25); }
.roster-heading,.card-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.roster-heading h3 { margin: 0; font-size: 15px; font-weight: 550; }
.count-badge { padding: 4px 8px; border-radius: 999px; color: var(--teal-dark); background: var(--teal-pale); font-size: 10px; font-weight: 750; white-space: nowrap; }
.players-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.player-row { display: flex; align-items: center; gap: 9px; min-height: 38px; padding: 7px 9px; border-radius: 6px; background: rgba(255,253,245,.82); }
.player-seal { width: 27px; height: 27px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: var(--teal-dark); background: #dce8d8; font-family: 'Noto Serif TC','Songti TC',serif; font-size: 11px; }
.player-detail { min-width: 0; display: grid; gap: 2px; }.player-detail strong { font-size: 11px; font-weight: 650; }.player-detail small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.empty-roster { color: var(--muted); font-size: 10px; }.start-row { margin-top: 17px; }.start-row .microcopy { margin-bottom: 8px; }.leave-button { margin-top: 12px; }
.town-panel { margin: 0 0 18px; }
.town-heading-row { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 0 0 13px; }
.town-heading-row h2 { margin: 4px 0 0; color: var(--teal-dark); font-size: clamp(26px,4vw,35px); font-weight: 550; }
.town-room-chip { display: flex; flex-wrap: wrap; justify-content: end; gap: 8px; color: var(--muted); font-size: 10px; }
.town-room-chip span { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,253,245,.75); }
.town-layout { display: grid; grid-template-columns: minmax(0,1.43fr) minmax(290px,.77fr); gap: 13px; align-items: stretch; }
.scene-card { overflow: hidden; padding: 11px; }
.scene-topline { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; color: var(--teal-dark); font-size: 10px; font-weight: 700; }
.scene-live-dot { width: 7px; height: 7px; flex: 0 0 auto; border-radius: 50%; background: #68a27a; box-shadow: 0 0 0 3px rgba(104,162,122,.12); }
.scene-reset { margin-left: auto; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,253,245,.9); font-size: 9px; }
.canvas-frame { position: relative; overflow: hidden; min-height: 360px; border-radius: 9px; background: linear-gradient(180deg,#c8ded7,#e5e3d4 60%,#d0d9c2); touch-action: none; }
#city-canvas { display: block; width: 100%; height: 360px; touch-action: none; cursor: grab; }
#city-canvas:active { cursor: grabbing; }
.scene-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 26px; text-align: center; color: var(--muted); background: #e8e7db; font-size: 12px; line-height: 1.8; }
.scene-hint { position: absolute; right: 11px; bottom: 10px; padding: 5px 8px; border-radius: 999px; color: rgba(44,55,52,.74); background: rgba(255,253,245,.75); font-size: 9px; pointer-events: none; }
.move-pad { position: absolute; z-index: 2; left: 12px; bottom: 12px; display: grid; grid-template: 42px 42px / 42px 42px 42px; gap: 3px; touch-action: none; }
.move-pad button { display: grid; place-items: center; padding: 0; border: 1px solid rgba(53,94,90,.34); border-radius: 12px; color: var(--teal-dark); background: rgba(255,253,245,.82); box-shadow: 0 3px 10px rgba(44,55,52,.12); font-size: 20px; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; }
.move-pad button:active { background: rgba(220,233,224,.96); transform: scale(.95); }
.move-pad button:nth-child(1) { grid-area: 1 / 2; }
.move-pad button:nth-child(2) { grid-area: 2 / 1; }
.move-pad button:nth-child(3) { grid-area: 2 / 2; }
.move-pad button:nth-child(4) { grid-area: 2 / 3; }
.life-column { display: grid; align-content: start; gap: 12px; }
.resident-card,.action-card-panel { padding: 16px; }
.resident-card-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.resident-card-heading h3,.panel-title-row h3 { margin: 4px 0 0; font-size: 17px; font-weight: 550; }
.resident-avatar { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(82,125,120,.24); border-radius: 12px; color: var(--teal-dark); background: var(--teal-pale); font-family: 'Noto Serif TC','Songti TC',serif; font-size: 13px; }
.stat-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid rgba(216,210,193,.7); color: var(--muted); font-size: 10px; }
.stat-row strong { color: var(--ink); font-size: 12px; font-weight: 750; text-align: right; }.stat-row strong small { color: var(--muted); font-size: 9px; font-weight: 500; }.stat-row-last strong { max-width: 60%; overflow-wrap: anywhere; }
.energy-track { height: 6px; overflow: hidden; margin: -4px 0 5px; border-radius: 99px; background: #e5e2d7; }
.energy-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#82aa7a,#b7c66f); transition: width .28s ease; }
.panel-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.life-actions { display: grid; gap: 8px; }
.life-action { width: 100%; display: flex; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid var(--line); border-radius: 8px; text-align: left; color: var(--ink); background: #fffdf5; transition: border .16s ease,transform .16s ease,background .16s ease; }
.life-action:hover:not(:disabled) { transform: translateY(-1px); border-color: rgba(82,125,120,.55); background: #f7f5e9; }.life-action:disabled { opacity: .45; cursor: not-allowed; }
.action-icon { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 10px; color: var(--teal-dark); background: var(--teal-pale); font-size: 18px; font-weight: 500; }
.life-action strong,.life-action small { display: block; }.life-action strong { font-size: 11px; }.life-action small { margin-top: 3px; color: var(--muted); font-size: 9px; }.action-hint { margin: 9px 0 0; }
.town-content-grid,.town-bottom-grid { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); gap: 13px; margin-top: 13px; }
.content-card { padding: 17px; }
.section-count { color: var(--muted); font-size: 9px; white-space: nowrap; }
.homes-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.home-card { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,253,245,.75); }
.home-card[data-owned="true"] { border-color: rgba(201,167,103,.8); background: #faf4e3; box-shadow: inset 0 0 0 1px rgba(201,167,103,.16); }
.home-card h4 { margin: 0 0 4px; color: var(--ink); font-family: 'Noto Serif TC','Songti TC',serif; font-size: 13px; font-weight: 600; }
.home-card p { min-height: 29px; margin: 0 0 8px; color: var(--muted); font-size: 9px; line-height: 1.6; }
.home-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; font-size: 10px; }.home-meta strong { color: var(--teal-dark); }.home-owner { color: var(--muted); font-size: 9px; }
.home-card .button { width: 100%; min-height: 36px; padding: 7px 9px; font-size: 10px; }
.travel-mark { color: var(--coral); font-size: 22px; }
.travel-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 7px; margin-top: 7px; }.travel-controls select { min-width: 0; min-height: 42px; padding: 9px; font-size: 10px; }.travel-controls .button { min-height: 42px; padding: 8px 11px; font-size: 10px; }
.return-town { margin-top: 6px; }.travel-note { margin: 10px 0 0; }
.town-bottom-grid .event-log { margin-top: 11px; }
.event-log { display: grid; gap: 8px; list-style: none; padding: 0; margin: 12px 0 0; }
.event-log li { padding-left: 11px; border-left: 1px solid rgba(197,111,88,.56); color: var(--muted); font-size: 10px; line-height: 1.65; }
.neighbors-card .players-list { margin-top: 10px; }
.limits-note { display: grid; grid-template-columns: 35px 1fr; gap: 12px; max-width: 940px; margin: 22px 0 25px; padding: 17px 19px; border-top: 1px solid rgba(82,125,120,.23); border-bottom: 1px solid rgba(82,125,120,.23); }
.note-symbol { width: 29px; height: 29px; display: grid; place-items: center; border: 1px solid rgba(82,125,120,.36); border-radius: 50%; color: var(--teal-dark); font-size: 13px; }
.limits-note h2 { margin: 0 0 6px; font-size: 14px; font-weight: 550; }.limits-note p { margin: 0; max-width: 840px; color: var(--muted); font-size: 10px; line-height: 1.85; }
.site-footer { display: flex; justify-content: space-between; gap: 12px; padding: 13px 2px; border-top: 1px solid rgba(82,125,120,.2); color: var(--muted); font-size: 9px; letter-spacing: .04em; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); width: max-content; max-width: min(90vw,480px); transform: translateX(-50%); padding: 12px 16px; border: 1px solid rgba(53,94,90,.38); border-radius: 8px; color: #fffaf0; background: #355e5a; box-shadow: 0 8px 25px rgba(38,58,53,.22); font-size: 11px; line-height: 1.65; }
.toast[data-kind="error"] { background: #895340; border-color: rgba(137,83,64,.4); }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(193,141,79,.12); opacity: .75; } }
@media (max-width:850px) {
  .page-shell { width: min(calc(100% - 32px),690px); }
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 34px 0 26px; }
  .hero-town { min-height: 220px; max-width: 470px; width: 100%; justify-self: center; }
  .town-layout { grid-template-columns: 1fr; }.life-column { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
  .canvas-frame,#city-canvas { min-height: 350px; height: 350px; }
  .town-content-grid,.town-bottom-grid { grid-template-columns: 1fr; }
}
@media (max-width:520px) {
  .page-shell { width: calc(100% - 22px); }
  .topbar { min-height: 68px; }.brand-mark { width: 34px; height: 34px; border-radius: 10px; }.brand-copy strong { font-size: 15px; }.brand-copy small { font-size: 9px; }
  .connection-pill { padding: 7px 9px; font-size: 9px; }
  .hero { padding-top: 27px; gap: 18px; }.hero h1 { margin: 14px 0 11px; font-size: clamp(31px,8.6vw,43px); }.hero-description { font-size: 12px; }.hero-town { height: 195px; min-height: 195px; }
  .panel { padding: 20px 15px 23px; }.section-heading { gap: 11px; }.section-heading h2 { font-size: 20px; }.lobby-name-row { grid-template-columns: 1fr; }.lobby-name-row .button { width: 100%; }
  .room-id-row { align-items: flex-start; }.room-status-text { width: 100%; margin-left: 0; }.button-row .button { flex: 1; }
  .town-heading-row { align-items: start; }.town-room-chip { max-width: 46%; flex-direction: column; align-items: end; gap: 5px; }.town-room-chip span { text-align: right; }
  .scene-card { padding: 8px; }.canvas-frame,#city-canvas { min-height: 270px; height: 270px; }.scene-topline { font-size: 9px; }.move-pad { left: 9px; bottom: 9px; transform: scale(.88); transform-origin: bottom left; }.scene-hint { right: 8px; bottom: 10px; max-width: 48%; text-align: right; font-size: 8px; }
  .life-column { grid-template-columns: 1fr; }.resident-card,.action-card-panel,.content-card { padding: 14px; }
  .homes-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; }.home-card { padding: 10px; }.home-card h4 { font-size: 12px; }
  .travel-controls { grid-template-columns: minmax(0,1fr) auto; }.travel-controls select { font-size: 9px; }
  .limits-note { padding: 14px 1px; grid-template-columns: 29px 1fr; }.site-footer { flex-direction: column; }
}
@media (max-width:360px) {
  .homes-grid { grid-template-columns: 1fr; }.travel-controls { grid-template-columns: 1fr; }.travel-controls .button { width: 100%; }.connection-pill { gap: 5px; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Open-world game view: the world fills the screen; life options live in one overlay. */
body:has(#town-panel:not([hidden])) { overflow: hidden; }
.world-screen { position: fixed; z-index: 5; inset: 0; width: 100vw; height: 100vh; height: 100dvh; overflow: hidden; color: #f9f5e9; background: linear-gradient(#bed4d0,#d2d1b9 56%,#879b78); }
#city-canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#city-canvas:active { cursor: grabbing; }
.world-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg,rgba(25,43,40,.32),transparent 27%,transparent 68%,rgba(25,43,40,.17)); }
.world-hud { position: absolute; z-index: 2; top: max(12px,env(safe-area-inset-top)); left: max(12px,env(safe-area-inset-left)); right: max(12px,env(safe-area-inset-right)); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; pointer-events: none; }
.world-title-card,.world-controls-card,.world-zone-pill,.world-hint { color: var(--ink); border: 1px solid rgba(255,253,245,.42); background: rgba(250,248,237,.86); box-shadow: 0 8px 26px rgba(25,43,40,.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.world-title-card { min-width: 155px; padding: 11px 15px; border-radius: 13px; }
.world-title-card .eyebrow { display: flex; align-items: center; gap: 6px; font-size: 9px; letter-spacing: .07em; }
.world-title-card h2 { margin: 4px 0 1px; color: var(--teal-dark); font-size: clamp(19px,3vw,25px); font-weight: 650; }
.world-location { color: var(--muted); font-size: 10px; }
.scene-live-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #68a27a; box-shadow: 0 0 0 3px rgba(104,162,122,.15); }
.world-controls-card { min-width: 190px; max-width: 310px; padding: 9px; border-radius: 13px; }
.world-player-line,.world-player-stats,.world-buttons { display: flex; align-items: center; gap: 7px; }
.world-player-line { justify-content: space-between; color: var(--muted); font-size: 9px; }
.world-player-stats { flex-wrap: wrap; margin: 7px 0; font-size: 11px; }
.world-player-stats strong { color: var(--teal-dark); }
.world-player-stats span:not(.energy-chip) { padding: 3px 7px; border-radius: 999px; background: rgba(220,233,224,.8); }
.energy-chip { color: #765c31; }
.world-buttons { flex-wrap: wrap; }
.hud-button { min-height: 31px; padding: 6px 9px; border: 1px solid rgba(53,94,90,.25); border-radius: 8px; color: #fffaf0; background: var(--teal); font-size: 9px; font-weight: 700; }
.hud-button-quiet { color: var(--teal-dark); background: rgba(255,253,245,.75); }
.world-zone-pill { position: absolute; z-index: 2; left: 50%; top: max(16px,env(safe-area-inset-top)); transform: translateX(-50%); display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 999px; color: var(--teal-dark); font-size: 10px; font-weight: 700; white-space: nowrap; }
.zone-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--coral); }
.move-pad { position: absolute; z-index: 3; left: max(18px,env(safe-area-inset-left)); bottom: max(22px,env(safe-area-inset-bottom)); display: grid; grid-template: 52px 52px / 52px 52px 52px; gap: 4px; touch-action: none; }
.move-pad button { display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,253,245,.56); border-radius: 15px; color: #fdf9eb; background: rgba(42,72,66,.72); box-shadow: 0 5px 17px rgba(21,37,34,.25); font-size: 22px; font-weight: 700; touch-action: none; user-select: none; -webkit-user-select: none; backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); }
.move-pad button:active { background: rgba(82,125,120,.94); transform: scale(.94); }
.move-pad button:nth-child(1) { grid-area: 1 / 2; }.move-pad button:nth-child(2) { grid-area: 2 / 1; }.move-pad button:nth-child(3) { grid-area: 2 / 2; }.move-pad button:nth-child(4) { grid-area: 2 / 3; }
.world-hint { position: absolute; z-index: 2; right: max(16px,env(safe-area-inset-right)); bottom: max(24px,env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 999px; color: var(--teal-dark); font-size: 9px; pointer-events: none; }
.world-hint i { width: 3px; height: 3px; border-radius: 50%; background: var(--coral); }
.scene-fallback { position: absolute; z-index: 4; inset: 0; display: grid; place-items: center; padding: 30px; text-align: center; color: var(--muted); background: #e8e7db; font-size: 13px; line-height: 1.8; }
.life-dialog { width: min(620px,calc(100vw - 24px)); max-width: 620px; max-height: min(88dvh,860px); padding: 0; overflow: hidden; border: 1px solid rgba(82,125,120,.28); border-radius: 18px; color: var(--ink); background: var(--paper); box-shadow: 0 24px 80px rgba(24,40,36,.35); }
.life-dialog::backdrop { background: rgba(18,31,29,.48); backdrop-filter: blur(4px); }
.life-dialog-header { position: sticky; z-index: 2; top: 0; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border-bottom: 1px solid var(--line); background: rgba(243,239,226,.97); }
.life-dialog-header h2 { margin: 3px 0 0; color: var(--teal-dark); font-size: 21px; }
.life-dialog-header form { margin: 0; }
.dialog-close { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 50%; color: var(--teal-dark); background: var(--paper-light); font-size: 22px; }
.life-dialog-content { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: calc(min(88dvh,860px) - 68px); overflow: auto; padding: 12px; overscroll-behavior: contain; }
.life-dialog-content > section { min-width: 0; padding: 13px; border: 1px solid rgba(82,125,120,.18); border-radius: 12px; background: rgba(255,253,245,.88); }
.life-dialog-content .resident-card,.life-dialog-content .action-card-panel,.life-dialog-content .content-card { box-shadow: none; }
.life-dialog-content .homes-section,.life-dialog-content .travel-section { grid-column: 1 / -1; }
.life-dialog-content .homes-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.life-dialog-content .home-card p { min-height: 0; }
.life-dialog-content .players-list { gap: 6px; }
.life-dialog-content .travel-controls { grid-template-columns: minmax(0,1fr) auto; }
.life-dialog-content .event-log { margin-top: 8px; }
@media (max-width:650px) {
  .world-hud { left: max(8px,env(safe-area-inset-left)); right: max(8px,env(safe-area-inset-right)); gap: 6px; }
  .world-title-card { min-width: 0; max-width: 43%; padding: 9px 10px; }
  .world-title-card .eyebrow { font-size: 8px; letter-spacing: .02em; }
  .world-title-card h2 { font-size: 20px; }
  .world-location { font-size: 9px; }
  .world-controls-card { min-width: 0; width: 57%; padding: 7px; }
  .world-player-line { font-size: 8px; }
  .world-player-stats { gap: 5px; margin: 5px 0; font-size: 10px; }
  .hud-button { min-height: 29px; padding: 5px 7px; font-size: 8px; }
  .world-zone-pill { top: calc(max(8px,env(safe-area-inset-top)) + 106px); bottom: auto; left: 50%; max-width: calc(100vw - 24px); transform: translateX(-50%); font-size: 9px; }
  .move-pad { left: max(12px,env(safe-area-inset-left)); bottom: max(15px,env(safe-area-inset-bottom)); grid-template: 48px 48px / 48px 48px 48px; }
  .world-hint { left: 50%; right: auto; bottom: max(115px,calc(env(safe-area-inset-bottom) + 105px)); transform: translateX(-50%); gap: 6px; padding: 6px 9px; font-size: 8px; white-space: nowrap; }
  .world-hint i,.world-hint span:nth-of-type(n+2) { display: none; }
  .world-hint .touch-look-hint { display: inline; }
  .world-hint .desktop-look-hint { display: none; }
  .life-dialog-content { grid-template-columns: 1fr; padding: 10px; }
  .life-dialog-content .homes-section,.life-dialog-content .travel-section { grid-column: auto; }
}
@media (max-width:380px) {
  .world-controls-card { width: 60%; }
  .world-title-card { max-width: 40%; }
  .world-buttons { gap: 4px; }
  .hud-button { padding: 5px 6px; font-size: 7px; }
  .world-hint { right: 8px; max-width: 45vw; }
  .world-hint span:last-child { white-space: nowrap; }
}


/* Game experience landing page inspired by game-discovery pages, using the existing city palette/art. */
.experience-page { max-width: 1160px; margin: 23px auto 18px; }
.experience-card { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(290px,.8fr); gap: 0; overflow: hidden; border: 1px solid rgba(82,125,120,.2); border-radius: 15px; background: rgba(255,253,245,.92); box-shadow: var(--shadow); }
.experience-cover { position: relative; min-height: 292px; overflow: hidden; isolation: isolate; background: linear-gradient(180deg,#c7ded9 0%,#e3e2cf 55%,#d3ddc1 100%); }
.experience-cover::before { content: ''; position: absolute; z-index: 5; inset: 13px; border: 1px solid rgba(255,253,245,.44); border-radius: 10px; pointer-events: none; }
.experience-cover .hero-sun { z-index: -1; width: 62px; height: 62px; }
.experience-cover .hero-hill { z-index: 0; }
.experience-cover .hero-road { z-index: 1; width: 29%; left: 39%; border-width: 30px; }
.experience-cover .hero-house { z-index: 2; bottom: 22%; transform: scale(1.2); }
.experience-cover .house-one { left: 18%; }.experience-cover .house-two { left: 44%; bottom: 31%; transform: scale(1.55); }.experience-cover .house-three { right: 16%; bottom: 21%; transform: scale(1.06); }
.experience-cover-label { position: absolute; z-index: 6; left: 25px; bottom: 23px; padding: 7px 11px; border: 1px solid rgba(255,253,245,.64); border-radius: 999px; color: var(--teal-dark); background: rgba(255,253,245,.84); font-size: 10px; font-weight: 750; letter-spacing: .08em; backdrop-filter: blur(8px); }
.experience-details { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 26px clamp(20px,3vw,35px); }
.experience-kicker { display: flex; align-items: center; gap: 8px; color: var(--teal-dark); font-size: 11px; font-weight: 750; }
.experience-kicker img { width: 27px; height: 27px; border-radius: 8px; }
.experience-category { margin-left: auto; padding: 4px 8px; border-radius: 999px; color: var(--muted); background: #ebe9dc; font-size: 9px; font-weight: 600; }
.experience-details h1 { margin: 16px 0 7px; color: var(--ink); font-size: clamp(23px,3vw,31px); line-height: 1.3; font-weight: 650; }
.experience-description { max-width: 360px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.experience-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 17px; }
.experience-tags span { padding: 5px 8px; border: 1px solid rgba(82,125,120,.18); border-radius: 999px; color: var(--teal-dark); background: #edf2e8; font-size: 9px; font-weight: 700; }
.experience-play { min-width: 190px; min-height: 46px; font-size: 13px; box-shadow: 0 8px 17px rgba(53,94,90,.22); }
.experience-play span { font-size: 10px; }
.experience-note { margin: 9px 0 0; color: var(--muted); font-size: 9px; }
.experience-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 17px; border: 1px solid rgba(82,125,120,.16); border-top: 0; border-radius: 0 0 13px 13px; background: rgba(255,253,245,.72); }
.experience-summary span { display: grid; gap: 3px; }
.experience-summary strong { color: var(--teal-dark); font-size: 10px; }
.experience-summary small { color: var(--muted); font-size: 9px; }
.experience-summary i { width: 1px; height: 25px; flex: 0 0 auto; background: var(--line); }
@media (max-width:850px) {
  .experience-page { margin-top: 17px; }
  .experience-card { grid-template-columns: minmax(0,1.15fr) minmax(260px,.85fr); }
  .experience-cover { min-height: 260px; }
}
@media (max-width:600px) {
  .experience-page { margin: 12px 0 15px; }
  .experience-card { grid-template-columns: 1fr; }
  .experience-cover { min-height: 205px; }
  .experience-cover .hero-house { bottom: 19%; }
  .experience-details { padding: 18px 17px 17px; }
  .experience-details h1 { margin-top: 10px; font-size: 23px; }
  .experience-description { margin-bottom: 10px; font-size: 11px; }
  .experience-tags { margin-bottom: 12px; }
  .experience-play { width: 100%; }
  .experience-summary { gap: 8px; padding: 12px 10px; }
  .experience-summary strong { font-size: 9px; }
  .experience-summary small { font-size: 8px; line-height: 1.4; }
}

/* Character selection, nearby housing prompts, monthly work and room chat. */
.avatar-picker { margin: 0; padding: 0; border: 0; }
.avatar-picker legend { padding: 0; margin-bottom: 7px; }
.avatar-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px; }
.avatar-option { position: relative; min-height: 56px; display: grid; place-items: center; gap: 3px; padding: 7px 3px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: rgba(255,253,245,.85); font-size: 9px; cursor: pointer; }
.avatar-option input { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; cursor: pointer; }
.avatar-option:has(input:checked) { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-pale); box-shadow: inset 0 0 0 1px var(--teal); }
.avatar-option:has(input:focus-visible) { outline: 3px solid rgba(82,125,120,.3); outline-offset: 2px; }
.avatar-swatch { width: 19px; height: 19px; border: 2px solid rgba(44,55,52,.18); border-radius: 50%; }
.avatar-sunrise { background: #e99679; }.avatar-ocean { background: #82b6dc; }.avatar-forest { background: #80b68c; }.avatar-lilac { background: #ad91ce; }
.nearby-interaction { position: absolute; z-index: 4; left: 50%; bottom: max(145px,calc(env(safe-area-inset-bottom) + 130px)); width: min(330px,calc(100vw - 30px)); transform: translateX(-50%); padding: 14px 16px; border: 1px solid rgba(255,253,245,.6); border-radius: 14px; color: var(--ink); background: rgba(250,248,237,.94); box-shadow: 0 12px 34px rgba(25,43,40,.24); backdrop-filter: blur(12px); }
.nearby-interaction .eyebrow { margin-bottom: 4px; }.nearby-interaction h3 { margin: 0 24px 5px 0; font-size: 17px; color: var(--teal-dark); }.nearby-interaction p:not(.eyebrow) { margin: 0 0 9px; color: var(--muted); font-size: 11px; }.interaction-dismiss { position: absolute; top: 7px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 50%; color: var(--muted); background: transparent; font-size: 20px; }
.chat-toggle { position: absolute; z-index: 3; right: max(16px,env(safe-area-inset-right)); bottom: max(76px,calc(env(safe-area-inset-bottom) + 70px)); min-height: 42px; padding: 9px 14px; border: 1px solid rgba(255,253,245,.6); border-radius: 999px; color: #fffaf0; background: var(--teal-dark); box-shadow: 0 6px 18px rgba(25,43,40,.26); font-size: 11px; font-weight: 750; }
.chat-panel { position: absolute; z-index: 4; right: max(14px,env(safe-area-inset-right)); bottom: max(74px,calc(env(safe-area-inset-bottom) + 70px)); width: min(320px,calc(100vw - 24px)); max-height: min(360px,55dvh); display: flex; flex-direction: column; padding: 11px; border: 1px solid rgba(255,253,245,.55); border-radius: 14px; color: var(--ink); background: rgba(250,248,237,.95); box-shadow: 0 12px 35px rgba(25,43,40,.25); backdrop-filter: blur(12px); }
.chat-panel[hidden] { display: none; }.chat-panel header { display: flex; align-items: center; justify-content: space-between; color: var(--teal-dark); font-size: 12px; }.chat-close { width: 28px; height: 28px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--muted); font-size: 18px; }.chat-status { margin: 5px 0; color: var(--muted); font-size: 9px; }.chat-messages { min-height: 70px; max-height: 230px; overflow: auto; display: grid; align-content: start; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }.chat-message { display: grid; gap: 2px; padding: 6px 8px; border-radius: 8px; background: rgba(220,233,224,.75); font-size: 10px; overflow-wrap: anywhere; }.chat-message strong { color: var(--teal-dark); font-size: 9px; }.chat-message-own { background: #f1e5ce; }.chat-panel form { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }.chat-panel input { min-height: 37px; padding: 7px 9px; font-size: 11px; }.chat-panel .hud-button { min-height: 37px; }.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
@media(max-width:520px) { .chat-panel { bottom: max(72px,calc(env(safe-area-inset-bottom) + 66px)); right: 10px; max-height: 44dvh; }.chat-toggle { right: 10px; bottom: max(72px,calc(env(safe-area-inset-bottom) + 66px)); }.nearby-interaction { bottom: max(148px,calc(env(safe-area-inset-bottom) + 136px)); } }

.first-person-reticle {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.first-person-reticle::before,
.first-person-reticle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 1px;
  background: rgba(255, 252, 238, .92);
  box-shadow: 0 0 2px rgba(24, 40, 36, .95);
  transform: translate(-50%, -50%);
}
.first-person-reticle::before { width: 10px; height: 2px; }
.first-person-reticle::after { width: 2px; height: 10px; }
.touch-look-hint { display: none; }
.desktop-look-hint { display: inline; }
.desktop-immersive-button { white-space: nowrap; }
@media (pointer: coarse) { .desktop-immersive-button { display: none; } }
.move-pad button { -webkit-tap-highlight-color: transparent; }
.move-pad button:active { background: rgba(42,72,66,.72); transform: none; }
.move-pad button:focus:not(:focus-visible) { outline: none; }
.move-pad button:focus-visible { outline: 2px solid #f2d187; outline-offset: 2px; }
