/* 데모 페이지. 색은 앱과 같은 토큰(app/theme.css)을 쓴다. */
* { box-sizing: border-box; }

/* display를 지정한 요소는 hidden 속성만으로 안 사라진다. CSS가 더 세기 때문이다. */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 400 16px/1.6 -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', system-ui, sans-serif;
  word-break: keep-all;
  padding: 32px 20px 60px;
}

header, .controls, .hint, footer, .desk, .sheet {
  max-width: 900px; margin-left: auto; margin-right: auto;
}

header h1 { margin: 0 0 6px; font-size: 26px; }
header h1 span {
  font-size: 13px; vertical-align: middle;
  background: var(--accent); color: #fff; border-radius: 999px; padding: 3px 10px;
}
header .what { margin: 0 0 6px; font-size: 19px; }
header #note { margin: 0 0 20px; color: var(--text-dim); font-size: 14px; }

/* 가짜 바탕화면 */
.desk { border-radius: 14px; overflow: hidden; border: 1px solid var(--surface-border); }
.bar {
  display: flex; align-items: center; gap: 7px;
  background: var(--surface-2); padding: 8px 14px; font-size: 13px; color: var(--text-dim);
}
.bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.bar .spacer { flex: 1; }

.screen {
  position: relative;
  aspect-ratio: 16 / 10;
  background: linear-gradient(140deg, #8d93d6, #b79ac8 55%, #e3aeb4);
}

/* 열려 있는 문서 창. 햄스터가 '작업을 가리지 않는다'를 보여주려면 가릴 것이 있어야 한다. */
.win {
  position: absolute; left: 5%; top: 9%; width: 46%; height: 62%;
  background: rgba(40, 38, 70, 0.82); border-radius: 10px; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.win i { display: block; height: 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); }
.win i:nth-child(2) { width: 72%; }
.win i:nth-child(4) { width: 54%; }

iframe { border: 0; background: transparent; }

/* 펫 창. 대기 중에는 구석 240×240, 운동할 때만 화면 전체. */
#pet {
  position: absolute; right: 0; bottom: 0;
  width: 240px; height: 240px;
  pointer-events: none;
}
#pet.full { right: 0; bottom: 0; width: 100%; height: 100%; }

#prompt {
  position: absolute; right: 18px; bottom: 18px;
  width: 320px; height: 170px;
}

/* 안내 상자. 화면 바로 아래에 붙여 "지금 할 일"이 하나만 보이게 한다. */
.guide {
  max-width: 900px; margin: 0 auto 14px;
  background: var(--surface-2); border: 1px solid var(--surface-border);
  border-radius: 14px; padding: 18px 20px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.guide .step { margin: 0; flex: 1; min-width: 260px; font-size: 15px; }
.guide .step b {
  display: inline-block; margin-right: 8px;
  background: var(--accent); color: #fff;
  border-radius: 999px; padding: 2px 10px; font-size: 13px;
}
.guide button {
  font: inherit; font-weight: 700; font-size: 15px; cursor: pointer;
  background: var(--accent); color: #fff;
  border: 1px solid var(--surface-border); border-radius: 12px; padding: 11px 22px;
}
.guide .ghost, .guide .back { background: transparent; color: var(--text-dim); font-weight: 400; border-color: var(--line); }

/* 기록 화면. 앱에서는 별도 창이라 여기서는 아래에서 올라오는 판으로 보여준다. */
.sheet { border: 1px solid var(--surface-border); border-radius: 14px; overflow: hidden; }
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); padding: 10px 16px;
}
.sheet .x {
  font: inherit; font-size: 14px; cursor: pointer; color: var(--text-dim);
  background: transparent; border: 0;
}
#dash { width: 100%; height: 620px; display: block; background: var(--surface); }

footer { margin-top: 36px; display: flex; gap: 16px; justify-content: center; font-size: 14px; }

/* 좁은 화면. 폭이 아니라 화면에 들어오는지를 기준으로 줄인다.
알림 카드와 안내 버튼은 잘리면 데모가 아니라 고장으로 보인다. */
@media (max-width: 720px) {
  body { padding: 20px 14px 40px; }
  header h1 { font-size: 21px; }
  header .what { font-size: 16px; }

  #pet { width: 150px; height: 150px; }
  #prompt {
    right: 8px; bottom: 8px;
    width: min(260px, calc(100% - 16px)); height: 150px;
    transform-origin: bottom right;
  }

  /* 안내 줄은 세로로 쌓는다. 한 줄에 버튼 세 개를 우겨넣으면 화면 밖으로 밀린다. */
  .guide { padding: 14px; gap: 10px; }
  .guide .step { min-width: 0; flex: 0 0 100%; font-size: 14px; }
  .guide button, .guide .back {
    flex: 1 1 auto; text-align: center; font-size: 14px; padding: 12px 14px;
  }
  /* 손가락으로 누를 것이라 칩도 44px 근처까지 키운다. */
  .gear button { padding: 10px 14px; }

  .sheet { border-radius: 12px; }
  #dash { height: min(620px, 70vh); }
}

