:root {
  color-scheme: light;
  --bg: #eee7dd;
  --paper: #fffdf8;
  --paper-2: #f7f1e8;
  --ink: #29231f;
  --muted: #6d6258;
  --line: rgba(104, 87, 68, .20);
  --line-strong: rgba(104, 87, 68, .34);
  --accent: #8a738d;
  --rose: #c28b98;
  --teal: #648f89;
  --gold: #cf9b47;
  --shadow: 0 14px 24px rgba(65, 52, 39, .07), inset 0 1px 0 rgba(255, 255, 255, .75);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #fbf8f2;
}

body {
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, #eee7dd 0%, #f8f4ed 46%, #fbf8f2 100%);
  color: var(--ink);
  font: 15px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
summary {
  font: inherit;
}

.paper-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px clamp(14px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 246, .96);
}

.paper-strip strong {
  display: block;
  color: var(--ink);
  font-size: clamp(16px, 2vw, 23px);
  line-height: 1.08;
}

.paper-strip p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.paper-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(129, 96, 68, .34);
  border-radius: 6px;
  padding: 0 14px;
  background: #dfb77d;
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  white-space: nowrap;
}

.page {
  width: min(1120px, calc(100vw - 30px));
  margin: 0 auto;
  padding: 20px 0 54px;
}

.champion-picker {
  position: relative;
  margin-bottom: 26px;
  padding: 8px 0 12px;
}

.champion-picker::before {
  position: absolute;
  inset: -18px -22px -10px;
  z-index: -1;
  border-top: 1px solid rgba(104, 87, 68, .1);
  border-bottom: 1px solid rgba(104, 87, 68, .08);
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 253, 248, .52) 20%, rgba(255, 253, 248, .42) 80%, transparent 100%),
    linear-gradient(180deg, rgba(242, 229, 211, .35), rgba(255, 253, 248, .08));
  content: "";
}

.portrait-row {
  display: grid;
  grid-template-columns: repeat(9, minmax(78px, 1fr));
  gap: 14px;
  scrollbar-width: none;
}

.portrait-row::-webkit-scrollbar {
  display: none;
}

.portrait-button {
  position: relative;
  isolation: isolate;
  --rx: 0deg;
  --ry: 0deg;
  --mx: 50%;
  --my: 42%;
  aspect-ratio: 9 / 16;
  border: 1px solid rgba(104, 87, 68, .24);
  border-radius: 9px;
  padding: 0;
  overflow: hidden;
  background: #211b1a;
  box-shadow: 0 16px 30px rgba(62, 46, 34, .16), 0 1px 0 rgba(255, 250, 244, .82);
  cursor: pointer;
  transform: perspective(760px) rotateX(var(--rx)) rotateY(var(--ry)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform .28s cubic-bezier(.18, .72, .2, 1), border-color .24s ease, box-shadow .24s ease, filter .24s ease;
  will-change: transform;
}

.portrait-button::before,
.portrait-button::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.portrait-button::before {
  z-index: 2;
  background:
    radial-gradient(circle at var(--mx) var(--my), rgba(255, 242, 197, .5), transparent 22%),
    linear-gradient(112deg, transparent 0 34%, rgba(255, 245, 210, .78) 45%, rgba(226, 156, 190, .48) 50%, transparent 62% 100%);
  opacity: 0;
  mix-blend-mode: screen;
  transform: translateX(-126%);
}

.portrait-button::after {
  z-index: 3;
  border: 1px solid rgba(255, 218, 132, .12);
  background: linear-gradient(180deg, rgba(255, 251, 235, .13), transparent 32%, rgba(34, 21, 25, .3));
  box-shadow: inset 0 0 0 1px rgba(255, 246, 214, .14), inset 0 -28px 38px rgba(61, 33, 48, .2);
  opacity: .72;
}

.portrait-button img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: saturate(.98) contrast(1.01);
  transform: translateZ(12px) scale(1.01);
  transition: transform .34s cubic-bezier(.18, .72, .2, 1), filter .3s ease;
}

.portrait-button:hover,
.portrait-button:focus-visible {
  border-color: rgba(218, 172, 77, .86);
  box-shadow: 0 22px 42px rgba(62, 46, 34, .22), 0 0 0 1px rgba(246, 218, 142, .34), 0 0 34px rgba(194, 139, 152, .28);
  filter: saturate(1.06);
  transform: perspective(760px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-7px) scale(1.045);
}

.portrait-button:hover::before,
.portrait-button:focus-visible::before,
.portrait-button[aria-pressed="true"]::before {
  opacity: 1;
  transform: translateX(120%);
  transition: transform .68s cubic-bezier(.2, .8, .2, 1), opacity .18s ease;
}

.portrait-button:hover img,
.portrait-button:focus-visible img {
  filter: saturate(1.12) contrast(1.04);
  transform: translateZ(18px) scale(1.045);
}

.portrait-button:active {
  transform: perspective(760px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-2px) scale(1.018);
}

.portrait-button[aria-pressed="true"] {
  border-color: rgba(226, 174, 75, .95);
  outline: 1px solid rgba(255, 249, 221, .72);
  box-shadow: 0 22px 42px rgba(64, 46, 34, .23), 0 0 0 3px rgba(194, 139, 152, .22), 0 0 34px rgba(207, 155, 71, .34);
}

