﻿:root {
  color-scheme: dark;
  --page: #ffffff;
  --ink: #191d21;
  --gt-green: #657f35;
  --gt-red: #7d211c;
  --gt-brown: #95452f;
  --bg: #14120f;
  --panel: #232522;
  --panel-2: #30332f;
  --text: #f4efe4;
  --muted: #bab2a3;
  --line: #55584f;
  --accent: #df3f2f;
  --accent-2: #f0b84c;
  --green: #4fb071;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100%;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: transparent;
  color: var(--ink);
}

a {
  color: inherit;
}

.siteHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 8px clamp(16px, 4vw, 34px);
  border-bottom: 5px solid var(--gt-green);
  background: #050505;
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.brandLogo {
  width: min(245px, 42vw);
  height: auto;
  display: block;
}

.headerActions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.headerLinks {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
}

.siteNav {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 24px);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.siteNav a {
  text-decoration: none;
}

.siteNav a:hover {
  color: #f4d7c8;
}

.helpLink {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: #fff;
  color: #b82820;
  font-size: 1.1rem;
  font-weight: 950;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.helpLink:hover {
  background: #f7eee9;
  color: var(--gt-brown);
}

.version {
  align-self: flex-end;
  color: #b8c79a;
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.app {
  background:
    linear-gradient(135deg, rgba(223, 63, 47, 0.16), transparent 36%),
    linear-gradient(315deg, rgba(79, 176, 113, 0.16), transparent 40%),
    var(--bg);
  color: var(--text);
  min-height: 100%;
  display: grid;
  place-items: start center;
  padding: 12px 24px 24px;
  cursor: crosshair;
}

button {
  font: inherit;
}

.roller {
  position: relative;
  width: min(940px, 100%);
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(280px, 1.1fr);
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  padding: clamp(18px, 4vw, 40px);
  border: 1px solid rgba(244, 239, 228, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    rgba(35, 37, 34, 0.92);
  background-size: 34px 34px;
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.3);
}

.status {
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gt-green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 16ch;
  font-size: clamp(1.55rem, 4vw, 3.15rem);
  line-height: 1.05;
  letter-spacing: 0;
}

.copy {
  max-width: 32rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.dieStage {
  position: relative;
  grid-row: span 2;
  display: grid;
  place-items: center;
  min-height: 360px;
}

.diceTray {
  width: min(86%, 430px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  align-items: center;
  justify-items: center;
  gap: clamp(10px, 2vw, 18px);
}

.dieStage[data-dice-count="1"] .diceTray {
  width: min(78%, 390px);
  grid-template-columns: 1fr;
}

.dieStage[data-dice-count="2"] .diceTray,
.dieStage[data-dice-count="3"] .diceTray,
.dieStage[data-dice-count="4"] .diceTray {
  width: min(84%, 430px);
  grid-template-columns: repeat(2, minmax(104px, 1fr));
}

.dieFace {
  position: relative;
  width: 100%;
  max-width: 130px;
  aspect-ratio: 1;
  filter: drop-shadow(0 22px 22px rgba(0, 0, 0, 0.32));
  transform: rotate(var(--die-tilt, -5deg));
  transition:
    transform 180ms ease,
    filter 180ms ease;
}

.dieImage {
  width: 100%;
  height: 100%;
  display: block;
}

.dieNumber {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #171512;
  font-size: clamp(1.2rem, 4.8vw, 3.6rem);
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.45);
}

.dieNumber.d4 {
  padding-top: 18%;
}

.dieNumber.d10,
.dieNumber.d100 {
  font-size: clamp(1rem, 4.2vw, 3.1rem);
}

.dieStage[data-dice-count="1"] .dieFace {
  max-width: 390px;
}

.dieStage[data-dice-count="2"] .dieFace,
.dieStage[data-dice-count="3"] .dieFace,
.dieStage[data-dice-count="4"] .dieFace {
  max-width: 165px;
}

.dieFace.rolling {
  transform: rotate(var(--die-spin, 14deg)) scale(1.04);
  filter: drop-shadow(0 30px 28px rgba(0, 0, 0, 0.42));
}

.rollValue {
  width: min(360px, 100%);
  min-width: 72px;
  min-height: 72px;
  margin-top: 16px;
  padding: 10px 14px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 239, 228, 0.24);
  border-radius: 8px;
  background: rgba(20, 18, 15, 0.76);
  color: var(--accent-2);
  font-size: clamp(1.45rem, 4vw, 2.45rem);
  font-weight: 900;
  text-align: center;
}

.controls {
  align-self: end;
}

.diceControls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.diceControl {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.diceControl select {
  width: 96px;
  min-height: 42px;
  border: 1px solid rgba(244, 239, 228, 0.2);
  border-radius: 6px;
  background: rgba(20, 18, 15, 0.72);
  color: var(--text);
  font: inherit;
  font-weight: 850;
  padding: 0 10px;
}

.modeControl {
  align-items: stretch;
}

.modeButtons {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(76px, 1fr));
  gap: 6px;
}

.modeButtons button {
  min-height: 42px;
  border: 2px solid rgba(244, 239, 228, 0.2);
  border-radius: 6px;
  background: rgba(20, 18, 15, 0.72);
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  cursor: pointer;
}

.modeButtons button.active {
  border-color: var(--accent-2);
  background: rgba(125, 33, 28, 0.94);
  color: #fff8ee;
  box-shadow:
    0 0 0 1px rgba(240, 184, 76, 0.34),
    0 0 18px rgba(240, 184, 76, 0.18);
}

#rollButton {
  width: 160px;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--gt-red);
  color: #fff8ee;
  font-weight: 850;
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

#rollButton:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

#rollButton:not(:disabled):hover {
  background: #9a2a23;
  transform: translateY(-1px);
}

