/* 4Muses Trade: builds on the main app's tokens and cards in /styles.css. */
.trade { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
.trade section { display: flex; flex-direction: column; gap: 16px; }
.logo .sub { font-weight: 700; color: var(--muted); }
a.logo { color: var(--ink); text-decoration: none; }
a.btn { text-decoration: none; text-align: center; display: inline-block; }
.err { background: var(--glow-soft); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.list { display: flex; flex-direction: column; gap: 8px; }
#recent { flex-direction: row; flex-wrap: wrap; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row input:not([type=number]) { flex: 1; min-width: 140px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.trade input, .trade select { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--card); }
.trade input[type=number] { width: 4.4em; padding: 8px 6px; }
.inline { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
button.link { background: none; border: 0; color: var(--glow); font-weight: 700; padding: 0; cursor: pointer; margin-left: auto; }

/* Lobby */
.code-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.code { font: 800 2rem/1 var(--f-mono); letter-spacing: .12em; }
.seats { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.seats li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--soft); border-radius: 10px; }
.seats .tag { font: 500 .7rem var(--f-mono); border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; }
.seats li.judge-claude { color: var(--claude); } .seats li.judge-chatgpt { color: var(--chatgpt); } .seats li.judge-gemini { color: var(--gemini); }
.seats li .name { color: var(--ink); font-weight: 700; }
.ai-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-row .judge-claude { color: var(--claude); } .ai-row .judge-chatgpt { color: var(--chatgpt); } .ai-row .judge-gemini { color: var(--gemini); }
.gm { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.gm label { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.params { display: flex; flex-direction: column; gap: 6px; }
.param { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 6px; font-size: .9rem; }
.param > span:first-child { min-width: 0; }
.param input:disabled { opacity: .8; }
body:not(.is-host) .host-only { display: none !important; }
body.is-host .guest-only { display: none !important; }

/* Game */
.status-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.clock { display: flex; flex-direction: column; align-items: flex-end; }
.clock b { font: 800 1.6rem/1 var(--f-mono); color: var(--glow); }
.board { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
#levels { display: flex; gap: 6px; flex-wrap: wrap; }
.lvl { min-width: 30px; text-align: center; padding: 3px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); font: 700 .9rem var(--f-mono); }
.lvl.mine { border-color: var(--glow); }
.goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.gd { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 8px; padding: 8px 10px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); align-items: center; }
.gd .icon { font-size: 1.5rem; grid-row: span 2; }
.gd .txt { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.gd .txt b { font: 800 1.15rem var(--f-mono); }
.gd .txt span { font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gd .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.gd .bar span { display: block; height: 100%; background: var(--glow); }
.gd .need { grid-column: 1 / -1; font: 500 .72rem var(--f-mono); color: var(--muted); }
.gd.wanted { border-color: var(--glow); }
.gd.done .bar span { background: var(--ok); }
.offer { display: flex; align-items: center; gap: 8px; padding: 10px; border-radius: 12px; background: var(--soft); border: 1px solid var(--line); flex-wrap: wrap; }
.offer .txt { display: flex; flex-direction: column; flex: 1; min-width: 160px; gap: 2px; }
.offer.forme { border-color: var(--glow); }
.offer.mine { opacity: .85; }
.offer .btn { padding: 8px 14px; font-size: .9rem; }
.trade-grid { display: grid; grid-template-columns: 1fr auto auto; gap: 6px 10px; align-items: center; }
.trade-grid .hd { font: 500 .72rem var(--f-mono); text-transform: uppercase; color: var(--muted); text-align: center; }
.gname { font-size: .9rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step { display: flex; align-items: center; gap: 2px; }
.step button { width: 30px; height: 34px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; font-weight: 800; }
.trade .step input { width: 3em; text-align: center; padding: 6px 2px; }
.feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow: auto; }
.feed li { display: flex; gap: 8px; font-size: .88rem; }
.feed time { font: 500 .72rem var(--f-mono); color: var(--muted); padding-top: 2px; }
.feed li.k-chat span { font-style: italic; }
.feed li.k-discover span { color: var(--ok); font-weight: 700; }
.reveal { margin: 0; padding-left: 18px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--card); padding: 10px 16px; border-radius: 12px; font-size: .9rem; max-width: calc(100vw - 32px); z-index: 5; }

/* Turns */
.turn-row { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.seg { display: flex; background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 3px; align-self: flex-start; }
.seg button { border: 0; background: transparent; color: var(--ink); border-radius: 9px; padding: 7px 14px; font-weight: 700; }
.seg button[aria-pressed=true] { background: var(--glow); color: var(--on-glow); }
.seg button:disabled { cursor: default; }
