/* Match the page colour so no white shows when iOS bounces past the edges. */
body.werewolf-page {
  background-color: #0b0e1f;
}

/*
 * The section is its own full-screen scroll area. Its background stays still while the content
 * scrolls inside it, which works on iOS where background-attachment: fixed and fixed layers do not.
 */
.werewolf-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 3rem 0;
  text-align: center;
  background-color: #0b0e1f;
  background-image: url("../img/werewolf/background.jpg");
  background-size: cover;
  background-position: center;
}

/* Leave room for the site sidebar on desktop. */
@media (min-width: 1200px) {
  .werewolf-menu {
    left: 300px;
  }
}

.werewolf-nav {
  display: flex;
  justify-content: flex-start;
  max-width: 640px;
  margin: 0 auto 1.5rem auto;
}

.werewolf-nav-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  font-weight: 600;
  color: #e4e9f5;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid #9fb3d9;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #000;
  transition: background 0.2s ease;
}

.werewolf-nav-button:hover,
.werewolf-nav-button:focus {
  color: #fff;
  background: #2b2f5c;
}

.werewolf-title {
  color: #e4e9f5;
  font-size: 2.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 2px 2px 0 #000;
  margin-bottom: 0.5rem;
}

.werewolf-subtitle {
  max-width: 640px;
  margin: 0 auto 2rem auto;
  color: #c9d1e6;
  text-shadow: 1px 1px 0 #000;
}

.werewolf-group {
  max-width: 640px;
  margin: 0 auto 1.5rem auto;
  padding: 1rem;
  color: #e4e9f5;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 12px;
}

.werewolf-group h5 {
  color: #f2d98a;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.werewolf-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.werewolf-button {
  flex: 1 1 160px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.9rem 1rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #e4e9f5;
  text-decoration: none;
  background: #2b2f5c;
  border: 2px solid #9fb3d9;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #000;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.werewolf-button:hover,
.werewolf-button:focus {
  color: #fff;
  background: #3b4180;
}

.werewolf-button:active {
  transform: translateY(2px);
}

.werewolf-button-primary {
  background: #8c1c24;
  border-color: #f2d98a;
}

.werewolf-button-primary:hover,
.werewolf-button-primary:focus {
  background: #a82530;
}

/* Setup: role cards are checkbox labels, dimmed until selected. */

.werewolf-roles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.werewolf-role input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.werewolf-role label {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  border: 2px solid #3a4163;
  border-radius: 8px;
  box-shadow: 2px 2px 0 #000;
  opacity: 0.35;
  filter: grayscale(0.8);
  transition: opacity 0.2s ease, filter 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.werewolf-role label:active {
  transform: translateY(2px);
}

.werewolf-role input:checked + label {
  opacity: 1;
  filter: none;
  border-color: #f2d98a;
}

.werewolf-role input:checked + label::after {
  content: "\F26E";
  font-family: "bootstrap-icons";
  position: absolute;
  top: -8px;
  right: -8px;
  width: 26px;
  height: 26px;
  line-height: 26px;
  font-size: 1.1rem;
  color: #0b0e1f;
  background: #f2d98a;
  border-radius: 50%;
  box-shadow: 1px 1px 0 #000;
}

.werewolf-role input:focus-visible + label {
  outline: 3px solid #9fb3d9;
  outline-offset: 2px;
}

.werewolf-count {
  margin: 0.75rem 0 0 0;
  color: #c9d1e6;
}

/* Setup: rules as collapsible sections. */

.werewolf-rules {
  text-align: left;
}

.werewolf-rule + .werewolf-rule {
  border-top: 1px solid rgba(159, 179, 217, 0.25);
}

.werewolf-rule summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.werewolf-rule summary::-webkit-details-marker {
  display: none;
}

.werewolf-rule summary::after {
  content: "\F282";
  font-family: "bootstrap-icons";
  margin-left: auto;
  color: #9fb3d9;
  transition: transform 0.2s ease;
}

.werewolf-rule[open] summary::after {
  transform: rotate(180deg);
}

.werewolf-rule summary img {
  width: 40px;
  height: 40px;
  border-radius: 6px;
}

.werewolf-rule summary small {
  font-weight: 400;
  opacity: 0.7;
}

.werewolf-rule-body {
  padding: 0 0 0.75rem 0;
  color: #c9d1e6;
}

.werewolf-rule-body p:last-child {
  margin-bottom: 0;
}

/* Play */

.werewolf-role-img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
  margin: 0 auto 1rem auto;
  border: 2px solid #f2d98a;
  border-radius: 12px;
  box-shadow: 2px 2px 0 #000, 0 0 40px rgba(242, 217, 138, 0.25);
}

.werewolf-controls .werewolf-button {
  flex: 0 1 auto;
  min-width: 72px;
  font-size: 2rem;
  padding: 0.5rem 1rem;
}