.meter {
  width: min(360px, 100%);
  height: 12px;
  margin: 20px 0 10px;
  overflow: hidden;
  border: 1px solid rgba(244, 239, 228, 0.18);
  border-radius: 999px;
  background: rgba(20, 18, 15, 0.58);
}

.meterFill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--gt-red), var(--accent-2), var(--gt-green));
  transition: width 120ms ease;
}

.hint {
  min-height: 1.45em;
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.log {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  max-width: min(560px, 100%);
  min-height: 42px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.log li {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  max-width: 100%;
  padding: 0 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 239, 228, 0.16);
  border-radius: 6px;
  background: rgba(20, 18, 15, 0.5);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 850;
  text-align: center;
  overflow-wrap: anywhere;
}

.siteFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px clamp(18px, 4vw, 46px);
  border-top: 5px solid var(--gt-green);
  background: var(--gt-brown);
  color: #fff;
}

.siteFooter div {
  display: grid;
  gap: 4px;
}

.siteFooter strong {
  color: #fff;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.siteFooter span,
.siteFooter p {
  margin: 0;
  color: #f2ddd2;
  font-size: 0.88rem;
}

.helpMain {
  min-height: 100%;
  padding: clamp(22px, 5vw, 54px);
  background:
    linear-gradient(135deg, rgba(101, 127, 53, 0.14), transparent 32%),
    linear-gradient(315deg, rgba(149, 69, 47, 0.2), transparent 38%),
    #161412;
  color: var(--text);
}

.helpArticle {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid rgba(244, 239, 228, 0.16);
  border-radius: 8px;
  background: rgba(35, 37, 34, 0.94);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.28);
}

.helpLogo {
  width: min(340px, 100%);
  height: auto;
  display: block;
  margin: 0 0 18px;
}

.helpArticle h1 {
  max-width: none;
  color: #fff;
  font-size: clamp(1.9rem, 5vw, 3.2rem);
}

.helpVersion {
  margin: 8px 0 0;
  color: #b8c79a;
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.helpArticle h2 {
  margin: 28px 0 10px;
  color: var(--accent-2);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.helpArticle p,
.helpArticle li {
  color: var(--muted);
  line-height: 1.65;
}

.helpArticle ol,
.helpArticle ul {
  padding-left: 1.25rem;
}

.helpArticle a {
  color: #fff;
  font-weight: 850;
}

.helpBack {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 18px;
  padding: 0 14px;
  border-radius: 6px;
  background: var(--gt-brown);
  color: #fff;
  font-weight: 850;
  text-decoration: none;
}

.legalNotice {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid rgba(244, 239, 228, 0.16);
  font-size: 0.82rem;
}

@media (max-width: 760px) {
  .siteHeader,
  .siteFooter {
    align-items: flex-start;
    flex-direction: column;
  }

  .headerActions {
    align-items: flex-start;
    flex-direction: column;
  }

  .headerLinks {
    align-items: flex-start;
    flex-direction: column;
  }

  .version {
    align-self: flex-start;
  }

  .brandLogo {
    width: min(100%, 245px);
  }

  .siteNav {
    flex-wrap: wrap;
  }

  .app {
    padding: 10px 14px 18px;
  }

  .roller {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .dieStage {
    grid-row: auto;
    min-height: 300px;
  }

  .dieFace {
    max-width: 118px;
  }

  .dieStage[data-dice-count="1"] .dieFace {
    max-width: 310px;
  }

  .rollValue {
    min-width: 58px;
    min-height: 58px;
    font-size: 1.7rem;
  }
}

[hidden] {
  display: none !important;
}

.appMasthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 14px;
}

.rollerLogo {
  width: min(330px, 100%);
  height: auto;
  display: block;
}

.appVersion {
  grid-column: 1;
  align-self: start;
  justify-self: start;
  margin-left: 4px;
}

.appHelpButton {
  position: absolute;
  top: clamp(14px, 2.5vw, 26px);
  right: clamp(14px, 2.5vw, 26px);
  z-index: 4;
}

.helpOverlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 28px);
  background: rgba(0, 0, 0, 0.68);
}

.helpDialog {
  position: relative;
  width: min(920px, 100%);
  max-height: min(82vh, 820px);
  overflow: auto;
}

.closeHelpButton {
  position: sticky;
  top: 0;
  float: right;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: #fff;
  color: #b82820;
  font-size: 1rem;
  font-weight: 950;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

@media (max-width: 760px) {
  .appMasthead {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .rollerLogo {
    width: min(270px, 100%);
  }

  .helpDialog {
    max-height: 88vh;
  }
}





.helpArticle h3 {
  margin: 14px 0 4px;
  color: var(--accent-2);
  font-size: 0.98rem;
  letter-spacing: 0.04em;
}

.helpArticle h3 + ul {
  margin-top: 0;
}
