* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #74c8f2;
  color: #5a3210;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 0;
  pointer-events: none;
}

.hud button,
.hud .pill {
  pointer-events: auto;
}

.pause {
  width: 50px;
  height: 50px;
  flex: 0 0 50px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 3px solid rgba(123, 63, 10, 0.3);
  border-radius: 50%;
  background: linear-gradient(180deg, #ffc14d, #ff8a3d);
  color: #6b3200;
  box-shadow: 0 4px 0 rgba(120, 60, 10, 0.28), 0 6px 14px rgba(0, 0, 0, 0.18);
  cursor: pointer;
}

.pause:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(120, 60, 10, 0.28);
}

.pause .mp-icon {
  width: 26px;
  height: 26px;
}

.pill {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 13px;
  border: 2px solid rgba(148, 89, 38, 0.42);
  border-radius: 14px;
  background: rgba(255, 247, 228, 0.94);
  box-shadow: 0 3px 10px rgba(80, 40, 5, 0.18);
  color: #6b3a12;
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.pill b {
  font-size: 21px;
  line-height: 1;
  color: #e65f14;
}

.timer-pill {
  margin-left: auto;
}

.timer-pill .mp-icon {
  width: 20px;
  height: 20px;
  color: #d98524;
}

.timer-pill b {
  min-width: 24px;
  color: #5a3210;
  text-align: center;
}

.hint {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 9;
  transform: translateX(-50%);
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(70, 36, 8, 0.62);
  color: #fff8e8;
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.hint.hide {
  opacity: 0;
}

.layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(40, 20, 5, 0.46);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.layer.hidden {
  display: none;
}

.panel {
  width: min(86vw, 330px);
  padding: 26px 22px 24px;
  border: 3px solid rgba(150, 88, 32, 0.32);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff9ea, #ffebcb);
  box-shadow: 0 18px 44px rgba(50, 20, 0, 0.35);
  text-align: center;
}

.panel h2 {
  margin: 0 0 8px;
  color: #5a3210;
  font-size: 25px;
}

.panel p {
  margin: 0 0 22px;
  color: #8a6a45;
  font-size: 14px;
}

.panel .final {
  color: #6b3a12;
  font-size: 16px;
}

.panel .final b {
  display: block;
  margin-top: 4px;
  color: #f26b13;
  font-size: 38px;
  line-height: 1.1;
}

.primary {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffb03a, #ff7a2f);
  box-shadow: 0 4px 0 #c95511;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
}

.primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c95511;
}
