/* Shared look for every Eight Saints game */
:root { --felt: #1f6b3a; --felt-dark: #17532d; --ink: #111; --red: #c4141c; --gold: #f0c674; --card: #fffdf7; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--felt); color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  touch-action: manipulation; -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden;
}
header { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--felt-dark); flex: 0 0 auto; }
header h1 { font-size: 19px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
header a.home { color: #fff; text-decoration: none; font-size: 26px; line-height: 1; padding: 4px 6px 4px 0; }
button {
  white-space: nowrap; font: inherit; font-size: 17px; font-weight: 600;
  min-height: 46px; padding: 0 13px; border-radius: 12px;
  border: 2px solid #fff; background: #fff; color: var(--felt-dark); cursor: pointer;
}
button.ghost { background: transparent; color: #fff; }
button.on { background: var(--gold); border-color: var(--gold); color: var(--felt-dark); }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.opts { display: flex; gap: 6px; justify-content: center; align-items: center; padding: 6px 8px; flex-wrap: wrap; flex: 0 0 auto; }
.opts button { min-height: 40px; font-size: 15px; padding: 0 11px; }
.opts .lbl { font-size: 15px; opacity: .9; }
.timer { font-size: 20px; font-variant-numeric: tabular-nums; min-width: 52px; text-align: center; }
#status { text-align: center; font-size: 19px; font-weight: 700; min-height: 26px; padding: 0 8px; flex: 0 0 auto; }
main { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
#board { position: relative; margin: 0 auto; }

/* Cards */
.slot, .card { position: absolute; border-radius: 7px; }
.slot { border: 2px dashed rgba(255,255,255,.45); display: grid; place-items: center; color: rgba(255,255,255,.55); }
.card { background: var(--card); color: var(--ink); border: 1px solid #555; box-shadow: 0 1px 2px rgba(0,0,0,.35); overflow: hidden; cursor: pointer; }
.card.red { color: var(--red); }
.card .corner { position: absolute; left: 5%; top: 3%; line-height: 1; font-weight: 800; white-space: nowrap; letter-spacing: -1px; }
.card .pip { position: absolute; left: 0; right: 0; bottom: 6%; text-align: center; line-height: 1; }
.card.down { background: repeating-linear-gradient(45deg, #2b4f8f 0 6px, #24447c 6px 12px); border: 2px solid #fff; }
.card.down.alt { background: repeating-linear-gradient(45deg, #9b2226 0 6px, #7f1b1f 6px 12px); }
.card.sel { outline: 4px solid var(--gold); outline-offset: -2px; transform: translateY(-6px); }
.card.dim { filter: brightness(.75); }
.shake { animation: es-shake .28s; }
@keyframes es-shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.lbl-abs { position: absolute; font-size: 15px; font-weight: 700; }
.badge { position: absolute; background: var(--gold); color: #222; font-weight: 800; border-radius: 10px; padding: 1px 7px; font-size: 14px; }

/* Dialogs: win screens and How to play */
.es-over { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; z-index: 5; padding: 12px; }
.es-over .box { background: #fff; color: #222; border-radius: 18px; padding: 22px 20px; max-width: 420px; width: 100%; max-height: 90vh; overflow: auto; text-align: center; }
.es-over h2 { font-size: 26px; margin: 0 0 10px; }
.es-over p { font-size: 18px; margin: 0 0 14px; }
.es-over .rules { text-align: left; font-size: 17px; line-height: 1.45; }
.es-over .rules ul, .es-over .rules ol { padding-left: 22px; margin: 6px 0 12px; }
.es-over .rules li { margin: 4px 0; }
.es-over button { background: var(--felt-dark); color: #fff; border-color: var(--felt-dark); width: 100%; margin-top: 8px; }
.es-over button.ghost { background: #fff; color: var(--felt-dark); }
canvas.es-confetti { position: fixed; inset: 0; pointer-events: none; z-index: 6; }
footer { text-align: center; padding: 6px 8px 10px; font-size: 15px; background: var(--felt-dark); flex: 0 0 auto; }
footer a { color: var(--gold); }
