:root {
  color-scheme: dark;
  font-family: Georgia, "Times New Roman", serif;
  color: #fff8e7;
  background: #071523;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
}

button {
  font: inherit;
}

.page-background,
.page-background img,
.winter-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.page-background {
  z-index: -3;
}

.page-background img {
  object-fit: cover;
  object-position: center top;
}

.winter-overlay {
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 16%, rgb(128 180 214 / 8%), transparent 34%),
    linear-gradient(180deg, rgb(3 13 26 / 38%) 0%, rgb(3 14 28 / 62%) 45%, rgb(8 20 35 / 88%) 100%);
}

.selection-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: 14px 13px 28px;
}

.season-heading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(100%, 560px);
  color: #efd48a;
  text-align: center;
  text-shadow: 0 2px 8px #020b15;
}

.season-heading::before,
.season-heading::after {
  width: clamp(24px, 12vw, 86px);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, transparent, #d8b85d, transparent);
}

.season-heading p {
  margin: 0;
  font-size: clamp(0.76rem, 3.2vw, 1rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

.season-heading__ornament {
  color: #fff2b6;
  font-size: 0.72rem;
}

.selection-intro {
  width: min(100%, 720px);
  margin: 15px auto 18px;
  text-align: center;
  text-shadow: 0 3px 12px rgb(0 5 14 / 82%);
}

.selection-intro__eyebrow {
  margin: 0 0 2px;
  color: #dfc47c;
  font-size: clamp(0.7rem, 3vw, 0.9rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.selection-intro h1 {
  margin: 0;
  color: #fff7df;
  font-size: clamp(2.1rem, 11vw, 4.75rem);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
}

.selection-intro__subtitle {
  max-width: 620px;
  margin: 9px auto 0;
  color: #eaf2f5;
  font-size: clamp(0.9rem, 3.9vw, 1.12rem);
  line-height: 1.4;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 11px;
  width: min(100%, 440px);
}

.member-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  padding: 5px 5px 8px;
  border: 1px solid rgb(224 190 91 / 80%);
  border-radius: 16px;
  color: #421d0c;
  background:
    linear-gradient(145deg, rgb(255 238 171 / 20%), transparent 27%),
    linear-gradient(160deg, rgb(16 42 59 / 94%), rgb(5 18 33 / 96%));
  box-shadow: 0 10px 24px rgb(0 7 18 / 44%);
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
  -webkit-tap-highlight-color: transparent;
}

.member-card:hover {
  border-color: #ffe7a1;
  box-shadow:
    0 13px 30px rgb(0 7 18 / 54%),
    0 0 18px rgb(229 195 92 / 26%);
  transform: translateY(-3px);
}

.member-card:active {
  transform: translateY(1px) scale(0.99);
}

.member-card:focus-visible {
  outline: 3px solid #fff0a8;
  outline-offset: 4px;
}

.member-card[aria-pressed="true"] {
  border-color: #fff0a8;
  box-shadow:
    0 13px 32px rgb(0 7 18 / 58%),
    0 0 25px rgb(243 204 89 / 46%);
  transform: translateY(-3px);
}

.portrait-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 2px solid #d7b457;
  border-radius: 12px 12px 9px 9px;
  background: #0b2130;
  box-shadow: inset 0 0 18px rgb(0 0 0 / 46%);
}

.portrait-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: filter 170ms ease, transform 220ms ease;
}

.member-card:hover .portrait-frame img,
.member-card[aria-pressed="true"] .portrait-frame img {
  filter: saturate(1.06) brightness(1.04);
  transform: scale(1.025);
}

.name-scroll {
  position: relative;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 88%;
  min-height: 35px;
  margin: -9px auto 0;
  padding: 5px 15px 6px;
  border: 1px solid #8c581f;
  color: #451f0d;
  background:
    linear-gradient(90deg, #c99b52, #f4dda1 13%, #ead08d 50%, #f5dfa5 87%, #c8964d);
  box-shadow: 0 4px 8px rgb(0 0 0 / 36%), inset 0 1px rgb(255 248 202 / 75%);
  font-size: clamp(0.94rem, 4.6vw, 1.2rem);
  font-style: italic;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px rgb(255 244 197 / 72%);
  clip-path: polygon(5% 10%, 95% 10%, 100% 50%, 95% 90%, 5% 90%, 0 50%);
}

.selection-status {
  min-height: 38px;
  margin: 20px auto 0;
  padding: 9px 15px;
  border: 1px solid rgb(229 200 112 / 48%);
  border-radius: 999px;
  color: #fff3c8;
  background: rgb(3 17 31 / 78%);
  box-shadow: 0 5px 18px rgb(0 6 16 / 36%);
  font-size: 0.88rem;
  line-height: 1.3;
  text-align: center;
  backdrop-filter: blur(5px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 700px) {
  .selection-page {
    padding: 18px 24px 28px;
  }

  .selection-intro {
    margin: 18px auto 22px;
  }

  .members-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 15px;
    width: min(100%, 920px);
  }

  .name-scroll {
    min-height: 38px;
    font-size: clamp(1rem, 2.2vw, 1.22rem);
  }
}

@media (min-width: 1100px) and (orientation: landscape) {
  .selection-page {
    justify-content: flex-start;
    padding: 20px 34px 22px;
  }

  .selection-intro {
    margin: 16px auto 20px;
  }

  .members-grid {
    grid-template-columns: repeat(4, minmax(190px, 230px));
    gap: clamp(16px, 2.1vh, 23px) clamp(18px, 2vw, 30px);
    width: auto;
  }

  .member-card {
    padding: 6px 6px 9px;
  }

  .selection-status {
    margin-top: clamp(12px, 2vh, 20px);
  }
}

@media (min-width: 1100px) and (orientation: landscape) and (max-height: 920px) {
  .selection-page {
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .selection-intro {
    margin: 8px auto 12px;
  }

  .selection-intro h1 {
    font-size: clamp(2.6rem, 6vh, 4rem);
  }

  .selection-intro__subtitle {
    margin-top: 5px;
  }

  .members-grid {
    grid-template-columns: repeat(4, minmax(170px, min(22vh, 220px)));
    gap: 12px 24px;
  }

  .name-scroll {
    min-height: 32px;
  }

  .selection-status {
    min-height: 34px;
    margin-top: 10px;
    padding-block: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .member-card,
  .portrait-frame img {
    transition: none;
  }
}
