html,body{width:100%;height:100%;margin:0;overflow:hidden;overscroll-behavior:none}body{background:#d7e4f4}.game{position:relative;width:100%;height:100dvh;max-width:none;padding:0;isolation:isolate;background:#d7e4f4}.game>header{position:absolute;top:max(10px,env(safe-area-inset-top));left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));z-index:1200;margin:0;pointer-events:none}.brand,header button{pointer-events:auto;background:#24382eee;box-shadow:0 3px 12px #17221940}.brand{border:1px solid #ad9774;border-radius:14px;padding:8px 12px}.brand h1{font-size:20px;letter-spacing:3px}.brand small,.brand .crest{display:none}header button{padding:10px 15px;font-size:14px;min-height:42px}.game>.daybar{position:absolute;top:65px;left:max(12px,env(safe-area-inset-left));z-index:1100;display:grid;gap:5px;padding:10px 13px;background:#24382ee8;border:1px solid #ad977477;border-radius:12px;font-size:14px}.game>.room-toolbar{position:absolute;right:max(12px,env(safe-area-inset-right));top:64px;z-index:1200;display:flex;flex-direction:column;gap:7px;align-items:stretch}.room-toolbar>span{display:none}.room-toolbar button{background:#24382ee8;min-height:40px;font-size:14px}.game>.room-viewport{position:absolute;inset:0;border:0;border-radius:0;max-height:none;background:#d7e4f4;overflow:auto;scrollbar-width:none}.game .room-viewport .scene{width:150dvh;height:100dvh;min-width:0;max-width:none;aspect-ratio:3/2;margin:0 auto;border:0;border-radius:0;background:none}.game .room-viewport.zoomed{max-height:none}.game .room-viewport.zoomed .scene{height:145dvh;width:217.5dvh;min-width:0;margin:0 auto}.game>.family-shortcuts{position:absolute;z-index:1100;bottom:max(14px,env(safe-area-inset-bottom));left:max(12px,env(safe-area-inset-left));display:flex;gap:6px;padding:0;max-width:43%;flex-wrap:wrap}.family-shortcuts button{font-size:14px;padding:10px 12px;min-height:42px;background:#24382eee;box-shadow:0 3px 8px #17221930}.game>.dashboard{position:absolute;left:max(12px,env(safe-area-inset-left));top:153px;padding:0;z-index:1100;pointer-events:none}.dashboard .mood{display:none}.dashboard .stats{display:grid;gap:8px;padding:10px;background:#24382ee8;border-radius:12px;text-align:left}.stats>div{display:flex;align-items:center;gap:12px}.stats span{font-size:12px}.stats strong{font-size:18px;margin:0}.game>.actions{position:absolute;right:max(12px,env(safe-area-inset-right));bottom:max(14px,env(safe-area-inset-bottom));z-index:1100;display:flex;gap:7px;margin:0;max-width:52%}.actions button{padding:8px 12px;font-size:20px;background:#24382eee;border-color:#b4a07999;min-width:66px;box-shadow:0 3px 8px #17221930}.actions span{font-size:12px;margin-top:2px;white-space:nowrap}.scene .hotspot{width:32px;height:32px;min-width:32px;opacity:.85}.scene .hotspot span{font-size:12px;top:34px}.scene .person .name{font-size:12px}.scene .person{width:9%}.scene .person.child{width:6.6%}dialog[open]{grid-template-columns:35% 65%;width:min(780px,92vw);max-height:90dvh}.portrait{height:80dvh;min-height:0;max-height:480px}.portrait img{object-fit:cover;object-position:top}.speech{padding:25px;max-height:85dvh;overflow:auto}.speech p{font-size:18px;min-height:0;line-height:1.7}#choices button{font-size:15px;padding:11px}#notebook[open]{display:block;width:min(600px,90vw);padding:22px;max-height:86dvh;background:#263a32;color:#ece2cc}#notebook>button{float:right;background:none;border:1px solid #a58f69;color:#eee1c9;border-radius:20px;padding:7px 12px}#notebook .journal{clear:both}#notebook footer{color:#d2dacb}#notebook li{color:#d2dacb}#rotate-notice{display:none}#toast{bottom:80px}#save-status{font-size:12px}@media(orientation:portrait){#rotate-notice{position:fixed;inset:0;background:#1e302df5;z-index:4000;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:30px;color:#eee2c8;gap:14px}#rotate-notice .rotate-icon{font-size:64px;color:#d9bf83}#rotate-notice h2{font-size:25px;margin:0}#rotate-notice p{font-size:16px;line-height:1.8;max-width:300px;margin:0}#rotate-notice button{background:#e0c38b;border:0;border-radius:22px;color:#25372e;padding:12px 24px;font-size:16px}#orientation-help{font-size:14px!important;color:#bdcbbd}}@media(max-height:430px) and (orientation:landscape){.brand{padding:7px 10px}.brand h1{font-size:18px}.game>.daybar{top:58px;font-size:12px;padding:7px 10px;gap:2px}.daybar small{font-size:12px}.game>.dashboard{top:119px}.dashboard .stats{padding:7px;gap:4px}.game>.room-toolbar{top:58px;gap:5px}.room-toolbar button{padding:6px 10px;min-height:34px;font-size:12px}.family-shortcuts button{padding:8px 10px;font-size:12px;min-height:36px}.actions button{padding:6px 8px;min-width:58px;font-size:18px}.actions span{font-size:12px}.portrait{height:86dvh}.speech{padding:18px}.speech p{margin:10px 0;font-size:17px}.scene .person .name{font-size:10px}.scene .hotspot{width:28px;height:28px;min-width:28px}.scene .hotspot span{top:29px;font-size:10px}}@media(max-width:660px) and (orientation:landscape){.actions span{display:none}.actions button{min-width:44px;min-height:44px}.family-shortcuts button{padding:8px}.game>.family-shortcuts{gap:3px}.stats span{font-size:12px}.game .room-viewport .scene{margin:auto}}
/* Keep the complete 3:2 room visible while filling the landscape screen. */
@media (orientation:landscape){
  .game>.room-viewport{display:grid;place-items:center;min-height:100dvh;overflow:hidden;background:#d7e4f4}
  .game .room-viewport .scene,
  .game .room-viewport.zoomed .scene{width:min(100vw,150dvh);height:min(100dvh,66.6667vw);min-width:0;max-width:none;margin:0;aspect-ratio:3/2}
  .game .room-viewport .room{object-fit:fill;object-position:center}
}

/* Game-native layout: the room is the whole screen and every control floats over it. */
@media (orientation:landscape){
  .game>.room-viewport{display:block;overflow:hidden;background:#b9cee8}
  .game .room-viewport .scene,
  .game .room-viewport.zoomed .scene{position:absolute;inset:0;width:100vw;height:100dvh;max-width:none;min-width:0;margin:0;border:0;border-radius:0;aspect-ratio:auto}
  .game .room-viewport .room{width:100%;height:100%;object-fit:contain;object-position:center}
  .game>.daybar,.game>.room-toolbar,.game>.family-shortcuts,.game>.dashboard,.game>.actions{pointer-events:none}
  .game>.daybar button,.game>.room-toolbar button,.game>.family-shortcuts button,.game>.actions button{pointer-events:auto}
  .game>.family-shortcuts{max-width:45%;bottom:max(14px,env(safe-area-inset-bottom));text-shadow:0 1px 2px #172219}
  .game>.actions{max-width:55%;bottom:max(14px,env(safe-area-inset-bottom))}
  .game>.dashboard .stats{backdrop-filter:blur(4px)}
  .game>.room-toolbar button,.game>.family-shortcuts button,.game>.actions button,.game>header button,.game>.dashboard .stats,.game>.daybar{backdrop-filter:blur(4px)}
}

/* One uniform scale for the 2622 × 1206 artwork and its coordinate system. */
@media (orientation:landscape){
  .game .room-viewport .scene,
  .game .room-viewport.zoomed .scene{inset:auto;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100vw,217.412935dvh);height:auto;aspect-ratio:2622 / 1206}
  .game .room-viewport .room{position:absolute;inset:0;object-fit:contain}
  #room-layer{position:absolute;left:20.1%;top:14%;width:57.2%;height:82.93%}
  #view-toggle[hidden]{display:none}
}
