@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/Nunito-Variable.ttf") format("truetype");
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Nunito", Arial, sans-serif;
  font-synthesis: none;
  color: #171717;
  background: #f1eee7;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 20% 10%, rgb(255 255 255 / 75%), transparent 28rem),
    #f1eee7;
}

button,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.screen {
  width: min(100%, 420px);
  min-height: min(720px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.4vh, 22px);
  padding: clamp(22px, 5vw, 38px);
  text-align: center;
  background: #fff;
  border: 2px solid #171717;
  border-radius: 28px;
  box-shadow: 8px 8px 0 #171717;
}

.eyebrow {
  margin: 0;
  font-size: clamp(14px, 3.8vw, 17px);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.game-title,
.screen-title,
.role-name {
  margin: 0;
  font-weight: 900;
  line-height: 1.04;
}

.game-title {
  font-size: clamp(54px, 16vw, 78px);
}

.screen-title {
  font-size: clamp(36px, 10vw, 50px);
}

.instruction {
  max-width: 19rem;
  margin: 0;
  font-size: clamp(18px, 4.8vw, 22px);
  font-weight: 650;
  line-height: 1.32;
}

.home-mark {
  width: clamp(132px, 37vw, 174px);
  aspect-ratio: 1;
}

.home-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-picker {
  width: 100%;
  display: grid;
  gap: 8px;
}

.player-picker p {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

.player-picker-controls {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  align-items: center;
  gap: 10px;
}

.count-button {
  width: 58px;
  height: 52px;
  padding: 0;
  color: #171717;
  background: #fff;
  border: 2px solid #171717;
  border-radius: 14px;
  font-size: 34px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.count-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.count-button:focus-visible {
  outline: 4px solid #6c6c6c;
  outline-offset: 3px;
}

.player-count {
  font-size: 36px;
  font-weight: 900;
  line-height: 1;
}

.game-help {
  width: 100%;
  text-align: left;
  border-top: 2px solid #171717;
  padding-top: 12px;
}

.game-help summary {
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.game-help-content {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.game-help-content p {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.32;
}

.player-number,
.done-mark {
  width: clamp(150px, 43vw, 190px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 5px solid #171717;
  border-radius: 50%;
  font-size: clamp(86px, 25vw, 116px);
  font-weight: 900;
  line-height: 1;
}

.done-mark {
  font-size: clamp(70px, 20vw, 94px);
}

.role-card {
  width: 100%;
  min-height: 0;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 18px);
}

.role-image {
  width: min(100%, 300px);
  max-height: min(43dvh, 330px);
  aspect-ratio: 1;
  object-fit: contain;
}

.role-name {
  font-size: clamp(38px, 11vw, 54px);
  overflow-wrap: anywhere;
}

.primary-button {
  width: 100%;
  min-height: 68px;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 15px 20px;
  border: 2px solid #171717;
  border-radius: 18px;
  font-size: clamp(19px, 5vw, 23px);
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  color: #fff;
  background: #171717;
}

.primary-button:focus-visible {
  outline: 4px solid #6c6c6c;
  outline-offset: 4px;
}

.primary-button:active {
  transform: translate(2px, 2px);
}

.primary-button svg {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  fill: currentColor;
}

.screen:not(.screen-home) > .primary-button {
  margin-top: auto;
}

@media (max-height: 720px) {
  .app {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .screen {
    min-height: calc(100dvh - 20px);
    gap: 10px;
    padding: 18px 24px;
  }

  .home-mark {
    width: 88px;
  }

  .player-number,
  .done-mark {
    width: 126px;
  }

  .role-image {
    max-height: 40dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .primary-button:active {
    transform: none;
  }
}
