* { box-sizing: border-box; margin: 0; padding: 0; }

  :root {
    --navy:        #2b3866;
    --navy-deep:   #1c2750;
    --navy-soft:   #3d4d80;
    --gold:        #b8902c;
    --gold-deep:   #8a6918;
    --gold-light:  #d6a838;
    --ink:         #1f2952;
    --ink-soft:    #404e88;
    --small-italic-font: 'Lora', Georgia, serif;
    --r: 3px;

    /* Day palette tones. Moonlight never changes these, so each theme's
       daylight palette (css/theme-styles.css) can recolour them without
       touching moonlight. */
    --tone-gold-rgb: 184, 144, 44;
    --tone-gold-light-rgb: 214, 168, 56;
    --tone-gold-deep-rgb: 138, 105, 24;
    --tone-paper-rgb: 255, 253, 245;
    --tone-navy-rgb: 43, 56, 102;
    --tone-navy-deep-rgb: 28, 39, 80;
    --tone-ink-soft-rgb: 64, 78, 136;
    --tone-navy: #2b3866;
    --tone-navy-deep: #1c2750;
    --tone-ink: #1f2952;
    --tone-ink-soft: #404e88;
    --tone-gold: #b8902c;
    --tone-gold-deep: #8a6918;
    --tone-parchment: #ede1c0;
    --tone-parchment-image: url('../assets/parchment-seamless.png');
    --tone-page-bg: linear-gradient(#5a4424 0%, #6e5530 50%, #8a6a40 100%);
  }

  html, body {
    background: var(--tone-page-bg);
    min-height: 100vh;
    font-family: 'IM Fell English', Georgia, serif;
    color: var(--ink);
    padding: 24px 12px;
  }
.start-page,
.sheet-toolbar {
  max-width: 1000px;
  margin: 0 auto 16px auto;
  background: var(--tone-parchment);
  border: 2px solid var(--gold);
  padding: 16px;
  color: var(--ink);
}

.sheet-toolbar form {
  margin: 0;
}

.sheet-version-preview {
  font-size: 0.82rem;
  font-weight: 700;
}

.character-detail-error {
  max-width: 1000px;
  margin: 0 auto 16px;
  padding: 12px 16px;
  border: 2px solid #9f3027;
  background: #f5d9cf;
  color: #671c17;
  font-weight: 700;
}

.start-page h1 {
  font-family: 'Cinzel Decorative', serif;
  margin-bottom: 16px;
  color: var(--navy-deep);
}

.character-card {
  border: 1px solid var(--gold);
  padding: 12px;
  margin: 10px 0;
  cursor: pointer;
  background: rgba(255,255,255,.35);
}

.character-card:hover {
  background: rgba(255,255,255,.6);
}

.character-card strong {
  font-size: 1.2rem;
}

.sheet-toolbar {
  display: none;
  align-items: center;
  gap: 8px;
}

.sheet-toolbar button,
.start-page button {
  padding: 8px 12px;
  border: 1px solid var(--gold-deep);
  background: var(--navy);
  color: white;
  cursor: pointer;
  font-family: 'Cinzel', serif;
}

.sheet-toolbar button.sheet-delete-button,
.sheet-toolbar button.sheet-copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  padding: 7px;
}

.sheet-toolbar button.sheet-copy-button {
  margin-left: auto;
}

.sheet-delete-button svg,
.sheet-copy-button svg {
  width: 20px;
  height: 20px;
}
  /* SHEET — seamless parchment background repeated vertically */
  .sheet {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background-color: var(--tone-parchment);
    background-image: var(--tone-parchment-image);
background-size: 100% auto;
background-repeat: repeat-y;
background-position: top center;
    box-shadow: 0 8px 40px rgba(0,0,0,.5), 0 2px 10px rgba(0,0,0,.3);
    padding: 230px 90px 90px;
  }

  /* TITLE BANNER — separate image */
  .title-banner {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: auto;
    z-index: 5;
    pointer-events: none;
    user-select: none;
  }

  /* CORNER ORNAMENTS — corner.png is natively top-right */
  .corner {
    position: absolute;
    width: 230px;
    height: 230px;
    background-image: url('../assets/corner.png');
    background-size: contain;
    background-repeat: no-repeat;
    pointer-events: none;
    z-index: 4;
  }
  .corner.tr { top: 0;     right: 0;   background-position: top right; }
  .corner.tl { top: 0;     left: 0;    transform: scaleX(-1);  background-position: top right; }
  .corner.br { bottom: 0;  right: 0;   transform: scaleY(-1);  background-position: top right; }
  .corner.bl { bottom: 0;  left: 0;    transform: scale(-1,-1); background-position: top right; }

  /* COMPASS WATERMARK */
  .compass-watermark {
    position: absolute;
    top: 38%;
    left: 50%;
    width: 460px;
    height: 480px;
    transform: translate(-50%, -50%);
    background-image: url('../assets/compass.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: .35;
    pointer-events: none;
    z-index: 1;
    mix-blend-mode: multiply;
  }

  /* SHIP */
  .ship-art {
    position: absolute;
    bottom: 125px;
    right: 90px;
    width: 320px;
    height: 260px;
    background-image: url('../assets/ship.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: bottom right;
    opacity: .85;
    pointer-events: none;
    z-index: 2;
  }

  .content { position: relative; z-index: 3; }

  /* TABS */
  .tabs {
    display: flex;
    justify-content: center;
    gap: 28px;
    border-bottom: 1.5px solid var(--gold);
    padding: 0 0 6px;
    margin-bottom: 24px;
  }
  .tab {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--ink-soft);
    background: transparent;
    border: none;
    padding: 6px 14px;
    cursor: pointer;
    text-transform: uppercase;
    border-bottom: 2px solid transparent;
    margin-bottom: -7.5px;
    transition: all .2s;
    font-weight: 500;
  }
  .tab:hover { color: var(--ink); }
  .tab.on {
    color: var(--navy-deep);
    border-bottom-color: var(--gold);
    font-weight: 700;
  }

  .pg { display: none; }
  .pg.on { display: block; }
