Files
tiennm99bot/internal/modules/loldle/web/app.css
T
tiennm99 629b513c91 feat(games): move /wordle and /loldle to the web games and add /loldledaily
/wordle and /loldle now send the wordle and loldle BotFather games in an
unlimited mode: each player gets their own word or champion, saved after
every guess, with a New game button. Cards the bot did not record as
unlimited, including the daily cards, play the daily puzzle. The helper
commands keep working on the player's round.

/loldledaily mirrors /wordledaily: one champion per day at 07:00 ICT,
subscribe and unsubscribe, the morning recap and the live group results.

The daily and unlimited machinery is shared in util/guessgame, the old
in-chat wordle module is removed, and a one-time startup migration carries
each player's stats and unfinished round over without changing old data.
2026-10-10 09:29:48 +07:00

283 lines
8.0 KiB
CSS

:root {
--bg: #1a1a2e;
--surface: #16213e;
--surface-hover: #1f2d50;
--header: #2a2a4a;
--text: #e0e0e0;
--muted: #8a8a9a;
/* Column labels are small text on --header: #a8a8b8 keeps 5.9:1 (AA). */
--head-text: #a8a8b8;
--correct: #4ecb71;
--partial: #f4b35e;
--wrong: #d85b5b;
--on-mark: #1a1a2e;
--input-bg: #0f3460;
--input-border: #533483;
--accent: #533483;
--accent-text: #c9b8ff;
--radius: 10px;
--name-col: 130px;
--cell: 90px;
--icon: 40px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
min-height: 100vh;
background: var(--bg);
color: var(--text);
font: 16px/1.4 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
-webkit-text-size-adjust: 100%;
touch-action: manipulation;
}
.app {
max-width: 900px;
margin: 0 auto;
padding: 12px 12px calc(16px + env(safe-area-inset-bottom));
display: flex;
flex-direction: column;
gap: 12px;
}
.top { text-align: center; }
.logo { margin: 0; font-size: 2rem; font-weight: 800; letter-spacing: .02em; }
.logo .accent { color: var(--accent-text); }
.mode { margin: 2px 0 0; font-weight: 600; }
.muted { color: var(--muted); }
.top .muted { margin: 0; font-size: .85rem; }
.lead { margin-top: 0; font-size: 1.05rem; }
code { font-size: .9em; }
.card {
background: var(--surface);
border: 1px solid var(--header);
border-radius: var(--radius);
padding: 16px;
}
button {
font: inherit;
border-radius: 8px;
border: 1px solid var(--input-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); font-weight: 600; }
button.ghost { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
button.ghost.confirm { border-color: var(--wrong); color: var(--wrong); }
#screen-game { display: flex; flex-direction: column; gap: 12px; }
.bar { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 36px; }
.counter { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Search: the combobox and its listbox. */
.search { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
.search input {
width: 100%;
padding: 12px 14px;
border-radius: 8px;
border: 2px solid var(--input-border);
background: var(--input-bg);
color: var(--text);
font: inherit;
outline: none;
}
.search input:focus { border-color: var(--accent-text); }
.search input:disabled { opacity: .5; }
.search input::placeholder { color: var(--muted); }
.options {
position: absolute;
top: 100%;
left: 0;
right: 0;
z-index: 30;
list-style: none;
margin: 0;
padding: 0;
max-height: 320px;
overflow-y: auto;
background: var(--surface);
border: 1px solid var(--input-border);
border-top: 0;
border-radius: 0 0 8px 8px;
}
.options li {
display: flex;
align-items: center;
gap: 10px;
padding: 6px 12px;
min-height: 48px;
cursor: pointer;
}
.options li[aria-selected="true"], .options li:hover { background: var(--surface-hover); }
/* A champion icon, or its initial when the image cannot load. */
.icon {
flex: none;
width: var(--icon);
height: var(--icon);
border-radius: 6px;
object-fit: cover;
background: var(--header);
}
.icon.badge {
display: inline-flex;
align-items: center;
justify-content: center;
font-weight: 700;
color: var(--accent-text);
}
.options .icon { --icon: 36px; }
.legend {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 6px 16px;
margin: 0;
padding: 0;
list-style: none;
font-size: .8rem;
color: var(--muted);
}
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.swatch.correct { background: var(--correct); }
.swatch.partial { background: var(--partial); }
.swatch.wrong { background: var(--wrong); }
.arrows { font-weight: 700; color: var(--text); }
/* Board: a header row, then guesses newest first. It scrolls sideways on
a narrow screen with the champion column pinned. */
.board-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.board { display: flex; flex-direction: column; gap: 4px; min-width: fit-content; margin: 0 auto; }
.grow {
display: grid;
grid-template-columns: var(--name-col) repeat(7, var(--cell));
gap: 4px;
}
.cell {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
min-height: 56px;
padding: 6px 4px;
border-radius: 4px;
font-size: .8rem;
font-weight: 500;
overflow-wrap: anywhere;
}
.head .cell {
min-height: 0;
background: var(--header);
color: var(--head-text);
font-size: .7rem;
font-weight: 600;
text-transform: uppercase;
letter-spacing: .04em;
}
.cell.name {
position: sticky;
left: 0;
z-index: 2;
justify-content: flex-start;
gap: 8px;
padding-left: 6px;
background: var(--surface);
text-align: left;
box-shadow: 4px 0 0 var(--bg);
}
.head .cell.name { background: var(--header); }
.cell.correct { background: var(--correct); color: var(--on-mark); }
.cell.partial { background: var(--partial); color: var(--on-mark); }
.cell.wrong { background: var(--wrong); color: #fff; }
.cell .dir { margin-left: 4px; font-size: 1.1em; font-weight: 700; }
.grow.fresh .cell { opacity: 0; animation: cell-reveal .3s ease forwards; }
.end { text-align: center; }
.end h2 { margin: 0 0 8px; font-size: 1.5rem; }
.end h2.won { color: var(--correct); }
.end h2.lost { color: var(--wrong); }
.end h3 { font-size: .85rem; margin: 16px 0 8px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.answer { display: flex; align-items: center; justify-content: center; gap: 12px; }
.answer p { margin: 0; color: var(--muted); }
.answer strong { color: var(--text); }
.answer .icon { --icon: 64px; border-radius: 10px; }
.answer .title { display: block; font-size: .85rem; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stats strong { display: block; font-size: 1.6rem; font-weight: 600; }
.stats span { font-size: .72rem; color: var(--muted); }
.dist { list-style: none; margin: 0 auto; padding: 0; max-width: 360px; display: flex; flex-direction: column; gap: 4px; }
.dist li { display: flex; align-items: center; gap: 6px; font-size: .85rem; }
.dist .n { width: 1.4em; text-align: right; }
.dist .bar { min-width: 8%; padding: 2px 6px; background: var(--header); text-align: right; font-weight: 700; }
.dist li.today .bar { background: var(--correct); color: var(--on-mark); }
.next { margin: 16px 0 8px; }
.next strong { font-variant-numeric: tabular-nums; }
#next-btn { display: block; margin: 0 auto 8px; }
.actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.hint { margin: 12px 0 0; font-size: .85rem; }
.toast {
position: fixed;
left: 50%;
top: 16px;
transform: translateX(-50%);
max-width: calc(100% - 32px);
margin: 0;
padding: 10px 16px;
border-radius: 6px;
background: var(--text);
color: var(--bg);
font-weight: 600;
text-align: center;
z-index: 40;
}
.offscreen { position: fixed; top: -1000px; left: 0; opacity: 0; }
.sr-only {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
padding: 0;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
@media (max-width: 768px) {
:root { --name-col: 100px; --cell: 72px; --icon: 32px; }
.cell { font-size: .7rem; min-height: 48px; padding: 4px 2px; }
}
@media (max-width: 480px) {
:root { --name-col: 84px; --cell: 60px; --icon: 28px; }
.app { padding-left: 8px; padding-right: 8px; }
.logo { font-size: 1.6rem; }
.cell.name { gap: 4px; padding-left: 4px; font-size: .65rem; }
}
@keyframes cell-reveal {
from { opacity: 0; transform: scale(.8); }
to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
.grow.fresh .cell { opacity: 1; animation: none; }
}