mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-14 04:16:43 +00:00
Serve the BotFather game noitu from the bot's HTTP server under /games/noitu when GAME_BASE_URL is set. /noitu sends the game, Play answers with a signed, expiring link, and the server validates every word against the embedded noitu dictionary (CC BY-SA 4.0), runs the bot opponent and turn timer, and reports the score with setGameScore. Modules can now register game-short-name callbacks and HTTP routes.
149 lines
5.0 KiB
CSS
149 lines
5.0 KiB
CSS
:root {
|
|
--bg: #f6f7f9;
|
|
--surface: #ffffff;
|
|
--text: #1b1f24;
|
|
--muted: #5f6b7a;
|
|
--border: #d9dee5;
|
|
--accent: #2481cc;
|
|
--accent-text: #ffffff;
|
|
--bot: #eef1f5;
|
|
--player: #e3f0fb;
|
|
--error: #c0392b;
|
|
--ok: #1e8e3e;
|
|
--warn: #d68910;
|
|
--radius: 12px;
|
|
}
|
|
|
|
@media (prefers-color-scheme: dark) {
|
|
:root {
|
|
--bg: #17212b;
|
|
--surface: #1f2b38;
|
|
--text: #e9eef3;
|
|
--muted: #93a1b0;
|
|
--border: #2f3d4c;
|
|
--accent: #5aa7e6;
|
|
--accent-text: #0e1621;
|
|
--bot: #263342;
|
|
--player: #1d3b55;
|
|
--error: #ff7b6b;
|
|
--ok: #6fcf87;
|
|
--warn: #f5b041;
|
|
}
|
|
}
|
|
|
|
* { box-sizing: border-box; }
|
|
[hidden] { display: none !important; }
|
|
|
|
html, body { margin: 0; padding: 0; }
|
|
|
|
body {
|
|
background: var(--bg);
|
|
color: var(--text);
|
|
font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
-webkit-text-size-adjust: 100%;
|
|
}
|
|
|
|
.app {
|
|
max-width: 560px;
|
|
margin: 0 auto;
|
|
padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
|
|
min-height: 100vh;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
|
|
.top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
|
|
h1 { font-size: 1.5rem; margin: 0; }
|
|
h2 { font-size: 1.2rem; margin: 0 0 8px; }
|
|
.player-name { margin: 0; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
|
|
.card {
|
|
background: var(--surface);
|
|
border: 1px solid var(--border);
|
|
border-radius: var(--radius);
|
|
padding: 16px;
|
|
}
|
|
|
|
.lead { margin-top: 0; font-size: 1.05rem; }
|
|
.muted { color: var(--muted); }
|
|
.rules { padding-left: 20px; color: var(--muted); }
|
|
.error { color: var(--error); min-height: 1.4em; margin: 8px 0 0; }
|
|
|
|
button {
|
|
font: inherit;
|
|
border-radius: 10px;
|
|
border: 1px solid var(--border);
|
|
background: var(--surface);
|
|
color: var(--text);
|
|
padding: 10px 16px;
|
|
min-height: 44px;
|
|
cursor: pointer;
|
|
}
|
|
button:disabled { opacity: .6; cursor: default; }
|
|
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 600; }
|
|
button.ghost { background: transparent; color: var(--muted); align-self: center; }
|
|
|
|
.difficulty { border: 1px solid var(--border); border-radius: 10px; margin: 0 0 16px; padding: 8px 12px 12px; }
|
|
.difficulty legend { padding: 0 4px; color: var(--muted); }
|
|
.difficulty label { display: inline-flex; align-items: center; gap: 6px; margin-right: 16px; min-height: 36px; }
|
|
|
|
.scoreline { display: flex; justify-content: space-between; align-items: center; font-size: 1.05rem; }
|
|
.timer-text { font-variant-numeric: tabular-nums; font-weight: 600; }
|
|
.timer-text.low { color: var(--error); }
|
|
|
|
.timer-track { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
|
|
.timer-bar { height: 100%; width: 100%; background: var(--accent); transform-origin: left center; }
|
|
.timer-bar.low { background: var(--error); }
|
|
|
|
.move-form { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
|
|
.move-form label { color: var(--muted); }
|
|
.move-form label strong { color: var(--text); font-size: 1.15rem; }
|
|
.move-row { display: flex; gap: 8px; }
|
|
.move-row input {
|
|
flex: 1;
|
|
min-width: 0;
|
|
font: inherit;
|
|
font-size: 1.1rem;
|
|
padding: 10px 12px;
|
|
border-radius: 10px;
|
|
border: 1px solid var(--border);
|
|
background: var(--surface);
|
|
color: var(--text);
|
|
}
|
|
.move-row input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
|
|
.message { min-height: 1.4em; margin: 0; }
|
|
.message.error { color: var(--error); }
|
|
.message.thinking { color: var(--muted); }
|
|
.message.thinking::after { content: "…"; animation: blink 1s steps(2) infinite; }
|
|
@keyframes blink { 50% { opacity: 0; } }
|
|
|
|
.chain-box { display: flex; flex-direction: column; }
|
|
.chain-title { font-size: 1rem; color: var(--muted); font-weight: 600; }
|
|
.chain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column-reverse; gap: 6px; }
|
|
.chain > li { border-radius: 10px; padding: 8px 12px; background: var(--bot); }
|
|
.chain > li.player { background: var(--player); }
|
|
.chain .row { display: flex; align-items: center; gap: 8px; }
|
|
.chain .who { font-size: .8rem; color: var(--muted); min-width: 34px; }
|
|
.chain .word { font-weight: 600; flex: 1; overflow-wrap: anywhere; }
|
|
.chain .points { font-size: .85rem; color: var(--ok); }
|
|
.chain .toggle { padding: 2px 8px; min-height: 30px; font-size: .8rem; }
|
|
.chain .no-meaning { font-size: .8rem; color: var(--muted); }
|
|
.chain ol.senses { margin: 6px 0 0; padding-left: 22px; font-size: .9rem; color: var(--muted); }
|
|
.chain > li.fresh { animation: pop .35s ease-out; }
|
|
@keyframes pop { from { transform: scale(.97); opacity: .4; } to { transform: none; opacity: 1; } }
|
|
|
|
.final-score { font-size: 1.2rem; }
|
|
.suggestions { padding-left: 20px; }
|
|
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
|
|
.report-ok { color: var(--ok); }
|
|
.report-failed { color: var(--warn); }
|
|
|
|
.footer { margin-top: auto; padding-top: 8px; font-size: .8rem; color: var(--muted); text-align: center; }
|
|
.footer a { color: inherit; }
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.chain > li.fresh, .message.thinking::after { animation: none; }
|
|
}
|