/* 分赃網站：牛皮紙西部告示風（跟 loot-brand 的 X 素材同一套顏色和字） */
:root {
  --paper: #EADBB8; --paper-hi: #F5EBD3; --paper-lo: #D9C59A;
  --ink: #2B1D14; --dim: #6B5440; --faint: #A48C68; --rule: #8C7253;
  --split: #2E6B57; --steal: #A8322A; --gun: #3E4650; --gold: #B8862B; --gold-hi: #E8BE57;
  --pos-bg: #d5e3d4; --neg-bg: #efd2c5;
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0; color: var(--ink); min-height: 100vh;
  font-family: 'Rokkitt', 'Noto Sans SC', system-ui, sans-serif; font-weight: 500; font-size: 16px; line-height: 1.6;
  background: var(--paper) radial-gradient(ellipse at center, transparent 55%, rgba(110, 69, 32, .28) 100%) fixed;
}
a { color: var(--steal); }
.qk { font-family: 'ZCOOL QingKe HuangYou', 'Noto Sans SC', sans-serif; font-weight: 400; letter-spacing: 1px; }
.rye { font-family: 'Rye', serif; letter-spacing: 2px; }
.num { font-family: 'Alfa Slab One', serif; letter-spacing: .5px; font-weight: 400; }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.big { font-size: 34px; margin: 6px 0; }
.warn { color: var(--steal); }
.hot { color: var(--steal); }

