:root {
  color-scheme: light;
  --ink: #243c35;
  --green: #245a46;
  --cream: #faf8ed;
  --line: #d4d7c6;
  --coral: #e68457;
  font-family: 'Trebuchet MS', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  color: var(--ink);
  background: #f7f6ec;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100vh;
  background-image: radial-gradient(#56735311 0.7px, transparent 0.8px);
  background-size: 5px 5px;
}
header,
main,
footer {
  width: min(1480px, 92vw);
  margin: auto;
}
header {
  height: 78px;
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid #304f392e;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 900;
  font-size: 1.18rem;
  text-decoration: none;
  color: inherit;
  letter-spacing: 0.04em;
}
.house-icon {
  width: 39px;
  height: 39px;
  background: var(--green);
  border-radius: 12px;
  display: grid;
  place-items: center;
  transform: rotate(-5deg);
}
.house-icon i {
  position: relative;
  background: #fff3cb;
  width: 24px;
  height: 22px;
  clip-path: polygon(0 47%, 50% 0, 100% 47%, 88% 47%, 88% 100%, 16% 100%, 16% 47%);
}
.house-icon i:after {
  content: '';
  width: 6px;
  height: 8px;
  position: absolute;
  bottom: 0;
  left: 10px;
  background: var(--green);
}
nav,
.btnrow,
.facts {
  display: flex;
  align-items: center;
  gap: 10px;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 1px solid #b9c6b7;
  border-radius: 12px;
  padding: 10px 17px;
  font-weight: 700;
  background: var(--cream);
}
button:hover:enabled {
  background: #e8eddd;
}
button:disabled {
  opacity: 0.47;
  cursor: default;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid #ae581c;
  outline-offset: 3px;
}
button.primary {
  background: var(--green);
  color: #fffcef;
  border: 1px solid #234e3e;
  box-shadow: 0 3px 0 #163b2c;
}
button.primary:hover:enabled {
  background: #336f54;
}
nav button {
  font-size: 0.87rem;
  border-radius: 22px;
  padding: 8px 16px;
}
nav #help {
  background: transparent;
  border-color: transparent;
}
.home {
  display: grid;
  grid-template-columns: minmax(255px, 0.72fr) minmax(0, 1.8fr);
  gap: clamp(24px, 4vw, 64px);
  padding: clamp(26px, 4vh, 54px) 0;
  align-items: stretch;
  min-height: min(810px, calc(100vh - 132px));
}
.intro {
  align-self: center;
  padding: 14px 0 14px 12px;
}
.wordmark,
.section-title small,
footer span:first-child {
  font-family: Consolas, monospace;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.wordmark {
  color: #526c58;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.wordmark:before {
  content: '';
  width: 22px;
  height: 3px;
  background: #dc855b;
}
.intro h1 {
  font-size: clamp(3.6rem, 6.2vw, 6.7rem);
  letter-spacing: -0.09em;
  line-height: 1.06;
  margin: 18px 0 14px;
  font-weight: 950;
}
.intro h1 b {
  color: var(--coral);
}
.pitch {
  font-size: clamp(1rem, 1.25vw, 1.25rem);
  color: #54645a;
  line-height: 1.65;
  margin: 0 0 20px;
}
.facts {
  gap: 8px;
}
.facts span {
  font-size: 0.78rem;
  padding: 5px 10px;
  border: 1px solid #cdd3c0;
  border-radius: 30px;
  background: #edf1e4;
  font-weight: 700;
}
form {
  max-width: 295px;
  margin-top: 25px;
}
label {
  display: block;
  font-weight: 700;
  font-size: 0.87rem;
  margin-bottom: 6px;
}
input:not([type='range']),
select {
  border: 1px solid #afbcaa;
  background: #fffef7;
  border-radius: 9px;
  padding: 10px 12px;
}
form input,
form button {
  width: 100%;
}
form button {
  margin-top: 10px;
  min-height: 45px;
}
.notice {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: #8c4327;
}
.notice:empty {
  display: none;
}
#showcase {
  position: relative;
  isolation: isolate;
  min-height: 440px;
  overflow: hidden;
  border: 1px solid #b7cbb6;
  border-radius: 30px;
  background: radial-gradient(ellipse at 45% 38%, #e9edce, #c8dbb8 67%, #a8c8a9);
  box-shadow: inset 0 0 0 7px #f8fcea33;
}
#showcase:before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(#5278613a 1px, transparent 1.1px);
  background-size: 17px 17px;
  opacity: 0.45;
  z-index: -1;
}
.scene-label,
.map-caption {
  position: absolute;
  z-index: 1;
  pointer-events: none;
}
.scene-label {
  top: 21px;
  left: 24px;
  border: 1px solid #d8e2c7;
  background: #fafbedde;
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
}
.scene-label i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5d9163;
  margin-right: 5px;
}
.map-caption {
  bottom: 22px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.small-house {
  font-size: 1.65rem;
  font-weight: 700;
}
.map-caption strong,
.map-caption small {
  display: block;
}
.map-caption small {
  color: #4e6451;
  font-size: 0.75rem;
  margin-top: 2px;
}
canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#showcase canvas,
#arena canvas {
  position: absolute;
  inset: 0;
}
.section-title,
.hud,
.gamefooter,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
footer {
  min-height: 48px;
  border-top: 1px solid #cfd6c6;
  color: #607364;
  font-size: 0.75rem;
}
footer span:first-child {
  letter-spacing: 0.12em;
}
#lobby {
  max-width: 1000px;
  margin: 32px auto;
}
.section-title {
  margin-bottom: 20px;
}
h2,
h3 {
  margin: 0;
}
.section-title h2 {
  font-size: 2.1rem;
}
.section-title small {
  color: #607864;
  font-size: 0.76rem;
}
.lobby-grid {
  display: grid;
  grid-template-columns: 0.88fr 1.12fr;
  gap: 20px;
}
article,
dialog {
  background: #fffdf3;
  border: 1px solid #c6d0bc;
  border-radius: 19px;
  padding: 24px;
}
article h3 {
  font-size: 1.15rem;
}
ul,
ol {
  padding: 0;
}
#roster {
  list-style: none;
  display: grid;
  gap: 10px;
}
#roster li {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 0;
  border-bottom: 1px dashed #d1d9c6;
}
#roster small {
  margin-left: auto;
  color: #526a56;
}
.portrait {
  width: 37px;
  height: 37px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #e6eacb;
  font-size: 1.3rem;
}
.btnrow {
  margin: 18px 0;
}
.quiet {
  border: 0;
  padding: 6px 0;
  background: transparent;
  font-size: 0.85rem;
}
#roomnote {
  color: #626e5a;
  font-size: 0.9rem;
  min-height: 1em;
}
#rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.rule {
  background: #f0f2e4;
  border-radius: 10px;
  padding: 10px;
}
.rule label {
  font-size: 0.82rem;
}
.rule select {
  width: 100%;
  padding: 7px;
}
.rule.flash {
  animation: flash 1.5s;
}
@keyframes flash {
  from {
    background: #f2be79;
  }
  to {
    background: #f0f2e4;
  }
}
#results {
  margin-top: 16px;
}
#ranking {
  padding-left: 25px;
  line-height: 1.8;
}
#play {
  margin: 14px 0;
}
.hud,
.gamefooter {
  background: #edf1e4;
  border-radius: 12px;
  padding: 8px 15px;
}
.hud strong {
  font:
    700 1.55rem Consolas,
    monospace;
}
.hud span,
.gamefooter {
  font-size: 0.88rem;
}
.gamefooter {
  flex-wrap: wrap;
}
.gamefooter kbd {
  background: #fffdf2;
  border: 1px solid #c3cdbb;
  border-radius: 5px;
  padding: 2px 4px;
}
#arena {
  position: relative;
  height: calc(100vh - 260px);
  min-height: 330px;
  background: #677e69;
  border-radius: 15px;
  overflow: hidden;
  margin: 6px 0;
}
.gamefooter b {
  color: var(--green);
}
dialog {
  max-width: 460px;
  color: inherit;
  box-shadow: 0 20px 100px #264c3840;
}
dialog::backdrop {
  background: #253c32a3;
}
dialog p,
dd {
  line-height: 1.65;
  color: #516254;
}
dt {
  font-weight: bold;
}
dd {
  margin: 4px 0 12px;
}
input[type='range'] {
  width: 100%;
  accent-color: #286844;
}
[hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  header,
  main,
  footer {
    width: 94vw;
  }
  .home {
    gap: 16px;
    grid-template-columns: 235px 1fr;
  }
  .intro {
    padding-left: 0;
  }
  .lobby-grid {
    gap: 10px;
  }
  article {
    padding: 15px;
  }
}
@media (max-height: 660px) {
  header {
    height: 55px;
  }
  .home {
    padding: 16px 0;
  }
  .intro h1 {
    font-size: 3.4rem;
  }
  .pitch {
    margin-bottom: 10px;
  }
  form {
    margin-top: 15px;
  }
  #showcase {
    min-height: 365px;
  }
}
