/* Live event boards. Builds on style.css (palette, fonts, buttons). */
.ev-head { padding: 2rem 0 1.4rem; border-bottom: 3px solid var(--wood);
  background: linear-gradient(180deg, rgba(85,138,72,.12), transparent); }
.ev-head h1 { color: var(--gold); font-size: clamp(1.8rem, 5vw, 2.8rem); text-shadow: 2px 2px 0 var(--wood-dk); }
.ev-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; color: var(--parchment); font-weight: 600; margin: .3rem 0 0; }
.ev-desc { color: var(--text); max-width: 70ch; margin: .6rem 0 0; }
.pill { display: inline-block; padding: .05rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 700;
  font-family: var(--sans); vertical-align: middle; background: var(--leaf); color: #0b160d; }
.pill.ended { background: var(--gold-dk); }
.pill.soon { background: var(--gold); }
.pill.draft { background: #8a8a8a; }
.conn { font-size: .8rem; color: var(--muted); }
.conn.ok::before { content: "● "; color: var(--leaf-hi); }
.conn.poll::before { content: "● "; color: var(--gold); }
.conn.off::before { content: "● "; color: #e2513b; }

.ev-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.2rem; padding: 1.4rem 0 3rem; align-items: start; }
@media (max-width: 960px) { .ev-grid { grid-template-columns: 1fr; } }

.card { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid #2c4a2f;
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem 1.1rem; margin-bottom: 1rem; }
.card h2, .card h3 { color: var(--gold); font-size: 1.2rem; }
.card.parch { background: var(--parchment); color: #2a2412; border: 3px solid var(--gold-dk); }
.card.parch h2, .card.parch h3 { color: var(--wood); }
.card.parch a { color: var(--wood); font-weight: 700; }

/* Forms */
label { display: block; font-weight: 600; margin: .5rem 0 .2rem; }
.inline { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; margin: .3rem .8rem .3rem 0; }
input[type=text], input[type=password], input[type=url], input[type=number], input[type=datetime-local], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: #0f1f12; border: 1px solid #3a5b3c; border-radius: 6px; padding: .45rem .6rem; }
textarea { min-height: 5rem; resize: vertical; }
textarea.code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; min-height: 16rem; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
input[type=color] { width: 2.6rem; height: 2.2rem; padding: 0; border: 1px solid #3a5b3c; border-radius: 6px; background: none; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.row > * { flex: 0 0 auto; }
.grow { flex: 1 1 12rem !important; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 1rem; }
button { font: inherit; cursor: pointer; }
button:disabled, .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; filter: grayscale(.4); }
.btn-ghost { display: inline-flex; align-items: center; gap: .4rem; padding: .35rem .8rem; font-weight: 700; color: var(--text);
  background: #0f1f12; border: 1px solid #3a5b3c; border-radius: 8px; }
.btn-ghost:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.btn-danger { border-color: #8d3b2e; color: #f0b3a6; }
.btn-danger:hover:not(:disabled) { border-color: #e2513b; color: #ffd2c8; }
.btn-roll { font-size: 1.25rem; padding: .7rem 1.6rem; }
.msg { min-height: 1.4rem; margin: .4rem 0 0; font-weight: 600; }
.msg.err { color: #ffb4a3; }
.msg.ok { color: var(--leaf-hi); }
.card.parch .msg.err { color: #9c2a14; }
.card.parch .msg.ok { color: #2f6b22; }
.help { font-size: .9rem; color: var(--muted); margin: .3rem 0; }
.card.parch .help { color: #5b5233; }

/* Team picker and team list */
.team-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; margin: .6rem 0; }
.team-pick button { display: flex; align-items: center; gap: .5rem; padding: .55rem .7rem; border-radius: 8px; border: 2px solid #3a5b3c;
  background: #0f1f12; color: var(--text); font-weight: 700; text-align: left; }
.team-pick button[aria-pressed=true] { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(199,195,123,.3); }
.swatch { display: inline-block; vertical-align: -.15em; flex: 0 0 auto; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid rgba(0,0,0,.45); background: var(--c, #888); }
.teams { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.teams li { display: grid; grid-template-columns: auto 1fr auto; gap: .2rem .6rem; align-items: center; padding: .5rem .6rem;
  border-radius: 8px; background: rgba(11,22,13,.5); border-left: 4px solid var(--c, #888); }
.teams .name { font-weight: 700; color: var(--parchment); }
.teams .score { font-weight: 700; color: var(--gold); white-space: nowrap; }
.teams .sub { grid-column: 2 / -1; font-size: .85rem; color: var(--muted); }
.teams li.me { outline: 1px solid var(--gold-dk); }
.badge-lock { color: #f0c27a; }

/* Dice */
.die { display: inline-grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 8px; background: var(--parchment);
  color: var(--wood-dk); font: 700 1.4rem var(--serif); border: 2px solid var(--gold-dk); box-shadow: 0 2px 0 var(--wood-dk); }
.die.rolling { animation: shake .5s; }
@keyframes shake { 20% { transform: rotate(-14deg) scale(1.1); } 50% { transform: rotate(12deg); } 80% { transform: rotate(-6deg); } }

/* Snakes and ladders board */
.board-wrap { position: relative; width: 100%; max-width: 760px; margin-inline: auto; }
.snl { position: relative; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr);
  aspect-ratio: 1; border: 4px solid var(--wood); border-radius: var(--radius); overflow: hidden; background: var(--wood-dk);
  box-shadow: var(--shadow), 0 0 0 2px var(--wood-dk); gap: 1px; }
.cell { position: relative; padding: 2px 3px; background: #1b3420; color: var(--text); overflow: hidden; cursor: pointer;
  border: 0; text-align: left; font: inherit; display: flex; flex-direction: column; min-width: 0; }
.cell:nth-child(odd) { background: #22402a; }
.cell:hover, .cell:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; z-index: 2; }
.cell.sel { outline: 3px solid var(--gold); outline-offset: -3px; z-index: 2; }
.cell .n { font: 700 .72rem var(--sans); color: var(--gold); line-height: 1.1; }
.cell .t { font-size: .58rem; line-height: 1.15; color: var(--parchment); opacity: .85; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; margin-top: 1px; }
.cell .r { position: absolute; right: 2px; top: 1px; font: 700 .6rem var(--sans); padding: 0 3px; border-radius: 4px; }
.cell.ladder { background: #24502c; } .cell.ladder .r { background: var(--leaf-hi); color: #0b160d; }
.cell.snake { background: #4a2a1d; } .cell.snake .r { background: #d0573f; color: #fff; }
.cell.dice { background: #4a4422; } .cell.dice .r, .cell.swap .r, .cell.back .r { background: var(--gold); color: #0b160d; }
.cell.finish { background: linear-gradient(135deg, #6a5a1e, #3a3210); }
.cell.path { box-shadow: inset 0 0 0 2px rgba(199,195,123,.7); }
.tokens { position: absolute; left: 2px; right: 2px; bottom: 2px; display: flex; flex-wrap: wrap; gap: 1px; justify-content: flex-end; }
.token { width: clamp(9px, 2.4vw, 18px); height: clamp(9px, 2.4vw, 18px); border-radius: 50%; background: var(--c, #888);
  border: 2px solid #0b160d; box-shadow: 0 1px 2px rgba(0,0,0,.6); font: 700 .5rem var(--sans); color: #fff; display: grid; place-items: center; }
.snl-svg { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); pointer-events: none; z-index: 1; }
.board-wrap.no-lines .snl-svg { display: none; }
.board-foot { justify-content: space-between; margin-top: .4rem; }
.board-toggle { font-size: .85rem; padding: .25rem .7rem; }
.start-area { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .5rem 0 0; font-size: .9rem; color: var(--muted); }
@media (max-width: 600px) { .cell .t { display: none; } .cell .n { font-size: .62rem; } .cell .r { font-size: .5rem; } }

/* Bingo board */
.bingo { max-width: 760px; margin-inline: auto; display: grid; grid-template-columns: repeat(var(--size, 5), 1fr); gap: 4px; padding: 4px; border: 4px solid var(--wood);
  border-radius: var(--radius); background: var(--wood-dk); box-shadow: var(--shadow), 0 0 0 2px var(--wood-dk); }
.btile { position: relative; aspect-ratio: 1; padding: .35rem; border-radius: 6px; background: var(--parchment); color: #2a2412;
  border: 2px solid var(--gold-dk); font: 600 clamp(.6rem, 1.6vw, .9rem)/1.2 var(--sans); text-align: center; display: grid;
  place-items: center; cursor: pointer; overflow: hidden; }
.btile:hover, .btile:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }
.btile.sel { outline: 3px solid var(--leaf-hi); outline-offset: 1px; }
.btile .bn { position: absolute; left: 4px; top: 2px; font-size: .65rem; color: var(--wood); }
.btile.free { background: #c9d9a0; }
.btile.approved { background: color-mix(in srgb, var(--c, #558a48) 55%, var(--parchment)); border-color: var(--c, #558a48); }
.btile.approved::after { content: "✓"; position: absolute; right: 4px; top: 0; font-size: 1.1rem; color: #10200f; }
.btile.pending { border-style: dashed; border-color: var(--c, #a39355); background: repeating-linear-gradient(45deg, var(--parchment) 0 8px, #efe6c4 8px 16px); }
.btile.rejected { border-color: #b4412b; }
.btile .st { position: absolute; bottom: 2px; left: 0; right: 0; font-size: .6rem; font-weight: 700; }
.btile .dots { position: absolute; right: 3px; bottom: 3px; display: flex; gap: 2px; }
.btile .dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); border: 1px solid #0b160d; }
.card-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .6rem; }
.card-tabs button { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .7rem; border-radius: 99px; border: 1px solid #3a5b3c;
  background: #0f1f12; color: var(--text); font-weight: 700; }
.card-tabs button[aria-pressed=true] { border-color: var(--gold); color: var(--gold); }

/* Tile detail, log, proofs */
.detail .num { font: 700 1.6rem var(--serif); color: var(--wood); }
.log { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow: auto; font-size: .9rem; }
.log li { padding: .35rem 0; border-bottom: 1px solid rgba(255,255,255,.06); display: grid; grid-template-columns: auto 1fr; gap: .5rem; }
.log time { color: var(--muted); white-space: nowrap; font-size: .8rem; padding-top: .1rem; }
.log .who { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--c, transparent); margin-right: .3rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid rgba(255,255,255,.08); vertical-align: top; }
th { color: var(--gold); font-weight: 700; white-space: nowrap; }
.status { font-weight: 700; text-transform: capitalize; }
.status.pending { color: var(--gold); } .status.approved, .status.accepted { color: var(--leaf-hi); } .status.rejected { color: #ff9b86; } .status.replaced { color: var(--muted); }
.warn { color: #f0c27a; font-size: .8rem; }
.empty { color: var(--muted); font-style: italic; }

/* Admin */
.admin-nav { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.admin-nav a { padding: .3rem .8rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--surface-2); color: var(--text); text-decoration: none; font-weight: 700; }
.admin-nav a:hover { border-color: var(--gold); color: var(--gold); }
.team-row { display: grid; grid-template-columns: auto minmax(8rem, 1fr) 8rem auto; gap: .5rem; align-items: center; margin: .4rem 0; }
@media (max-width: 560px) { .team-row { grid-template-columns: auto 1fr; } }
.ctl { display: grid; gap: .5rem; padding: .7rem; margin: .5rem 0; border-radius: 8px; background: rgba(11,22,13,.5); border-left: 4px solid var(--c, #888); }
.ctl .row input[type=number] { width: 5.5rem; }
.login { max-width: 420px; margin: 3rem auto; }
.sticky-msg { position: sticky; top: 64px; z-index: 5; }
.sticky-msg .msg:not(:empty) { background: var(--surface); border: 1px solid var(--surface-2); border-radius: 8px; padding: .4rem .8rem; box-shadow: var(--shadow); }

.archives { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.archives li { display: flex; flex-wrap: wrap; gap: .5rem 1rem; justify-content: space-between; align-items: center; padding: .6rem .8rem;
  border-radius: 8px; background: rgba(11,22,13,.5); border-left: 4px solid var(--leaf); }
.archives li.open { border-left-color: var(--gold); }
.archives .a-main { display: grid; gap: .1rem; min-width: 0; flex: 1 1 18rem; }
.archive-view { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--wood); }

/* Finishing places */
.medal { display: inline-block; min-width: 2.6em; padding: .05em .55em; border-radius: 999px; text-align: center; font: 700 .8rem/1.5 var(--sans); vertical-align: .08em;
  border: 2px solid rgba(0,0,0,.4); color: #1b1608; }
.medal.m1 { background: linear-gradient(#ffe27a, #d4a521); }
.medal.m2 { background: linear-gradient(#f2f4f6, #aab2ba); }
.medal.m3 { background: linear-gradient(#e6a56b, #a8642d); }
.medal.mx { background: var(--leaf); }
.medal.pl { background: transparent; color: var(--muted); border-color: var(--muted); }
.teams li.fin { background: rgba(212,165,33,.12); }
.finish-note { padding: .5rem .7rem; border-radius: 8px; background: rgba(212,165,33,.18); border: 1px solid var(--gold-dk); }
.log li.finish span { color: var(--gold); font-weight: 700; }
.toasts { position: fixed; z-index: 50; top: 4.5rem; left: 50%; transform: translateX(-50%); width: min(92vw, 30rem); display: grid; gap: .5rem; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .6rem; padding: .7rem .9rem; border-radius: 10px; font-size: 1.05rem;
  background: var(--wood-dk); color: var(--parchment); border: 2px solid var(--gold); box-shadow: 0 6px 22px rgba(0,0,0,.5); animation: toast-in .35s ease-out; }
.toast.t1 { border-color: #ffe27a; box-shadow: 0 0 0 3px rgba(255,226,122,.25), 0 6px 22px rgba(0,0,0,.5); }
.toast strong { flex: 1 1 auto; }
.toast-x { flex: 0 0 auto; background: transparent; border: 0; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0 .3rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
.places-panel { margin-bottom: 1rem; }
.teams.places li .place-ctl { grid-column: 1 / -1; }
.teams.places select { width: auto; min-width: 7rem; }
