Files
argument.es/pregunta.css
Malin d42e93b013 feat: question-count tiers, footer in main, pregunta footer
- Pricing: 0,99€/10q · 9,99€/200q · 19,99€/unlimited (all 30 days)
- DB: max_questions + questions_used columns on credits table;
  consumeCreditQuestion() atomically validates, creates question,
  and decrements quota in a single transaction
- Server: updated CREDIT_TIERS, /api/credito/estado returns questionsLeft,
  /api/pregunta/enviar returns updated questionsLeft after each submission
- pregunta.tsx: badge shows live question count; submit disabled when exhausted;
  questionsLeft synced to localStorage after each submission; Cloud Host footer added
- footer: moved from Standings sidebar into <main> (scrolls with game content);
  also added to all pregunta page states

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-27 17:13:02 +01:00

358 lines
8.2 KiB
CSS

/* ── Reset & Variables ────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
--bg: #0a0a0a;
--surface: #111;
--border: #1c1c1c;
--text: #ededed;
--text-dim: #888;
--text-muted: #444;
--accent: #D97757;
--sans: 'Inter', -apple-system, sans-serif;
--mono: 'JetBrains Mono', 'SF Mono', monospace;
}
body {
background: var(--bg);
color: var(--text);
font-family: var(--sans);
font-size: 14px;
line-height: 1.5;
-webkit-font-smoothing: antialiased;
min-height: 100vh;
min-height: 100dvh;
}
/* ── Layout ────────────────────────────────────────────────────── */
.pregunta {
min-height: 100vh;
min-height: 100dvh;
display: flex;
align-items: center;
justify-content: center;
padding: 32px 20px;
}
.pregunta__panel {
width: 100%;
max-width: 480px;
display: flex;
flex-direction: column;
gap: 20px;
}
/* ── Logo ──────────────────────────────────────────────────────── */
.pregunta__logo {
display: inline-flex;
text-decoration: none;
margin-bottom: 4px;
}
.pregunta__logo img {
height: 20px;
width: auto;
}
/* ── Typography ────────────────────────────────────────────────── */
.pregunta__panel h1 {
font-size: 22px;
font-weight: 700;
line-height: 1.3;
}
.pregunta__sub {
color: var(--text-dim);
font-size: 14px;
}
/* ── Form ──────────────────────────────────────────────────────── */
.pregunta__form {
display: flex;
flex-direction: column;
gap: 12px;
}
.pregunta__label {
font-size: 13px;
font-weight: 500;
color: var(--text-dim);
}
.pregunta__textarea {
width: 100%;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px;
color: var(--text);
font-family: var(--sans);
font-size: 14px;
line-height: 1.5;
resize: vertical;
min-height: 88px;
transition: border-color 0.15s;
}
.pregunta__textarea:focus {
outline: none;
border-color: #444;
}
.pregunta__textarea::placeholder {
color: var(--text-muted);
}
.pregunta__hint {
font-size: 12px;
color: var(--text-muted);
font-family: var(--mono);
}
/* ── Error ─────────────────────────────────────────────────────── */
.pregunta__error {
background: rgba(220, 60, 60, 0.08);
border: 1px solid rgba(220, 60, 60, 0.25);
border-radius: 6px;
padding: 10px 14px;
color: #ff6b6b;
font-size: 13px;
}
/* ── Submit ────────────────────────────────────────────────────── */
.pregunta__submit {
padding: 12px 20px;
background: var(--accent);
border: none;
border-radius: 8px;
color: #fff;
font-size: 14px;
font-weight: 600;
cursor: pointer;
font-family: var(--sans);
transition: opacity 0.15s;
}
.pregunta__submit:hover:not(:disabled) {
opacity: 0.85;
}
.pregunta__submit:disabled {
opacity: 0.35;
cursor: not-allowed;
}
/* ── Status button (ok/ko states) ──────────────────────────────── */
.pregunta__btn {
display: inline-block;
padding: 12px 20px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--text);
font-size: 14px;
text-decoration: none;
text-align: center;
transition: border-color 0.15s;
}
.pregunta__btn:hover {
border-color: #444;
}
/* ── Quick links ───────────────────────────────────────────────── */
.pregunta__links {
display: flex;
gap: 16px;
align-items: center;
justify-content: center;
}
.pregunta__links a {
color: var(--text-muted);
text-decoration: none;
font-size: 13px;
}
.pregunta__links a:hover {
color: var(--text-dim);
}
.pregunta__links-sep {
color: var(--text-muted);
font-size: 13px;
}
.pregunta__link-btn {
background: none;
border: none;
padding: 0;
color: var(--text-muted);
font-size: 13px;
font-family: var(--sans);
cursor: pointer;
}
.pregunta__link-btn:hover {
color: var(--text-dim);
}
/* ── Header row (logo + credit badge) ─────────────────────────── */
.pregunta__header-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
}
.pregunta__credit-badge {
font-size: 12px;
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: 4px 12px;
white-space: nowrap;
}
.pregunta__credit-badge--empty {
color: var(--text-muted);
background: rgba(255, 255, 255, 0.03);
border-color: var(--border);
}
/* ── Success banner ────────────────────────────────────────────── */
.pregunta__success {
background: rgba(76, 175, 125, 0.1);
border: 1px solid rgba(76, 175, 125, 0.25);
border-radius: 6px;
padding: 10px 14px;
color: #4caf7d;
font-size: 13px;
font-weight: 500;
}
/* ── Username input ────────────────────────────────────────────── */
.pregunta__input {
width: 100%;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 12px;
color: var(--text);
font-family: var(--sans);
font-size: 14px;
line-height: 1.5;
transition: border-color 0.15s;
}
.pregunta__input:focus {
outline: none;
border-color: #444;
}
.pregunta__input::placeholder {
color: var(--text-muted);
}
/* ── Tier cards ────────────────────────────────────────────────── */
.tier-cards {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 10px;
}
.tier-card {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
padding: 18px 12px;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 10px;
cursor: pointer;
font-family: var(--sans);
color: var(--text);
transition: border-color 0.15s, background 0.15s;
}
.tier-card:hover {
border-color: #444;
}
.tier-card--selected {
border-color: var(--accent);
background: rgba(217, 119, 87, 0.08);
}
.tier-card__price {
font-size: 20px;
font-weight: 700;
color: var(--accent);
}
.tier-card__label {
font-size: 12px;
font-weight: 500;
color: var(--text);
}
.tier-card__sub {
font-size: 11px;
color: var(--text-muted);
}
/* ── Spinner ───────────────────────────────────────────────────── */
.pregunta__spinner {
width: 32px;
height: 32px;
border: 3px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: pregunta-spin 0.8s linear infinite;
margin: 8px auto;
}
@keyframes pregunta-spin {
to { transform: rotate(360deg); }
}
/* ── Site footer ───────────────────────────────────────────────── */
.pregunta__footer {
margin-top: 24px;
padding-top: 16px;
border-top: 1px solid var(--border);
font-size: 11px;
color: var(--text-muted);
line-height: 1.9;
text-align: center;
}
.pregunta__footer a {
color: var(--text-dim);
text-decoration: none;
}
.pregunta__footer a:hover {
color: var(--text);
text-decoration: underline;
}