:root {
  color-scheme: dark;
  font-family: "Unifont", ui-monospace, SFMono-Regular, Menlo, Consolas, "Segoe UI", "PingFang SC", "Microsoft YaHei", monospace;
  /* match assets/美术素材/背景及电脑屏幕/background.jpg avg color */
  background: rgb(61, 74, 106);
  color: #f3f6ff;
}

@font-face {
  font-family: "Unifont";
  src: url("./unifont-16.0.04.ttf") format("truetype");
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  /* match assets/美术素材/背景及电脑屏幕/background.jpg avg color */
  background: rgb(61, 74, 106);
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  gap: 16px;
}

.hud-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border: none;
  border-radius: 18px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

.hud-title {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hud-title h1,
.hud-title p {
  margin: 0;
}

#score-label {
  min-width: 160px;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: rgba(243, 246, 255, 0.88);
  white-space: nowrap;
}

.hud-title h1 {
  font-size: 48px;
  letter-spacing: 0.08em;
}

.hud-title p {
  margin-top: 4px;
  font-size: 14px;
  color: rgba(243, 246, 255, 0.72);
}

.hud-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 18px;
}

#stage-label,
#timer-label {
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

#timer-label {
  font-family: "Unifont", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 700;
  font-size: 48px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.game-wrapper {
  flex: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}

#game-canvas {
  grid-area: 1 / 1;
  width: min(100%, calc((100vh - 120px) * 16 / 9));
  max-height: calc(100vh - 120px);
  aspect-ratio: 16 / 9;
  /* 下区开放：去掉画布外框（圆角/边框/阴影/底色） */
  border-radius: 0;
  border: none;
  background: transparent;
  box-shadow: none;
}

.canvas-overlay {
  grid-area: 1 / 1;
  align-self: end;
  justify-self: center;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

#message-box {
  min-width: 0;
  max-width: min(520px, 42vw);
  padding: 10px 26px;
  border-radius: 0;
  border: none;
  background-color: transparent;
  background-image: url("./assets/美术素材/背景及电脑屏幕/hint.png");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  color: rgba(243, 246, 255, 0.88);
}

/* ── 开始 / 结束界面 ── */
.screen-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
}

.screen-overlay.hidden {
  display: none;
}

.screen-card {
  max-width: 800px;
  width: 90%;
  padding: 48px 40px;
  border-radius: 24px;
  border: none;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  text-align: center;
}

.screen-title {
  margin: 0 0 8px;
  font-size: 42px;
  letter-spacing: 0.1em;
  color: #f3f6ff;
}

.screen-subtitle {
  margin: 0 0 28px;
  font-size: 16px;
  color: rgba(243, 246, 255, 0.6);
}

.screen-intro {
  text-align: left;
  margin-bottom: 32px;
  padding: 20px 24px;
  border-radius: 14px;
  background: transparent;
  border: none;
}

.screen-intro p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(243, 246, 255, 0.82);
}

.screen-intro ul {
  margin: 0;
  padding-left: 20px;
}

.screen-intro li {
  font-size: 13px;
  line-height: 1.8;
  color: rgba(243, 246, 255, 0.7);
}

.highlight-format,
.highlight-hobby,
.highlight-intensity {
  font-weight: 700;
  text-shadow: 0 0 10px currentColor, 0 0 18px currentColor;
}

.highlight-format {
  color: #69b7ff;
}

.highlight-hobby {
  color: #78e08f;
}

.highlight-intensity {
  color: #ffb347;
}

.end-icon {
  font-size: 56px;
  margin-bottom: 16px;
  line-height: 1;
}

.end-meta {
  margin-top: -12px;
  margin-bottom: 28px;
  color: rgba(243, 246, 255, 0.82);
}

.primary-button {
  display: inline-block;
  padding: 14px 40px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 16px;
  font-weight: 700;
  color: #f3f6ff;
  background: linear-gradient(180deg, rgba(255, 214, 109, 0.28), rgba(243, 164, 59, 0.2));
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  transition: all 0.18s ease;
  letter-spacing: 0.04em;
}

.primary-button:hover {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255, 214, 109, 0.38), rgba(243, 164, 59, 0.28));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.38);
}

.primary-button:active {
  transform: translateY(0);
}

/* ── 美术按钮素材（DOM 按钮）── */
.primary-button.art-button {
  --btn-art-normal: none;
  --btn-art-hover: var(--btn-art-normal);
  --btn-art-active: var(--btn-art-hover);
  --btn-art-width: auto;
  --btn-art-height: auto;

  width: var(--btn-art-width);
  height: var(--btn-art-height);
  max-width: 100%;
  padding: 0;

  /* 让美术图覆盖在原渐变之上：即使图片缺失也仍有兜底渐变 */
  background-image: var(--btn-art-normal), linear-gradient(180deg, rgba(255, 214, 109, 0.28), rgba(243, 164, 59, 0.2));
  background-size: 100% 100%, 100% 100%;
  background-repeat: no-repeat, no-repeat;
  background-position: center, center;

  color: transparent;
  border: 0;
}

.primary-button.art-button:hover {
  background-image: var(--btn-art-hover), linear-gradient(180deg, rgba(255, 214, 109, 0.38), rgba(243, 164, 59, 0.28));
}

.primary-button.art-button:active {
  background-image: var(--btn-art-active), linear-gradient(180deg, rgba(255, 214, 109, 0.38), rgba(243, 164, 59, 0.28));
}

.primary-button.art-button:focus-visible {
  outline: 3px solid rgba(243, 213, 109, 0.9);
  outline-offset: 4px;
}
