/* Driftwood Isle: the hand, the trade and card dialogs, the log. The rest comes from /rooms/room.css. */

.sx { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.sx > * { pointer-events: auto; }
.sx-side { position: absolute; left: calc(12px + env(safe-area-inset-left, 0px)); top: calc(66px + env(safe-area-inset-top, 0px)); width: min(300px, 40vw); display: grid; gap: 8px; pointer-events: none; }
.sx-side > * { pointer-events: auto; }
.sx-bank { display: flex; gap: 5px; align-items: center; flex-wrap: wrap; padding: 6px 9px; border-radius: 10px; background: var(--glass, rgba(10,12,16,.7)); backdrop-filter: blur(8px); font-size: 12px; color: #d9cfbd; }
.sx-bank:empty, .sx-log:empty { display: none; }
.sx-bank small { color: #d9b26b; letter-spacing: .1em; text-transform: uppercase; font-size: 10px; margin-right: 2px; }
.sx-mini { min-width: 22px; text-align: center; padding: 2px 5px; border-radius: 5px; font-weight: 700; font-size: 12px; color: #fff; }
.sx-log { list-style: none; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--glass, rgba(10,12,16,.7)); backdrop-filter: blur(8px); font-size: 12.5px; line-height: 1.45; color: #e8dfcd; display: grid; gap: 3px; max-height: 40vh; overflow: hidden; }
.sx-log li.big { color: #f1d59a; font-weight: 700; }
.sx .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }

/* resource colours */
.sx-card.brick, .sx-mini.brick, .sx-count.brick small { --c: #a8452a; }
.sx-card.lumber, .sx-mini.lumber, .sx-count.lumber small { --c: #2f6b2a; }
.sx-card.wool, .sx-mini.wool, .sx-count.wool small { --c: #8fbf55; }
.sx-card.grain, .sx-mini.grain, .sx-count.grain small { --c: #d9a520; }
.sx-card.ore, .sx-mini.ore, .sx-count.ore small { --c: #7c828c; }
.sx-mini { background: var(--c, #555); }
.sx-mini.dev { background: #5a3d7a; }

/* the hand, just above the buttons */
.sx-hand { display: flex; gap: 10px; align-items: flex-end; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; pointer-events: auto; }
.sx-hand:empty { display: none; }
.sx-cards { display: flex; gap: 6px; }
.sx-card { appearance: none; border: 0; position: relative; width: 52px; height: 70px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 6px 2px 5px;
  background: linear-gradient(170deg, color-mix(in srgb, var(--c) 75%, #fff), var(--c) 60%); color: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.45), inset 0 0 0 2px rgba(255,255,255,.18); font: inherit; }
.sx-card b { font: 700 22px/1 var(--gu-serif); text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.sx-card small { font-size: 9.5px; letter-spacing: .04em; text-transform: uppercase; font-weight: 700; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.sx-card.none { opacity: .38; }
.sx-devs { appearance: none; border: 1px solid rgba(217,178,107,.45); border-radius: 10px; background: rgba(40,26,60,.85); padding: 6px 8px; display: flex; gap: 6px; flex-wrap: wrap; max-width: 280px; color: #efe6d6; font: inherit; cursor: pointer; }
.sx-dev { font-size: 11.5px; padding: 3px 7px; border-radius: 6px; background: rgba(255,255,255,.08); }
.sx-dev b { margin-left: 4px; color: #f1d59a; }
.sx-dev.new { outline: 1px dashed rgba(241,213,154,.6); }
.dock .go.on { background: linear-gradient(180deg, #f1d59a, #c99b4f); color: #1d150a; }
.side .sx-chip { float: right; min-width: 24px; padding: 2px 6px; border-radius: 999px; text-align: center; font-weight: 800; font-size: 13px; color: #111; margin-left: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.3); }

/* a trade on the table */
.sx-panel { position: absolute; right: calc(12px + env(safe-area-inset-right, 0px)); top: 50%; transform: translateY(-50%); width: min(300px, 80vw); padding: 14px 16px; border-radius: 14px;
  background: rgba(16,13,10,.92); border: 1px solid rgba(217,178,107,.35); box-shadow: 0 18px 50px rgba(0,0,0,.5); color: #efe6d6; font-size: 14px; }
.sx-panel h3 { margin: 0 0 6px; font: 400 20px var(--gu-serif); color: #f6ecd8; }
.sx-panel ul { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.sx-panel li { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sx-panel li > span:first-of-type { flex: 1; }

/* dialogs */
.sx-modal { position: fixed; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.5); z-index: 30; overflow-y: auto; }
.sx-modal[hidden] { display: none; }
.sx-modal .card { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; padding: 18px 20px; border-radius: 16px; background: #15110d; border: 1px solid rgba(217,178,107,.35); box-shadow: 0 30px 80px rgba(0,0,0,.6); color: #efe6d6; box-sizing: border-box; }
.sx-modal h2 { margin: 0 0 10px; font: 400 26px var(--gu-serif); color: #f6ecd8; }
.sx-modal h3 { margin: 14px 0 6px; font: 400 18px var(--gu-serif); color: #f6ecd8; }
.sx-modal section + section { border-top: 1px solid rgba(255,255,255,.08); margin-top: 12px; }
.sx-modal .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.sx-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.sx-pick .sx-card { cursor: pointer; }
.sx-pick .sx-card:disabled { opacity: .3; cursor: not-allowed; }
.sx-pick .sx-card.on { outline: 3px solid #f1d59a; outline-offset: 2px; }
.sx-counter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; margin: 6px 0; }
.sx-counter .lbl { grid-column: 1 / -1; font-size: 12px; color: #d9b26b; letter-spacing: .08em; text-transform: uppercase; }
.sx-count { display: grid; gap: 4px; text-align: center; }
.sx-count small { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 3px 0; border-radius: 5px; background: var(--c); color: #fff; }
.sx-count div { display: flex; align-items: center; justify-content: center; gap: 4px; }
.sx-count button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid rgba(217,178,107,.4); background: rgba(255,255,255,.04); color: #f1d59a; font-size: 16px; line-height: 1; cursor: pointer; }
.sx-count b { min-width: 16px; font-size: 16px; }
.sx-devlist { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.sx-devlist li { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); }
.sx-devlist p { margin: 2px 0 0; }

/* an online room filling up */

/* the trading post's swatches */
.swatch-pieces { gap: 8px; background: #2a1d10; }
.swatch-pieces i { display: block; background: #c53a2c; box-shadow: 0 3px 5px rgba(0,0,0,.5); }
.swatch-pieces .house { width: 20px; height: 18px; clip-path: polygon(50% 0, 100% 40%, 100% 100%, 0 100%, 0 40%); }
.swatch-pieces .house.city { width: 28px; height: 24px; }
.swatch-pieces .road { width: 26px; height: 7px; border-radius: 2px; }
.swatch-pieces.stone i { background: linear-gradient(#8a8d93, #5c5f64); }
.swatch-pieces.metal i { background: linear-gradient(135deg, #f2c08a, #b4552e 60%, #6d2a12); }
.swatch-sea { background: var(--frame); }
.swatch-sea i { width: 60px; height: 52px; background: var(--sea); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); box-shadow: inset 0 0 12px rgba(255,255,255,.2); }
.swatch-dice { gap: 10px; background: #2a1d10; }
.swatch-dice i { width: 30px; height: 30px; border-radius: 6px; background: var(--die); display: grid; grid-template-columns: 1fr 1fr; place-items: center; padding: 4px; box-sizing: border-box; box-shadow: 0 3px 6px rgba(0,0,0,.5); }
.swatch-dice b { width: 6px; height: 6px; border-radius: 50%; background: var(--pip); }

@media (max-width: 760px) {
  .sx-side { width: min(220px, 55vw); top: calc(60px + env(safe-area-inset-top, 0px)); }
  .sx-log { max-height: 16vh; font-size: 11.5px; }
  .sx-card { width: 44px; height: 58px; }
  .sx-card b { font-size: 18px; }
  .sx-panel { top: auto; bottom: 200px; transform: none; }
}
