@import url(
  "https://fonts.googleapis.com/css2?family=Cinzel:wght@500;600;700&family=Libre+Baskerville:wght@400;700&display=swap"
);

:root {
  --background: #05060a;
  --background-deep: #020307;

  --cream: #f3e2bd;
  --cream-muted: rgba(243, 226, 189, 0.68);

  --ink: #21150d;

  --paper: #f3e3c8;
  --paper-light: #fff8eb;
  --paper-dark: #d7b880;

  --gold: #d99d3e;
  --gold-light: #f6d486;
  --gold-dark: #704117;

  --brown: #422719;
  --brown-dark: #1c100a;

  --red: #842a23;
  --red-light: #aa4338;

  --green: #36674f;
  --emerald: #2e8066;

  --shadow: rgba(15, 8, 4, 0.42);

  --content-width: 1440px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;

  margin: 0;

  overflow-x: hidden;

  color: var(--cream);

  background:
    radial-gradient(
      circle at 50% 0,
      rgba(100, 42, 131, 0.2),
      transparent 38rem
    ),
    linear-gradient(
      180deg,
      #090a10,
      var(--background) 46%,
      var(--background-deep)
    );

  font-family:
    "Libre Baskerville",
    Georgia,
    serif;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
}

button,
select,
summary {
  cursor: pointer;
}

button,
a {
  -webkit-tap-highlight-color:
    transparent;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

/* =========================================================
   BACKGROUND
========================================================= */

.page-background {
  position: fixed;
  z-index: -20;

  inset: 0;

  overflow: hidden;
  pointer-events: none;
}

.page-background__glow {
  position: absolute;

  width: 65vw;
  height: 65vw;

  border-radius: 50%;

  opacity: 0.16;

  filter:
    blur(90px);

  animation:
    atmosphere-drift
    24s
    ease-in-out
    infinite
    alternate;
}

.page-background__glow--gold {
  top: -34vw;
  left: -18vw;

  background: #9b5c1d;
}

.page-background__glow--emerald {
  right: -24vw;
  bottom: -38vw;

  background: #29664f;

  animation-delay: -10s;
}

.page-background__texture {
  position: absolute;

  inset: 0;

  opacity: 0.08;

  background-image:
    radial-gradient(
      circle,
      rgba(255, 210, 110, 0.75) 0 1px,
      transparent 1.5px
    );

  background-size:
    42px
    42px;
}

/* =========================================================
   HEADER
========================================================= */

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;

  display: grid;

  grid-template-columns:
    minmax(230px, 1fr)
    auto
    minmax(230px, 1fr);

  align-items: center;

  gap: 24px;

  min-height: 78px;

  padding:
    10px
    clamp(
      18px,
      3vw,
      48px
    );

  border-bottom:
    1px solid
    rgba(220, 159, 59, 0.22);

  background:
    linear-gradient(
      180deg,
      rgba(7, 8, 12, 0.97),
      rgba(7, 8, 12, 0.87)
    );

  box-shadow:
    0 8px 28px
    rgba(0, 0, 0, 0.44);

  backdrop-filter:
    blur(14px);
}

.site-brand {
  display: inline-flex;

  align-items: center;

  gap: 12px;

  min-width: 0;

  text-decoration: none;
}

.site-brand__logo {
  width: 54px;
  height: 54px;

  flex: 0 0 auto;

  object-fit: contain;

  filter:
    drop-shadow(
      0 0 11px
      rgba(218, 153, 55, 0.4)
    );

  transition:
    transform 0.2s ease,
    filter 0.2s ease;
}

.site-brand:hover .site-brand__logo,
.site-brand:focus-visible .site-brand__logo {
  transform:
    rotate(-3deg)
    scale(1.06);

  filter:
    drop-shadow(
      0 0 15px
      rgba(247, 195, 98, 0.52)
    );
}

.site-brand__copy {
  display: flex;
  flex-direction: column;

  min-width: 0;

  line-height: 1.12;
}

