:root {
  --ink: #fff8ec;
  --petal: #ff9ec4;
  --gold: #ffd36b;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: #0b1420; overflow: hidden; }
body { font-family: "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); -webkit-font-smoothing: antialiased; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; outline: none; }

/* ---------- title ---------- */
#title {
  position: fixed; inset: 0; display: grid; place-items: center; text-align: center;
  background: radial-gradient(120% 90% at 50% 40%, rgba(9, 22, 40, 0.05), rgba(6, 14, 28, 0.62));
  transition: opacity 1.4s ease, visibility 1.4s; z-index: 5;
}
#title.loading { background: #0b1522; }
#title.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.title-inner { padding: 24px; transform: translateY(-4vh); }
.credit {
  position: absolute; left: 0; right: 0; bottom: 16px; margin: 0;
  font-size: 12px; letter-spacing: 0.12em; opacity: 0.55; text-shadow: 0 1px 12px rgba(10, 30, 60, 0.5);
}
.credit a { color: inherit; text-decoration: none; border-bottom: 1px solid rgba(255, 248, 236, 0.35); }
.credit a:hover { border-bottom-color: rgba(255, 248, 236, 0.8); }
.kicker { margin: 0 0 10px; letter-spacing: 0.34em; text-transform: uppercase; font-size: 12px; opacity: 0.78; }
h1 {
  margin: 0; font-family: "Fraunces", "Songti SC", "Noto Serif SC", Georgia, serif; font-weight: 340; font-style: italic;
  font-size: clamp(64px, 11vw, 168px); line-height: 0.95; letter-spacing: -0.02em;
  text-shadow: 0 2px 40px rgba(10, 30, 60, 0.45);
}
.bar { width: min(280px, 60vw); height: 2px; margin: 34px auto 12px; background: rgba(255, 255, 255, 0.18); overflow: hidden; border-radius: 2px; }
.bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--petal), var(--gold)); transition: width 0.35s ease; }
.status { margin: 0; font-size: 13px; letter-spacing: 0.08em; opacity: 0.7; min-height: 1.4em; }
.title-actions { margin-top: 30px; display: flex; gap: 14px; justify-content: center; align-items: center; }
#start {
  padding: 15px 44px; font: 600 14px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.3em; text-transform: uppercase;
  color: #2a1730; background: linear-gradient(180deg, #fff3e2, #ffd9e6); border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 10px 40px rgba(255, 150, 200, 0.35), inset 0 -2px 0 rgba(120, 40, 80, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
#start:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 50px rgba(255, 150, 200, 0.5), inset 0 -2px 0 rgba(120, 40, 80, 0.18); }
#otherBtn, #contactBtn {
  padding: 15px 34px; font: 600 14px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.3em;
  color: var(--ink); background: rgba(255, 248, 236, 0.10); border: 1px solid rgba(255, 248, 236, 0.45); border-radius: 999px; cursor: pointer;
  backdrop-filter: blur(4px); transition: transform 0.18s ease, background 0.18s ease;
}
#otherBtn:hover, #contactBtn:hover { transform: translateY(-2px) scale(1.03); background: rgba(255, 248, 236, 0.2); }

/* ---------- contact overlay ---------- */
#contact {
  position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; cursor: pointer;
  background: rgba(6, 14, 28, 0.72); backdrop-filter: blur(6px);
}
.contact-panel {
  padding: 30px 38px 22px; text-align: center; cursor: default;
  background: rgba(13, 28, 48, 0.85); border: 1px solid rgba(255, 248, 236, 0.16); border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 10, 30, 0.6);
}
.contact-kicker { margin: 0 0 20px; font-size: 12px; letter-spacing: 0.34em; text-transform: uppercase; opacity: 0.78; }
.contact-cards { display: flex; gap: 30px; flex-wrap: wrap; justify-content: center; }
.contact-card { margin: 0; }
.contact-card img {
  display: block; width: min(220px, 36vw); aspect-ratio: 1; object-fit: contain; border-radius: 12px;
  background: #fff; box-shadow: 0 8px 30px rgba(0, 10, 30, 0.45);
}
.contact-card figcaption { margin-top: 10px; font-size: 13px; letter-spacing: 0.2em; opacity: 0.85; }
.contact-hint { margin: 18px 0 0; font-size: 12px; letter-spacing: 0.12em; opacity: 0.55; }

