:root {
  color-scheme: dark;
  --ground: #101214;
  --ink: #d8dce0;
  --dim: #7d8791;
  --edge: #2a3036;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.45 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;
}
#gate, #notice, #other {
  max-width: 34rem;
  margin: 18vh auto 0;
  padding: 0 1.25rem;
  text-align: center;
}
/* The other way to play is offered with the page's own words, never over the game. */
#other { margin-top: 1rem; }
#notice[hidden] + #other { display: none; }
a { color: var(--ink); }
h1 { font-size: 1.6rem; }
#game {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 62rem;
  margin: 0 auto;
}
#game.window {
  display: block;
  position: relative;
  max-width: none;
  overflow: hidden;
  background: var(--ground);
}
#stage {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
  user-select: none;
}
#over {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #101214cc;
}
#warn {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.4rem 1rem;
  text-align: center;
  background: #101214cc;
  color: #f07178;
}
#log {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#line {
  display: flex;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  border-top: 1px solid var(--edge);
}
input, button {
  font: inherit;
  color: inherit;
  background: #1a1e22;
  border: 1px solid var(--edge);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
}
input { flex: 1; min-width: 0; }
button { cursor: pointer; }
button:hover, button:focus-visible, input:focus-visible { border-color: var(--dim); outline: none; }
#again { align-self: center; margin: 0.6rem; }
.typed { color: var(--dim); }
.gain { color: #5fd38a; }
.loss { color: #f07178; }
.legendary { color: #f2c94c; font-weight: bold; }
.rare { color: #6cb6ff; }
.uncommon { color: #5fd7d7; }
