:root {
  color-scheme: light;
  --bg: #f4efe7;
  --bg-accent: #e4d5c2;
  --panel: #efd9ccbd;
  --panel-highlight: #fffaf2;
  --text: #2a2118;
  --muted: #b49976;
  --border: #c4aa88;
  --border-strong: #9a7b52;
  --button-top: #f6ead8;
  --button-bottom: #dcc1a1;
  --button-shadow: rgba(70, 44, 20, 0.22);
  --shadow: 0 18px 40px rgba(76, 52, 28, 0.22);
  --radius: 18px;
  --fouc-opacity: 0;
}

* {
  box-sizing: border-box;
}

html {
  background: url("./dark-brown.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Plantin", Georgia, "Times New Roman", serif;
  color: var(--text);
  user-select: none;
}

body {
  padding: 32px 20px 20px 20px;
  overflow-x: hidden;
  overflow-y: auto;
}

.fouc {
  opacity: var(--fouc-opacity);
  transition: opacity 750ms ease;
}

#bg-deco-rectangle {
  z-index: 1;

  user-select: none;
  position: relative;
  /* filter: drop-shadow(rgba(0, 0, 0, 0.5) -10px 10px 6px); */
  border-color: #ffeba369 #ffeba369 #00000065 #00000065;
  border-style: solid;
  border-width: 5px;

  display: block;
  padding: 9px;
  height: 100%;
  width: 100%;
  background:
    radial-gradient(
      circle at 80% 20%,
      #ecd40032 0%,
      #ecd4001a 25%,
      #00000000 100%
    ),
    url("./medium-brown.jpg");
  background-size: cover;
  background-position: center;

  box-shadow:
    0 0 0 3px #000000,
    0 0 0 7px #6b4e94,
    0 0 0 8px #00000080,
    -10px 10px 6px rgba(0, 0, 0, 0.5);
}

.bg-inner-1 {
  position: relative;
  user-select: none;
  display: block;
  height: 100%;

  border-color: #00000065 #00000065 #ffeba369 #ffeba369;
  border-style: solid;
  border-width: 2px;
}
.bg-inner-2 {
  position: relative;
  text-align: center;
  user-select: none;
  display: block;
  height: 100%;

  border-color: #ffeba369 #ffeba369 #00000065 #00000065;
  border-style: solid;
  border-width: 2px;
  padding: 9px;
}

#bg-deco-rectangle,
.bg-inner-1,
.bg-inner-2 {
  transform-style: preserve-3d;
}
.bg-deco-oval {
  transform: translateZ(6px);
}

.bg-orange-ball {
  transform: translateZ(3px);
}

.eyebrow {
  transform: translateZ(10px);
}

.text-wrap {
  transform: translateZ(10px);
}

#status {
  transform: translateZ(7px);
}

.tagline {
  transform: translateZ(25px);
  transform-origin: top left;
  transition: transform 500ms ease;
}