header {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--paper-hi); border-bottom: 3px double var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand .qk { font-size: 32px; line-height: 1; }
.brand .tag { font-size: 11px; color: var(--dim); }
nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
nav button { background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: 6px 10px; font-size: 16px; color: var(--dim); }
nav button.on { color: var(--ink); border-bottom-color: var(--steal); }
button {
  font: inherit; cursor: pointer; padding: 7px 14px; border: 2px solid var(--ink); border-radius: 4px;
  background: var(--paper-hi); color: var(--ink);
}
button:hover:not(:disabled) { background: #fff7e4; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--ink); color: var(--paper-hi); }
button.primary:hover:not(:disabled) { background: #46322a; }
#connect.on { border-color: var(--split); color: var(--split); }

main { max-width: 1040px; margin: 0 auto; padding: 18px 16px 40px; }
section { display: flex; flex-direction: column; gap: 14px; }
section[hidden], #pre[hidden] { display: none; }
.card {
  background: rgba(245, 235, 211, .65); border: 2px solid var(--ink); outline: 1px solid var(--ink); outline-offset: -7px;
  padding: 18px 20px; border-radius: 2px;
}
.card h2 { font-size: 30px; margin: 0 0 8px; }
.card h3 { font-size: 22px; margin: 0 0 8px; }
.card p { margin: 6px 0; }
#pre { text-align: center; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
input[type=number] { font: inherit; width: 90px; padding: 6px 8px; border: 2px solid var(--ink); border-radius: 4px; background: #fffaf0; }

.roundbar { display: flex; gap: 22px; align-items: baseline; flex-wrap: wrap; padding: 10px 16px; background: var(--ink); color: var(--paper-hi); border-radius: 2px; }
.roundbar .dim { color: var(--faint); }
.roundbar .num { font-size: 24px; }
.roundbar .hot { color: #ff9b8f; }
.tables { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.table { background: var(--paper-hi); border: 2px solid var(--rule); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.table.picked { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.table.seated { opacity: .75; }
.tname { font-size: 34px; line-height: 1; }
.tname .num { font-size: 38px; }
.tname .u { font-family: 'Alfa Slab One', serif; font-size: 22px; margin-left: 2px; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 4px; }
.choices button { padding: 8px 0; font-family: 'ZCOOL QingKe HuangYou', sans-serif; font-size: 20px; border-width: 2px; }
.c-split { border-color: var(--split); color: var(--split); }
.c-steal { border-color: var(--steal); color: var(--steal); }
.c-gun { border-color: var(--gun); color: var(--gun); }
.choices button.c-split.on, .choices button.c-split.on:hover { background: var(--split); color: #fff; }
.choices button.c-steal.on, .choices button.c-steal.on:hover { background: var(--steal); color: #fff; }
.choices button.c-gun.on, .choices button.c-gun.on:hover { background: var(--gun); color: #fff; }
.c-split-t { color: var(--split); } .c-steal-t { color: var(--steal); } .c-gun-t { color: var(--gun); }
.done { color: var(--split); font-weight: 600; }
.sitbar { display: flex; flex-direction: column; gap: 10px; }
.sitbar .primary { align-self: flex-start; padding: 10px 26px; font-size: 18px; }
.chk { display: flex; gap: 8px; align-items: baseline; }

.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 6px 0; border-bottom: 1px dashed var(--faint); }
.pill { display: inline-block; padding: 0 8px; border-radius: 10px; font-size: 13px; color: #fff; background: var(--dim); }
.pill.split { background: var(--split); } .pill.steal { background: var(--steal); } .pill.gun { background: var(--gun); }

.bars { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 10px 0; }
.bar { height: 14px; border: 2px solid var(--ink); background: var(--paper-hi); }
.bar i { display: block; height: 100%; background: var(--steal); }
.passes { display: flex; flex-wrap: wrap; gap: 8px; }
.passchip { display: inline-block; padding: 4px 10px; background: var(--steal); color: var(--paper-hi); border: 2px solid var(--ink); border-radius: 4px; font-size: 15px; }
button.passchip:hover:not(:disabled) { background: #8c2a23; }

.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.stats div { display: flex; flex-direction: column; align-items: center; }
.stats b { font-size: 22px; }
.stats span { font-size: 13px; color: var(--dim); }

table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th, table.list td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--faint); }
table.list th { color: var(--dim); font-weight: 600; }
.matrix { border-collapse: collapse; width: 100%; text-align: center; }
.matrix th, .matrix td { border: 1.5px solid var(--ink); padding: 10px 6px; }
.matrix th { font-family: 'ZCOOL QingKe HuangYou', sans-serif; font-weight: 400; font-size: 22px; }
.matrix td { font-family: 'Alfa Slab One', serif; font-size: 20px; background: var(--paper-hi); }
.matrix td small { display: block; font-family: 'Noto Sans SC', sans-serif; font-size: 12px; color: var(--dim); }
.matrix td.pos { background: var(--pos-bg); color: var(--split); }
.matrix td.neg { background: var(--neg-bg); color: var(--steal); }

footer { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 20px 16px 30px; border-top: 3px double var(--ink); font-size: 14px; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(80px); max-width: min(92vw, 560px); padding: 10px 18px; background: var(--ink); color: var(--paper-hi); border-radius: 4px; opacity: 0; transition: .25s; z-index: 20; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.ok { background: var(--split); }
#toast.err { background: var(--steal); }

@media (max-width: 820px) {
  .tables { grid-template-columns: 1fr 1fr; }
  .grid2, .bars { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(5, 1fr); }
  header { padding: 8px 16px 0; gap: 8px 12px; }
  .brand .tag { display: none; }
  #lang { margin-left: auto; }
  nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  nav button { white-space: nowrap; }
}
@media (max-width: 480px) {
  main { padding: 12px 16px 30px; }
  .tables { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); }
  nav button { padding: 4px 6px; font-size: 15px; }
  table.list { font-size: 13px; }
  .card { padding: 14px; }
}

/* 雙語：頁面上中英各一份，只顯示 html[data-lang] 那一份 */
html[data-lang="en"] [lang="zh"], html[data-lang="zh"] [lang="en"] { display: none !important; }
button.lang { padding: 6px 10px; font-family: 'Rye', serif; font-size: 13px; letter-spacing: 1px; }
html[data-lang="en"] button.lang { font-family: 'Noto Sans SC', sans-serif; font-size: 15px; letter-spacing: 0; }

/* 帳號選單（點右上角地址）：複製地址、斷開連接 */
#acctMenu { position: fixed; z-index: 30; min-width: 220px; max-width: calc(100vw - 16px); background: var(--paper-hi); border: 2px solid var(--ink); border-radius: 4px; box-shadow: 0 6px 18px rgba(43, 29, 20, .25); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
#acctMenu .addr { font-size: 12px; word-break: break-all; color: var(--dim); }
#acctMenu button { width: 100%; text-align: left; }
#acctMenu button.danger { color: var(--steal); border-color: var(--steal); }
#acctMenu .hint { font-size: 12px; line-height: 1.5; color: var(--dim); }

/* 複製給 AI 的提示詞（不連網站的 AI Agent 用戶） */
button.aicopy { padding: 3px 9px; font-size: 13px; line-height: 1.4; border: 1.5px dashed var(--dim); background: transparent; color: var(--dim); border-radius: 12px; white-space: nowrap; vertical-align: middle; }
button.aicopy:hover:not(:disabled) { background: var(--paper-hi); color: var(--ink); border-style: solid; }
h3 button.aicopy { font-family: 'Rokkitt', 'Noto Sans SC', sans-serif; margin-left: 6px; }
.airow { display: flex; justify-content: flex-end; margin-top: 2px; }
.row button.aicopy { margin-left: 2px; }
td button.aicopy { margin-left: 6px; }
.ailist { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.ailist > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--faint); }
@media (max-width: 480px) { button.aicopy { font-size: 12px; padding: 2px 7px; } td button.aicopy { margin: 4px 0 0; display: block; } }