.site-brand__copy strong {
  color: var(--gold-light);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 1.15rem;

  white-space: nowrap;
}

.site-brand__copy small {
  margin-top: 4px;

  color:
    rgba(244, 226, 187, 0.62);

  font-size: 0.65rem;

  white-space: nowrap;
}

/* =========================================================
   SPLIT NAVIGATION
========================================================= */

.main-nav--split {
  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  gap: 3px;
}

.main-nav__row {
  display: flex;

  align-items: center;
  justify-content: center;

  gap:
    clamp(
      12px,
      1.5vw,
      24px
    );
}

.main-nav__row a {
  position: relative;

  padding:
    5px
    1px;

  color: #e5c680;

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.68rem;
  font-weight: 600;

  text-decoration: none;
  white-space: nowrap;
}

.main-nav__row a::after {
  position: absolute;

  right: 50%;
  bottom: 0;
  left: 50%;

  height: 1px;

  content: "";

  background: var(--gold);

  box-shadow:
    0 0 8px
    rgba(225, 159, 57, 0.76);

  transition:
    right 0.2s ease,
    left 0.2s ease;
}

.main-nav__row a:hover::after,
.main-nav__row a:focus-visible::after,
.main-nav__row a[aria-current="page"]::after {
  right: 0;
  left: 0;
}

/* =========================================================
   AUTHENTICATION BUTTONS
========================================================= */

.site-header #auth-buttons,
.site-header .auth-actions {
  position: static !important;

  display: flex !important;

  align-items: center;
  justify-content: flex-end;

  justify-self: end;

  width: auto !important;

  gap: 10px;
}

.site-header .auth-button,
.site-header #auth-buttons .btn {
  width: auto !important;

  min-width: 78px;
  min-height: 40px;

  padding:
    10px
    14px;

  border:
    1px solid
    rgba(225, 164, 64, 0.42);

  border-radius: 7px;

  color: #f3dfb7;

  background:
    linear-gradient(
      180deg,
      #26160e,
      #0c0b0d
    );

  box-shadow:
    inset 0 1px
    rgba(255, 255, 255, 0.08),
    0 6px 14px
    rgba(0, 0, 0, 0.34);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.68rem;
  font-weight: 700;

  cursor: pointer;

  transition:
    color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.site-header .auth-button--primary {
  color: #291706;

  background:
    linear-gradient(
      180deg,
      #f2ca71,
      #b97922
    );
}

.site-header .auth-button:hover,
.site-header .auth-button:focus-visible,
.site-header #auth-buttons .btn:hover,
.site-header #auth-buttons .btn:focus-visible {
  color: #2b1707;

  background:
    linear-gradient(
      180deg,
      #ffe39a,
      #cf9134
    );

  box-shadow:
    0 0 0 1px
    rgba(255, 222, 146, 0.52),
    0 0 16px
    rgba(229, 164, 64, 0.5);

  outline: none;

  transform:
    translateY(-2px);
}

/* =========================================================
   TREASURE HERO
========================================================= */

.treasure-hero {
  display: grid;

  grid-template-columns:
    minmax(0, 1.1fr)
    minmax(0, 0.9fr);

  align-items: center;

  min-height:
    min(
      760px,
      calc(100svh - 78px)
    );

  overflow: hidden;

  border-bottom:
    1px solid
    rgba(218, 155, 52, 0.23);

  background:
    radial-gradient(
      circle at 72% 44%,
      rgba(89, 103, 48, 0.18),
      transparent 34rem
    ),
    #05060a;
}

.treasure-hero__art {
  position: relative;

  align-self: stretch;

  min-height: 600px;

  overflow: hidden;

  background:
    radial-gradient(
      circle at 48% 45%,
      rgba(207, 155, 59, 0.24),
      transparent 34%
    ),
    linear-gradient(
      145deg,
      #27170d,
      #080707 70%
    );
}

