/* Our Days in Taiwan — warm travel-journal palette (same as the game: cream paper, brown ink, terracotta) */
:root { --paper: #f8f2e7; --paper2: #efe4d2; --ink: #3a2a24; --ink2: #6b5a50; --accent: #aa593e; --tape: rgba(214, 170, 120, 0.55); --bg: #1b1a1f; }
html, body { margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--bg);
  -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
body { position: fixed; inset: 0; }
#stage { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; box-sizing: border-box;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
#frame { position: relative; background: #000; box-shadow: 0 0 24px rgba(0, 0, 0, 0.6); }
#unity-canvas { width: 100%; height: 100%; display: block; background: #231f20; outline: none;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* loading page */
#loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--paper); color: var(--ink); font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  padding: 0 5%; box-sizing: border-box; text-align: center; }
#title { font-size: clamp(20px, 4.2vw, 48px); font-weight: 700; letter-spacing: 0.02em; }
#subtitle { font-size: clamp(11px, 1.6vw, 18px); color: var(--ink2); margin: 4px 0 clamp(12px, 2.4vw, 26px); }
#bar { width: min(60%, 520px); height: 12px; background: var(--paper2); border-radius: 6px; overflow: hidden; }
#fill { width: 0; height: 100%; background: var(--accent); transition: width 0.2s; }
#pct { margin-top: 10px; font-size: clamp(12px, 1.5vw, 15px); }
#loadNote { margin-top: clamp(8px, 2vw, 22px); font-size: clamp(10px, 1.3vw, 13px); line-height: 1.7; color: var(--ink2); }

/* washi tape decoration */
.tape { position: absolute; top: -10px; left: 50%; width: 110px; height: 22px; transform: translateX(-50%) rotate(-3deg);
  background: var(--tape); border-left: 2px dashed rgba(255,255,255,0.5); border-right: 2px dashed rgba(255,255,255,0.5); }
#loading .tape { top: 8%; }
.tape.small { width: 70px; height: 16px; top: -8px; }

#clickToFocus { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); background: rgba(58, 42, 36, 0.8);
  color: #fff8ec; padding: 4px 12px; border-radius: 12px; font: clamp(10px, 1.1vw, 13px) system-ui, sans-serif; white-space: nowrap;
  pointer-events: none; transition: opacity 1s; }
#clickToFocus.fade { opacity: 0; }

/* phone held upright: journal note */
#rotate { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center;
  background: rgba(27, 26, 31, 0.86); padding: max(20px, env(safe-area-inset-top)) 20px max(20px, env(safe-area-inset-bottom)); box-sizing: border-box; }
#rotate[hidden] { display: none; }
#rotate .note { position: relative; width: min(100%, 360px); background: var(--paper); color: var(--ink); border-radius: 14px;
  padding: 30px 22px 18px; box-sizing: border-box; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  background-image: repeating-linear-gradient(transparent 0 27px, rgba(170, 89, 62, 0.08) 27px 28px);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif; }
.phoneIcon { position: relative; height: 70px; margin-bottom: 10px; }
.phoneIcon .ph { display: inline-block; width: 34px; height: 58px; border: 3px solid var(--ink); border-radius: 8px; animation: tilt 2.4s ease-in-out infinite; }
.phoneIcon .arrow { position: absolute; left: calc(50% + 26px); top: 4px; font-size: 26px; color: var(--accent); }
@keyframes tilt { 0%, 30% { transform: rotate(0); } 55%, 85% { transform: rotate(-90deg); } 100% { transform: rotate(0); } }
@media (prefers-reduced-motion: reduce) { .phoneIcon .ph { animation: none; transform: rotate(-90deg); } }
#rotate p { margin: 0 0 8px; line-height: 1.6; }
#rotate .zh { font-size: 16px; }
#rotate .strong { font-weight: 700; color: var(--accent); }
#rotate .en { font-size: 14px; color: var(--ink2); margin-bottom: 16px; }
#rotateSkip { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; min-width: 200px; padding: 8px 22px;
  border: 2px solid var(--ink); border-radius: 24px; background: transparent; color: var(--ink); font: 600 16px "Noto Sans TC", "PingFang TC", system-ui, sans-serif; cursor: pointer; }
#rotateSkip span { font-size: 12px; font-weight: 400; color: var(--ink2); }
#rotateSkip:active { background: var(--paper2); }
#rotate .small { font-size: 12px; color: var(--ink2); margin: 12px 0 0; }

/* first-play hint card */
#hintCard { position: fixed; z-index: 25; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%);
  width: min(92vw, 560px); box-sizing: border-box; padding: 16px 18px 10px; border-radius: 12px; background: var(--paper); color: var(--ink);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  text-align: center; cursor: pointer; animation: drop 0.35s ease-out; transition: opacity 0.4s; }
#hintCard[hidden] { display: none; }
#hintCard.bye { opacity: 0; }
#hintZh { font-size: 16px; font-weight: 600; line-height: 1.6; }
#hintEn { font-size: 13px; color: var(--ink2); line-height: 1.5; margin-top: 2px; }
#hintFs { margin-top: 10px; min-height: 44px; padding: 8px 18px; border: 2px solid var(--ink); border-radius: 22px; background: transparent;
  color: var(--ink); font: 600 14px "Noto Sans TC", "PingFang TC", system-ui, sans-serif; cursor: pointer; }
#hintFs[hidden], #fs[hidden] { display: none; }
#hintCard .tapClose { font-size: 11px; color: var(--ink2); margin-top: 6px; opacity: 0.8; }
@keyframes drop { from { transform: translate(-50%, -16px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }

/* fullscreen button: small on computers, 44 px on touch screens */
#fs { position: fixed; z-index: 10; right: max(6px, env(safe-area-inset-right)); bottom: max(6px, env(safe-area-inset-bottom));
  width: 30px; height: 30px; border: 0; border-radius: 8px; padding: 0; background: rgba(248, 242, 231, 0.6); color: var(--ink);
  font-size: 16px; line-height: 30px; cursor: pointer; }
#fs:hover { background: rgba(248, 242, 231, 0.95); }
[data-device="phone"] #fs, [data-device="tablet"] #fs { width: 44px; height: 44px; font-size: 22px; line-height: 44px; }

#warning { position: fixed; left: 50%; top: max(10px, env(safe-area-inset-top)); transform: translateX(-50%); width: min(90%, 760px); z-index: 40; }
#warning div { padding: 10px 14px; margin-bottom: 6px; border-radius: 8px; font: 14px system-ui, sans-serif; }
#warning .warn { background: #fff3c4; color: #5a4300; }
#warning .err { background: #ffd6d0; color: #7a1200; }
