/*
 * Papercraft skin: UI chrome cut from "UI buttons_panels.png" (see
 * tools/build-assets.mjs → assets/generated/ui/).
 * Loaded last so it layers over the plain CSS fallbacks in components.css.
 * Paths are relative to this file.
 */
:root {
  --ui-btn: url('../assets/generated/ui/btn-cream.png');
  --ui-btn-gold: url('../assets/generated/ui/btn-gold.png');
  --ui-btn-plain: url('../assets/generated/ui/btn-plain.png');
  --ui-btn-off: url('../assets/generated/ui/btn-disabled.png');
  --ui-square: url('../assets/generated/ui/square-cream.png');
  --ui-plaque: url('../assets/generated/ui/plaque-corners.png');
  --ui-ribbon: url('../assets/generated/ui/ribbon-blue.png');
  --sprite-toggle-off: url('../assets/generated/ui/toggle-off.png');
  --sprite-toggle-on: url('../assets/generated/ui/toggle-on.png');
}

/* ---------- Buttons: 9-sliced cardstock plates ---------- */
.btn {
  border: 18px solid transparent;
  border-image: var(--ui-btn) 17 fill / 18px stretch;
  background: none;
  box-shadow: 0 5px 0 rgba(29, 24, 18, 0.55), 0 9px 14px rgba(0, 0, 0, 0.3);
  border-radius: 16px;
  padding: 0 6px;
  min-height: 52px;
}
.btn--gold { border-image-source: var(--ui-btn-gold); }
.btn--danger { border-image-source: var(--ui-btn-plain); color: var(--red-deep); }
.btn:disabled,
.btn[aria-disabled='true'] {
  border-image-source: var(--ui-btn-off);
  background: none;
  box-shadow: 0 3px 0 rgba(29, 24, 18, 0.45);
}
.btn:active:not(:disabled) { box-shadow: 0 1px 0 rgba(29, 24, 18, 0.55); }
.btn--sm { min-height: 44px; border-width: 14px; border-image-width: 14px; }
.btn--lg { min-height: 60px; }
.btn--xl { min-height: 66px; }
.btn--icon {
  width: 54px;
  min-height: 54px;
  border-width: 16px;
  border-image: var(--ui-square) 18 fill / 16px stretch;
  border-radius: 14px;
}
.btn--icon .btn__icon { width: 26px; }
.btn--icon.btn--sm { width: 46px; min-height: 46px; border-width: 13px; border-image-width: 13px; }
.btn--icon.btn--sm .btn__icon { width: 22px; }

/* ---------- Toggles: the pill switches from the sheet ---------- */
.toggle {
  width: 66px;
  height: 29px;
  border: 0;
  border-radius: 999px;
  background: var(--sprite-toggle-off) no-repeat center / 100% 100%;
  box-shadow: 0 2px 0 rgba(29, 24, 18, 0.4);
}
.toggle::after { display: none; }
.toggle:checked { background: var(--sprite-toggle-on) no-repeat center / 100% 100%; }

/* ---------- Page ribbon ---------- */
.ribbon-title {
  padding: 12px 48px 20px;
  background: var(--ui-ribbon) no-repeat center / 100% 100%;
  border: 0;
  box-shadow: none;
  filter: drop-shadow(0 4px 3px rgba(0, 0, 0, 0.4));
}

/* ---------- Cardstock panels ---------- */
/* Player cards / HUD: the corner-bracket plaque as a 9-slice frame. */
.player-card:not(.is-empty) {
  border: 14px solid transparent;
  border-left-width: 14px;
  border-image: var(--ui-plaque) 20 fill / 14px stretch;
  padding: 0 2px 2px;
  background: none;
  box-shadow: 0 6px 0 rgba(29, 24, 18, 0.45), 0 12px 18px rgba(0, 0, 0, 0.35);
  border-radius: 12px;
}
.player-card:not(.is-empty)::before {
  /* seat colour tab replaces the old coloured left border */
  content: '';
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: -8px;
  width: 7px;
  border-radius: 4px;
  background: var(--seat);
  box-shadow: 0 0 0 2px var(--ink);
}
.player-card.is-active:not(.is-empty) {
  box-shadow: 0 0 0 4px var(--seat), 0 0 0 7px var(--ink), 0 12px 20px rgba(0, 0, 0, 0.45);
}
.player-card.is-distress:not(.is-empty) {
  box-shadow: 0 0 0 4px var(--red), 0 0 0 7px var(--ink), 0 12px 20px rgba(0, 0, 0, 0.45);
}

/* Board: a stack of card sheets on the table. */
.board-frame {
  box-shadow:
    inset 0 0 0 3px var(--paper-hi),
    inset 0 0 0 5px var(--paper-edge),
    0 0 0 4px var(--turn),
    5px 6px 0 -1px #e6d4ad,
    5px 6px 0 2px var(--ink),
    10px 12px 0 -1px #d9c297,
    10px 12px 0 2px var(--ink),
    0 22px 34px rgba(0, 0, 0, 0.5);
}

.board-area { position: relative; }


/* ---------- Compact screens: readability over decoration ---------- */
@media (max-height: 560px) and (orientation: landscape) {
  .btn { min-height: 40px; border-width: 11px; border-image-width: 11px; }
  .btn--icon.btn--sm { width: 40px; min-height: 40px; border-width: 11px; border-image-width: 11px; }
  .player-card:not(.is-empty) { border-width: 8px; border-image-width: 8px; }
  .action-bar .btn { min-height: 38px; }
}
@media (max-width: 560px) {
  .btn { border-width: 13px; border-image-width: 13px; min-height: 46px; }
  .player-card:not(.is-empty) { border-width: 10px; border-image-width: 10px; }
}
