Files
casino/cmd/arcade/static/admin.css
drjones 1da3b6760e feat(admin): operations console, fees wired into payouts
Fees now flow through settlement. The payout and the deduction are posted
as separate ledger transactions rather than netted, so a player's history
shows the full win and the charge as itemised lines instead of a quietly
smaller win.

The admin console shows treasury, liability, revenue, every posting,
every round, and risk flags. Auth is a constant-time token compare and
the surface is not mounted at all unless ARCADE_ADMIN_TOKEN is set, so a
default deployment has no admin endpoint to attack. The token lives in
browser memory only.

It is read-only over game outcomes by design: seeds show only after
settlement and nothing can alter a crash point. A control that could
would make the fairness proof a lie.

The console immediately found a real bug: 343 unresolved rounds, because
the reconciler only considered rounds with bets and abandoned empty ones
accumulated forever, burying the signal. Now cleared automatically.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-05 23:34:16 +00:00

114 lines
4.0 KiB
CSS

/* Operations console.
*
* Denser than the player interface on purpose: an operator is reading tables,
* not playing a game. Same palette, but amber is reserved for money the house
* holds and red for anything that needs a decision. */
body.admin { font-size: 13px; }
body.admin .filigree { opacity: 0.25; }
.wrap { max-width: 1400px; margin: 0 auto; padding: 14px 14px 60px; }
.livedot {
width: 7px; height: 7px; border-radius: 50%;
background: var(--green); margin-left: 10px;
box-shadow: 0 0 10px var(--green);
animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.livedot.stale { background: var(--red); box-shadow: 0 0 10px var(--red); }
/* Six tiles across on a wide screen, two on a phone. */
.tiles.ops { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .tiles.ops { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .tiles.ops { grid-template-columns: repeat(6, 1fr); } }
#tile-books.bad { border-color: var(--red); }
#tile-books.bad .tile-value { color: var(--red); }
.opsnav { display: flex; gap: 4px; margin: 14px 0 12px; flex-wrap: wrap; }
.opsnav button {
font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase;
padding: 8px 14px; color: var(--green-dim);
}
.opsnav button.on {
color: var(--green); border-color: var(--green); background: #00291c;
}
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.chart.tall { height: 190px; }
/* ---------- data tables ---------- */
.tablewrap { overflow-x: auto; margin-top: 8px; }
table.data {
width: 100%; border-collapse: collapse; font-size: 11.5px;
font-variant-numeric: tabular-nums; white-space: nowrap;
}
table.data th {
text-align: left; padding: 6px 10px 6px 0;
font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase;
color: var(--green-dim); font-weight: 400;
border-bottom: 1px solid var(--green-ghost);
position: sticky; top: 0; background: #00120c;
}
table.data td {
padding: 6px 10px 6px 0;
border-bottom: 1px solid #06231a;
color: var(--green);
}
table.data tr:hover td { background: #00ff9c0a; }
td.num { text-align: right; padding-right: 18px; }
td.pos { color: var(--amber); }
td.neg { color: var(--green-dim); }
td.dim { color: var(--green-dim); }
td.mono { font-size: 10px; color: var(--green-dim); }
.pill {
display: inline-block; padding: 2px 6px; border-radius: 2px; font-size: 9.5px;
letter-spacing: 0.1em; text-transform: uppercase;
border: 1px solid var(--green-ghost); color: var(--green-dim);
}
.pill.fee { color: var(--amber); border-color: #4a3300; }
.pill.payout { color: var(--magenta); border-color: #4a0f2c; }
.pill.void { color: var(--red); border-color: #4a1119; }
/* ---------- key/value grid ---------- */
.kvgrid {
display: grid; grid-template-columns: 1fr; gap: 1px;
background: var(--green-ghost); border: 1px solid var(--green-ghost);
margin-top: 8px;
}
@media (min-width: 700px) { .kvgrid { grid-template-columns: repeat(3, 1fr); } }
.kvgrid > div { background: #00120c; padding: 10px 12px; }
.kvgrid .k {
display: block; font-size: 9px; letter-spacing: 0.16em;
text-transform: uppercase; color: var(--green-dim); margin-bottom: 3px;
}
.kvgrid .v { font-size: 15px; color: var(--amber); font-weight: 700; }
/* ---------- risk flags ---------- */
.flags { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.flag {
display: flex; align-items: center; gap: 10px; padding: 10px 12px;
border: 1px solid var(--green-ghost); border-radius: 3px; background: #00120c;
}
.flag .n {
font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums;
min-width: 46px;
}
.flag .t { font-size: 12px; color: var(--green-dim); }
.flag.ok .n { color: var(--green); }
.flag.warn { border-color: #4a3300; }
.flag.warn .n { color: var(--amber); }
.flag.bad { border-color: var(--red); }
.flag.bad .n { color: var(--red); }
#player-filter { max-width: 340px; }