.nook-mastery-art {
  display: block;
  overflow: hidden;
  border: 1px solid #d9c495;
  border-radius: 12px;
  background: #eee7d2;
  aspect-ratio: 320 / 216;
}

.nook-mastery-art svg {
  display: block;
  width: 100%;
  height: auto;
}
.nook-mastery{margin-top:35px;padding-top:25px;border-top:1px solid #d3dac8;scroll-margin-top:18px}.nook-mastery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.nook-mastery-card{min-width:0;padding:17px;border:1px solid #d8ceb2;border-radius:17px;background:#f7f3e7;text-align:left;display:flex;flex-direction:column}.nook-mastery-card.is-earned{border:2px solid #b59a58;background:#fff8e4;box-shadow:inset 0 0 0 4px #f0e2b6;padding:16px}.nook-mastery-card .eyebrow{font-size:11px;letter-spacing:1.7px;line-height:1.6;min-height:28px;margin:0 0 10px}.nook-mastery-card h3{font:400 23px/1.15 Georgia,serif;margin:16px 0 9px}.nook-mastery-card p{font-size:13px;line-height:1.55;color:#607052;margin:0 0 13px}.nook-mastery-card .nook-mastery-rule{font-size:12px;margin-top:auto;color:#485d40}.nook-mastery-card progress{display:block;width:100%;height:9px;accent-color:#7a925c}.nook-mastery-count{font-size:12px;color:#5d704f;line-height:1.5;margin:7px 0 12px}.nook-mastery-card button{font-size:13px;padding:10px}.nook-card-back{display:flex;height:100%;aspect-ratio:320/216;align-items:center;justify-content:center;flex-direction:column;background:radial-gradient(ellipse at 50% 35%,#e5d7ae,transparent 60%),#d5ddc3;border:6px double #f7efd7;font:italic 46px/1 Georgia,serif;color:#7f8e67}.nook-card-back small{font:400 12px/1.5 system-ui,sans-serif;text-align:center;margin-top:10px;color:#5a7050}.nook-mastery-detail h2{font:400 32px/1.1 Georgia,serif}.nook-mastery-detail p{font-size:15px;line-height:1.6;color:#52664a}.nook-earned{margin-top:32px;padding-top:25px;border-top:1px solid #d1d7c5}.nook-earned h2{font:400 30px/1.2 Georgia,serif}.nook-earned .nook-mastery-card{max-width:370px;margin:18px auto}.nook-earned .nook-mastery-card>h3{font-size:29px}
@media(max-width:760px){.nook-mastery-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.nook-mastery-card{padding:13px}.nook-mastery-card.is-earned{padding:12px}.nook-mastery-card h3{font-size:21px}.nook-mastery-card .eyebrow{font-size:11px;letter-spacing:1px}}
@media(max-width:359px){.nook-mastery-grid{grid-template-columns:1fr}.nook-mastery-card{display:grid;grid-template-columns:100px minmax(0,1fr);column-gap:12px}.nook-mastery-card .eyebrow{grid-column:1/-1;min-height:0}.nook-mastery-art{grid-column:1;grid-row:2/4}.nook-mastery-card h3{grid-column:2;margin:0 0 10px}.nook-mastery-card p:not(.eyebrow,.nook-mastery-rule){grid-column:2}.nook-mastery-card .nook-mastery-rule,.nook-mastery-card progress,.nook-mastery-count,.nook-mastery-card button{grid-column:1/-1}.nook-card-back{font-size:30px}.nook-card-back small{font-size:9px;margin-top:3px}.nook-earned .nook-mastery-card{display:flex}}

:is(.nook-mastery-card, .nook-mastery-detail)[data-tier="1"] {
  --nook-edition-metal: #a06d48;
  --nook-edition-rim: #e4c4a8;
  --nook-edition-paper: #fff4e9;
}

:is(.nook-mastery-card, .nook-mastery-detail)[data-tier="2"] {
  --nook-edition-metal: #788a93;
  --nook-edition-rim: #d4dfe4;
  --nook-edition-paper: #f4f8f9;
}

:is(.nook-mastery-card, .nook-mastery-detail)[data-tier="3"] {
  --nook-edition-metal: #b59a58;
  --nook-edition-rim: #f0e2b6;
  --nook-edition-paper: #fff8e4;
}

:is(.nook-mastery-card, .nook-mastery-detail)[data-tier="5"] {
  --nook-edition-metal: #8d7096;
  --nook-edition-rim: #e5d6e8;
  --nook-edition-paper: #fcf4fc;
}

.nook-mastery-card.is-earned[data-tier] {
  border-color: var(--nook-edition-metal);
  background: var(--nook-edition-paper);
  box-shadow: inset 0 0 0 4px var(--nook-edition-rim);
}

:is(.nook-mastery-card.is-earned, .nook-mastery-detail)[data-tier] .nook-mastery-art {
  border-color: var(--nook-edition-metal, #d9c495);
}

#nook-note:has(.nook-mastery-detail) {
  width:min(390px,calc(100% - 24px));
  max-height:calc(100dvh - max(28px,env(safe-area-inset-top,0px) + env(safe-area-inset-bottom,0px)));
  padding:clamp(14px,4vw,20px);
  border-color:#7a8f73;
  background:#21433a;
  overflow:auto;
  overscroll-behavior:contain;
}
.nook-collectible {
  display:grid;
  gap:10px;
  min-width:0;
  padding:clamp(10px,3.5vw,15px);
  border:5px solid transparent;
  border-radius:17px;
  background:linear-gradient(var(--nook-edition-paper),var(--nook-edition-paper)) padding-box,
    linear-gradient(145deg,var(--nook-edition-metal),var(--nook-edition-rim) 25%,var(--nook-edition-metal) 48%,var(--nook-edition-rim) 76%,var(--nook-edition-metal)) border-box;
  box-shadow:0 4px 12px #102a253d;
  color:#304438;
}
.nook-collectible-top {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  color:#52634e;
  font:750 9px/1.3 system-ui,sans-serif;
  letter-spacing:.11em;
}
.nook-collectible-top>span:last-child {white-space:nowrap}
.nook-mastery-detail .nook-collectible h2 {margin:0;font:400 clamp(21px,6vw,28px)/1.1 Georgia,serif}
.nook-mastery-detail .nook-mastery-art {grid-column:auto;grid-row:auto;border-radius:8px}
.nook-mastery-detail .nook-collectible-meaning {margin:0;font:italic 14px/1.45 Georgia,serif;color:#354c3d}
.nook-collectible-edition {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  padding:6px 9px;
  border:1px solid var(--nook-edition-metal);
  border-radius:8px;
  background:var(--nook-edition-rim);
  color:#35483d;
  font:700 12px/1.2 system-ui,sans-serif;
}
.nook-collectible-edition>span {letter-spacing:.14em;white-space:nowrap}
.nook-mastery-detail .nook-collectible-requirement {margin:12px 2px 0;color:#ece4c9;font-size:12px;line-height:1.5}
#nook-note:has(.nook-mastery-detail)>#nook-close-note {width:100%;margin-top:12px;background:#e9d093;color:#253b30}

@media (min-width:540px) and (max-height:520px) and (orientation:landscape) {
  #nook-note[open]:has(.nook-mastery-detail) {
    display:grid;
    grid-template-columns:minmax(0,220px) minmax(0,1fr);
    grid-template-rows:auto 1fr;
    align-items:start;
    gap:10px 20px;
    width:min(620px,calc(100% - 24px));
  }
  #nook-note:has(.nook-mastery-detail) #nook-note-body,
  #nook-note .nook-mastery-detail {display:contents}
  #nook-note .nook-collectible {grid-column:1;grid-row:1/span 2}
  #nook-note .nook-collectible h2 {font-size:24px}
  #nook-note .nook-collectible-requirement {grid-column:2;grid-row:1;margin:0;font-size:14px}
  #nook-note:has(.nook-mastery-detail)>#nook-close-note {grid-column:2;grid-row:2;margin:0}
}
