@font-face{font-family:Suit;src:url('assets/fonts/SUIT-Regular.woff2')}@font-face{font-family:Suit;src:url('assets/fonts/SUIT-Bold.woff2');font-weight:700}
:root{font-family:Suit,'Malgun Gothic',sans-serif;color:#493d29;background:#e9e1d1;font-synthesis:none}*{box-sizing:border-box}body{margin:0;overflow:hidden;height:100dvh}button,input{font:inherit}button,a,input{touch-action:manipulation}button{cursor:pointer;color:inherit}button:focus-visible,a:focus-visible,canvas:focus-visible,input:focus-visible{outline:3px solid #315b49;outline-offset:5px}button:disabled{opacity:.55;cursor:wait}[hidden]{display:none!important}#scene{position:fixed;inset:0;width:100%;height:100%;touch-action:none}header{position:fixed;top:max(22px,env(safe-area-inset-top));left:clamp(20px,4vw,58px);right:clamp(20px,4vw,58px);display:flex;justify-content:space-between;align-items:flex-start;pointer-events:none}h1{font-size:clamp(22px,3vw,37px);font-weight:700;margin:0;letter-spacing:-1.2px;color:#fffaf0;text-shadow:0 2px 12px #473c2e}#dayline{font-size:13px;color:#fff8e6;text-shadow:0 1px 6px #362a1b;margin:6px 0}nav{display:flex;gap:10px;pointer-events:auto}nav button{width:47px;height:47px;border:1.5px solid #fff7e6;border-radius:17px;background:#493c2766;color:#fff9eb;font-size:26px}footer{position:fixed;bottom:max(20px,env(safe-area-inset-bottom));left:0;right:0;text-align:center;pointer-events:none}#actions{display:flex;justify-content:center;gap:clamp(8px,2vw,24px);padding:0 16px;pointer-events:auto}#actions button,.soft{border:1px solid #d8c7a8;border-top:2px solid white;border-radius:28px;background:linear-gradient(#fffaf0,#f1e4cc);box-shadow:0 4px 0 #9c805a44,0 8px 20px #49382112;padding:14px 28px;min-height:54px;font-size:18px;font-weight:700}#actions button:hover{background:#fffaf0;transform:translateY(-2px)}#actions button:active{transform:translateY(2px);box-shadow:none}#actions .icon{font-size:24px;vertical-align:middle;margin-right:10px}#hint{display:block;color:#fffcef;text-shadow:0 1px 5px #372817;font-size:12px;margin-top:14px}#speech{position:fixed;top:25%;left:50%;transform:translateX(-50%);text-align:center;background:#fffaf0e8;border:1px solid #e5d9c5;padding:12px 23px;border-radius:22px;max-width:82vw;font-size:clamp(16px,2vw,22px);box-shadow:0 5px 25px #4d39231a;pointer-events:none;transition:opacity .3s}#speech:empty{opacity:0}.paper,dialog{background:#fffaf0;color:#493d29;border:1px solid #decfb6;border-radius:24px;box-shadow:0 24px 80px #33271945}.paper{position:fixed;left:5%;top:24%;width:390px;max-width:90vw;padding:30px}h2{font-size:27px;letter-spacing:-.8px;margin:8px 0 18px}p{line-height:1.7}.eyebrow{font-size:12px;color:#6e8061;font-weight:700;letter-spacing:1px}.paper label{display:block;margin:24px 0 10px;font-size:14px}.name-row{display:flex;gap:8px}.name-row input{min-width:0;width:50%;border:1px solid #c8b795;border-radius:12px;padding:12px;background:white}.primary{background:#476249;border:0;border-radius:12px;padding:12px 22px;color:white;font-weight:bold}dialog{padding:30px;width:540px;max-width:94vw;max-height:85dvh;overflow:auto}dialog::backdrop{background:#29271d70}.close{float:right;width:40px;height:40px;background:none;border:0;font-size:30px}#panelBody{clear:both}#panelBody button{margin:5px 4px;min-height:44px}#panelBody .row{display:flex;flex-wrap:wrap;gap:8px}#panelBody p{font-size:15px}#panelBody a{color:#52664e}.memory{border-bottom:1px solid #e7ddcc;padding:12px 0;font-size:15px}.memory small{display:block;color:#857b66;margin-bottom:4px}.photos{display:grid;grid-template-columns:1fr 1fr;gap:12px}.photos figure{margin:0;background:white;padding:8px;border-radius:10px}.photos img{width:100%;border-radius:6px}.photos figcaption{font-size:12px}#loading{position:fixed;bottom:45%;left:0;right:0;text-align:center;background:#fffaf0dd;padding:20px}#saveError{position:fixed;top:90px;left:5%;right:5%;background:#fff3d9;padding:12px 18px;border-radius:12px;z-index:5;font-size:14px}.shutter{animation:flash .28s}@keyframes flash{0%{filter:brightness(2)}100%{filter:brightness(1)}}
@media(max-width:600px){header{top:18px;left:18px;right:18px}nav{gap:6px}nav button{width:38px;height:40px;font-size:22px;border-radius:13px}h1{font-size:23px}.paper{top:auto;bottom:25px;left:5%;padding:22px}body[data-welcome] #speech{display:none}#speech{top:20%;font-size:16px;width:max-content}#actions button{font-size:15px;padding:12px 17px;min-width:80px}.icon{display:none}footer{bottom:22px}dialog{padding:22px}#hint{font-size:11px}#dayline{font-size:12px}}
@media(max-height:500px){.paper{top:80px;padding:18px;width:350px}.paper h2{font-size:22px;margin:5px 0}.paper p{font-size:13px;margin:6px 0}.paper label{margin:10px 0 4px}#speech{top:18%;font-size:15px;padding:7px 14px}footer{bottom:12px}#hint{margin-top:6px}#actions button{padding:9px 24px;min-height:44px;font-size:16px}header{top:12px}h1{font-size:23px}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

/* Keep the face unobstructed when approaching for a touch. */
@media(min-width:900px) and (min-height:600px){#speech{left:20%;top:40%;max-width:27vw;font-size:21px;background:#fffaf0d9;line-height:1.5}#actions button{min-width:155px}}

nav button svg{width:25px;height:25px;vertical-align:middle}
@media(min-width:900px) and (min-height:600px){body[data-pet-side="left"] #speech{left:80%}}

#dayline{display:block;pointer-events:auto;border:0;background:none;padding:0 0 4px;min-height:44px;text-align:left;cursor:pointer}#dayline:hover{text-decoration:underline}#offer{position:fixed;bottom:145px;left:50%;transform:translateX(-50%);min-height:44px;border:1px solid #d8c7a8;border-radius:22px;padding:10px 20px;background:#fffaf0f2;box-shadow:0 3px 12px #49382122;font-weight:700;max-width:90vw}@media(max-height:500px){#offer{bottom:105px;left:20%;}}

.pet-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.pet-grid button{display:flex;flex-direction:column;align-items:center;justify-content:end;border:1px solid #d8c7a8;background:#f5efdf;border-radius:16px;padding:8px;font-size:14px;min-width:0}.pet-grid img{width:100%;height:115px;object-fit:contain;pointer-events:none}.pet-grid button[aria-pressed="true"]{border:2px solid #476249;background:#e9efdf}@media(max-width:460px){.pet-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.pet-grid img{height:110px}.paper{max-height:70dvh;overflow:auto}}

/* Keep the room and pet primary; existing three actions stay easy to read. */
nav button{height:62px;border-radius:15px;background:#3e4435c9;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px}.nav-label{font-size:11px;font-weight:700;line-height:1}#actions{flex-wrap:wrap;gap:10px}#actions button{border-radius:19px}#hint{padding:0 20px;line-height:1.5}#closePanel{position:sticky;top:0;background:#fffaf0;z-index:1}@media(max-width:600px){nav button{width:44px;height:56px}header{gap:10px}h1{font-size:21px}#actions button{min-width:0;padding:12px 14px}#actions .icon{display:none}#hint{max-width:360px;margin:10px auto 0}}

#queued{display:block;width:fit-content;max-width:90vw;margin:9px auto 0;border-radius:12px;padding:5px 13px;background:#e7efdf;color:#34523c;font-size:12px}#queued::before{content:"이어서 · "}#offer{border:2px solid #577253;background:#f5f8eb;color:#334e38}#offer::before{content:"함께 · ";font-weight:400}#speech{line-height:1.55}

#speech{word-break:keep-all;overflow-wrap:anywhere;text-wrap:pretty;border-radius:18px 18px 18px 5px}#panelBody p,.memory{word-break:keep-all;overflow-wrap:anywhere}@media(min-width:900px) and (min-height:600px){#speech{max-width:30vw;padding:14px 20px;font-size:20px}}

.quiet-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:20px 0 24px;padding-bottom:22px;border-bottom:1px solid #d9cbb5}.quiet-actions h3{grid-column:1/-1;margin:0 0 8px;font-size:18px}.quiet-actions button.soft{font-size:15px;border-radius:14px;padding:12px 9px;margin:0!important;min-height:48px;background:#eaf0df;border:1px solid #bdc9ac;box-shadow:none}.settings-heading{font-size:14px;color:#6e765c;margin-top:15px}#panelBody>.soft{font-size:14px;padding:10px 15px;border-radius:13px;box-shadow:none}.close{border-radius:50%}#panelBody{padding-top:4px}

#queued{pointer-events:auto;min-height:44px;border:1px solid #b9c8ae;font:inherit;font-size:12px;cursor:pointer;margin-top:7px}#queued::after{content:" · 취소 ×"}@media(max-height:500px){#queued{position:fixed;left:16px;bottom:100px;margin:0;max-width:32vw}#offer{max-width:34vw}}
@media(max-height:500px){body.petting-drag #speech{top:auto;bottom:110px;left:12px;right:auto;transform:none;max-width:190px;font-size:13px}}

@media(max-height:500px){.paper{max-height:calc(100dvh - 96px);overflow:auto}}
#panelBody form{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
#panelBody form input{flex:1 1 160px;min-width:0;max-width:100%;min-height:44px;padding:10px 12px;border:1px solid #c8b795;border-radius:12px;background:#fff}
#panelBody form>[role=status]{flex-basis:100%;margin:4px 0}
@media(max-width:400px){#actions button{min-width:0;flex:1;padding:10px 4px;font-size:14px}}
@media(max-width:400px){header h1{font-size:18px;letter-spacing:-.7px}}

/* Direct petting keeps the animal unobstructed. */
#actions:empty{display:none}.bond-meter{display:block;font-weight:700;margin:24px 0 12px}.bond-meter meter{display:block;width:100%;height:20px;margin-top:10px;accent-color:#66845c}.care-record{display:flex;justify-content:space-between;gap:16px;border-bottom:1px solid #e7ddcc;padding:12px 0;font-size:14px}.care-record span:last-child{text-align:right;color:#74674f}@media(max-width:480px){header{flex-wrap:wrap;gap:8px}header nav{margin-left:auto}nav button{min-width:44px;min-height:44px}}

.touch-status{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;font-size:13px}.touch-status strong,.touch-status span{display:block}.touch-status span{margin-top:8px;color:#74674f}.bond-meter meter::-webkit-meter-bar{background:#e8e4d7;border:0;border-radius:10px}.bond-meter meter::-webkit-meter-optimum-value{background:#66845c;border-radius:10px}

#place{display:block;pointer-events:auto;min-height:44px;border:1px solid #fff6dc99;background:#433d2a99;color:#fff9eb;border-radius:22px;padding:8px 14px;font-size:13px;margin-top:6px}#placeActivity{position:fixed;right:22px;top:35%;min-height:44px;padding:10px 16px;border:1px solid #eee4cc;border-radius:24px;background:#fff9e9ed;color:#4b5940;font-size:14px;box-shadow:0 3px 12px #30281922}.place-choice{display:block;width:100%;text-align:left;padding:12px 16px;border:1px solid #d9d3c0;border-radius:14px;background:#faf6ea}.place-choice small{display:block;margin-top:6px;font-weight:400;color:#776c53;font-size:13px}.place-choice:disabled{cursor:default;opacity:.65}@media(max-height:500px){#place{margin-top:0}#placeActivity{top:35%;right:16px}}

@media(max-width:480px){header{flex-wrap:nowrap}header>div{flex:1;min-width:0}header nav{flex:0 0 auto;gap:4px}#place{position:fixed;top:120px;left:18px;margin:0;max-width:calc(100vw - 36px)}}
@media(max-width:480px){#speech{top:max(185px,20%)}}
.care-gauges{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.care-gauges .bond-meter{margin:8px 0;font-size:14px}.care-gauges meter{height:16px;margin-top:8px}@media(max-width:480px){.care-gauges{grid-template-columns:1fr;gap:0}.care-gauges .bond-meter{margin:8px 0}}

/* The controls frame the animal. Empty space between controls accepts a touch on the room. */
header {
  --edge: clamp(12px, 3vw, 44px);
  left: max(var(--edge), env(safe-area-inset-left));
  right: max(var(--edge), env(safe-area-inset-right));
  top: max(12px, env(safe-area-inset-top));
}
header nav, #actions { pointer-events: none; }
header nav button, #actions button { pointer-events: auto; }
header nav { gap: 8px; }
nav button { padding: 3px 1px; background: #354537e8; }
nav .nav-label { font-size: 12px; white-space: nowrap; }
#menu { margin-left: 2px; }
#scene:focus-visible { outline: 3px solid #fffaf0; outline-offset: -6px; box-shadow: inset 0 0 0 7px #35523c; }
body[data-welcome] :is(#status, #camera, #album, #dayline, footer, #speech) { display: none; }

#welcome { padding: 20px 24px 12px; }
#welcome h2 { font-size: 24px; margin: 0 0 12px; }
#choosePet {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 44px; font-size: 16px; padding: 8px 12px;
  border: 1px solid #c6bda7; border-radius: 12px;
  background: #f7f3e8; box-shadow: none;
}
.choose-link { font-size: 14px; color: #3e5b43; }
#welcome label { margin: 12px 0 4px; font-weight: 700; }
.name-row input { flex: 1; }
#panelBody > .classic { display: flex; align-items: center; width: fit-content; min-height: 44px; margin-left: auto; padding-inline: 4px; font-size: 11px; color: #706652; text-underline-offset: 2px; }
#dayline {
  max-width: 100%; margin: 4px 0 0; padding: 5px 10px;
  background: #354537e8; color: #fffaf0; text-shadow: none; border-radius: 10px;
  font-size: 12px; line-height: 1.35; overflow-wrap: anywhere;
}
#dayline::after { display: block; content: "이름 부르기 ›"; font-weight: 700; }
#place { background: #354537e8; word-break: keep-all; }
footer {
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right));
}
#hint {
  display: table; width: fit-content; max-width: min(92%, 650px);
  margin: 8px auto 0; padding: 4px 12px; border-radius: 12px;
  color: #fffaf0; background: #344435ed; text-shadow: none;
  font-size: 13px; line-height: 1.45; word-break: keep-all; overflow-wrap: anywhere;
}
#hint:empty { display: none; }
.next-action { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.next-action :is(#queued,#offer) {
  position: static; transform: none; margin: 0 0 8px; max-width: 100%;
  min-height: 44px; pointer-events: auto;
}
#actions[data-mode="play"] button:last-child,
#actions[data-mode="care"] button:last-child,
#actions[data-mode="hunt"] button:last-child,
#actions[data-mode="fetch"] button:last-child {
  background: #455744; color: white; border: 1px solid #e5e5d4;
}
#actions button { word-break: keep-all; overflow-wrap: anywhere; }

#panel[open] {
  display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr); padding: 0; overflow: hidden;
  max-height: min(90dvh, 820px);
}
#panelBody {
  --gutter: clamp(16px, 3vw, 27px);
  grid-area: 1/1; overflow: auto; overscroll-behavior: contain;
  padding: 0 var(--gutter) 18px; scroll-padding-top: 72px;
}
#panelBody h2 {
  position: sticky; top: 0; z-index: 1; margin: 0 calc(0px - var(--gutter)) 12px;
  padding: 16px 66px 14px var(--gutter); min-height: 62px;
  font-size: clamp(21px, 3vw, 26px); line-height: 1.28; background: #fffaf0;
  border-bottom: 1px solid #e7ddcc; text-wrap: balance; overflow-wrap: anywhere;
}
#closePanel {
  position: relative; grid-area: 1/1; place-self: start end; z-index: 2;
  margin: 8px 10px 0 0; width: 44px; height: 44px; border: 1px solid #d9cfba;
  background: #f7f1e4; font-size: 26px; line-height: 1;
}
#panelBody .pet-grid { gap: 8px; }
#panelBody .pet-grid button { position: relative; margin: 0; }
.pet-grid button[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 5px; right: 5px; display: grid; place-items: center;
  width: 22px; height: 22px; color: white; background: #476249; border-radius: 50%;
}
#panelBody .place-choice { position: relative; margin: 5px 0; padding-right: 36px; }
.place-choice:not(:disabled)::after, .place-choice[aria-current="location"]::after {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 19px; content: "›";
}
.place-choice[aria-current="location"]:disabled { opacity: 1; border-color: #83967b; background: #ebefdf; }
.place-choice[aria-current="location"]::after { content: "✓"; color: #3e5b43; }
.photos { grid-template-columns: repeat(auto-fit,minmax(min(185px,100%),1fr)); }
.photos figure { display: grid; grid-template-columns: 1fr auto; align-content: start; gap: 4px 10px; }
.photos img, .photos figcaption { grid-column: 1/-1; }
.photos img { max-height: 235px; object-fit: contain; background: #f4f0e5; }
.photos a, #panelBody .photos button { display: inline-flex; align-items: center; min-height: 44px; }
#panelBody .photos button { margin: 0; padding: 0 10px; background: transparent; border: 0; color: #794e40; text-decoration: underline; }

@media (max-width: 600px) {
  header nav { gap: 6px; }
  nav button { width: 44px; height: 52px; }
  #actions { padding: 0; gap: 6px; }
  #actions:not(:empty) { display: grid; grid-auto-columns: minmax(0,1fr); grid-auto-flow: column; }
  #actions button { min-width: 0; min-height: 48px; padding: 7px 3px; font-size: 15px; line-height: 1.24; }
  #place { position: static; width: fit-content; margin: 6px 0 0; max-width: 100%; padding: 5px 10px; }
  #welcome { bottom: max(12px,env(safe-area-inset-bottom)); padding: 16px 18px 8px; }
  #welcome h2 { font-size: 21px; }
}
@media (max-height: 500px) and (orientation:landscape) {
  #welcome {
    left: max(12px,env(safe-area-inset-left)); top: auto; bottom: max(10px,env(safe-area-inset-bottom));
    width: min(38vw,330px); max-height: calc(100dvh - 66px); padding: 14px 16px 8px;
  }
  #welcome h2 { font-size: 20px; margin-bottom: 8px; }
  #welcome .name-row .primary { padding: 8px 12px; }
  #speech, body.petting-drag #speech {
    margin: 0; top: 44%; bottom: auto; left: max(12px,env(safe-area-inset-left)); right: auto;
    transform: none; max-width: 26vw; font-size: 14px; line-height: 1.4;
  }
  body[data-pet-side="left"] #speech { left: auto; right: max(12px,env(safe-area-inset-right)); }
  #placeActivity { top: 24%; }
  #actions button { min-height: 44px; padding: 6px 14px; font-size: 15px; }
  #hint { margin-top: 4px; }
  #panel[open] { max-height: 94dvh; }
}
@media (max-height: 650px) and (orientation:portrait) {
  #speech { top: 76px; right: 12px; left: auto; transform: none; margin: 0; padding: 7px 12px; max-width: 57vw; font-size: 14px; }
}
@media (max-height: 500px) and (orientation:landscape) {
  .next-action { justify-content: flex-start; padding-inline: 4px; }
}
@media (max-width:360px) { header h1 { font-size: 15px; white-space: nowrap; } }
/* Keep the credit clear of activity controls and the device safe area. */
footer { bottom: calc(42px + env(safe-area-inset-bottom)); }
.creator-credit { display:flex; align-items:center; gap:5px; margin:4px 0 9px; width:fit-content; color:#fffaf0; font-size:clamp(11px,3vw,15px); font-weight:700; line-height:1.1; text-shadow:0 1px 3px #241d12,0 0 5px #241d12; }
.creator-credit img { display:block; width:24px; height:24px; object-fit:contain; }
#hint.drag-instruction { font-size:clamp(14px,2.4vw,17px); font-weight:700; padding:8px 15px; }
@media(max-width:600px){.creator-credit img{width:21px;height:21px}}

/* One persistent instruction, only changing when the play step changes. */
#playGuide{position:fixed;top:130px;left:50%;transform:translateX(-50%);width:max-content;max-width:calc(100vw - 28px);padding:12px 20px;border-radius:18px;background:#fff9eaf5;color:#274737;box-shadow:0 4px 18px #203e3026;pointer-events:none;text-align:center}
#playGuide small,#playGuide strong,#playGuide span{display:block}
#playGuide small{font-size:12px;color:#67765a}#playGuide strong{font-size:clamp(17px,2vw,22px);margin:5px 0 7px}#playGuide span{font-size:13px;line-height:1.5}
body[data-play-guide="true"] #hint{visibility:hidden}
@media(max-width:600px) and (min-height:501px){#playGuide{top:clamp(170px,24vh,205px)}}
@media(max-width:350px) and (min-height:501px){#playGuide{top:clamp(188px,26vh,205px)}}
@media(max-height:500px){#playGuide{top:87px;left:auto;right:16px;transform:none;max-width:min(320px,48vw);padding:8px 12px}#playGuide strong{font-size:16px}#playGuide span{font-size:11px}}
@media(max-height:420px) and (orientation:landscape){
 #playGuide{top:auto;bottom:calc(8px + env(safe-area-inset-bottom));left:50%;right:auto;transform:translateX(-50%);display:flex;align-items:center;gap:8px;max-width:calc(100% - 24px);padding:5px 12px}
 #playGuide small{flex-shrink:0}
 #playGuide strong{margin:0;font-size:14px}
 #playGuide #playSteps{display:none}
}
#speech:empty{visibility:hidden}

#entryIntro{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#26372b;color:#fff9e7;overflow:hidden}
#entryIntro::backdrop{background:#26372b}
#entryIntro video,#entryIntro .entry-shade{position:absolute;inset:0;width:100%;height:100%}
#entryIntro video{object-fit:cover;object-position:55% 50%;opacity:0;transition:opacity .24s ease-out}
#entryIntro[data-playing="true"] video{opacity:1}
.entry-shade{pointer-events:none;background:linear-gradient(0deg,#16241dde 0%,#18271f44 26%,transparent 54%),linear-gradient(180deg,#18271f48,transparent 18%)}
.entry-title{position:absolute;left:max(clamp(24px,5vw,80px),env(safe-area-inset-left));bottom:calc(clamp(22px,6vh,70px) + env(safe-area-inset-bottom));margin:0;font-size:clamp(32px,6vw,68px);line-height:1.13;letter-spacing:-.04em;text-shadow:0 2px 16px #1e2a20}
.entry-skip{position:absolute;right:max(16px,env(safe-area-inset-right));top:max(16px,env(safe-area-inset-top));height:44px;padding:0 16px;border:1px solid #fff4d98c;border-radius:30px;color:inherit;background:#22352bd9;font-size:15px;font-weight:700}
.entry-skip:focus-visible{outline-color:#fff4d9}
@media(orientation:portrait){.entry-title{left:16px;right:16px;text-align:center}}