.treasure-hero__placeholder {
  position: absolute;
  z-index: 1;

  inset: 0;

  display: flex;
  flex-direction: column;

  align-items: center;
  justify-content: center;

  gap: 12px;

  padding: 30px;

  color:
    rgba(246, 212, 134, 0.58);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  text-align: center;
}

.treasure-hero__placeholder span {
  color: var(--gold-light);

  font-size: 5rem;

  text-shadow:
    0 0 30px
    rgba(226, 163, 59, 0.68);
}

.treasure-hero__placeholder strong {
  font-size: 0.9rem;

  letter-spacing: 0.12em;

  text-transform: uppercase;
}

.treasure-hero__placeholder small {
  color:
    rgba(246, 212, 134, 0.42);

  font-size: 0.66rem;
}

.treasure-hero__image {
  position: relative;
  z-index: 2;

  width: 100%;
  height: 100%;

  object-fit: cover;
  object-position: 58% 44%;
}

.treasure-hero__art::after {
  position: absolute;
  z-index: 3;

  inset: 0;

  content: "";

  background:
    linear-gradient(
      90deg,
      transparent 58%,
      rgba(5, 6, 10, 0.42)
    ),
    linear-gradient(
      180deg,
      transparent 72%,
      #05060a
    );

  pointer-events: none;
}

.treasure-hero__glow {
  position: absolute;
  z-index: 4;

  top: 48%;
  right: 19%;

  width: 180px;
  height: 180px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(255, 214, 88, 0.4),
      rgba(74, 139, 82, 0.2) 46%,
      transparent 72%
    );

  filter:
    blur(20px);

  mix-blend-mode: screen;

  pointer-events: none;

  animation:
    treasure-glow
    4.5s
    ease-in-out
    infinite
    alternate;
}

.treasure-hero__content {
  padding:
    clamp(
      44px,
      6vw,
      86px
    )
    clamp(
      24px,
      5vw,
      70px
    );
}

.eyebrow {
  margin:
    0
    0
    13px;

  color: var(--gold);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.72rem;
  font-weight: 700;

  letter-spacing: 0.17em;

  text-transform: uppercase;
}

.treasure-hero h1 {
  margin: 0;

  color: var(--cream);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size:
    clamp(
      3.1rem,
      5.5vw,
      6rem
    );

  line-height: 0.93;
  letter-spacing: -0.045em;

  text-shadow:
    0 3px 2px
    rgba(28, 10, 4, 0.9),
    0 0 24px
    rgba(210, 141, 47, 0.22);
}

.treasure-hero h1 span {
  display: block;

  color: var(--gold-light);

  font-size: 0.8em;
}

.treasure-hero__dnd-logo {
  width:
    min(
      320px,
      65%
    );

  max-height: 106px;

  margin:
    20px
    0
    18px;

  object-fit: contain;
  object-position: left center;

  filter:
    drop-shadow(
      0 6px 5px
      rgba(0, 0, 0, 0.58)
    );
}

.treasure-hero__description {
  max-width: 620px;

  margin: 0;

  color:
    rgba(244, 227, 190, 0.83);

  font-size:
    clamp(
      0.94rem,
      1.3vw,
      1.08rem
    );

  line-height: 1.75;
}

.greeting {
  margin:
    18px
    0
    0;

  color: var(--gold-light);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.9rem;
}

.greeting:empty {
  display: none;
}

