/* Pact Wallet · paper cream first · rosewood ink · seal gold */
:root {
  --paper: #F4ECDF;
  --rosewood: #3A2418;
  --seal: #C9A227;
  --night: #1C1612;
  --blot: #9B2D22;
  --linen: #E8DCC8;
  --faint: #6B5344;
  --edge: #C4B29A;
  --lift: #FFF8EE;
  --title: 22px;
  --body: 18px;
}

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

html,
body,
.wallet {
  overflow: hidden;
  height: 100%;
  max-height: 100dvh;
}

html,
body {
  background: var(--paper);
  color: var(--rosewood);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans", "Noto Sans Devanagari", sans-serif;
  font-size: var(--body);
  font-weight: 500;
  line-height: 1.3;
}

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

button,
a {
  font: inherit;
  font-weight: 500;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.wallet {
  position: relative;
  width: min(375px, 100%);
  display: flex;
  flex-direction: column;
  background:
    repeating-linear-gradient(
      180deg,
      transparent,
      transparent 3px,
      rgba(58, 36, 24, 0.018) 3px,
      rgba(58, 36, 24, 0.018) 4px
    ),
    var(--paper);
}

.notice {
  flex: 0 0 auto;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--rosewood);
  background: var(--paper);
  border-bottom: 2px solid var(--rosewood);
}

.mast {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 6px;
}

.mark {
  position: relative;
  flex: 0 0 22px;
  width: 22px;
  height: 28px;
  border: 1.5px solid var(--rosewood);
  background: var(--lift);
  border-radius: 2px 3px 2px 2px;
}

.mark .wax,
.slip .wax {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seal);
}

.mark .wax {
  position: absolute;
  top: 5px;
  right: 4px;
}

.word {
  font-family: Palatino, "Palatino Linotype", Georgia, "Iowan Old Style", serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--rosewood);
}

.faces {
  font-size: 14px;
  font-weight: 500;
  color: var(--faint);
}

.folio {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 4px 16px 0;
  overflow: hidden;
}

.deck {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.slip {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 10px 28px;
  background: var(--lift);
  border: 1px solid var(--edge);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(58, 36, 24, 0.06);
}

.slip .wax {
  position: absolute;
  top: 14px;
  left: 10px;
}

.slip-name,
.sheet-head {
  font-family: Palatino, "Palatino Linotype", Georgia, "Iowan Old Style", serif;
  font-size: var(--title);
  font-weight: 600;
  color: var(--rosewood);
}

.slip-face {
  font-size: 15px;
  font-weight: 600;
  color: var(--seal);
}

.slip-line {
  font-size: var(--body);
  font-weight: 500;
  color: var(--rosewood);
}

.softrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px 0;
}

.murmur,
.roster-open,
.soft-close,
.ping {
  font-size: 15px;
  font-weight: 500;
  color: var(--faint);
  min-height: 40px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.murmur {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.speck {
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--seal);
  border-radius: 50%;
  background: var(--paper);
}

.colophon {
  flex: 0 0 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--faint);
}

.sheet,
.roster,
.breath {
  position: absolute;
  left: 0;
  right: 0;
  overflow: hidden;
  background: var(--paper);
}

.sheet,
.roster {
  top: 40px;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 12px;
  gap: 6px;
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.sheet.is-open,
.roster.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.sheet[hidden],
.roster[hidden],
.breath[hidden],
.veil[hidden] {
  display: none;
}

.sheet-verse {
  font-size: var(--body);
  font-weight: 500;
}

.circle {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 0;
}

.named {
  padding: 6px 8px;
  border-left: 2px solid var(--edge);
}

.named.is-focus {
  border-left-color: var(--seal);
  background: var(--linen);
}

.named strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.named span {
  display: block;
  font-size: 15px;
  font-weight: 500;
}

.deeds {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.alarm {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 58px;
  border-radius: 6px;
  background: var(--blot);
  color: var(--paper);
  font-size: var(--body);
  font-weight: 600;
  text-decoration: none;
  text-align: center;
}

.hush-pair {
  display: flex;
  gap: 8px;
}

.hush {
  flex: 1;
  min-height: 52px;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--linen);
  font-size: 16px;
  font-weight: 500;
  text-align: center;
}

.ping-echo {
  font-size: 15px;
  font-weight: 500;
  color: var(--faint);
}

.breath {
  top: 38%;
  left: 28px;
  right: 28px;
  bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 14px 10px;
  border: 1px solid var(--seal);
  border-radius: 4px;
  background: var(--lift);
  box-shadow: 0 8px 24px rgba(28, 22, 18, 0.12);
  opacity: 0;
  transform: scale(0.97);
  pointer-events: none;
}

.breath.is-open {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.breath-en,
.breath-hi,
.veil-en,
.veil-hi {
  font-size: var(--body);
  font-weight: 500;
  text-align: center;
}

.veil {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--night);
  overflow: hidden;
}

.veil-pane {
  width: min(320px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  color: var(--paper);
}

.veil .hush {
  width: 100%;
  background: transparent;
  border-color: var(--edge);
  color: var(--paper);
}

.wallet.is-deep .folio,
.wallet.is-deep .mast,
.wallet.is-deep .colophon {
  visibility: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .sheet,
  .roster,
  .breath,
  .sheet.is-open,
  .roster.is-open,
  .breath.is-open {
    transition: none;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .sheet.is-open,
  .roster.is-open,
  .breath.is-open {
    transition: opacity 200ms ease, transform 200ms ease;
  }
}
