/* Self-hosted typefaces, see /assets/fonts/README.md. Federo revives a 1909
   Jugendstil grotesque; Cormorant Garamond carries the running text. */
@font-face { font-family: Federo; font-style: normal; font-weight: 400; font-display: swap; src: url('/assets/fonts/federo-regular.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 400 600; font-display: swap; src: url('/assets/fonts/cormorant-garamond-regular.woff2') format('woff2'); }
@font-face { font-family: 'Cormorant Garamond'; font-style: italic; font-weight: 400; font-display: swap; src: url('/assets/fonts/cormorant-garamond-italic.woff2') format('woff2'); }

/* Scoped so the games keep their own canvas sizes, typography, and input. */
.house-visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.house-skip { position: fixed; top: 8px; left: 8px; z-index: 101; padding: 12px 18px; background: #eeeade; color: #293e34; transform: translateY(-160%); }
.house-skip:focus { transform: none; }
.house-map-open { overflow: hidden !important; }

/* The drawing studio: a sheet of cream paper on an easel, in a papered room. */
.house-room-studio, .house-room-garden { box-sizing: border-box; margin: 0; min-height: 100svh; padding: 24px 20px 88px; display: flex; justify-content: center; align-items: flex-start; background: linear-gradient(#354a39 0 68%, #513b29 68% 100%); }
.house-room-studio {
  background:
    linear-gradient(180deg, transparent 0 calc(100% - 150px), #3b2b1f calc(100% - 150px) calc(100% - 146px), #6b4a33 calc(100% - 146px) calc(100% - 143px), transparent calc(100% - 143px)),
    repeating-linear-gradient(90deg, #52392650 0 2px, transparent 2px 64px),
    linear-gradient(180deg, transparent 0 calc(100% - 150px), #5a4030 calc(100% - 150px)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='104' height='180' viewBox='0 0 104 180'%3E%3Cpath d='M52 0C20 30 84 60 52 90S20 150 52 180M52 90C14 78 10 40 22 24M52 90C90 78 94 40 82 24' fill='none' stroke='%237d8c6e' stroke-width='1.2' opacity='.55'/%3E%3Cpath d='M36 46C18 48 12 32 20 22C36 28 38 38 36 46ZM68 62C88 58 92 70 86 80C72 78 66 70 68 62ZM36 134C18 132 16 114 24 108C36 114 40 126 36 134ZM70 152C90 148 94 162 86 170C72 166 68 160 70 152Z' fill='%238f9c7a' stroke='%236f7d60' stroke-width='.8' opacity='.7'/%3E%3Cpath d='M52 92C38 78 42 64 52 56C62 64 66 78 52 92Z' fill='%23b89b8f' stroke='%238f7569' stroke-width='.8' opacity='.8'/%3E%3C/svg%3E") 0 0 / 104px 180px,
    #44584a;
}
.house-room-studio > canvas { display: block; flex: none; max-width: 100%; max-height: calc(100svh - 112px); width: auto !important; height: auto !important; background: #f0e8d2; outline: 1px solid #d9c9a2; box-shadow: 0 0 0 6px #e7dcc0, 0 0 0 8px #5b4430, 0 0 0 10px #a98e5c, 0 14px 34px #15271b80; }
.house-room-garden { height: 100dvh; min-height: 0; padding: 12px 12px 84px; overflow: hidden; display: block; background: radial-gradient(ellipse at 50% 15%, #5b7053, #344c3d 68%, #263e32); }
.house-room-garden > canvas { width: 100% !important; height: 100% !important; max-width: none; max-height: none; border-radius: 18px; outline: 1px solid #bdab79; box-shadow: 0 0 0 6px #2c4536, 0 0 0 8px #9b8a60, 0 12px 35px #15271b70; cursor: pointer; touch-action: manipulation; }
.house-room-garden > canvas:focus-visible { outline: 3px solid #ead39a; outline-offset: 3px; }

/* Room pages carry one brass plate: back to the hall, and the floor plan. */
.house-room-nav, .house-map, .house-map * { box-sizing: border-box; }
.house-room-nav { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 100; display: flex; align-items: center; gap: 14px; width: max-content; max-width: calc(100% - 24px); padding: 7px 18px; color: #eee9d7; background: #243a30f5; border: 1px solid #c2b281; border-radius: 22px 22px 5px 5px; box-shadow: 0 6px 25px #0f1c1760, inset 0 0 0 3px #243a30, inset 0 0 0 4px #c2b28166; font: 14px/1.4 'Cormorant Garamond', Georgia, 'Times New Roman', serif; touch-action: manipulation; }
.house-room-salon .house-room-nav { left: auto; right: max(16px, env(safe-area-inset-right)); transform: none; }
.house-return, .house-room-map { display: flex; align-items: center; justify-content: center; gap: 9px; min-height: 34px; padding: 4px 0; color: inherit; text-decoration: none; border: 0; background: none; font: inherit; cursor: pointer; }
.house-return { font-style: italic; font-size: 15px; }
.house-return > span { font-style: normal; font-size: 18px; color: #c2b281; }
.house-room-map { font-family: Federo, Georgia, serif; font-size: 13px; letter-spacing: .8px; text-transform: uppercase; }
.house-room-map svg { width: 16px; height: 16px; fill: none; stroke: #c2b281; stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.house-room-map > span:last-child { color: #c2b281; margin-left: 4px; font-size: 11px; }
.house-room-nav-divider { width: 1px; height: 22px; background: #c2b28150; }
.house-room-nav a:hover, .house-room-nav button:hover { color: #e9ce89; }
.house-room-nav a:focus-visible, .house-room-nav button:focus-visible { outline: 2px solid #e9ce89; outline-offset: 3px; }

/* The floor plan: an inked drawing on drafting paper. Walls are hatched, the
   rooms have curved heads, and the halls are round pavilions. */
.house-map { position: fixed; inset: 0; width: min(720px, calc(100% - 32px)); max-height: calc(100dvh - 32px); margin: auto; padding: 30px 36px 28px; color: #2a3a32; background: linear-gradient(#cdc7ad44 1px, transparent 1px) 0 0 / 100% 22px, linear-gradient(90deg, #cdc7ad44 1px, transparent 1px) 0 0 / 22px 100%, #f0eadb; border: 1px solid #8f8a6d; border-radius: 4px; box-shadow: inset 0 0 0 6px #f0eadb, inset 0 0 0 7px #9c763e88, 0 25px 90px #101e1766; font: 15px/1.5 'Cormorant Garamond', Georgia, 'Times New Roman', serif; text-align: left; touch-action: pan-y; overscroll-behavior: contain; color-scheme: light; }
.house-map::backdrop { background: #172a24b8; backdrop-filter: blur(5px); }
.house-map a { text-decoration: none; color: inherit; }
.house-map button { font: inherit; cursor: pointer; }
.house-map-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 15px; }
.house-map-kicker { margin: 0 0 2px; font-style: italic; font-size: 15px; color: #5c6457; }
.house-map h2 { margin: 0; font: 30px/1.1 Federo, Georgia, serif; letter-spacing: 2px; text-transform: uppercase; }
.house-map-close { width: 38px; height: 38px; border: 1px solid #8f8a6d; border-radius: 50%; color: #2a3a32; font: 24px/1 Georgia, serif !important; background: #f6f1e4; }
.house-map-close:hover { background: #fff; }
.house-map-floors { display: grid; gap: 22px; margin-top: 22px; }
.house-map-current-dot { font-size: 6px !important; }
.house-map h3 { display: flex; align-items: baseline; justify-content: space-between; margin: 0 0 8px; font: 13px/1.5 Federo, Georgia, serif; letter-spacing: 1.4px; text-transform: uppercase; font-weight: 400; }
.house-map h3 small { font: italic 14px/1.4 'Cormorant Garamond', Georgia, serif; letter-spacing: 0; text-transform: none; color: #5c6457; }
.house-map-grid { display: grid; gap: 7px; padding: 7px; border: 2px solid #2a3a32; border-radius: 30px 30px 6px 6px; background: repeating-linear-gradient(45deg, #2a3a32 0 1px, transparent 1px 5px); }
.house-map-ground { grid-template-columns: 1fr .7fr 1fr; grid-template-rows: auto auto; }
.house-map-garden, .house-map-glyphs, .house-map-vitrine { grid-column: 1 / 4; min-height: 72px; border-radius: 24px 24px 4px 4px; }
/* Upstairs the back wall holds two doors: Glyphs on the left, Vitrine on the right. */
.house-map-glyphs { grid-column: 1 / 3; }
.house-map-vitrine { grid-column: 3 / 4; }
.house-map-grid .house-map-vitrine:nth-child(2) { border-radius: 24px 24px 4px 4px; }
.house-map-upper .house-map-room:nth-child(3) { border-radius: 40px 6px 6px 6px; }
.house-map-garden { background: #e5e7cf !important; }
.house-map-upper { grid-template-columns: 1fr .7fr 1fr; grid-template-rows: auto auto; }
.house-map-room { position: relative; min-height: 104px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 13px 10px; border: 1.5px solid #2a3a32; border-radius: 6px; background: #f6f1e4; text-align: center; transition: background .15s; }
.house-map-grid .house-map-room:nth-child(2) { border-radius: 40px 6px 6px 6px; }
.house-map-grid .house-map-room:last-child { border-radius: 6px 40px 6px 6px; }
.house-map-room strong { font: 15px/1.2 Federo, Georgia, serif; letter-spacing: .6px; font-weight: 400; }
.house-map-room small:not(.house-visually-hidden) { font-style: italic; font-size: 13px; color: #5c6457; }
.house-map-hall { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; border: 1.5px solid #2a3a32; border-radius: 50% 50% 8px 8px; background: #faf6ea; text-align: center; padding: 12px 5px; }
.house-map-hall > span { font-size: 22px; line-height: 1; color: #9c763e; }
.house-map-hall strong { font: 12px/1.2 Federo, Georgia, serif; letter-spacing: 1px; text-transform: uppercase; font-weight: 400; }
.house-map-room:hover, .house-map-hall:hover { background: #e9dcc9 !important; }
.house-map-current { background: #2e4c3d !important; color: #f4edda !important; }
.house-map-current > span, .house-map-current small { color: #d6d3ab !important; }
.house-map-current:hover { background: #3c5a48 !important; }
.house-map-flourish { display: block; width: 120px; height: 20px; margin: 18px auto 0; fill: none; stroke: #9c763e; stroke-width: 1.1; stroke-linecap: round; }
.house-map-flourish path:last-child { fill: #e4cfc4; stroke: #a9696d; }
.house-map a:focus-visible, .house-map button:focus-visible { outline: 2px solid #9c763e; outline-offset: 2px; }
@media (max-width: 600px) {
  .house-room-studio { padding: 17px 14px 88px; }
  .house-room-garden { padding: 8px 8px 76px; }
  .house-room-nav { font-size: 13px; gap: 10px; padding: 5px 13px; }
  .house-room-salon .house-room-nav { left: 50%; right: auto; transform: translateX(-50%); }
  .house-map { padding: 22px 16px 18px; }
  .house-map h2 { font-size: 24px; }
  .house-map-room { padding: 14px 5px 12px; min-height: 100px; }
  .house-map-room strong { font-size: 13px; }
  .house-map-room small:not(.house-visually-hidden) { display: none; }
  .house-map-hall strong { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .house-map-room { transition: none; } }
