:root {
  --ink: #f8efe0;
  --coal: #17120f;
  --shadow: #2a1915;
  --rouge: #b8323a;
  --jade: #1e8f74;
  --gold: #e4ae3f;
  --fox: #f0783b;
  --porcelain: #fff7e8;
  --glass: rgba(23, 18, 15, 0.74);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--coal);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  touch-action: none;
  user-select: none;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
}

button {
  font: 700 14px/1 Georgia, "Times New Roman", serif;
}

.panel {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 32px));
  transform: translate(-50%, -50%);
  padding: 26px;
  border: 1px solid rgba(248, 239, 224, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 247, 232, 0.13), rgba(255, 247, 232, 0.05)),
    var(--glass);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  z-index: 20;
}

.panel.is-hidden {
  display: none;
}

.panel__mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  letter-spacing: 0;
}

h1 {
  margin: 0 0 10px;
  max-width: 480px;
  color: var(--porcelain);
  font-size: clamp(34px, 7vw, 64px);
  line-height: 0.92;
  letter-spacing: 0;
  text-wrap: balance;
}

p {
  margin: 0;
  max-width: 48ch;
  color: rgba(248, 239, 224, 0.86);
  font-size: 17px;
  line-height: 1.45;
}

.panel__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 22px;
}

.panel__stats span {
  padding: 8px 10px;
  border: 1px solid rgba(248, 239, 224, 0.18);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  color: rgba(248, 239, 224, 0.82);
  font-size: 13px;
}

.panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.panel button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 7px;
  background: var(--gold);
  color: #1d120c;
  cursor: pointer;
  box-shadow: 0 8px 0 #7a4b1b;
}

.panel button:active {
  transform: translateY(3px);
  box-shadow: 0 5px 0 #7a4b1b;
}

.panel button + button {
  background: var(--porcelain);
  box-shadow: 0 8px 0 #8e7461;
}

.hud {
  position: fixed;
  left: 14px;
  top: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10;
  transition: opacity 160ms ease;
}

.hud.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.meter {
  width: min(180px, 28vw);
  padding: 8px;
  border: 1px solid rgba(248, 239, 224, 0.18);
  border-radius: 8px;
  background: rgba(23, 18, 15, 0.62);
}

.meter span,
.hud__readout small {
  display: block;
  margin-bottom: 5px;
  color: rgba(248, 239, 224, 0.76);
  font-size: 12px;
  line-height: 1;
}

.meter div {
  height: 8px;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.meter i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--rouge);
}

.meter--gold i {
  background: var(--gold);
}

.hud__readout {
  min-width: 82px;
  padding: 8px 10px;
  border: 1px solid rgba(248, 239, 224, 0.18);
  border-radius: 8px;
  background: rgba(23, 18, 15, 0.62);
}

.hud__readout b {
  display: block;
  color: var(--porcelain);
  font-size: 22px;
  line-height: 1;
}

.icon-btn,
#sg-fs-btn {
  position: fixed;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  z-index: 9999;
}

.icon-btn:hover,
#sg-fs-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

#sg-fs-btn {
  top: 8px;
  right: 8px;
}

#mute-btn {
  top: 8px;
  right: 40px;
}

#pause-btn {
  top: 8px;
  right: 72px;
}

@media (max-width: 640px) {
  .panel {
    top: 48%;
    padding: 20px;
  }

  .hud {
    left: 8px;
    top: 44px;
    gap: 6px;
  }

  .meter {
    width: 31vw;
    padding: 6px;
  }

  .hud__readout {
    min-width: 64px;
    padding: 7px;
  }

  .hud__readout b {
    font-size: 18px;
  }
}
