:root {
  --ink: #24332c;
  --cream: #fff8e8;
  --gold: #f6c66f;
  --paper: #f5f0e3;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC",
    sans-serif;
  color: var(--cream);
  background: #0f2e30;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  height: 72px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--cream);
  background: linear-gradient(
    180deg,
    rgba(15, 35, 35, 0.8),
    rgba(15, 35, 35, 0)
  );
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 248, 232, 0.75);
  border-radius: 50%;
  font-size: 15px;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav a {
  font-size: 14px;
  opacity: 0.9;
}

.game {
  position: relative;
  width: 100%;
  height: 100svh;
  overflow: hidden;
}

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

.hud {
  position: absolute;
  top: 84px;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 12px 18px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  border-radius: 8px;
  background: rgba(13, 45, 42, 0.52);
  backdrop-filter: blur(6px);
  font-size: 15px;
  font-weight: 700;
}

.hud p {
  margin: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 60px;
  background: rgba(8, 31, 30, 0.36);
}

.overlay.hidden {
  display: none;
}

.kicker {
  margin: 0 0 16px;
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
}

.overlay h1 {
  margin: 0;
  font-size: 64px;
  line-height: 1.1;
}

.hint,
.result,
#message {
  max-width: 420px;
  margin: 18px 0 0;
  color: rgba(255, 248, 232, 0.88);
  line-height: 1.7;
}

#message {
  font-size: 18px;
  font-weight: 700;
}

.result strong {
  color: var(--gold);
  font-size: 22px;
}

button,
.actions a {
  border: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  margin-top: 34px;
  padding: 13px 22px;
  border-radius: 8px;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    background 0.15s ease;
}

button:hover,
.actions a:hover {
  transform: translateY(-2px);
  background: #fffdf5;
}

.actions {
  display: flex;
  gap: 14px;
}

.actions a {
  background: transparent;
  border: 1px solid rgba(255, 248, 232, 0.45);
  color: var(--cream);
}

.actions a:hover {
  background: rgba(255, 248, 232, 0.12);
}

@media (max-width: 640px) {
  .overlay h1 {
    font-size: 46px;
  }

  .actions {
    flex-direction: column;
  }

  button,
  .actions a {
    width: 200px;
  }
}

@media (max-height: 560px) {
  .overlay {
    padding-top: 90px;
    padding-bottom: 40px;
  }

  .overlay h1 {
    font-size: 38px;
  }

  button,
  .actions a {
    margin-top: 22px;
  }
}