@media (max-width: 420px) {
  header h1 { font-size: 19px; }
  #pet { width: 120px; height: 120px; }
  /* 알림 카드가 화면 폭을 다 쓰게 둔다. 줄여 접으면 버튼이 카드 밖으로 나간다. */
  #prompt { left: 8px; right: 8px; width: auto; }
  /* 가려질 '작업 창' 소품은 이 폭에서는 자리만 차지한다. */
  .win { width: 60%; }
}

/* 꾸미기 칩. 앱의 설정 창에 있는 소품 목록을 데모에서 바로 만지게 한 것이다. */
.gear { flex-basis: 100%; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.gear button {
  font: inherit; font-size: 14px; font-weight: 400; cursor: pointer;
  background: transparent; color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px;
}
.gear button.on { background: var(--ham-body); border-color: var(--ham-body); color: var(--ham-outline); font-weight: 700; }
.gear .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.gear .label { color: var(--text-dim); font-size: 13px; margin-right: 2px; }

/* 자동 시연 중임을 알린다. 안 보이면 "내가 안 눌렀는데 왜 움직이지"가 된다. */
.auto { flex-basis: 100%; color: var(--text-dim); font-size: 13px; }

/* 제출·스토어용 스크린샷 모드(?shot=). 화면만 16:9로 꽉 채운다. */
body.shooting { padding: 0; height: 100vh; overflow: hidden; }
body.shooting header,
body.shooting .guide,
body.shooting footer { display: none; }
body.shooting .desk { max-width: none; height: 100vh; border: 0; border-radius: 0; display: flex; flex-direction: column; }
body.shooting .screen { flex: 1; aspect-ratio: auto; }
body.shooting .sheet { display: none; }

/* 기록 창은 앱에서 420px짜리 패널이다. 1920으로 늘리면 레이아웃이 무너지므로
   바탕화면 위에 창처럼 띄운 모습으로 찍는다. */
body.shooting-sheet .sheet {
  display: block; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 460px; max-width: none; height: 760px; z-index: 5;
  box-shadow: 0 30px 80px var(--shadow);
}
body.shooting-sheet .sheet-head { display: none; }
body.shooting-sheet #dash { height: 760px; }

/* 시연 모드. 설명을 읽는 화면과 보는 화면을 나눈다.
화면이 작으면 햄스터가 무엇을 하는지 안 보인다. */
body.stage {
  padding: 0; height: 100vh; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column;
}
body.stage header, body.stage footer { display: none; }
/* margin-left/right:auto(위쪽 공통 규칙)가 남아 있으면 flex 아이템이 늘어나지 않아
   바탕화면이 내용 너비만큼의 세로 띠로 쪼그라든다. */
body.stage .desk {
  max-width: none; margin: 0; width: 100%;
  border: 0; border-radius: 0;
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
body.stage .screen { flex: 1; aspect-ratio: auto; }

/* 안내는 화면 아래에 따로 붙인다. 화면 위에 띄우면 오른쪽 아래 알림 카드를 가린다. */
body.stage .guide {
  margin: 0; max-width: none; border: 0; border-top: 1px solid var(--surface-border);
  border-radius: 0; background: var(--surface); flex: none;
}

/* 기록 창은 바탕화면 위에 창처럼 띄운다. */
body.stage .sheet {
  position: fixed; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: 460px; max-width: calc(100% - 32px); height: min(720px, 78vh); z-index: 15;
  box-shadow: 0 30px 80px var(--shadow);
}
body.stage #dash { height: 100%; }

/* 랜딩에 끼워 넣는 미리보기. 바탕화면만 남긴다. */
body.embed { padding: 0; overflow: hidden; }
body.embed header, body.embed footer, body.embed .guide, body.embed .sheet { display: none; }
body.embed .desk { max-width: none; border: 0; border-radius: 0; }

.guide .back {
  text-decoration: none; border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 18px; color: var(--text-dim); font-size: 15px;
}

/* Embedded demo fills its frame, including on narrow screens. */
body.embed .desk { width:100%; height:100vh; height:100dvh; display:flex; flex-direction:column; margin:0; }
body.embed .screen { flex:1; min-height:0; aspect-ratio:auto; }
