/* Shared furniture remains in common/base.css; these are Castle Combo's paper, wood and printed components. */
:root{--felt:#e3d2af;--felt-dark:#b79772;--felt-glow:#f7ecd0;--panel:#eee2c5;--sheet:#f0e6ce;--text:#333a32;--muted:#6d6654;--gold:#e3c063;--gold-deep:#ae7e36;--win:#4d8466;--safe-l:env(safe-area-inset-left,0px);--safe-r:env(safe-area-inset-right,0px);--safe-t:env(safe-area-inset-top,0px);--safe-b:env(safe-area-inset-bottom,0px)}
.brand h1{font-family:Georgia,serif;font-weight:900;letter-spacing:.025em;color:#304d4a;text-shadow:0 1px #fff8}
.cc-crest{width:260px;height:118px;margin:0 auto 10px;overflow:hidden;border-radius:70% 70% 12% 12%;border-bottom:3px solid #ad9060}
.cc-crest img{width:100%;height:100%;object-fit:cover}.cc-lobby-crest{width:110px;height:44px;object-fit:cover;border-radius:50%}
a.back-link{display:inline-block;padding:6px 10px;border-radius:8px;background:#5b6253}
.panel,.sheet{border-color:#8c7b5755;box-shadow:0 5px 14px #51432c30,inset 0 0 0 1px #fff8}
.btn.ghost{border-color:#80725266;background:#fff8e030}.btn.danger{color:#fff3dc}.field input{background:#fff9e7;border-color:#a6967270;color:var(--text)}.game-item .code{color:#fff9df}.rules.howto h3{color:#79463b}.howto-panel>summary{color:#425b4a}
#menu .sheet>.btn{display:block;width:100%;margin:10px 0 0;line-height:1.3;text-align:center}
#menu a.linkbtn,#menu a.linkbtn:visited{color:var(--text);text-decoration:none}
.toggle-row{display:flex;align-items:center;gap:9px;font-size:18px;margin:12px 0}.toggle-row input{width:22px;height:22px;accent-color:#7d5140}
#table{display:grid;grid-template-columns:76px minmax(0,1fr) clamp(285px,43vw,440px);grid-template-rows:32px minmax(0,1fr);gap:5px 8px;width:100%;height:100%;max-width:1240px;max-height:640px;margin:auto;padding:calc(4px + var(--safe-t)) calc(5px + var(--safe-r)) calc(5px + var(--safe-b)) calc(5px + var(--safe-l));background:linear-gradient(115deg,#f7e6bd28,#6c4c2c12),url('art/tabletop.svg') center/600px 420px;touch-action:none}
.cc-players{grid-column:1;grid-row:1/3;display:flex;flex-direction:column;gap:5px;min-height:0;overflow-y:auto;touch-action:pan-y}
.cc-seat{flex:none;display:grid;grid-template-columns:24px minmax(0,1fr);gap:2px;min-height:44px;border:1px solid #80785a;border-radius:8px;padding:4px 3px;background:linear-gradient(125deg,#f1e6c9,#d8ccac);box-shadow:0 2px 2px #66503235;color:#3d4539;text-align:center;font-size:13px}
.cc-seat .avatar{width:24px;height:24px;grid-row:1/3;align-self:center;font-size:14px}.cc-seat>b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cc-seat>small{grid-column:1/-1;font-size:11px;color:#62563f;display:flex;align-items:center;justify-content:center;gap:2px}.cc-seat>small .cc-token{width:12px;height:14px}
.cc-seat.me{margin-top:auto;border-color:#8b533e}.cc-seat.active{border:2px solid #8d4a39;background:linear-gradient(125deg,#fff1c8,#e9cf98);box-shadow:0 0 0 1px #f9ebc5,0 3px 4px #6b50383b}
#tableauArea{grid-column:2;grid-row:1/3;display:grid;grid-template-rows:25px minmax(0,1fr) 25px;gap:4px;min-width:0;min-height:0}
.cc-tableau-heading{display:flex;justify-content:space-between;align-items:center;gap:4px;min-width:0;font-size:15px}.cc-tableau-heading>b{font-family:Georgia,serif;color:#3f4c3d;text-shadow:0 1px #ead5ad}.cc-tableau-heading .btn{font-size:12px;padding:3px 5px;background:#f3e7ca8c}
#tableau{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-template-rows:repeat(3,minmax(0,1fr));gap:5px;min-width:0;min-height:0;padding:3px;border:1px solid #72553c40;border-radius:6px;background:#f6e7be15}
#resources{display:flex;align-items:center;justify-content:center;gap:9px;white-space:nowrap;font-size:14px;font-weight:800}#resources>span{display:flex;align-items:center;gap:3px}#resources b{padding:0 4px;border-radius:4px;background:#5b604c;color:white;min-width:17px;text-align:center}
.cc-token{display:inline-block;flex:none;width:20px;height:23px;vertical-align:middle}.cc-token-key,.cc-token-keys{width:17px}.cc-banner{width:16px;height:20px;flex:none;vertical-align:middle}.cc-messenger{width:26px;height:25px;flex:none;filter:drop-shadow(0 1px 1px #5a5b4945)}
.cc-top{grid-column:3;grid-row:1;display:flex;justify-content:space-between;gap:3px;font-size:13px;line-height:1.15;min-width:0;color:#3b4235}.cc-tools{display:flex;gap:4px}.icon-btn{border:1px solid #796a4b66;border-radius:8px;min-width:30px;height:30px;padding:3px;background:#f2e7ca9c;color:#3f4e41;font-size:18px}
.cc-right{grid-column:3;grid-row:2;display:grid;grid-template-rows:minmax(0,1fr) 20px 34px;gap:5px;min-width:0;min-height:0}#markets{display:grid;grid-template-rows:repeat(2,minmax(0,1fr));gap:6px;min-height:0}
.cc-market{display:grid;grid-template-rows:22px minmax(0,1fr);gap:3px;min-height:0;min-width:0}.cc-market-title{font-size:13px;display:flex;align-items:center;justify-content:space-between;gap:4px;min-width:0}.cc-market-name{display:flex;align-items:center;gap:3px;color:#3d4d43;font-family:Georgia,serif}.cc-market-title small{font-size:11px;color:#5d563f;display:flex;align-items:center;gap:4px}.cc-market-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;min-width:0;min-height:0}
.cc-deck-back{display:inline-block;width:15px;height:20px;border:1px solid #6b6d56;border-radius:2px;box-shadow:2px 1px #e9e4cc,3px 2px #8b8e77;background:url('art/village-back.svg') center/cover;flex:none}.cc-market[data-realm=castle] .cc-deck-back{background-image:url('art/castle-back.svg')}.cc-market.inactive{opacity:.88}.cc-market-title .cc-banner{width:20px;height:23px}
.cc-discard-btn{border:0;padding:0;background:#f2e7c65c;border-radius:3px;color:#5e583e;font:inherit;text-decoration:underline;cursor:pointer}
.cc-slot{padding:0;border:0;border-radius:6px;min-width:0;min-height:0;background:transparent;display:block;position:relative;text-align:inherit;color:inherit}.cc-slot.can{outline:2px solid #a75d3f;outline-offset:0}.cc-slot:hover{filter:brightness(1.035)}.cc-empty{border:1px dashed #745c4259;border-radius:5px;min-width:0;min-height:0;background:#f8edc91a;box-shadow:inset 0 1px 3px #75553412}.cc-incoming{visibility:hidden}
/* Printed paper cards: coin corner, tapestry and shields, name ribbon, ability, parchment and wax seal. */
.cc-card{--cc-ribbon:#987344;height:100%;width:100%;min-height:0;min-width:0;position:relative;display:grid;grid-template-rows:minmax(0,1fr) auto 18px 28px;gap:2px;overflow:hidden;padding:4px 3px 3px;background:repeating-linear-gradient(90deg,#fff2 0 2px,transparent 2px 16px,#916b3a0d 16px 19px),linear-gradient(125deg,#ead7ad,#d8bc92);border:1px solid #c4b28d;border-radius:6px;color:#343a2e;box-shadow:inset 0 0 0 1px #fff7,0 2px 2px #4c3b2a60}
.cc-card.castle{--cc-ribbon:#66828a;background:repeating-linear-gradient(0deg,transparent 0 23px,#6587770b 24px 26px),repeating-linear-gradient(90deg,transparent 0 34px,#65877709 35px 37px),linear-gradient(125deg,#e5e9dc,#c4d2c8);border-color:#b3c2b5}
.cc-picture{grid-row:1;min-height:0;overflow:hidden;display:flex;align-items:center;justify-content:center;padding:0 10px}.cc-portrait{height:100%;width:100%;display:block;max-width:220px;overflow:visible}
.cc-name{grid-row:2;position:relative;z-index:1;min-height:16px;font-family:Georgia,serif;font-size:13px;line-height:1.05;text-align:center;padding:1px 5px;background:var(--cc-ribbon);color:#fff8db;clip-path:polygon(0 0,100% 0,97% 50%,100% 100%,0 100%,3% 50%);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-shadow:0 1px #0002}
.cc-cost{position:absolute;top:1px;left:1px;z-index:2;display:block;width:25px;height:25px;filter:drop-shadow(0 1px 1px #6c573344)}.cc-cost .cc-token{width:100%;height:100%}
.cc-shields{position:absolute;right:2px;top:3px;display:flex;gap:1px;z-index:2}.cc-shield{height:19px;width:16px;flex:none;vertical-align:middle}.cc-travel{position:absolute;bottom:68px;left:4px;z-index:2;display:flex;align-items:center;justify-content:center}.cc-travel .cc-banner{width:15px;height:20px}.cc-travel::after{content:'↕';position:absolute;left:3px;top:2px;color:#fff6db;font-size:14px;font-weight:900;line-height:1}
.cc-lock{position:absolute;top:2px;left:28px;z-index:2}.cc-lock .cc-token{height:21px;width:15px}.cc-lock.spent{opacity:.5}
.cc-ability{grid-row:3;display:flex;align-items:center;justify-content:center;gap:2px;min-width:0;overflow:hidden;white-space:nowrap;color:#3e4835;font-size:12px;line-height:1}.cc-ability small{font-size:10px}.cc-ability .cc-token{height:17px;width:15px}.cc-ability .cc-banner{height:17px;width:13px}.cc-ability .cc-shield{height:16px;width:13px}.cc-ability .cc-mini-grid{width:17px;height:17px}.cc-ability i{font-style:normal;font-size:10px}
.cc-scroll{grid-row:4;position:relative;display:flex;align-items:center;gap:2px;min-height:0;min-width:0;border-radius:3px;padding:1px 4px 2px 2px;background:linear-gradient(100deg,#e0d5ad,#fff8d9 10%,#f7f1d3 65%,#e6dcb8);border:1px solid #a99e7580;box-shadow:0 2px 1px #5e655340,inset 2px 0 #fff4df,inset -2px 0 #fff8df;color:#30392e}
.cc-scroll::after{content:'';position:absolute;top:0;bottom:0;right:2px;width:2px;background:#aba77b44}.cc-points{width:25px;height:25px;display:block;flex:none}.cc-points .cc-token{width:100%;height:100%}
.cc-formula{display:flex;align-items:center;justify-content:center;gap:1px;min-width:0;flex:1;line-height:1;overflow:hidden}.cc-formula small{font-family:Georgia,serif;font-size:10px;text-align:center;white-space:normal;max-width:26px;flex-shrink:1}.cc-formula .cc-shield{height:18px;width:15px}.cc-formula .cc-banner{height:19px;width:13px}.cc-formula .cc-token{width:18px;height:21px}.cc-mini-grid{width:23px;height:23px;flex:none;vertical-align:middle}
.cc-any-shield{display:inline-flex;background:linear-gradient(135deg,#3f77a8 15%,#8e5b9e 30%,#75a57c 47%,#c76357 64%,#e7bc65 84%);clip-path:polygon(0 0,100% 0,100% 60%,50% 100%,0 60%);width:15px;height:18px;flex:none}.cc-any-shield .cc-shield{opacity:.18}
.cc-mini-card{min-width:15px;max-width:29px;height:21px;padding:0 2px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #8c937a;border-radius:2px;background:#f9efd1;font-family:Georgia,serif;font-size:10px;text-align:center;line-height:.9;flex:none}.cc-mini-card .cc-token{width:16px;height:18px}
.cc-purse{display:flex;align-items:center;gap:1px;font-size:10px;color:#4f492f}.cc-purse .cc-token{height:18px;width:15px}.cc-purse b{font-size:11px}
.cc-back{display:flex;flex-direction:column;align-items:center;justify-content:space-between;background:linear-gradient(#b8cbc4,#d8dbc0);padding:4px;gap:2px}.cc-back-reward{display:flex;align-items:center;justify-content:center;gap:2px;max-height:30%;color:#fff3d6;background:#536d66;border:1px solid #f7efd0;border-radius:3px;padding:1px 6px;font-family:Georgia,serif;font-size:14px}.cc-back-reward .cc-token{height:21px;width:21px}.cc-back-reward .cc-token-key{width:14px}.cc-back-landscape{background:url('art/kingdom.svg') center/cover;min-height:0;flex:1;width:100%;border-radius:3px}.cc-back-label{font-family:Georgia,serif;font-size:11px;color:#465948;white-space:nowrap}
#prompt{font-size:15px;line-height:1.2;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#actions{display:flex;gap:5px;min-height:0}#actions .btn{flex:1;min-width:0;font-size:13px;padding:5px 3px;white-space:nowrap;background-color:#f3e6c680}#actions .btn.gold{background-color:var(--gold)}
#cardWin,#placeWin,#chooseWin{z-index:70}#cardBody{display:grid;grid-template-columns:140px minmax(0,1fr);gap:18px;align-items:start;font-size:17px;line-height:1.4}#cardBody>.cc-card{height:230px;grid-template-rows:minmax(0,1fr) auto 25px 37px;gap:4px;padding:5px}
#cardBody .cc-name{font-size:16px}#cardBody .cc-cost{width:32px;height:32px}#cardBody .cc-shields{flex-direction:column;right:4px;top:5px}#cardBody .cc-shield{height:25px;width:22px}#cardBody .cc-points{width:33px;height:33px}#cardBody .cc-formula{gap:2px}#cardBody .cc-formula small{font-size:12px}#cardBody .cc-formula .cc-shield{height:24px;width:20px}#cardBody .cc-formula .cc-token{height:25px;width:22px}#cardBody .cc-mini-grid{width:30px;height:30px}#cardBody .cc-travel{bottom:92px}#cardBody .cc-lock{left:35px;top:5px}#cardBody .cc-lock .cc-token{height:25px;width:19px}#cardBody .cc-ability .cc-token{height:21px;width:18px}
#cardBody h3{font-size:18px;color:#7e453a;margin:8px 0}#cardBody p{margin:5px 0 12px}#cardActions .btn{min-height:44px;font-size:16px;width:auto;flex:1}#cardBody .cc-purse b{font-size:12px}
#placementBoard{display:grid;gap:5px;grid-template-columns:repeat(var(--cols,3),minmax(0,1fr));grid-auto-rows:minmax(44px,1fr);height:min(58vh,310px);max-width:640px;margin:auto}.cc-target{border:2px solid #a45b44;box-shadow:inset 0 0 12px #bc7d3c22;border-radius:6px;color:#965038;font-size:26px;background:#f6e6b944;cursor:pointer}
.cc-placement .cc-card{grid-template-rows:minmax(0,1fr) 23px;gap:1px;padding:2px}.cc-placement .cc-picture,.cc-placement .cc-ability,.cc-placement .cc-shields,.cc-placement .cc-cost,.cc-placement .cc-travel,.cc-placement .cc-lock{display:none}.cc-placement .cc-name{grid-row:1;font-size:12px;background:transparent;color:#43543e;padding:1px}.cc-placement .cc-scroll{grid-row:2}.cc-placement .cc-points{width:20px;height:20px}.cc-placement .cc-formula .cc-shield{width:12px;height:15px}.cc-placement .cc-mini-grid{width:18px;height:18px}.cc-position-empty{visibility:hidden}
#chooseBody{display:flex;flex-wrap:wrap;gap:10px}#chooseBody .btn{flex:1 1 190px;min-height:44px;font-size:17px;text-align:left}#chooseHelp{font-size:17px;line-height:1.4}#chooseActions .btn{width:auto}.cc-choice-card{width:130px;height:155px;border:0;background:transparent;padding:0}.cc-choice-card.selected{outline:3px solid #a1583b;border-radius:8px}
#peekBody{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));grid-auto-rows:150px;gap:7px}#peekBody .cc-card{max-width:220px;margin:auto}#scoreBody{font-size:17px;line-height:1.5}.cc-legend{display:flex;gap:12px;flex-wrap:wrap}.cc-legend .cc-shield{height:24px;width:22px}
.cc-results{border-collapse:collapse;width:100%;font-size:16px}.cc-results td,.cc-results th{padding:8px 5px;border-bottom:1px solid #91856855;text-align:right}.cc-results th:first-child,.cc-results td:first-child{text-align:left}.cc-final-detail{margin:10px 0}.cc-final-detail summary{cursor:pointer;font-weight:bold;color:#80503a}.cc-final-detail li{font-size:16px;line-height:1.5}
@media(max-height:380px){#table .cc-card:not(.cc-back){grid-template-rows:minmax(0,1fr) auto 26px;gap:1px;padding:3px 2px 2px}#table .cc-ability{display:none}#table .cc-scroll{grid-row:3}#table .cc-name{font-size:12px;min-height:15px}#table .cc-cost{width:23px;height:23px}#table .cc-shield{height:17px;width:14px}#table .cc-travel{bottom:45px;left:3px}#table .cc-travel .cc-banner{height:15px;width:12px}#table .cc-travel::after{font-size:11px;left:2px}#table .cc-points{width:23px;height:23px}#table .cc-formula small{font-size:9px;max-width:18px}#table .cc-formula .cc-shield{width:12px;height:16px}#table .cc-formula .cc-banner{width:11px;height:17px}#table .cc-formula .cc-token{width:15px;height:18px}#table .cc-mini-grid{width:21px;height:21px}#table .cc-back-reward .cc-token{height:17px;width:17px}#table .cc-back-reward .cc-token-key{width:12px}#table .cc-back-label{font-size:10px}#table .cc-purse .cc-token{display:none}#table .cc-purse b{font-size:10px}}
@media(max-height:330px){#table{grid-template-columns:68px minmax(0,1fr) clamp(280px,42vw,400px);column-gap:6px}.cc-players{gap:4px}.cc-seat{min-height:40px;padding:3px}.cc-top{font-size:12px}#resources{font-size:13px;gap:7px}#resources .cc-token{width:16px;height:19px}#cardBody>.cc-card{height:210px}#placeWin h2{margin:0 0 5px}#placeWin .hint{font-size:14px;margin:4px 0 8px}}
@media(orientation:portrait){body:has(#table:not([hidden])) .rotate{display:flex}}