/* ---------- other games overlay ---------- */
#games {
  position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; padding: 20px; cursor: pointer;
  background: rgba(6, 14, 28, 0.72); backdrop-filter: blur(6px);
}
.games-list { display: flex; flex-direction: column; gap: 12px; min-width: min(320px, 76vw); }
.game-item {
  padding: 14px 26px; font-size: 14px; letter-spacing: 0.18em; text-decoration: none; text-align: center;
  color: var(--ink); background: rgba(255, 248, 236, 0.08); border: 1px solid rgba(255, 248, 236, 0.25); border-radius: 12px;
  transition: transform 0.15s ease, background 0.15s ease;
}
.game-item:hover { transform: translateY(-1px); background: rgba(255, 248, 236, 0.18); }

/* ---------- pause menu ---------- */
#pauseMenu {
  position: fixed; inset: 0; z-index: 7; display: grid; place-items: center;
  background: rgba(6, 14, 28, 0.55); backdrop-filter: blur(5px);
}
.pause-panel {
  min-width: min(340px, 84vw); padding: 30px 40px 32px; text-align: center;
  background: rgba(13, 28, 48, 0.88); border: 1px solid rgba(255, 248, 236, 0.16); border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0, 10, 30, 0.6);
}
.menu-kicker { margin: 0 0 22px; font-size: 12px; letter-spacing: 0.34em; text-transform: uppercase; opacity: 0.78; }
.menu-list { display: flex; flex-direction: column; gap: 12px; }
.menu-item {
  padding: 13px 34px; font: 600 14px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.3em;
  color: var(--ink); background: rgba(255, 248, 236, 0.10); border: 1px solid rgba(255, 248, 236, 0.45); border-radius: 999px; cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.menu-item:hover { background: rgba(255, 248, 236, 0.2); transform: translateY(-1px); }
.menu-primary {
  color: #2a1730; background: linear-gradient(180deg, #fff3e2, #ffd9e6); border: 0;
  box-shadow: 0 10px 40px rgba(255, 150, 200, 0.35), inset 0 -2px 0 rgba(120, 40, 80, 0.18);
}
.menu-primary:hover { background: linear-gradient(180deg, #fff8ec, #ffe3ec); }
#keysHelp .keys-grid {
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  margin-bottom: 24px; font-size: 13px; opacity: 0.92;
}
#keysHelp .menu-item { padding: 10px 30px; }
.keys { margin-top: 34px; display: flex; gap: 10px 26px; flex-wrap: wrap; justify-content: center; font-size: 13px; opacity: 0.86; max-width: 760px; }
kbd {
  display: inline-block; min-width: 24px; padding: 3px 7px; margin-right: 4px; font: 600 11px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 6px; background: rgba(255, 255, 255, 0.10);
}

/* ---------- hud ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 3; transition: opacity 0.6s ease; text-shadow: 0 1px 12px rgba(0, 20, 50, 0.55); }
#hud.quiet { opacity: 0; }
.hud-tl { position: absolute; left: 30px; top: 26px; }
.seeds { display: flex; align-items: baseline; gap: 8px; font-family: "Fraunces", "Songti SC", "Noto Serif SC", serif; font-size: 34px; font-style: italic; }
.seeds-of { font-size: 16px; opacity: 0.7; font-style: normal; font-family: "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; }
.seeds-icon { width: 15px; height: 15px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, var(--gold) 55%, #ff9f43); box-shadow: 0 0 16px var(--gold); align-self: center; }
.place { margin-top: 6px; font-size: 12px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0; transition: opacity 1.2s ease; }
.place.show { opacity: 0.85; }
.hud-bl { position: absolute; left: 30px; bottom: 28px; width: 190px; }
.gust { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); overflow: hidden; }
.gust-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #fff, var(--petal)); border-radius: 4px; }
.gust-label { margin-top: 7px; font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase; opacity: 0.7; }
.hud-br { position: absolute; right: 32px; bottom: 22px; font-family: "Fraunces", "Songti SC", "Noto Serif SC", serif; font-style: italic; font-size: 44px; line-height: 1; }
.hud-br small { font: 500 11px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.3em; text-transform: uppercase; margin-left: 8px; opacity: 0.7; }
.toast {
  position: absolute; left: 50%; top: 15%; transform: translateX(-50%); font-family: "Fraunces", "Songti SC", "Noto Serif SC", serif; font-style: italic; font-size: clamp(22px, 2.6vw, 38px);
  opacity: 0; transition: opacity 0.9s ease; white-space: nowrap;
}
.toast.show { opacity: 0.96; }

.compass { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; font: 500 12px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.12em; opacity: 0.8; font-style: normal; }
.compass svg { color: var(--gold); filter: drop-shadow(0 0 6px rgba(255, 211, 107, 0.7)); transition: transform 0.12s linear; }

/* ---------- errands: the parcel (top right), the landing prompt, the delivery card, the trick ---------- */
.hud-tr { position: absolute; right: 32px; top: 26px; text-align: right; }
.job-kicker { font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase; opacity: 0.75; }
.job-icon {
  display: inline-block; width: 12px; height: 11px; margin-right: 10px; border-radius: 2px; vertical-align: -1px;
  background: linear-gradient(#fff8ec, #fff8ec) center / 2px 100% no-repeat, linear-gradient(#fff8ec, #fff8ec) center / 100% 2px no-repeat, linear-gradient(135deg, var(--gold), #ff9f43);
  box-shadow: 0 0 14px rgba(255, 211, 107, 0.85);
}
.job-name { margin-top: 3px; font: italic 400 28px/1.12 "Fraunces", "Songti SC", "Noto Serif SC", serif; }
.job-spot { font: 500 12px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.12em; opacity: 0.7; }
.job-meta { margin-top: 5px; display: flex; justify-content: flex-end; align-items: center; gap: 14px; font: 500 12px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.12em; }
.job-meta .compass { margin-left: 0; }
.job-count { opacity: 0.7; }
#job.fresh .job-name { animation: job-fresh 1.8s ease; }
@keyframes job-fresh { 0% { opacity: 0; transform: translateY(8px); color: var(--gold); } 35% { opacity: 1; color: var(--gold); } 100% { transform: none; color: var(--ink); } }

.prompt {
  position: absolute; left: 50%; bottom: 9%; transform: translate(-50%, 8px); display: flex; align-items: center; gap: 10px; white-space: nowrap;
  font: 500 13px "Karla", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0; transition: opacity 0.4s ease, transform 0.4s ease;
}
.prompt.show { opacity: 0.96; transform: translate(-50%, 0); }
.prompt kbd { margin-right: 0; padding: 4px 10px; font-size: 12px; background: rgba(255, 255, 255, 0.16); }
.prompt .x2 { margin: 0 2px 0 -3px; font-weight: 600; letter-spacing: 0.04em; color: var(--gold); }
.prompt em { margin-left: 8px; font: italic 400 21px/1 "Fraunces", "Songti SC", "Noto Serif SC", serif; letter-spacing: 0; text-transform: none; }
.prompt small { margin-left: 18px; font-size: 10px; letter-spacing: 0.26em; opacity: 0.62; }
.prompt small kbd { margin-right: 7px; padding: 2px 6px; font-size: 10px; }

.card { position: absolute; left: 50%; top: 23%; transform: translate(-50%, 12px); text-align: center; white-space: nowrap; opacity: 0; transition: opacity 0.8s ease, transform 1s cubic-bezier(0.2, 0.9, 0.2, 1); }
.card.show { opacity: 1; transform: translate(-50%, 0); }
.card-kicker { font-size: 11px; letter-spacing: 0.42em; text-transform: uppercase; color: var(--gold); text-shadow: 0 0 18px rgba(255, 211, 107, 0.5), 0 1px 12px rgba(0, 20, 50, 0.55); }
.card-name { margin-top: 5px; font: italic 340 clamp(34px, 4.6vw, 68px)/1.05 "Fraunces", "Songti SC", "Noto Serif SC", Georgia, serif; letter-spacing: -0.01em; text-shadow: 0 2px 30px rgba(10, 30, 60, 0.5); }
.card-name::after { content: ""; display: block; width: 72px; height: 1px; margin: 13px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.card-sub { margin-top: 11px; font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.85; }

.trick { margin-top: 12px; font-size: 10px; letter-spacing: 0.34em; text-transform: uppercase; opacity: 0.75; transition: opacity 0.3s ease; }
.trick kbd { min-width: 20px; padding: 2px 6px; margin-right: 8px; text-align: center; }
.trick.cool { opacity: 0.3; }