.hero-action {
  display: inline-flex;

  align-items: center;
  justify-content: center;

  min-width: 220px;
  min-height: 52px;

  margin-top: 26px;

  padding:
    13px
    22px;

  border:
    1px solid
    var(--gold-dark);

  color: #2a1706;

  background:
    linear-gradient(
      180deg,
      #f2ca71,
      #b97922
    );

  box-shadow:
    inset 0 0 0 1px
    rgba(255, 219, 137, 0.14),
    0 12px 24px
    rgba(0, 0, 0, 0.45);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.76rem;
  font-weight: 700;

  text-decoration: none;

  clip-path:
    polygon(
      12px 0,
      calc(100% - 12px) 0,
      100% 12px,
      100% calc(100% - 12px),
      calc(100% - 12px) 100%,
      12px 100%,
      0 calc(100% - 12px),
      0 12px
    );

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.hero-action:hover,
.hero-action:focus-visible {
  box-shadow:
    0 0 0 1px
    rgba(255, 219, 137, 0.36),
    0 0 12px
    rgba(238, 177, 73, 0.72),
    0 14px 26px
    rgba(0, 0, 0, 0.5);

  outline: none;

  transform:
    translateY(-4px)
    scale(1.025);
}

/* =========================================================
   TREASURE WORKSPACE
========================================================= */

.treasure-workspace {
  width:
    min(
      calc(100% - 36px),
      var(--content-width)
    );

  margin:
    0
    auto;

  padding:
    78px
    0
    110px;
}

.treasure-workspace__heading {
  max-width: 840px;

  margin:
    0
    auto
    34px;

  text-align: center;
}

.treasure-workspace__heading h2 {
  margin: 0;

  color: #f0ce7d;

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size:
    clamp(
      2.1rem,
      4vw,
      4rem
    );

  line-height: 1.05;
}

.treasure-workspace__heading > p:last-child {
  max-width: 650px;

  margin:
    15px
    auto
    0;

  color: var(--cream-muted);

  line-height: 1.7;
}

/* =========================================================
   GENERATOR LAYOUT
========================================================= */

.generator-layout {
  display: grid;

  grid-template-columns:
    minmax(18rem, 25rem)
    minmax(0, 1fr);

  align-items: start;

  gap: 24px;
}

.generator-panel,
.result-panel,
.history-panel,
.reference-panel {
  border:
    2px solid
    rgba(157, 96, 38, 0.62);

  border-radius: 5px;

  color: var(--ink);

  background:
    linear-gradient(
      145deg,
      var(--paper),
      #ead4b1
    );

  box-shadow:
    inset 0 0 0 1px
    rgba(255, 248, 226, 0.35),
    0 24px 50px
    rgba(0, 0, 0, 0.42);
}

.generator-panel {
  position: sticky;

  top: 98px;

  padding:
    24px;
}

.result-panel {
  min-height: 560px;

  padding:
    clamp(
      20px,
      3vw,
      34px
    );
}

.panel-heading,
.result-heading,
.history-heading {
  display: flex;

  align-items: flex-end;
  justify-content: space-between;

  gap: 16px;

  margin-bottom: 20px;
}

.generator-panel h2,
.result-panel h2,
.history-panel h2,
.reference-panel h2 {
  margin: 0;

  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;
}

.generator-panel .eyebrow,
.result-panel .eyebrow,
.history-panel .eyebrow,
.reference-panel .eyebrow {
  color: #975d1e;
}

/* =========================================================
   GENERATOR CONTROLS
========================================================= */

.control-group {
  display: grid;

  gap: 7px;

  margin:
    0
    0
    19px;

  padding: 0;

  border: 0;
}

.control-group legend,
.control-group > label {
  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.73rem;
  font-weight: 700;

  letter-spacing: 0.07em;

  text-transform: uppercase;
}

.control-group select,
.control-group input[type="number"] {
  width: 100%;
  min-height: 48px;

  padding:
    10px
    12px;

  border:
    1px solid
    #96785e;

  border-radius: 5px;

  color: var(--ink);

  background:
    var(--paper-light);
}

.control-group select:focus,
.control-group input[type="number"]:focus {
  border-color:
    var(--gold-dark);

  box-shadow:
    0 0 0 3px
    rgba(181, 125, 43, 0.2);

  outline: none;
}

.control-group small {
  color: #725947;

  font-size: 0.75rem;

  line-height: 1.45;
}

.segmented-control {
  display: grid;

  grid-template-columns:
    1fr
    1fr;

  gap: 8px;
}

.segmented-control label {
  position: relative;
}

.segmented-control input {
  position: absolute;

  opacity: 0;
  pointer-events: none;
}

.segmented-control span {
  display: grid;

  place-items: center;

  min-height: 48px;

  padding: 8px;

  border:
    1px solid
    #8c6c52;

  border-radius: 5px;

  color: #5d432f;

  background:
    rgba(255, 255, 255, 0.5);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.73rem;
  font-weight: 700;

  transition:
    color 0.15s ease,
    background-color 0.15s ease,
    border-color 0.15s ease,
    transform 0.15s ease;
}

.segmented-control input:checked + span {
  border-color:
    #315e48;

  color: white;

  background:
    linear-gradient(
      180deg,
      #5f8563,
      #37563e
    );

  box-shadow:
    0 0 14px
    rgba(52, 109, 77, 0.3);
}

.segmented-control span:hover {
  transform:
    translateY(-1px);
}

/* =========================================================
   GENERATOR BUTTONS
========================================================= */

.button-stack {
  display: grid;

  grid-template-columns:
    1fr
    1fr;

  gap: 10px;
}

.button-stack button,
.danger-button {
  min-height: 46px;

  padding:
    10px
    13px;

  border:
    1px solid
    rgba(55, 32, 19, 0.7);

  border-radius: 5px;

  color: white;

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.68rem;
  font-weight: 700;

  box-shadow:
    0 5px 10px
    rgba(0, 0, 0, 0.2);

  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.button-stack button:hover,
.button-stack button:focus-visible,
.danger-button:hover,
.danger-button:focus-visible {
  border-color:
    var(--gold-light);

  box-shadow:
    0 8px 14px
    rgba(0, 0, 0, 0.28),
    0 0 10px
    rgba(212, 154, 56, 0.3);

  outline: none;

  transform:
    translateY(-2px);
}

.primary-button {
  grid-column:
    1 / -1;

  background:
    linear-gradient(
      180deg,
      #b17b2e,
      #79501d
    );
}

.secondary-button {
  background:
    linear-gradient(
      180deg,
      #76513a,
      #4d3121
    );
}

.danger-button {
  background:
    linear-gradient(
      180deg,
      var(--red-light),
      #76261f
    );
}

.generator-status {
  margin:
    16px
    0
    0;

  padding:
    12px;

  border-left:
    4px solid
    var(--red);

  color: #614734;

  background:
    rgba(255, 255, 255, 0.43);

  font-size: 0.82rem;

  line-height: 1.5;
}

/* =========================================================
   RESULT PANEL
========================================================= */

.roll-badge {
  padding:
    10px
    14px;

  border:
    1px solid
    #8e6d4c;

  border-radius: 999px;

  color: white;

  background:
    var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.76rem;
}

.empty-result {
  display: grid;

  place-items: center;

  align-content: center;

  min-height: 430px;

  color: #765b45;

  text-align: center;
}

.empty-result__symbol {
  color: var(--gold);

  font-size: 5rem;

  text-shadow:
    0 0 18px
    rgba(209, 145, 47, 0.34);
}

.empty-result h3 {
  margin:
    8px
    0
    0;

  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size:
    clamp(
      1.35rem,
      3vw,
      1.8rem
    );
}

.empty-result p {
  margin:
    7px
    0
    0;
}

.treasure-result {
  display: grid;

  gap: 16px;
}

.result-section {
  padding:
    16px;

  border:
    1px solid
    rgba(86, 54, 32, 0.26);

  border-radius: 6px;

  background:
    rgba(255, 255, 255, 0.45);
}

.result-section h3 {
  margin:
    0
    0
    13px;

  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 1.12rem;
}

.coin-grid {
  display: grid;

  grid-template-columns:
    repeat(
      5,
      minmax(5rem, 1fr)
    );

  gap: 12px;
}

.coin-card {
  padding:
    13px;

  border:
    1px solid
    rgba(77, 48, 29, 0.25);

  border-radius: 5px;

  background:
    var(--paper-light);

  text-align: center;

  box-shadow:
    0 5px 10px
    rgba(70, 41, 22, 0.08);
}

.coin-card span {
  display: block;

  margin-bottom: 4px;

  color: #745844;

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.68rem;
  font-weight: 700;

  letter-spacing: 0.12em;
}

.coin-card strong {
  display: block;

  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size:
    clamp(
      1.15rem,
      3vw,
      1.7rem
    );
}

.valuable-group,
.magic-group {
  margin-bottom: 16px;
}

.valuable-group:last-child,
.magic-group:last-child {
  margin-bottom: 0;
}

.valuable-group h4,
.magic-group h4 {
  margin:
    0
    0
    7px;

  color: var(--green);

  font-family:
    "Cinzel",
    Georgia,
    serif;
}

.valuable-group ul,
.magic-group ul {
  margin: 0;

  padding-left: 21px;

  line-height: 1.65;
}

.total-section {
  border-color:
    rgba(178, 123, 44, 0.5);

  background:
    linear-gradient(
      135deg,
      rgba(242, 205, 119, 0.34),
      rgba(255, 255, 255, 0.5)
    );
}

.total-value {
  margin:
    0
    0
    4px;
}

.total-value strong {
  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size:
    clamp(
      2rem,
      5vw,
      3.2rem
    );
}

.total-value span {
  color: #71543d;

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-weight: 700;
}

/* =========================================================
   HISTORY
========================================================= */

.history-panel,
.reference-panel {
  margin-top: 24px;

  padding:
    clamp(
      20px,
      3vw,
      34px
    );
}

#historyAccountMessage {
  color: #684d39;

  font-size: 0.84rem;

  line-height: 1.55;
}

.history-list {
  display: grid;

  gap: 12px;
}

.history-entry {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    auto;

  align-items: center;

  gap: 16px;

  padding:
    14px;

  border:
    1px solid
    rgba(78, 48, 29, 0.26);

  border-radius: 5px;

  background:
    rgba(255, 255, 255, 0.48);
}

.history-entry h3 {
  margin:
    0
    0
    4px;

  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.92rem;
}

.history-entry p {
  margin: 0;

  color: #725844;

  font-size: 0.8rem;
}

.history-entry button {
  padding:
    8px
    11px;

  border:
    1px solid
    #74533b;

  border-radius: 5px;

  color: white;

  background:
    #65432e;

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.66rem;
  font-weight: 700;
}

/* =========================================================
   REFERENCE TABLES
========================================================= */

.reference-grid {
  display: grid;

  grid-template-columns:
    repeat(
      3,
      1fr
    );

  gap: 16px;
}

.reference-grid details {
  border:
    1px solid
    rgba(82, 51, 31, 0.3);

  border-radius: 5px;

  background:
    rgba(255, 255, 255, 0.45);

  overflow: hidden;
}

.reference-grid summary {
  padding:
    16px;

  color: var(--brown);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.8rem;
  font-weight: 700;
}

.reference-grid details[open] summary {
  border-bottom:
    1px solid
    rgba(82, 51, 31, 0.18);

  background:
    rgba(255, 255, 255, 0.25);
}

.reference-table,
.conversion-list {
  padding:
    0
    16px
    16px;
}

.reference-table h4 {
  margin:
    13px
    0
    5px;

  color: var(--green);

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.8rem;
}

.reference-table ul {
  margin: 0;

  padding-left: 18px;

  font-size: 0.82rem;

  line-height: 1.55;
}

.conversion-list p {
  margin:
    7px
    0;

  font-size: 0.84rem;
}

/* =========================================================
   RESOURCE NAVIGATION
========================================================= */

.resource-navigation {
  display: flex;
  flex-wrap: wrap;

  justify-content: center;

  gap:
    12px
    22px;

  margin-top: 34px;
}

.resource-navigation a {
  color: #ddb15e;

  font-family:
    "Cinzel",
    Georgia,
    serif;

  font-size: 0.68rem;

  text-decoration: none;
}

.resource-navigation a:hover,
.resource-navigation a:focus-visible {
  color: var(--gold-light);
}

/* =========================================================
   FOOTER
========================================================= */

.site-footer {
  display: flex;
  flex-wrap: wrap;

  align-items: center;
  justify-content: space-between;

  gap: 20px;

  width:
    min(
      calc(100% - 36px),
      var(--content-width)
    );

  margin:
    0
    auto;

  padding:
    28px
    0
    38px;

  border-top:
    1px solid
    rgba(219, 158, 54, 0.22);

  color:
    rgba(243, 224, 185, 0.56);

  font-size: 0.68rem;
}

.site-footer__brand {
  display: flex;

  align-items: center;

  gap: 11px;

  text-decoration: none;
}

.site-footer__brand img {
  width: 42px;
  height: 42px;

  object-fit: contain;
}

.site-footer__brand span {
  display: flex;
  flex-direction: column;
}

.site-footer__brand strong {
  color: var(--gold-light);

  font-family:
    "Cinzel",
    Georgia,
    serif;
}

.site-footer__brand small {
  margin-top: 3px;
}

.site-footer > a {
  color: #ddb15e;

  text-decoration: none;
}

/* =========================================================
   AUTHENTICATION MODAL LAYERS
========================================================= */

.overlay {
  z-index: 999;
}

.modal {
  z-index: 1000;
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes atmosphere-drift {
  from {
    transform:
      translate3d(
        -4%,
        -2%,
        0
      )
      scale(0.94);
  }

  to {
    transform:
      translate3d(
        7%,
        6%,
        0
      )
      scale(1.08);
  }
}

@keyframes treasure-glow {
  from {
    opacity: 0.55;

    transform:
      scale(0.92);
  }

  to {
    opacity: 1;

    transform:
      scale(1.08);
  }
}

/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns:
      1fr
      auto;
  }

  .main-nav--split {
    display: none;
  }

  .treasure-hero {
    grid-template-columns:
      1fr
      1fr;
  }

  .generator-layout {
    grid-template-columns:
      1fr;
  }

  .generator-panel {
    position: static;
  }
}

