:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  color: #f5f4e9;
  background: #10231c;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
}

button,
a { font: inherit; }

button {
  min-height: 44px;
  padding: 10px 18px;
  color: #11211a;
  background: #e2c83e;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 750;
}

button:disabled {
  cursor: default;
  opacity: .5;
}

button:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 3px solid #4dd7dc;
  outline-offset: 3px;
}

.shell-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 14px;
  background: #183529;
  border-bottom: 1px solid #3e7055;
}

.wordmark {
  color: inherit;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none;
}

.edition {
  flex: 1;
  color: #c9d9ca;
  font-size: .82rem;
}

.site-link {
  color: #dce8dc;
  font-size: .8rem;
  text-decoration: none;
  white-space: nowrap;
}

.site-link:hover {
  text-decoration: underline;
}

.tool {
  min-width: 44px;
  padding-inline: 12px;
  color: #f5f4e9;
  background: #285a43;
  font-size: .77rem;
}

.tool[aria-pressed="true"] {
  background: #bd4146;
}

.storage-notice {
  position: absolute;
  z-index: 2;
  top: 64px;
  left: 50%;
  max-width: min(720px, calc(100vw - 32px));
  margin: 0;
  padding: 10px 14px;
  color: #fff4dc;
  background: #6b3c21;
  border: 1px solid #e2c83e;
  border-radius: 6px;
  font-size: .88rem;
  line-height: 1.4;
  text-align: center;
  transform: translateX(-50%);
}

.storage-notice[hidden] {
  display: none;
}

#stage {
  position: relative;
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-height: 0;
  height: calc(100dvh - 56px);
  background:
    radial-gradient(circle at 50% 30%, rgb(48 94 68 / 55%), transparent 48%),
    #10231c;
}

canvas {
  display: block;
  max-width: 100%;
  max-height: 100%;
  touch-action: none;
}

.loading-card,
.completion-card {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
  background: rgb(9 24 18 / 93%);
}

.loading-card[hidden] {
  display: none;
}

.completion-card[hidden] {
  display: none;
}

.eyebrow {
  margin: 0;
  color: #e2c83e;
  font-size: .74rem;
  font-weight: 850;
  letter-spacing: .16em;
}

h1 {
  max-width: 620px;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(2rem, 6vw, 4.2rem);
  line-height: 1.04;
}

h2 {
  max-width: 620px;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.7rem, 5vw, 3.3rem);
  line-height: 1.08;
}

.intro,
#status {
  max-width: 520px;
  margin: 0;
  color: #d1ded2;
  line-height: 1.5;
}

#status {
  min-height: 1.5em;
  font-size: .9rem;
}

.start {
  min-width: 176px;
}

.completion-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.diary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  color: #f5f4e9;
  border: 1px solid #8cad96;
  border-radius: 6px;
  font-weight: 750;
  text-decoration: none;
}

.diary-link:hover {
  background: rgb(255 255 255 / 10%);
}

@media (max-width: 540px) {
  .shell-header { gap: 8px; padding-inline: 10px; }
  .edition { font-size: .7rem; }
  .tool { min-width: 40px; padding-inline: 8px; }
  #stage { height: calc(100dvh - 54px); }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