.bg-orange-ball {
  border-radius: 50%;
  position: absolute;
  width: 16px;
  height: 16px;

  border-radius: 50%;
  background:
    /* BRIGHT SPOT */
    radial-gradient(
      circle at 70% 30%,
      #f13729 0%,
      #e62712 10%,
      #fff6f500 15%,
      #fff6f500 100%
    ),
    /* CENTER ORANGE BALL */
    radial-gradient(
        circle at 55% 45%,
        #e62712 0%,
        #d2210e 41%,
        #d03a1400 67%,
        #d03a1400 100%
      ),
    /* TOP RIGHT HIGHLIGHT */
    radial-gradient(
        circle at 100% 0%,
        #fff6f5 0%,
        #fff6f5 20%,
        #fff6f500 45%,
        #fff6f500 100%
      ),
    radial-gradient(
      circle at 100% 0%,
      #ff8c7a 0%,
      #ff8c7a 15%,
      #ff957a00 67%,
      #ff957a00 100%
    ),
    /* FOR BOTTOM LEFT SHADOW */
    radial-gradient(
        circle at 57% 43%,
        #51160d 0%,
        #641d12 61%,
        #51160d00 70%,
        #51160d00 100%
      ),
    /* BACKGROUND */
    radial-gradient(circle at 50% 50%, #894438 0%, #894438 100%);
}

.top-left-corner {
  top: 3px;
  left: 3px;
}
.top-right-corner {
  top: 3px;
  right: 3px;
}
.bottom-left-corner {
  bottom: 3px;
  left: 3px;
}
.bottom-right-corner {
  bottom: 3px;
  right: 3px;
}

.bg-deco-oval {
  /* border: 2px solid #6b4e94; */
  position: absolute;
  top: 9px;
  left: 9px;
  bottom: 9px;
  right: 9px;

  display: block;
  border-radius: 50%;

  background: url("./light-brown.jpg");
  background-size: cover;
  background-position: center;

  box-shadow:
    0 0 0 3px #6b4e94,
    0 0 0 5px #000000;
}

.text-wrap {
  user-select: none;
  position: relative;
  display: inline-block;
  font-size: 8rem;
  font-weight: bold;
  margin-top: -14px;
}

/* textured top text */
.text-wrap > span {
  user-select: none;
  position: relative;
  z-index: 3;
  padding-left: 2px;

  background-image: url("./blue-marble.jpg");
  background-repeat: repeat;
  background-size: 300px 300px;

  background-clip: text;
  -webkit-background-clip: text;

  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* first outline */
.text-wrap::before {
  user-select: none;
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 2;
  padding-left: 2px;

  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 6px #e62712;
}

/* outer outline */
.text-wrap::after {
  user-select: none;
  content: attr(data-text);
  position: absolute;
  inset: 0;
  z-index: 1;
  padding-left: 2px;

  color: transparent;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 10px #000;
}

.eyebrow {
  user-select: none;
  position: relative;
  text-align: left;
  padding-left: 25%;
  font-family: "BelweStd-Bold", "Plantin", Georgia, serif;
  font-size: 2.5rem;
  margin: 0;

  color: transparent;
  -webkit-text-fill-color: transparent;

  /* 1. Bottom Layer: Only handles the thick outline */
  -webkit-text-stroke: 4px #000;
}

.eyebrow::after {
  content: attr(data-text);
  user-select: none;
  padding-left: 25%;

  /* 3. Top Layer: Perfectly aligned over the bottom layer */
  position: absolute;
  left: 0;
  top: 0;

  /* 4. Fill Color: Paints over the interior stroke overlap */
  background: linear-gradient(
    to top,
    #40bdeb 0%,
    #40bdeb 40%,
    #e5f5f4 75%,
    #f4eee3 100%
  );
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-stroke: 0; /* Clears the stroke on the top layer */
}

.tagline {
  user-select: none;
  display: inline-block;
  border-color: #ffeba369 #ffeba369 #00000065 #00000065;
  border-style: solid;
  border-width: 5px;
  box-shadow: 0 0 0 2px #000000;
  color: #000;
  position: relative;
  margin: 0 0 12px 0;
  font-size: 2rem;
  background:
    radial-gradient(
      circle at 80% 20%,
      #ecd40032 0%,
      #ecd4001a 75%,
      #00000000 100%
    ),
    url("./fu-300dpi.jpg");
  background-size: 110%;
  background-position: 10%;
}

.tagline-inner {
  user-select: none;
  padding: 0 5px 0 5px;
  border: 1px solid #000;
  line-height: 0.8;
  padding-top: 5px;
}

/* Fixed layer stack of frame backgrounds, cross-fades between the 8 frame jpgs behind the app. */
.frame-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.frame-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1200ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.frame-bg.active {
  opacity: 1;
}

.frame-bg[data-frame-index="0"] {
  background-image: url("./fl-300dpi.jpg");
}
.frame-bg[data-frame-index="1"] {
  background-image: url("./fa-300dpi.jpg");
}
.frame-bg[data-frame-index="2"] {
  background-image: url("./fw-300dpi.jpg");
}
.frame-bg[data-frame-index="3"] {
  background-image: url("./fu-300dpi.jpg");
}
.frame-bg[data-frame-index="4"] {
  background-image: url("./fb-300dpi.jpg");
}
.frame-bg[data-frame-index="5"] {
  background-image: url("./fr-300dpi.jpg");
}
.frame-bg[data-frame-index="6"] {
  background-image: url("./fg-300dpi.jpg");
}
.frame-bg[data-frame-index="7"] {
  background-image: url("./fz-300dpi.jpg");
}

/* Color wash on top of the active frame image, driven by the same vars as the panel highlights. */
.frame-bg-tint {
  position: absolute;
  inset: 0;
  background-color: var(--page-background-color, transparent);
  -webkit-mask-image: linear-gradient(to bottom, black 50%, transparent);
  mask-image: linear-gradient(to bottom, black 33%, transparent);
  transition: background-color 300ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

h1,
h2,
.medieval {
  font-family: "Medieval", "Plantin", Georgia, serif;
  line-height: 1;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

h2 {
  margin-bottom: 14px;
}

.belwe {
  font-family: "BelweStd-Bold", "Plantin", Georgia, serif !important;
}

.carolingia {
  font-family: "Carolingia", "Plantin", Georgia, serif !important;
}

.symbol {
  font-family: "Symbols", Courier, "Courier New", monospace !important;
}

.exp-front {
  font-family: "ExpFront", Courier, "Courier New", monospace !important;
}
.exp-back {
  font-family: "ExpBack", Courier, "Courier New", monospace !important;
}

.text-center {
  text-align: center;
}

.p-0 {
  padding: 0 !important;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-10 {
  margin-bottom: 10px;
}
.mb-20 {
  margin-bottom: 20px;
}

.mt-6 {
  margin-top: 6px;
}

.mr-6 {
  margin-right: 6px;
}

.overflow-x-hidden {
  overflow-x: hidden;
}

.app {
  perspective: 800px;
  perspective-origin: center top;
  width: min(900px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 20px;
}

.panel {
  border: 1px solid var(--page-background-color, var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background-color: var(--page-background-tb-color, var(--panel));
  transition: background-color 800ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
  padding: 20px;
  padding-right: 18px;
  position: relative;
}

/* Sits behind the panel's semi-transparent background-color (the panel must not create its own stacking context) */
.panel::before {
  content: "";
  border: 1px solid var(--page-background-color, var(--border));
  position: absolute;
  inset: 0px;
  z-index: -1;
  border-radius: inherit;
  background-image: url("./folio.jpg");
  background-size: cover;
  background-position: center;
  pointer-events: none;
}

.app-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 1px 0 4px;
  font-size: 1.5rem;
}

.app-footer a {
  color: #ddd;
  opacity: 0.68;
  text-decoration: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.app-footer a:hover {
  opacity: 1;
  transform: translateY(-2px);
}

.app-footer a:focus-visible {
  border-radius: 2px;
  outline: 2px solid currentColor;
  outline-offset: 4px;
  opacity: 1;
}

.user-instructions {
  margin-bottom: 10px;
  color: var(--page-background-color, #8e785d);
  font-size: 0.95rem;
  text-align: center;
  font-style: italic;
}

.acknowledgement {
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
  margin-bottom: 5px;
}

.acknowledgement a {
  color: #8e735a;
  text-decoration: none;
}
.acknowledgement a:hover {
  text-decoration: underline;
}

#deck-panel-help {
  padding-left: 20px;
  padding-right: 20px;
}

.help-title {
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 12px;
}

#status {
  user-select: none;
  position: relative;
  font-weight: 700;
  margin-bottom: 12px;
  margin-top: 12px;
}

button {
  position: relative;
  padding: 11px 18px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(180deg, var(--button-top), var(--button-bottom));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    0 4px 10px var(--button-shadow);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition:
    scale 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease,
    border-color 120ms ease,
    background-color 120ms ease;
}

button::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(123, 89, 51, 0.24);
  border-radius: inherit;
  pointer-events: none;
}

button:hover {
  border-color: #7e5f3c;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 7px 16px rgba(70, 44, 20, 0.28);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 2px 4px rgba(70, 44, 20, 0.18),
    0 2px 6px rgba(70, 44, 20, 0.18);
}

button:focus-visible {
  outline: none;
  border-color: #7b5b37;
  box-shadow:
    0 0 0 3px rgba(154, 123, 82, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 6px 14px rgba(70, 44, 20, 0.24);
}

select:disabled,
button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#border-toggle {
  padding-left: 3px;
  padding-right: 0px;
  width: 52px;
  text-align: center;
}

.deck-nav {
  display: flex;
  flex-direction: row-reverse;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--page-background-color, var(--border));
}

#deck-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0px;
  margin-bottom: -1px;
  margin-right: auto;
}

.deck-tab {
  position: relative;
  top: 1px;
  padding: 8px 18px;
  border: 2px solid var(--page-background-color, var(--border));
  border-radius: 10px 10px 0 0;
  border-bottom: none;
  background: rgb(209 209 209 / 5%);
  color: var(--page-background-color, var(--muted));
  transition: color 1000ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
  box-shadow: none;
  margin-left: 9px;
  font-family: "Medieval", "Plantin", Georgia, serif;
  font-size: 1.5em;
  line-height: 0.9;
}
.single-char-tab {
  padding: 4px 6px;
  font-size: 1.2em;
  min-width: 34px;
}

#deck-tabs.disabled {
  cursor: not-allowed;
}

#deck-tabs.disabled .deck-tab {
  pointer-events: none;
  /* opacity: 0.6; */
}

.deck-tab::before {
  content: none;
}

.deck-tab:hover {
  border-color: var(--page-background-color, var(--border));
  color: var(--text);
  background: rgba(207, 184, 154, 0.5);
  box-shadow: none;
  transform: none;
}

.deck-tab:active {
  box-shadow: none;
  transform: none;
}

.deck-tab.active {
  color: var(--text);
  opacity: 1;

  border-bottom-width: 1px;
  border-bottom-style: solid;
  border-bottom-color: var(--page-background-tb-color, var(--panel-highlight));
  background-color: var(--page-background-tb-color, var(--panel-highlight));

  transition:
    background-color 600ms cubic-bezier(0.445, 0.05, 0.55, 0.95),
    border-bottom-color 400ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
}

.deck-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding-bottom: 10px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -10px;
}