/* =========================================================
   PHONE
========================================================= */

@media (max-width: 700px) {
  .site-header {
    position: relative;

    display: grid;

    grid-template-columns:
      minmax(0, 1fr)
      auto;

    align-items: center;

    min-height: 0;

    gap: 10px;

    padding:
      10px
      12px;
  }

  .site-brand {
    min-width: 0;
  }

  .site-brand__logo {
    width: 46px;
    height: 46px;
  }

  .site-brand__copy strong {
    font-size: 1rem;
  }

  .site-brand__copy small {
    display: none;
  }

  .site-header #auth-buttons,
  .site-header .auth-actions {
    justify-content: flex-end;

    width: auto !important;

    gap: 7px;
  }

  .site-header .auth-button,
  .site-header #auth-buttons .btn {
    min-width: 68px;
    min-height: 38px;

    padding:
      8px
      10px;

    font-size: 0.62rem;
  }

  .treasure-hero {
    display: grid;

    grid-template-columns:
      minmax(0, 54%)
      minmax(0, 46%);

    align-items: stretch;

    min-height: 430px;
  }

  .treasure-hero__art {
    width: 100%;
    height: 430px;
    min-height: 0;
  }

  .treasure-hero__image {
    object-position:
      56% 25%;
  }

  .treasure-hero__art::after {
    background:
      linear-gradient(
        90deg,
        transparent 72%,
        rgba(5, 6, 10, 0.92)
      ),
      linear-gradient(
        180deg,
        transparent 80%,
        rgba(5, 6, 10, 0.65)
      );
  }

  .treasure-hero__glow {
    top: 30%;
    right: 10%;

    width: 95px;
    height: 95px;
  }

  .treasure-hero__content {
    display: flex;
    flex-direction: column;

    justify-content: center;

    min-width: 0;

    padding:
      22px
      18px
      22px
      14px;
  }

  .treasure-hero__content .eyebrow {
    margin-bottom: 8px;

    font-size: 0.56rem;

    letter-spacing: 0.11em;
  }

  .treasure-hero h1 {
    font-size:
      clamp(
        1.75rem,
        7vw,
        2.75rem
      );

    line-height: 0.98;
  }

  .treasure-hero h1 span {
    margin-top: 4px;
  }

  .treasure-hero__dnd-logo {
    width:
      min(
        190px,
        95%
      );

    max-height: 70px;

    margin:
      14px
      0
      12px;

    object-position:
      left center;
  }

  .treasure-hero__description {
    font-size: 0.78rem;

    line-height: 1.55;
  }

  .greeting {
    font-size: 0.72rem;
  }

  .hero-action {
    min-width: 0;
    min-height: 44px;

    margin-top: 17px;

    padding:
      10px
      12px;

    font-size: 0.62rem;
  }

  .treasure-workspace {
    width:
      calc(
        100% - 20px
      );

    padding:
      44px
      0
      68px;
  }

  .treasure-workspace__heading {
    margin-bottom: 26px;

    padding:
      0
      10px;
  }

  .treasure-workspace__heading h2 {
    font-size:
      clamp(
        1.8rem,
        8vw,
        2.8rem
      );
  }

  .treasure-workspace__heading > p:last-child {
    font-size: 0.84rem;

    line-height: 1.55;
  }

  .coin-grid {
    grid-template-columns:
      repeat(
        2,
        minmax(0, 1fr)
      );
  }

  .reference-grid {
    grid-template-columns:
      1fr;
  }

  .history-entry {
    grid-template-columns:
      1fr;
  }

  .site-footer {
    flex-direction: column;

    text-align: center;
  }
}

