* { box-sizing: border-box }
html, body { width: 100%; height: 100%; padding: 0; margin: 0; overflow: hidden }
body {
  background: radial-gradient(circle at 50% 0%, #fffdf3 0%, #fff6dc 55%, #f8ebca 100%);
  color: #4c4031;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, a { font: inherit }
button { -webkit-tap-highlight-color: transparent }

#test-bar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 46px;
  padding: 7px max(12px, env(safe-area-inset-left)) 7px max(12px, env(safe-area-inset-right));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 252, 242, .92);
  border-bottom: 1px solid rgba(112, 85, 45, .11);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: baseline; gap: 8px; min-width: 0; white-space: nowrap }
.brand strong { overflow: hidden; text-overflow: ellipsis; font-size: 14px; letter-spacing: .02em }
.brand small { color: #8e7b62; font-size: 11px }
#test-bar nav { display: flex; flex: 0 0 auto; gap: 6px }
#test-bar a {
  min-height: 30px;
  padding: 6px 11px;
  display: inline-flex;
  align-items: center;
  color: #67563e;
  background: #fff;
  border: 1px solid rgba(103, 86, 62, .17);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}
#test-bar a:first-child { color: #216c61; background: #edf9f5; border-color: rgba(33, 108, 97, .18) }
#test-bar a:focus-visible, button:focus-visible { outline: 3px solid rgba(40, 144, 129, .3); outline-offset: 2px }

#unity-container { position: absolute }
#unity-container.unity-desktop { left: 50%; top: calc(50% + 23px); transform: translate(-50%, -50%) }
#unity-container.unity-mobile {
  position: fixed;
  top: 46px;
  left: 0;
  width: 100%;
  height: calc(100% - 46px - env(safe-area-inset-bottom));
}
#unity-canvas {
  display: block;
  background: #fff8e8;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(101, 77, 42, .14);
  touch-action: none;
}
.unity-mobile #unity-canvas { width: 100%; height: 100%; border-radius: 0; box-shadow: none }
#unity-footer { position: relative; height: 38px }
.unity-mobile #unity-footer { display: none }
#unity-build-title { float: left; padding-left: 8px; line-height: 38px; color: #75634b; font-size: 13px }
#unity-fullscreen-button {
  float: right;
  width: 38px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  border: 0;
  background: url("fullscreen-button.png") no-repeat center;
}
#unity-warning {
  position: absolute;
  z-index: 30;
  left: 50%;
  top: 5%;
  display: none;
  width: min(90vw, 640px);
  transform: translateX(-50%);
}
#unity-warning div { margin-bottom: 8px; padding: 10px 12px; border-radius: 12px; background: #fff3b8; box-shadow: 0 8px 24px rgba(80, 56, 24, .14) }
#unity-warning .error { color: #842c2c; background: #ffe4df }

#experience-gate {
  position: fixed;
  z-index: 50;
  inset: 46px 0 0;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 210, 90, .34), transparent 32%),
    radial-gradient(circle at 82% 80%, rgba(73, 190, 171, .22), transparent 34%),
    rgba(255, 249, 231, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: opacity .34s ease, visibility .34s ease;
}
#experience-gate[hidden] { display: none }
#experience-gate.is-leaving { opacity: 0; visibility: hidden }
.gate-card {
  width: min(92vw, 430px);
  padding: 30px 28px 26px;
  text-align: center;
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(121, 90, 45, .12);
  border-radius: 30px;
  box-shadow: 0 24px 80px rgba(111, 83, 38, .15), inset 0 1px 0 #fff;
}
.duck-mark {
  width: 82px;
  height: 82px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  font-size: 48px;
  background: linear-gradient(145deg, #fff8c9, #ffe17c);
  border: 1px solid rgba(205, 145, 33, .18);
  border-radius: 28px;
  box-shadow: 0 10px 30px rgba(226, 168, 43, .2);
}
.eyebrow { margin: 0 0 6px; color: #238174; font-size: 12px; font-weight: 750; letter-spacing: .12em }
.gate-card h1 { margin: 0; color: #3f3529; font-size: clamp(24px, 6vw, 31px); line-height: 1.25; letter-spacing: -.02em }
#gate-copy { margin: 10px auto 20px; max-width: 330px; color: #7b6a55; font-size: 14px; line-height: 1.7 }
#progress-track { width: 100%; height: 9px; overflow: hidden; background: rgba(93, 73, 44, .11); border-radius: 999px }
#progress-fill { width: 0; height: 100%; background: linear-gradient(90deg, #f5bd45, #4bbcab); border-radius: inherit; transition: width .18s ease }
#progress-copy { margin: 8px 0 17px; color: #92816c; font-size: 12px }
#enter-button {
  width: 100%;
  min-height: 58px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  background: linear-gradient(135deg, #eaa829, #f2bd45);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 12px 26px rgba(214, 151, 29, .25);
  font-size: 17px;
  font-weight: 750;
  cursor: pointer;
  transition: transform .16s ease, filter .16s ease, opacity .16s ease;
}
#enter-button:not(:disabled):active { transform: scale(.98) }
#enter-button:disabled { cursor: wait; filter: saturate(.55); opacity: .58; box-shadow: none }
#enter-button.is-confirmed { background: linear-gradient(135deg, #238c7d, #4cb9a8) }
.button-icon { font-size: 22px; line-height: 1 }
.sound-note { margin: 13px 4px 0; color: #8e7d68; font-size: 11px; line-height: 1.55 }

@media (max-width: 1024px) {
  .brand strong { font-size: 13px }
  .brand small, #test-bar a:last-child { display: none }
  #test-bar a { min-height: 32px; padding-inline: 12px }
}

@media (max-height: 620px) {
  .gate-card { padding: 18px 22px 16px; border-radius: 24px }
  .duck-mark { width: 58px; height: 58px; margin-bottom: 8px; border-radius: 20px; font-size: 34px }
  #gate-copy { margin: 6px auto 12px; line-height: 1.45 }
  #progress-copy { margin-bottom: 10px }
  #enter-button { min-height: 50px }
  .sound-note { margin-top: 8px }
}

@media (max-height: 720px) and (min-width: 1025px) {
  #unity-container.unity-desktop { transform: translate(-50%, -50%) scale(.9) }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important }
}
