/* D&D: a character sheet. Light paper on the grey table, black ink, blue for what matters.
   The line of this world is the double rule of a form: every box of the sheet is drawn with it. */
.page-dnd { --paper-sheet: #F1EFE8; --blue: #14336B; }
.page-dnd main { max-width: 1240px; margin: 0 auto; padding-top: clamp(20px, 4vh, 40px); display: grid; gap: 44px; }
.dd-head { display: flex; align-items: center; gap: 14px; }
.dd-head .mark { width: 46px; height: 46px; }
.dd-head h1 { font-size: clamp(34px, 4.4vw, 52px); font-weight: 800; letter-spacing: -0.02em; }
.dd-head p { align-self: flex-end; padding-bottom: 7px; font-size: 14px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; }

.sheet { background: var(--paper-sheet); border: 4px double var(--ink); padding: clamp(14px, 2vw, 26px); display: grid; gap: 20px; font-size: 15.5px; line-height: 1.45;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 12px 28px rgba(0, 0, 0, 0.16); }
.sheet dt, .sheet th, .box h2, .ability h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* the plate on top: a value on a line, its name under the line */
.plate { display: grid; grid-template-columns: 1.5fr 1fr 1fr 132px; gap: 14px 22px; align-items: end; }
.plate > div { display: grid; }
.plate dd { padding-bottom: 3px; border-bottom: 2px solid var(--ink); font-size: 18px; font-weight: 700; line-height: 1.25; min-height: 30px; }
.plate dt { padding-top: 4px; opacity: 0.75; }
.p-name { grid-column: 1; grid-row: 1 / span 2; }
.p-name dd { font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.p-level { grid-column: 4; grid-row: 1 / span 2; align-self: center; justify-items: center; align-content: center; width: 132px; height: 116px; border: 3px double var(--ink); border-radius: 50%; }
.p-level dd { border: 0; padding: 0; font-size: 46px; font-weight: 800; line-height: 1; min-height: 0; color: var(--blue); }
.p-level dt { padding-top: 2px; }
.p-align { grid-column: 1 / span 2; }
.p-align dd, .p-xp dd { font-size: 16.5px; font-weight: 600; }
.p-prof { justify-items: center; text-align: center; }
.p-prof dd { justify-self: stretch; color: var(--blue); font-size: 22px; font-weight: 800; }

.sheet-body { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(0, 2fr); gap: 20px; align-items: start; }
.abilities { display: grid; gap: 12px; }
.ability { display: grid; grid-template-columns: 92px minmax(0, 1fr); column-gap: 14px; row-gap: 6px; padding: 10px 12px 12px; border: 3px double var(--ink); border-radius: 10px; }
.ability h3 { grid-column: 1 / -1; padding-bottom: 5px; border-bottom: 1.5px solid var(--ink); }
.ab-nums { position: relative; align-self: start; display: grid; justify-items: center; padding-bottom: 14px; }
.score { display: grid; place-items: center; width: 78px; height: 66px; border: 2.5px solid var(--ink); border-radius: 14px 14px 26px 26px; font-size: 34px; font-weight: 800; line-height: 1; }
.mod { position: absolute; bottom: 0; display: grid; place-items: center; min-width: 46px; height: 30px; padding: 0 8px; border: 2.5px solid var(--ink); border-radius: 15px; background: var(--paper-sheet); font-size: 16px; font-weight: 800; color: var(--blue); }
.skills { display: grid; gap: 7px; align-content: start; padding-top: 2px; }
.skills li { display: grid; grid-template-columns: 14px minmax(0, 1fr); column-gap: 8px; align-items: baseline; }
.skills i { width: 11px; height: 11px; border: 2px solid var(--ink); transform: rotate(45deg) translateY(1px); }
.skills .on i { background: var(--blue); border-color: var(--blue); }
.skills b { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.skills span { grid-column: 2; font-size: 14.5px; }

.sheet-right { display: grid; gap: 14px; }
.small { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.small > div { display: grid; justify-items: center; text-align: center; gap: 3px; padding: 9px 8px 10px; border: 3px double var(--ink); border-radius: 10px 10px 22px 22px; }
.small > div { min-width: 0; }
.small dd { max-width: 100%; font-size: clamp(22px, 2.3vw, 30px); font-weight: 800; line-height: 1.1; color: var(--blue); overflow-wrap: anywhere; }
.small p { font-size: 13.5px; line-height: 1.3; }
.box { display: grid; gap: 10px; padding: 12px 14px 14px; border: 3px double var(--ink); border-radius: 10px; }
.box h2 { text-align: center; padding-bottom: 6px; border-bottom: 1.5px solid var(--ink); }
.doing table { width: 100%; border-collapse: collapse; }
.doing th, .doing td { padding: 7px 10px 7px 0; text-align: left; vertical-align: top; border-bottom: 1px solid rgba(22, 22, 22, 0.3); }
.doing thead th { opacity: 0.75; padding-bottom: 4px; }
.doing tbody th { font-size: 15.5px; font-weight: 800; letter-spacing: 0; text-transform: none; white-space: nowrap; }
.doing td.num { font-weight: 700; color: var(--blue); white-space: nowrap; }
.doing tbody tr:last-child th, .doing tbody tr:last-child td { border-bottom: 0; }
.features ul { columns: 2; column-gap: 26px; column-rule: 1px solid rgba(22, 22, 22, 0.3); }
.features li { break-inside: avoid; padding-bottom: 9px; }
.box ul { display: block; }
.box:not(.features) ul li + li { margin-top: 7px; }
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.go { white-space: nowrap; font-weight: 700; color: var(--blue); }
.go::before { content: '\2192\00a0'; }
.sheet a:not(.go) { font-weight: 700; color: var(--blue); }

/* the two characters he plays */
.party { display: grid; gap: 10px; }
.party > h2 { font-size: clamp(24px, 2.6vw, 32px); font-weight: 800; letter-spacing: -0.01em; }
.heroes { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hero { display: grid; gap: 14px; align-content: start; background: var(--paper-sheet); border: 4px double var(--ink); padding: 18px 20px 20px; font-size: 15.5px; }
.hero header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.hero h3 { font-size: 26px; font-weight: 800; letter-spacing: -0.01em; }
.hero header p { line-height: 1.35; }
.lvl { display: grid; justify-items: center; padding: 8px 12px 9px; border: 3px double var(--ink); border-radius: 10px 10px 24px 24px; }
.lvl b { font-size: 30px; font-weight: 800; line-height: 1; color: var(--blue); }
.lvl span { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.six { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.six li { display: grid; justify-items: center; gap: 1px; padding: 6px 2px 5px; border: 2px solid var(--ink); border-radius: 8px; }
.six span { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; }
.six b { font-size: 22px; font-weight: 800; line-height: 1.1; }
.six i { font-style: normal; font-size: 14px; font-weight: 800; color: var(--blue); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 6px 22px; }
.hero-stats div { display: flex; align-items: baseline; gap: 8px; }
.hero-stats dt { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
.hero-stats dd { font-size: 18px; font-weight: 800; color: var(--blue); }
.knows { display: grid; gap: 6px; }
.knows li { padding-left: 16px; background: linear-gradient(var(--blue), var(--blue)) 0 0.62em / 8px 2px no-repeat; }

.dice { justify-items: start; }
.dice h2 { justify-self: stretch; }
.roller { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 22px; }
#roll { display: inline-flex; align-items: center; gap: 12px; padding: 8px 18px 8px 10px; background: #fff; color: var(--ink); border: 3px double var(--ink); border-radius: 10px; font: inherit; font-weight: 800; cursor: pointer; }
#roll:hover, #roll:focus-visible { background: var(--blue); color: #fff; }
#roll:hover .die polygon, #roll:focus-visible .die polygon { fill: #fff; }
#roll .die { width: 40px; height: 40px; }
.rolled { display: flex; align-items: center; gap: 14px; min-height: 52px; max-width: 60ch; }
.rolled b { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border: 3px double var(--ink); border-radius: 50%; background: #fff; font-size: 22px; font-weight: 800; color: var(--blue); }
.rolled span { font-size: 18px; font-weight: 600; line-height: 1.35; }
/* a natural 20: the number fills with the blue of the sheet, jumps, and two rings run out from it */
.rolled b { position: relative; }
.rolled.crit b { background: var(--blue); border-color: var(--blue); color: #fff; animation: crit-pop 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
.rolled.crit b::before, .rolled.crit b::after { content: ''; position: absolute; inset: -4px; border: 3px solid var(--blue); border-radius: 50%; animation: crit-ring 0.9s ease-out both; }
.rolled.crit b::after { animation-delay: 0.16s; }
.rolled.crit span { font-weight: 800; color: var(--blue); }
@keyframes crit-pop { from { transform: scale(0.5) rotate(-20deg); } to { transform: none; } }
@keyframes crit-ring { from { transform: scale(0.9); opacity: 0.9; } to { transform: scale(2.4); opacity: 0; } }
.facts { margin: 0; padding-left: 28px; columns: 2; column-gap: 40px; }
.work { justify-self: start; }
.has-js .facts, html:not(.has-js) .roller { display: none; }
.work a { font-weight: 700; }

@media (max-width: 1000px) {
  .sheet-body { grid-template-columns: minmax(0, 1fr); }
  .abilities { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .heroes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .plate { grid-template-columns: 1fr 1fr; }
  .p-name, .p-align { grid-column: 1 / -1; grid-row: auto; }
  .p-level, .p-prof, .p-xp { grid-column: auto; grid-row: auto; }
  .p-level { grid-column: 1 / -1; justify-self: center; }
  .abilities, .pair { grid-template-columns: minmax(0, 1fr); }
  .small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .features ul, .facts { columns: 1; }
  .doing thead { display: none; }
  .doing tr { display: grid; grid-template-columns: 1fr auto; padding: 6px 0; border-bottom: 1px solid rgba(22, 22, 22, 0.3); }
  .doing th, .doing td { border: 0; padding: 0; }
  .doing td:last-child { grid-column: 1 / -1; }
  .six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
