/* Omikuji — the slip, and the box's focus ring. */

#canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -4px;
  border-radius: 4px;
}

/*
 * A real omikuji is a narrow strip of newsprint-ish paper, printed in one
 * colour, with the grade huge at the top and the readings listed underneath.
 * Copying that shape is most of what makes this feel like a fortune rather
 * than a results screen, so the slip is deliberately tall, narrow and plain.
 */
.slip {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -46%) scale(.97);
  width: min(82vw, 20rem);
  max-height: 84%;
  overflow-y: auto;
  padding: 1.1rem 1.2rem 1.3rem;
  background:
    repeating-linear-gradient(0deg, rgba(0,0,0,.012) 0 2px, transparent 2px 4px),
    linear-gradient(#fdfaf2, #f2ead7);
  color: #1b1712;
  border-radius: 2px;
  box-shadow: 0 22px 50px rgba(0,0,0,.65);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
  z-index: 4;
}
.slip[hidden] { display: none; }
.slip[data-show="true"] { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Tying a bad fortune to the rack and walking away is what you are supposed
   to do with it, so the slip folds away rather than merely closing. */
.slip[data-tied="true"] {
  opacity: 0;
  transform: translate(-50%, -50%) scale(.4) rotate(-8deg);
}

.slip-head {
  text-align: center;
  border-bottom: 1px solid rgba(43,35,26,.25);
  padding-bottom: .6rem;
}
.slip-grade {
  margin: 0;
  font-family: var(--font-jp);
  font-size: 3rem;
  line-height: 1;
  font-weight: 700;
  letter-spacing: .1em;
}
.slip[data-tier="great"] .slip-grade { color: #a8791a; }
.slip[data-tier="good"]  .slip-grade { color: var(--matcha-dark); }
.slip[data-tier="mild"]  .slip-grade { color: #4a5a6b; }
.slip[data-tier="bad"]   .slip-grade { color: var(--red-dark); }

.slip-romaji {
  margin: .35rem 0 0;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #6b5d47;
}
.slip-lede {
  margin: .85rem 0 0;
  font-size: .9375rem;
  line-height: 1.55;
  text-align: center;
  color: #241d16;
}
.slip-lines { margin: .9rem 0 0; }
.slip-lines div {
  display: flex;
  gap: .7rem;
  padding: .4rem 0;
  border-top: 1px dotted rgba(43,35,26,.22);
  font-size: .875rem;
  line-height: 1.45;
}
.slip-lines dt {
  flex: none;
  width: 5.2rem;
  font-weight: 700;
  color: #6b5d47;
}
.slip-lines dd { margin: 0; color: #2a231a; }

/* Buttons on the slip are on paper, not on the dark shell. */
.slip .jg-btn {
  border-color: rgba(43,35,26,.35);
  color: #1b1712;
}
.slip .jg-btn:hover { border-color: rgba(43,35,26,.7); background: rgba(43,35,26,.06); }

@media (prefers-reduced-motion: reduce) {
  .slip { transition: opacity var(--dur-fast) linear; }
  .slip[data-tied="true"] { transform: translate(-50%, -50%) scale(1); }
}
