/* Remaining action screens share the same parchment, portraits and wax accents. */
#sheetBackdrop{position:fixed;inset:0;z-index:19;background:#01131b99;touch-action:none}
#sheet{box-shadow:0 20px 60px #000a;outline:none}
#sheet .sheet-title h3{white-space:normal;text-align:center;overflow-wrap:anywhere;line-height:1.12}
#sheet .sheet-footer{margin-top:20px;padding-top:16px}
#sheet .sheet-footer button{min-height:44px}
.action-emblem{display:flex;justify-content:center;margin:-8px 0 16px}
.action-emblem>.ui-icon{width:64px;height:64px}
.victim-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(145px,1fr));gap:14px}
.victim-choice,.resource-selection .resource-choice{display:flex;flex-direction:column;align-items:center;gap:9px;padding:16px 10px 12px;min-width:0;border:1px solid #997548;border-radius:3px;background:linear-gradient(#f3e4c7,#d9bc8f);color:#382719;text-shadow:none;box-shadow:inset 0 1px #fff9,0 3px 0 #795633,0 5px 9px #39241433}
.victim-choice:hover,.resource-selection .resource-choice:hover{background:linear-gradient(#fff0d1,#e6c798)}
.victim-choice:focus-visible,.resource-choice:focus-visible{outline-color:#822b20}
.victim-portrait{display:grid;place-items:center;width:100%;background:radial-gradient(ellipse,color-mix(in srgb,var(--player-colour) 22%,transparent),transparent 65%)}
.victim-portrait>.ui-icon{width:96px;height:96px}
.victim-choice strong{max-width:100%;overflow-wrap:anywhere;font-size:calc(19px * var(--text-scale, 1))}
.victim-hand{display:flex;align-items:center;gap:5px;font-size:calc(12px * var(--text-scale, 1));font-weight:normal;white-space:nowrap;color:#694b2d}
.choice-cta{display:block;width:100%;margin-top:auto;background:#72291e;border:1px solid #a26b42;color:#fff0d1;padding:7px;font-size:calc(15px * var(--text-scale, 1))}
.quantity-list{display:flex;flex-direction:column;gap:9px;max-width:620px;margin:auto}
.resource-quantity{display:grid;grid-template-columns:48px 1fr auto;align-items:center;gap:14px;padding:9px 15px;border:1px solid #aa8655;background:#d3b68855;box-shadow:inset 0 1px #fff4}
.resource-quantity>.ricon{width:43px;height:43px}
.quantity-controls{display:flex;align-items:center;gap:12px}
.quantity-controls button{width:44px;height:44px;padding:0;min-height:44px;border:1px solid #a88a5a;border-radius:3px;background:#f2e0bd;color:#51371e;text-shadow:none;box-shadow:0 2px 2px #60462233;font:calc(24px * var(--text-scale, 1)) Georgia}
.quantity-controls .v{min-width:28px;text-align:center;font-size:calc(24px * var(--text-scale, 1));font-variant-numeric:tabular-nums}
.quantity-controls button:disabled{opacity:.35}
.quantity-controls button:focus-visible{outline-color:#822b20}
.resource-selection{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:12px}
.resource-selection .resource-choice{padding:22px 8px;min-height:170px;font-size:calc(16px * var(--text-scale, 1))}
.resource-selection .resource-choice>.ricon{width:64px;height:64px}
.development-list{display:flex;flex-direction:column;gap:12px}
.development-entry{display:flex;align-items:center;gap:22px;padding:15px 20px;background:#d2b78955;border:1px solid #aa8655}
.development-entry .card{flex:none;width:106px;height:151px;cursor:default}
.development-copy{flex:1;min-width:0}
.development-copy h4{margin:0;font-size:calc(22px * var(--text-scale, 1));font-variant:small-caps}
.development-copy p{font-size:calc(14px * var(--text-scale, 1));line-height:1.5;color:#65492e;margin:6px 0 12px}
.development-copy button{padding:7px 15px;font-size:calc(15px * var(--text-scale, 1))}
.development-copy button:disabled{opacity:1;color:#765d41;background:#ceb48b;border:1px solid #a88a5a;text-shadow:none;box-shadow:none}
button.card{padding:0;border:0;background:none;box-shadow:none;min-height:0;flex:none;display:block;font-variant:normal;letter-spacing:0}
button.card:focus-visible{outline-color:#fff0b7}
.empty-cards{text-align:center;display:flex;align-items:center;flex-direction:column;gap:14px;padding:15px}
.empty-cards>.card-back-icon{width:100px;height:140px}
.empty-cards h4{font-size:calc(23px * var(--text-scale, 1));margin:0}.empty-cards p{color:#65492e;margin:0;font-size:calc(15px * var(--text-scale, 1))}
.results-list{display:flex;flex-direction:column;gap:9px;max-width:660px;margin:auto}
.result-row{display:flex;align-items:center;gap:15px;padding:7px 15px;border:1px solid #a78453;background:#d4b88966;font-weight:bold;font-size:calc(20px * var(--text-scale, 1))}
.result-row>.ui-icon{width:52px;height:52px}.result-row>.tagit{margin-left:auto;font-size:calc(15px * var(--text-scale, 1));color:#765534;white-space:nowrap}
.result-row.winner{background:linear-gradient(90deg,#f8e2ab,#d9af64);border-color:#8f4928;box-shadow:inset 0 0 0 2px #fbe7b780}
.result-row.winner>.tagit{color:#822b20}.trade-conflict{font-size:calc(13px * var(--text-scale, 1));color:#822b20;margin:7px 0 0}
#hand{max-width:calc(100vw - 24px);overflow-x:auto;padding:5px;touch-action:pan-x;justify-content:flex-start}
#acts{flex-wrap:wrap;gap:10px}
/* The active turn's primary action: ivory dice, wax red and a fine brass rim. */
#acts button.roll-dice{
  min-width:210px;min-height:58px;padding:8px 24px;gap:12px;
  justify-content:center;border:1px solid #d1ac68;border-radius:3px;
  background:linear-gradient(180deg,#9b3026,#6a201c);
  box-shadow:inset 0 0 0 2px #421c17,inset 0 0 0 3px #c99c5359,0 3px 0 #291714,0 5px 10px #0005;
  color:#fff0d1;font:700 calc(22px * var(--text-scale, 1))/1.15 var(--serif);font-variant:small-caps;
  letter-spacing:.025em;text-shadow:0 2px 2px #35100f;
}
#acts button.roll-dice::before{display:none}
#acts button.roll-dice .ui-icon{display:block;width:38px;height:38px;filter:drop-shadow(0 2px 2px #210e0c80)}
#acts button.roll-dice:hover{background:linear-gradient(180deg,#ab3a2d,#7a2820);filter:none}
#acts button.roll-dice:active{transform:translateY(2px);box-shadow:inset 0 0 0 2px #421c17,inset 0 0 0 3px #c99c5359,0 1px 0 #291714}
#acts button.roll-dice:focus-visible{outline:2px solid #fff0c5;outline-offset:4px}
@media(max-width:760px){#acts button.roll-dice{min-width:228px;min-height:58px;margin:3px 0 7px;font-size:calc(22px * var(--text-scale, 1))}}
#offer{max-height:35vh;overflow:auto;touch-action:pan-y}.pile{max-height:80px;overflow:auto}.oh{overflow-wrap:anywhere}
@media(max-width:760px){
  #sheet{top:50%;max-height:calc(100dvh - 20px);box-shadow:0 12px 35px #0009}
  #sheet .sheet-title{height:auto;min-height:64px;padding:8px 20px 20px}
  #sheet .sheet-title h3{font-size:calc(21px * var(--text-scale, 1))}
  #sheet>p.hint{margin-bottom:15px;line-height:1.45}
  #sheet .sheet-footer{gap:8px;margin-top:16px!important;padding-top:12px}
  #sheet .sheet-footer button{font-size:calc(14px * var(--text-scale, 1));padding:7px 12px}
  .action-emblem{margin:-3px 0 12px}.action-emblem>.ui-icon{width:48px;height:48px}
  .victim-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
  .victim-choice{padding:10px 5px 7px;gap:6px}.victim-portrait>.ui-icon{width:76px;height:76px}
  .victim-choice strong{font-size:calc(15px * var(--text-scale, 1))}.victim-hand{font-size:calc(10px * var(--text-scale, 1));gap:3px}.victim-hand>.ui-icon{width:18px;height:18px}.choice-cta{font-size:calc(13px * var(--text-scale, 1));padding:7px 1px}
  .quantity-list{gap:7px}.resource-quantity{grid-template-columns:35px 1fr auto;padding:6px 7px;gap:7px}
  .resource-quantity>.ricon{width:34px;height:34px}.quantity-controls{gap:4px}.quantity-controls .v{min-width:22px;font-size:calc(21px * var(--text-scale, 1))}
  .resource-quantity .resource-name h4{font-size:calc(15px * var(--text-scale, 1))}.resource-quantity .resource-name small{font-size:calc(10px * var(--text-scale, 1))}
  .resource-selection{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.resource-selection .resource-choice{min-height:125px;padding:12px 6px;font-size:calc(15px * var(--text-scale, 1))}.resource-selection .resource-choice>.ricon{width:54px;height:54px}
  .development-entry{padding:10px;gap:12px;align-items:flex-start}.development-entry .card{width:74px;height:106px}.development-copy h4{font-size:calc(17px * var(--text-scale, 1))}.development-copy p{font-size:calc(12px * var(--text-scale, 1));margin-bottom:10px}.development-copy button{font-size:calc(12px * var(--text-scale, 1));padding:7px;width:100%}
  .result-row{padding:6px 8px;gap:8px;font-size:calc(16px * var(--text-scale, 1))}.result-row>.ui-icon{width:43px;height:43px}.result-row>.tagit{font-size:calc(12px * var(--text-scale, 1))}
  .trade-grid{display:flex;flex-direction:column;gap:7px}
  .trade-resource{display:grid;grid-template-columns:52px 1fr 70px 70px;grid-template-rows:auto auto;gap:2px 6px;border-width:3px;padding:6px 7px}
  .trade-resource>.ricon{grid-column:1;grid-row:1/3;width:45px;height:50px;padding:2px;background:none;clip-path:none}
  .trade-resource h4{grid-column:2;grid-row:1;font-size:calc(14px * var(--text-scale, 1));align-self:end}.trade-resource small{grid-column:2;grid-row:2;font-size:calc(10px * var(--text-scale, 1));align-self:start}
  .trade-resource>[data-give]{grid-column:3;grid-row:1/3}.trade-resource>[data-receive]{grid-column:4;grid-row:1/3}.trade-resource>button{min-height:44px;font-size:calc(12px * var(--text-scale, 1));padding:5px 2px}
  #acts{gap:4px 13px;justify-content:center}#controlbar{min-height:106px}
  #controlbar{height:auto;min-height:calc(106px + var(--safe-b));padding-bottom:var(--safe-b)}
  #hand{bottom:calc(var(--control-height,106px) + 78px)}
}
@media(max-width:380px){.trade-resource{grid-template-columns:34px 1fr 57px 57px;padding:6px 3px;gap:2px 4px}.trade-resource>.ricon{width:33px;height:40px}.trade-resource h4{font-size:calc(12px * var(--text-scale, 1))}.trade-resource>button{font-size:calc(11px * var(--text-scale, 1))}.resource-quantity{gap:5px;padding:6px 4px;grid-template-columns:28px 1fr auto}.resource-quantity>.ricon{width:28px;height:28px}.quantity-controls{gap:2px}.resource-quantity .resource-name h4{font-size:calc(13px * var(--text-scale, 1))}.quantity-controls .v{min-width:19px}.victim-choice strong{font-size:calc(13px * var(--text-scale, 1))}.victim-hand{font-size:calc(9px * var(--text-scale, 1))}}

#bottom{padding-bottom:var(--control-height,80px)}
.development-entry .card .t,.development-entry .card .sub{display:none}
@media(min-width:761px){#controlbar{height:auto;min-height:80px}#hand{bottom:calc(var(--control-height,80px) + 60px)}}

/* A wax-red close seal stays inside the frame while the parchment scrolls. */
#sheet .sheet-close-bar{position:sticky;top:0;z-index:6;height:0;display:flex;justify-content:flex-end;pointer-events:none}
#sheet .sheet-close{position:relative;flex:none;display:grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border:2px solid #d6af6c;border-image:none;border-radius:50%;background:radial-gradient(circle at 35% 25%,#a64b36,#6d251d 75%);color:#fff0ce;box-shadow:inset 0 0 0 2px #4b1b1755,inset 0 1px 2px #ffe0a244,0 3px 8px #39241455;pointer-events:auto;touch-action:manipulation;cursor:pointer;transition:background .15s,box-shadow .15s}
#sheet .sheet-close:hover{background:radial-gradient(circle at 35% 25%,#bc6246,#812e22 75%);box-shadow:inset 0 0 0 2px #4b1b1755,0 3px 10px #39241477}
#sheet .sheet-close:focus-visible{outline:3px solid #fff0ce;outline-offset:3px}
#sheet .sheet-close-mark{position:relative;display:block;width:18px;height:18px}
#sheet .sheet-close-mark::before,#sheet .sheet-close-mark::after{content:"";position:absolute;left:8px;top:0;width:2px;height:18px;border-radius:2px;background:currentColor;transform:rotate(45deg)}
#sheet .sheet-close-mark::after{transform:rotate(-45deg)}
@media(max-width:760px){#sheet:has(.sheet-close) .sheet-title{padding-left:52px;padding-right:52px}}