.row > .col {
  flex: 1 1 0;
  padding: 0 10px;
}

.row > .col:first-child {
  flex: 0 0 auto;
}

.row > .col:last-child {
  flex: 1 1 0;
}

@media (max-width: 520px) {
  #deck-panel-constructed .row > .col {
    flex: 0 0 100%;
  }
}

.col button {
  margin-bottom: 9px;
}

.pack-image {
  padding: 0;
  background: unset;
  border: none;
  box-shadow: none;
  margin-right: -1px !important;
}
.pack-image:first-child {
  margin-right: 6px !important;
}
.pack-image:before {
  content: none;
}
.pack-image:hover {
  box-shadow: none;
  transform: translateY(3px) scale(1.75);
  z-index: 10;
}
.pack-image:active {
  box-shadow: none;
  transform: translateY(3px) scale(2);
  z-index: 10;
}

.pack-image img {
  filter: drop-shadow(-2px 4px 4px rgba(0, 0, 0, 0.5));
}

.edition-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
  margin-top: 4px;
  margin-bottom: 8px;
}

.edition-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.85rem;
  color: var(--page-background-color, var(--muted));
  transition: color 1000ms cubic-bezier(0.445, 0.05, 0.55, 0.95);
  cursor: pointer;
  min-width: 79px;
  -webkit-user-select: none;
  user-select: none;
}

