﻿body {
  font-family: 'MedievalSharp', Georgia, serif;
  margin: 0;
  padding: 24px 20px;
  background:
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 98%,
      rgba(201, 162, 39, 0.03) 98%,
      rgba(201, 162, 39, 0.03) 100%
    ),
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 98%,
      rgba(139, 0, 0, 0.02) 98%,
      rgba(139, 0, 0, 0.02) 100%
    ),
    linear-gradient(135deg, rgba(139, 0, 0, 0.02) 0%, transparent 50%),
    linear-gradient(225deg, rgba(201, 162, 39, 0.04) 0%, transparent 50%),
    var(--parchment);
  background-size: 60px 60px, 60px 60px, 100% 100%, 100% 100%, 100% 100%;
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  position: relative;
}
*, *::before, *::after {
  box-sizing: border-box;
}
h1, h2 {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 600;
  color: var(--ink);
}
h3 {
  font-family: 'Uncial Antiqua', 'Cinzel', serif;
  font-weight: 600;
  color: var(--ink);
}
h1 {
  text-align: center;
  margin: 0 0 28px;
  font-size: 2.2rem;
  letter-spacing: 0.08em;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.08);
  border-bottom: none;
  padding-bottom: 16px;
  position: relative;
  font-weight: 700;
}
h1::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 15%;
  right: 15%;
  height: 0;
  border-top: 2px solid var(--gold-dark);
  border-bottom: 1px solid var(--gold);
  padding-top: 3px;
}
h2 {
  font-size: 1.3rem;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule-heavy);
  display: flex;
  align-items: center;
  gap: 0;
  letter-spacing: 0.06em;
  font-weight: 700;
  position: relative;
}
h2::before {
  content: none;
}
#pools {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--rule-heavy);
  border-radius: 0;
  padding: 16px 8px 20px;
  margin-bottom: 16px;
  box-shadow: none;
}
#pools label {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.04em;
  position: relative;
}
#pools .pool-input {
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--gold-dark);
  border-radius: 0;
  color: var(--accent);
  font-family: 'UnifrakturMaguntia', 'MedievalSharp', 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.8rem;
  padding: 4px 8px;
}
#pools .pool-input:focus {
  outline: none;
  border-bottom-color: var(--gold);
  box-shadow: none;
  background: rgba(201, 162, 39, 0.06);
}
  #statSpent, #statRemaining,
  #skillSpent, #skillRemaining {
    color: #8a7565;
    font-family: 'MedievalSharp', serif;
    font-style: italic;
    font-weight: 400;
  }

  @keyframes pool-anger {
    0% {
      text-shadow:
        0 0 10px rgba(255, 92, 92, 0.9),
        0 0 25px rgba(255, 64, 64, 0.7);
    }
    50% {
      text-shadow:
        0 0 18px rgba(255, 92, 92, 1),
        0 0 32px rgba(255, 46, 46, 0.85);
    }
    100% {
      text-shadow:
        0 0 10px rgba(255, 92, 92, 0.9),
        0 0 25px rgba(255, 64, 64, 0.7);
    }
  }

  .pool-overspend {
    color: var(--ui-danger);
    animation: pool-anger 1.5s ease-in-out infinite;
  }

  @media (prefers-reduced-motion: reduce) {
    .pool-overspend {
      animation: none;
      text-shadow: 0 0 6px rgba(255, 92, 92, 0.7);
    }
  }
