/* Diablo Class Randomizer - web version */

@font-face {
  font-family: "Diablo";
  src: url("assets/fonts/diabloheavy.ttf") format("truetype");
  font-display: block;
}

:root {
  --blood-red: #c00000;
  --bright-red: #ff3c1e;
  --dark-red: #6e0000;
  --ember: #ff8c3c;
  --bone: #dccdb4;
  --dim-bone: #82735f;
  --faint-bone: #5a5041;
  --bronze: #785f46;
}

* {
  box-sizing: border-box;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  background: #000;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

button {
  font: inherit;
  color: inherit;
}

/* Blurred copy of the current background that fills the space around the app on tall/wide screens */
.backdrop {
  position: fixed;
  inset: -40px;
  background: #000 center / cover no-repeat;
  filter: blur(18px) brightness(0.4);
}

/* Stage + screens */

.stage {
  position: relative;
  width: 384px;
  height: 661px;
  flex: none;
  overflow: hidden;
  background: #000 center / 100% 100% no-repeat;
  transform-origin: center center;
  font-family: "Diablo", "Times New Roman", serif;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

.screen {
  position: absolute;
  inset: 0;
}

.screen[hidden] {
  display: none;
}

/* Outlined gradient text
   The element itself draws the dark outline (and optional red glow);
   its ::after copy (same text, from data-text) sits on top with the gradient fill. */

.txt {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  font-weight: normal;
  line-height: 1;
  color: rgba(0, 0, 0, 0.9);
  -webkit-text-stroke: 4px rgba(0, 0, 0, 0.9);
}

.txt::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;   /* the glow belongs to the outline layer underneath */
  color: transparent;
  background-image: linear-gradient(var(--top, #fff), var(--bottom, #ccc));
  -webkit-background-clip: text;
  background-clip: text;
}

.txt.glow {
  text-shadow: 0 0 calc(10px * var(--glow, 0.5)) rgba(255, 60, 30, var(--glow, 0.5)),
               0 0 calc(4px * var(--glow, 0.5)) rgba(255, 60, 30, var(--glow, 0.5));
}

.red { --top: var(--bright-red); --bottom: var(--blood-red); }
.bone { --top: var(--bone); --bottom: var(--dim-bone); }
.bone-dim { --top: var(--dim-bone); --bottom: var(--faint-bone); }

/* Title screen */

.title-glow {
  position: absolute;
  left: -60px;
  top: 90px;
  width: 504px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(120, 0, 0, 0.35), rgba(0, 0, 0, 0));
}

.embers {
  position: absolute;
  inset: 0;
}

.title-logo {
  position: absolute;
  left: 12px;
  top: 120px;
  width: 360px;
  height: 236px;
}

.title-name {
  top: 367px;
  font-size: 22px;
}

.title-version {
  top: 399px;
  font-size: 12px;
  -webkit-text-stroke-width: 3px;
}

.footer-line {
  position: absolute;
  left: 102px;
  top: 615px;
  width: 180px;
  height: 1px;
  background: #8c0000;
}

.footer {
  top: 624px;
  font-size: 14px;
  -webkit-text-stroke-width: 3px;
}

/* Dark red Diablo button */

.diablo-btn {
  position: absolute;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  outline: none;
}

/* the button face sits 6px in from the edges, leaving room for the hover glow */
.diablo-btn::before {
  content: "";
  position: absolute;
  inset: 6px 7px 7px 6px;
  background: linear-gradient(#460505, #0f0000);
  border: 2px solid var(--blood-red);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px #5a462d;
}

.diablo-btn:hover::before,
.diablo-btn:focus-visible::before {
  border-color: var(--bright-red);
  box-shadow: inset 0 0 0 1px #000, inset 0 0 0 2px #5a462d, 0 0 10px 3px rgba(255, 60, 30, 0.45);
}

.diablo-btn:active::before {
  background: linear-gradient(#190000, #370404);
}

.diablo-btn:disabled {
  cursor: default;
}

.diablo-btn:disabled::before {
  background: linear-gradient(#231e1e, #0f0c0c);
  border-color: #463c3c;
  box-shadow: inset 0 0 0 1px #000;
}

.btn-label {
  top: 50%;
  transform: translateY(-45%);
  --top: var(--bright-red);
  --bottom: var(--blood-red);
}

.diablo-btn:hover .btn-label,
.diablo-btn:focus-visible .btn-label {
  --top: var(--ember);
  --bottom: var(--bright-red);
  text-shadow: 0 0 6px rgba(255, 60, 30, 0.6);
}

.diablo-btn:active .btn-label {
  margin-top: 1px;
}

.diablo-btn:disabled .btn-label {
  --top: #6e6464;
  --bottom: #463c3c;
  text-shadow: none;
}

/* Game tiles (Select Game screen) */

.game-tile {
  position: absolute;
  left: 24px;
  width: 336px;
  height: 113px;
  padding: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  outline: none;
}

.game-tile img {
  display: block;
  width: 324px;
  height: 101px;
  border: 2px solid var(--bronze);
  filter: brightness(0.8);
  transition: filter 0.1s, box-shadow 0.1s, border-color 0.1s;
}

.game-tile:hover img,
.game-tile:focus-visible img {
  border-color: var(--bright-red);
  filter: brightness(1.12);
  box-shadow: 0 0 12px 4px rgba(255, 60, 30, 0.55);
}

/* Results screen */

.result-logo {
  position: absolute;
  left: 42px;
  top: 48px;
  width: 300px;
  height: 94px;
  border: 2px solid var(--bronze);
}

.status {
  top: 157px;
  font-size: 14px;
  -webkit-text-stroke-width: 3px;
}

.banner {
  position: absolute;
  left: 12px;
  top: 184px;
  width: 360px;
  height: 76px;
}

/* red glow behind the banner's name slot when the class locks in */
.banner-glow {
  position: absolute;
  left: 104px;
  top: 200px;
  width: 222px;
  height: 24px;
  box-shadow: 0 0 calc(16px * var(--glow, 0)) calc(6px * var(--glow, 0)) rgba(255, 60, 30, calc(0.8 * var(--glow, 0)));
}

/* Centered on the window. The box starts at the flag's edge (x 104), so long names shrink to fit. */
.class-name {
  left: 104px;
  width: 176px;
  top: 204px;
  font-size: 16px;
  --top: var(--ember);
  --bottom: var(--blood-red);
}

.class-name.spinning {
  font-size: 15px;
  --top: var(--bone);
  --bottom: var(--dim-bone);
}

/* Dark see-through panel with a red outer border and a thin bronze inner border */
.panel {
  position: absolute;
  left: 42px;
  top: 282px;
  width: 300px;
  background: rgba(10, 4, 4, 0.72);
  border: 2px solid var(--dark-red);
  box-shadow: inset 0 0 0 2px rgba(10, 4, 4, 0.72), inset 0 0 0 3px #46321e;
}

.list-header {
  top: 10px;
  font-size: 11px;
  -webkit-text-stroke-width: 3px;
}

.list-cells {
  position: absolute;
  left: 8px;
  top: 26px;
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: 142px 142px;
}

.cell {
  position: relative;
  width: 142px;
  height: 22px;
}

.cell .txt {
  top: 6px;
  font-size: 12px;
  -webkit-text-stroke-width: 3px;
  --top: #968773;
  --bottom: #645848;
}

.cell.shown .txt {
  --top: var(--bone);
}

.cell.picked::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 2px;
  right: 4px;
  bottom: 2px;
  background: rgba(140, 0, 0, 0.47);
  border: 1px solid rgba(255, 60, 30, 0.78);
}

.cell.picked .txt {
  top: 5px;
  font-size: 13px;
  --top: var(--ember);
  --bottom: var(--bright-red);
  text-shadow: 0 0 5px rgba(255, 60, 30, 0.5);
}