.edition-checkbox .exp-front {
  font-size: 2.8rem;
  color: var(--text);
  line-height: 0.5;
}

input[type="checkbox"] {
  accent-color: #8c6d54;
  cursor: pointer;
}

.app-preferences {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 12px;
}

.app-preference {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.edition-checkboxes-toggle {
  padding: 4px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  margin-right: 8px;
}

#card-preview {
  display: block;
  width: 575px;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--page-background-color, var(--border));
  border-radius: 16px;
}

#card-lookup {
  width: min(408px, 100%);
  padding: 12px 14px;
  margin-right: 10px;
  border: 1px solid var(--page-background-color, var(--border));
  border-radius: 12px;
  background: #fbf6ef;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(76, 52, 28, 0.08);
  outline: none;
}

#card-lookup::placeholder {
  color: var(--page-background-color, var(--muted));
}

#card-lookup:focus {
  border-color: #9a7b52;
  box-shadow:
    0 0 0 3px rgba(154, 123, 82, 0.18),
    inset 0 1px 2px rgba(76, 52, 28, 0.08);
  background: #fffaf3;
}

textarea,
select {
  border: 1px solid var(--page-background-color, var(--border));
  border-radius: 6px;
  background: #fbf6ef;
  color: var(--text);
  font: inherit;
  box-shadow: inset 0 1px 2px rgba(76, 52, 28, 0.08);
  outline: none;
}

textarea {
  min-width: 225px;
  min-height: 75px;
  padding: 12px 14px;
  resize: both;
}

textarea::placeholder {
  color: var(--muted);
}

textarea:focus,
select:focus {
  border-color: #9a7b52;
  box-shadow:
    0 0 0 3px rgba(154, 123, 82, 0.18),
    inset 0 1px 2px rgba(76, 52, 28, 0.08);
  background: #fffaf3;
}

select {
  padding: 10px 12px 10px 14px;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--border-strong) 50%),
    linear-gradient(135deg, var(--border-strong) 50%, transparent 50%);
  background-position:
    calc(100% - 12px) center,
    calc(100% - 7px) center;
  background-size:
    5px 5px,
    5px 5px;
  background-repeat: no-repeat;
}