#characterName {
  font-family: 'Eagle Lake', 'Uncial Antiqua', serif !important;
  font-size: 1.5rem !important;
  font-weight: 400 !important;
  text-align: center;
  letter-spacing: 0.02em;
  background: rgba(244, 228, 193, 0.35) !important;
  border: none !important;
  border-bottom: 2px solid var(--gold-dark) !important;
  border-radius: 4px 4px 0 0;
  padding: 10px 16px !important;
  min-width: 12ch;
}
#controls {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #2a1b0f;
  border-radius: 4px;
  border: 1px solid var(--rule-color);
}
.btn {
  position: relative;
  border: 1px solid var(--ui-border-strong);
  padding: 8px 14px;
  cursor: pointer;
  font-family: 'Uncial Antiqua', 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  background: transparent;
  color: var(--ui-accent);
  width: auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  white-space: nowrap;
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: none;
  box-shadow: none;
  border-radius: 4px;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  overflow: hidden;
}
.btn:not(.inline-btn):not(.transaction-btn):not(.btn-seal):not(.btn-seal-sm)::before {
  content: none;
  display: none;
}
.btn:hover {
  background: var(--ui-bg-alt);
  color: var(--ui-fg-strong);
  border-color: var(--ui-accent);
  transform: translateY(-1px);
  filter: none;
}
.btn:active {
  transform: translateY(0);
}
.btn-seal {
  --seal-w: 102px;
  --seal-h: 53px;
  border: none;
  padding: 0 8px 0 0;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  line-height: 1.15;
  background: none;
  background-color: transparent;
  min-height: var(--seal-h);
  justify-content: flex-start;
  gap: 0;
  text-align: left;
  white-space: nowrap;
  color: #f7db7f;
  -webkit-text-stroke: 5px rgba(0, 0, 0, 0.85);
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 rgba(183, 158, 89, 0.3),
    0 -1px 3px rgba(0, 0, 0, 0.7),
    0 0 8px rgba(212, 175, 55, 0.15),
    1px 2px 3px rgba(0, 0, 0, 0.5);
  border-radius: 0;
  overflow: visible;
}
.btn-seal::before {
  content: '';
  display: block;
  width: var(--seal-w);
  height: var(--seal-h);
  flex: 0 0 var(--seal-w);
  margin-right: -6px;
  background: url('character-wax%20button.svg') center / contain no-repeat;
  pointer-events: none;
}
.btn-seal:hover {
  background: none;
  color: #f7db7f;
  border-color: transparent;
  transform: translateY(-3px);
  filter: brightness(1.05);
}
.btn-seal:active {
  transform: translateY(1px) scale(0.98);
}
.btn-cracks {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--seal-w);
  height: var(--seal-h);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.btn-seal.shattered {
  transform: translateY(2px) scale(0.98) !important;
  filter: brightness(1) !important;
}
.btn-seal.shattered .btn-cracks {
  opacity: 1;
}
.btn-seal.healing {
  transform: translateY(2px) scale(0.98) !important;
  filter: brightness(1) !important;
}
#controls input[type="file"] {
  color: var(--ink);
  font-family: 'MedievalSharp', serif;
  font-size: 0.85rem;
}

/* Seal Button Refresh */
.btn {
  position: relative;
  border: 1px solid var(--ui-border-strong);
  padding: 8px 14px;
  cursor: pointer;
  font-family: 'Uncial Antiqua', 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  background: transparent;
  color: var(--ui-accent);
  width: auto;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  white-space: nowrap;
  -webkit-text-stroke: 0;
  paint-order: normal;
  text-shadow: none;
  box-shadow: none;
  border-radius: 4px;
  transition: transform 0.15s ease, filter 0.15s ease, border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  overflow: hidden;
}
.btn:not(.inline-btn):not(.transaction-btn):not(.btn-seal):not(.btn-seal-sm)::before {
  content: none;
  display: none;
}
.btn:hover {
  background: var(--ui-bg-alt);
  color: var(--ui-fg-strong);
  border-color: var(--ui-accent);
  transform: translateY(-1px);
  filter: none;
}
.btn:active {
  transform: translateY(0);
}
.btn-seal {
  --seal-w: 102px;
  --seal-h: 53px;
  border: none;
  padding: 0 8px 0 0;
  font-family: 'Cinzel', serif;
  font-size: 0.9rem;
  letter-spacing: 1px;
  line-height: 1.15;
  background: none;
  background-color: transparent;
  min-height: var(--seal-h);
  justify-content: flex-start;
  gap: 0;
  text-align: left;
  white-space: nowrap;
  color: #f7db7f;
  -webkit-text-stroke: 5px rgba(0, 0, 0, 0.85);
  paint-order: stroke fill;
  text-shadow:
    0 1px 0 rgba(183, 158, 89, 0.3),
    0 -1px 3px rgba(0, 0, 0, 0.7),
    0 0 8px rgba(212, 175, 55, 0.15),
    1px 2px 3px rgba(0, 0, 0, 0.5);
  border-radius: 0;
  overflow: visible;
}
.btn-seal::before {
  content: '';
  display: block;
  width: var(--seal-w);
  height: var(--seal-h);
  flex: 0 0 var(--seal-w);
  margin-right: -6px;
  background: url('character-wax%20button.svg') center / contain no-repeat;
  pointer-events: none;
}
.btn-seal:hover {
  background: none;
  color: #f7db7f;
  border-color: transparent;
  transform: translateY(-3px);
  filter: brightness(1.05);
}
.btn-seal:active {
  transform: translateY(1px) scale(0.98);
}
.btn-cracks {
  position: absolute;
  top: 0;
  left: 0;
  width: var(--seal-w);
  height: var(--seal-h);
  opacity: 0;
  pointer-events: none;
  z-index: 2;
}
.btn-seal.shattered {
  transform: translateY(2px) scale(0.98) !important;
  filter: brightness(1) !important;
}
.btn-seal.shattered .btn-cracks {
  opacity: 1;
}
.btn-seal.healing {
  transform: translateY(2px) scale(0.98) !important;
  filter: brightness(1) !important;
}
