feat: embed propose-question widget inline in main game page

- Move /pregunta flow into a compact ProposeQuestion component
  rendered inside <main> above the footer
- Tier cards, username input, Redsys payment, polling, and question
  submission all work inline without leaving the game page
- Payment redirects now go to /?credito_ok=ORDER and /?ko=1
  so the game stays in view during the full payment cycle
- Badge shows live questions remaining; updates on each submission
- Removed /pregunta link from footer (functionality is now inline)
- .propose-* CSS: compact tier grid, textarea+button row, spinner

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 17:21:35 +01:00
parent d42e93b013
commit 3e5c080466
3 changed files with 479 additions and 4 deletions

View File

@@ -769,6 +769,186 @@ body {
white-space: nowrap;
}
/* ── Propose Question widget ─────────────────────────────────── */
.propose {
flex-shrink: 0;
border-top: 1px solid var(--border);
padding: 14px 0 10px;
display: flex;
flex-direction: column;
gap: 8px;
}
.propose__head {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
}
.propose__title {
font-family: var(--mono);
font-size: 10px;
font-weight: 700;
letter-spacing: 1.2px;
text-transform: uppercase;
color: var(--text-muted);
}
.propose__badge {
font-size: 11px;
font-weight: 600;
color: #4caf7d;
background: rgba(76, 175, 125, 0.12);
border: 1px solid rgba(76, 175, 125, 0.25);
border-radius: 20px;
padding: 2px 10px;
white-space: nowrap;
}
.propose__badge--empty {
color: var(--text-muted);
background: rgba(255, 255, 255, 0.03);
border-color: var(--border);
}
.propose__tiers {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 6px;
}
.propose__tier {
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 8px 6px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 7px;
cursor: pointer;
font-family: var(--sans);
color: var(--text);
transition: border-color 0.15s, background 0.15s;
}
.propose__tier:hover { border-color: #444; }
.propose__tier--selected {
border-color: var(--accent);
background: rgba(217, 119, 87, 0.08);
}
.propose__tier__price {
font-size: 14px;
font-weight: 700;
color: var(--accent);
}
.propose__tier__label {
font-size: 10px;
color: var(--text-dim);
}
.propose__row {
display: flex;
gap: 6px;
align-items: flex-start;
}
.propose__row--mt { margin-top: 2px; }
.propose__input {
flex: 1;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
padding: 7px 10px;
color: var(--text);
font-family: var(--sans);
font-size: 13px;
min-width: 0;
}
.propose__input:focus { outline: none; border-color: #444; }
.propose__input::placeholder { color: var(--text-muted); }
.propose__textarea {
flex: 1;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 6px;
padding: 7px 10px;
color: var(--text);
font-family: var(--sans);
font-size: 13px;
line-height: 1.4;
resize: none;
min-width: 0;
}
.propose__textarea:focus { outline: none; border-color: #444; }
.propose__textarea::placeholder { color: var(--text-muted); }
.propose__btn {
padding: 7px 14px;
background: var(--accent);
border: none;
border-radius: 6px;
color: #fff;
font-size: 13px;
font-weight: 600;
cursor: pointer;
font-family: var(--sans);
white-space: nowrap;
flex-shrink: 0;
transition: opacity 0.15s;
}
.propose__btn:hover:not(:disabled) { opacity: 0.85; }
.propose__btn:disabled { opacity: 0.35; cursor: not-allowed; }
.propose__hint {
font-size: 11px;
color: var(--text-muted);
font-family: var(--mono);
}
.propose__msg {
font-size: 12px;
margin: 0;
}
.propose__msg--ok { color: #4caf7d; }
.propose__msg--error { color: #ff6b6b; }
.propose__spinner {
width: 14px;
height: 14px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: propose-spin 0.8s linear infinite;
flex-shrink: 0;
}
@keyframes propose-spin { to { transform: rotate(360deg); } }
.propose__link-btn {
background: none;
border: none;
padding: 0;
color: var(--text-muted);
font-size: 11px;
font-family: var(--mono);
cursor: pointer;
text-decoration: underline;
}
.propose__link-btn:hover { color: var(--text-dim); }
/* ── Desktop (1024px+) ───────────────────────────────────────── */
@media (min-width: 1024px) {