.portrait-button[aria-pressed="true"]::after {
  border-color: rgba(255, 218, 132, .54);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 224, .42), inset 0 -25px 34px rgba(72, 39, 54, .2), 0 0 26px rgba(236, 159, 191, .28);
  opacity: 1;
}

.portrait-button.is-flashing {
  animation: championSelect .82s cubic-bezier(.16, .9, .18, 1);
}

.portrait-button.is-flashing::after {
  animation: championRing .82s cubic-bezier(.16, .9, .18, 1);
}

.selected-champion,
.situations,
.notes-panel,
.notice {
  width: min(760px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.selected-champion {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .82);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: 50% 18%;
}

.selected-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 16px 18px;
}

h1,
h2,
h3,
p {
  max-width: 100%;
  margin-top: 0;
  overflow-wrap: anywhere;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: 0;
}

#champion-focus {
  margin: 0;
  color: #342d28;
  font-size: clamp(18px, 2vw, 22px);
  font-weight: 760;
  line-height: 1.24;
}

#champion-note {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 580;
}

.situations {
  margin-top: 22px;
  transform-origin: 50% 0;
}

.plain-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.plain-head h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.plain-head p {
  margin: 0;
  color: var(--muted);
  font-weight: 680;
}

.situation-list {
  display: grid;
  gap: 12px;
}

.situation-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.situation-heading {
  max-width: none;
  margin: 0;
  color: #2f2925;
  font-size: clamp(16px, 1.6vw, 19px);
  font-weight: 760;
  line-height: 1.32;
}

.situation-response {
  max-width: none;
  margin: 0;
  color: #4b4039;
  font-size: 15px;
  font-weight: 580;
  line-height: 1.52;
}

.selected-champion.is-leaving,
.situations.is-leaving {
  opacity: 0;
  filter: blur(4px);
  transform: translateY(10px) scale(.988);
  transition: opacity .16s ease, filter .16s ease, transform .16s ease;
}

.selected-champion.is-entering,
.situations.is-entering {
  animation: reviewEnter .54s cubic-bezier(.16, .92, .2, 1) both;
}

.situations.is-entering {
  animation-delay: .04s;
}

.notes-panel {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 248, .72);
}

.notes-panel summary {
  cursor: pointer;
  padding: 14px 16px;
  color: #3b332e;
  font-weight: 760;
}

.notes {
  display: grid;
  gap: 10px;
  padding: 0 16px 16px;
}

.note {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 14px;
  border-top: 1px solid rgba(104, 87, 68, .14);
  padding-top: 12px;
}

.note time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.note h3 {
  margin: 0 0 4px;
  font-size: 17px;
}

.note p {
  margin: 0;
  color: #4b403a;
}

.notice {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

@keyframes championSelect {
  0% {
    transform: perspective(760px) rotateX(var(--rx)) rotateY(var(--ry)) translateY(-3px) scale(1.02);
  }
  44% {
    transform: perspective(760px) rotateX(0deg) rotateY(0deg) translateY(-9px) scale(1.072);
  }
  100% {
    transform: perspective(760px) rotateX(0deg) rotateY(0deg) translateY(0) scale(1);
  }
}

@keyframes championRing {
  0% {
    box-shadow: inset 0 0 0 1px rgba(255, 250, 224, .42), 0 0 0 0 rgba(236, 159, 191, .46), 0 0 0 0 rgba(219, 165, 76, .28);
  }
  46% {
    box-shadow: inset 0 0 0 1px rgba(255, 250, 224, .5), 0 0 0 9px rgba(194, 139, 152, .2), 0 0 38px 7px rgba(207, 155, 71, .38);
  }
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 250, 224, .42), 0 0 0 17px rgba(194, 139, 152, 0), 0 0 24px 0 rgba(207, 155, 71, 0);
  }
}

@keyframes reviewEnter {
  0% {
    opacity: 0;
    filter: blur(5px);
    transform: translateY(18px) scale(.985);
  }
  56% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-3px) scale(1.006);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 900px) {
  .portrait-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .portrait-button {
    flex: 0 0 96px;
  }

  .selected-champion {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .paper-strip {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .paper-button {
    width: fit-content;
  }

  .page {
    width: min(100% - 22px, 1180px);
    padding-top: 16px;
  }

  .champion-picker::before {
    inset: -14px 0 -8px;
  }

  .portrait-button {
    flex-basis: 84px;
  }

  .selected-copy {
    padding: 18px;
  }

  .plain-head {
    display: block;
  }

  .plain-head p {
    margin-top: 4px;
  }

  .note {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portrait-button,
  .portrait-button img,
  .portrait-button::before {
    transition: none;
  }

  .portrait-button:hover,
  .portrait-button:focus-visible,
  .portrait-button.is-flashing {
    animation: none;
    transform: none;
  }

  .portrait-button.is-flashing::after {
    animation: none;
  }

  .selected-champion.is-leaving,
  .situations.is-leaving,
  .selected-champion.is-entering,
  .situations.is-entering {
    animation: none;
    filter: none;
    opacity: 1;
    transform: none;
    transition: none;
  }
}