/* =========================================================
   VERY SMALL PHONE
========================================================= */

@media (max-width: 480px) {
  .site-header {
    display: flex;
    flex-direction: column;
  }

  .site-header #auth-buttons,
  .site-header .auth-actions {
    justify-content: center;

    width: 100% !important;
  }

  .treasure-hero {
    display: flex;
    flex-direction: column;

    min-height: 0;
  }

  .treasure-hero__art {
    height:
      clamp(
        320px,
        92vw,
        430px
      );
  }

  .treasure-hero__image {
    object-position:
      56% 22%;
  }

  .treasure-hero__art::after {
    background:
      linear-gradient(
        180deg,
        transparent 70%,
        #05060a
      );
  }

  .treasure-hero__content {
    padding:
      24px
      18px
      38px;

    text-align: center;
  }

  .treasure-hero__dnd-logo {
    margin-inline: auto;

    object-position:
      center;
  }

  .treasure-hero__description {
    margin-inline: auto;
  }

  .hero-action {
    align-self: center;
  }

  .button-stack {
    grid-template-columns:
      1fr;
  }

  .primary-button {
    grid-column: auto;
  }

  .result-heading,
  .history-heading,
  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .roll-badge {
    align-self: flex-start;
  }

  .danger-button {
    width: 100%;
  }

  .coin-grid {
    grid-template-columns:
      1fr
      1fr;
  }
}

/* =========================================================
   PRINT
========================================================= */

@media print {
  .site-header,
  .page-background,
  .treasure-hero,
  .generator-panel,
  .history-panel,
  .reference-panel,
  .resource-navigation,
  .site-footer,
  #auth-buttons,
  #modals-placeholder,
  #overlay {
    display: none !important;
  }

  html,
  body {
    margin: 0;
    padding: 0;

    color: #000;

    background: #fff;
  }

  .treasure-workspace,
  .generator-layout,
  .result-panel {
    width: 100%;
    min-height: auto;

    margin: 0;
    padding: 0;

    border: 0;

    color: #000;

    background: #fff;

    box-shadow: none;
  }

  .treasure-workspace__heading {
    display: none;
  }

  .result-section {
    break-inside: avoid;
  }
}

/* =========================================================
   REDUCED MOTION
========================================================= */

@media (
  prefers-reduced-motion:
  reduce
) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration:
      1ms !important;

    animation-iteration-count:
      1 !important;

    transition-duration:
      1ms !important;
  }
}