DiffMT / public /style.css
Koddenbrock's picture
enhance delete-session functionality to optionally keep trial clicks
5b54cf8
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
--bg: #f2f5fb;
--surface: #ffffff;
--surface2: #eaeff8;
--border: #d0d7ea;
--accent: #1a3a70;
--red: #c84323;
--gold: #e8b830;
--green: #27733a;
--text: #18243c;
--muted: #5a6a85;
--r: 10px;
--font: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
}
html { scroll-behavior: smooth; }
body {
font-family: var(--font);
background: var(--bg);
color: var(--text);
min-height: 100dvh;
line-height: 1.5;
}
/* ── Screens ─────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; align-items: center; min-height: 100dvh; }
#screen-welcome.active, #screen-name.active { justify-content: center; padding: 2rem 1rem; }
#screen-results.active { justify-content: flex-start; padding: 2rem 1rem; }
/* ── Card ────────────────────────────────────────────────────── */
.card {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 2.5rem;
width: min(580px, 100%);
box-shadow: 0 6px 32px rgba(26, 58, 112, .09);
}
/* ── Welcome background ──────────────────────────────────────── */
#screen-welcome {
background-size: cover;
background-position: center;
position: relative;
}
#screen-welcome::before {
content: '';
position: absolute;
inset: 0;
-webkit-backdrop-filter: blur(18px) brightness(0.75) saturate(0.45);
backdrop-filter: blur(18px) brightness(0.75) saturate(0.45);
background: rgba(242, 245, 251, 0.78);
z-index: 0;
}
#screen-welcome .card {
position: relative;
z-index: 1;
}
/* ── Brand logo ──────────────────────────────────────────────── */
.brand-logo {
display: flex;
align-items: center;
gap: 0.75rem;
margin-bottom: 1.6rem;
}
.logo-img {
height: 44px;
width: auto;
flex-shrink: 0;
}
.brand-logo-text {
font-size: 0.64rem;
font-weight: 700;
letter-spacing: 0.06em;
text-transform: uppercase;
color: var(--muted);
line-height: 1.4;
}
/* ── Welcome ─────────────────────────────────────────────────── */
.badge {
display: inline-block;
background: rgba(26, 58, 112, .08);
color: var(--accent);
font-size: 0.72rem;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
padding: 0.25rem 0.7rem;
border-radius: 999px;
border: 1px solid rgba(26, 58, 112, .2);
margin-bottom: 1.1rem;
}
h1 { font-size: 2.6rem; font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 1.25rem; }
.lead { color: var(--muted); font-size: 1rem; line-height: 1.65; margin-bottom: 1.75rem; }
kbd {
display: inline-block;
background: var(--surface2);
border: 1px solid var(--border);
border-bottom-width: 2px;
border-radius: 6px;
padding: 0.2rem 0.55rem;
font-size: 0.85rem;
font-family: monospace;
color: var(--text);
line-height: 1.4;
}
/* ── Keyboard controls ───────────────────────────────────────── */
.key-row {
display: flex;
align-items: center;
gap: 1rem;
margin-bottom: 1.75rem;
}
.key-card {
flex: 1;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: var(--r);
padding: 1rem;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 0.55rem;
}
.key-chips {
display: flex;
gap: 0.4rem;
justify-content: center;
}
.key-card span {
font-size: 0.8rem;
color: var(--muted);
font-weight: 500;
}
.key-vs {
font-size: 0.72rem;
font-weight: 700;
color: var(--muted);
letter-spacing: .12em;
flex-shrink: 0;
}
.img-count {
color: var(--muted);
font-size: 0.83rem;
margin-bottom: 1.25rem;
min-height: 1.2em;
text-align: center;
}
.attribution {
text-align: center;
color: var(--muted);
font-size: 0.78rem;
margin-top: 1.25rem;
line-height: 1.5;
}
/* ── Buttons ─────────────────────────────────────────────────── */
.btn-primary {
display: block;
width: 100%;
background: var(--accent);
color: #fff;
border: none;
border-radius: var(--r);
padding: 0.85rem 1.5rem;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
touch-action: manipulation;
transition: opacity .18s, transform .1s;
}
.btn-primary.inline { width: auto; white-space: nowrap; }
.btn-primary:active:not(:disabled) { transform: translateY(0); opacity: .85; }
.btn-primary:disabled { opacity: .35; cursor: not-allowed; }
.btn-ghost {
display: block;
width: 100%;
background: none;
color: var(--muted);
border: 1px solid var(--border);
border-radius: var(--r);
padding: 0.75rem 1.5rem;
font-size: 0.9rem;
cursor: pointer;
text-align: center;
text-decoration: none;
margin-top: 0.75rem;
touch-action: manipulation;
transition: color .18s, border-color .18s;
}
/* ── Game header ─────────────────────────────────────────────── */
.game-header {
position: sticky;
top: 0;
z-index: 10;
width: 100%;
display: grid;
grid-template-columns: 1fr 3fr 1fr;
align-items: center;
gap: 1rem;
padding: 0.85rem 1.75rem;
background: var(--surface);
border-bottom: 1px solid var(--border);
box-shadow: 0 2px 10px rgba(26, 58, 112, .07);
}
.header-stat { font-size: 0.88rem; color: var(--muted); font-weight: 500; }
.header-stat.right { text-align: right; }
.progress-bar {
height: 5px;
background: var(--surface2);
border-radius: 3px;
overflow: hidden;
}
#progress-fill {
height: 100%;
background: var(--accent);
width: 0%;
transition: width .45s ease;
}
/* ── Game main ───────────────────────────────────────────────── */
.game-main {
width: 100%;
max-width: 980px;
padding: 1.5rem 1.75rem 2rem;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
gap: 1.4rem;
}
.prompt { font-size: 1.35rem; font-weight: 600; text-align: center; }
.prompt em { color: var(--accent); font-style: normal; }
/* ── Arena ───────────────────────────────────────────────────── */
.arena {
width: 100%;
display: flex;
align-items: stretch;
gap: 0.75rem;
}
.img-panel {
flex: 1;
position: relative;
border: 2px solid var(--border);
border-radius: var(--r);
overflow: hidden;
cursor: pointer;
background: #0e1420;
transition: border-color .2s ease, box-shadow .2s ease, transform .12s ease;
user-select: none;
touch-action: manipulation;
}
.img-panel:not(.disabled):active { transform: scale(.988); }
.img-panel.disabled { cursor: default; }
.img-panel img {
width: 100%;
display: block;
object-fit: contain;
max-height: 46vh;
min-height: 180px;
pointer-events: none;
}
.panel-label {
position: absolute;
top: 0.55rem;
left: 0.55rem;
background: rgba(0,0,0,.62);
color: #fff;
font-weight: 700;
font-size: 0.85rem;
padding: 0.15rem 0.45rem;
border-radius: 5px;
z-index: 2;
letter-spacing: .06em;
}
/* Neutral selection flash β€” no right/wrong revealed */
.img-panel.chosen {
border-color: var(--accent) !important;
box-shadow: 0 0 0 3px rgba(26, 58, 112, .22) !important;
}
/* ── VS divider ──────────────────────────────────────────────── */
.vs-divider {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
flex-shrink: 0;
padding: 0 0.25rem;
gap: 0.7rem;
}
.vs-divider::before, .vs-divider::after {
content: '';
flex: 1;
width: 1px;
background: var(--border);
}
.vs-divider span {
font-size: 0.75rem;
font-weight: 700;
color: var(--muted);
letter-spacing: .1em;
}
/* ── Feedback bar (kept for structural compatibility) ─────────── */
.feedback-bar {
font-size: 1.05rem;
font-weight: 600;
padding: 0.7rem 1.5rem;
border-radius: var(--r);
text-align: center;
min-height: 3.2rem;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
max-width: 600px;
opacity: 0;
transition: opacity .25s;
}
.feedback-bar.correct-fb {
opacity: 1;
background: rgba(39, 115, 58, .1);
color: var(--green);
border: 1px solid rgba(39, 115, 58, .25);
}
.feedback-bar.incorrect-fb {
opacity: 1;
background: rgba(200, 67, 35, .1);
color: var(--red);
border: 1px solid rgba(200, 67, 35, .25);
}
/* ── Trial result dots ───────────────────────────────────────── */
.trial-dots {
display: flex;
gap: 0.5rem;
justify-content: center;
flex-wrap: wrap;
margin: 0.25rem 0 1.25rem;
}
.trial-dot {
width: 14px;
height: 14px;
border-radius: 50%;
}
.trial-dot.correct { background: var(--green); }
.trial-dot.wrong { background: var(--red); }
/* ── Name entry ──────────────────────────────────────────────── */
.final-score { text-align: center; margin: 0.75rem 0 1.5rem; }
.score-big { font-size: 3.6rem; font-weight: 700; color: var(--accent); line-height: 1; }
.score-sub { font-size: 1rem; color: var(--muted); margin-top: 0.3rem; }
.enter-name-label { margin-bottom: 0.75rem; }
.input-row { display: flex; gap: 0.65rem; }
.text-input {
flex: 1;
background: var(--surface2);
border: 1px solid var(--border);
color: var(--text);
padding: 0.75rem 1rem;
border-radius: var(--r);
font-size: 1rem;
font-family: var(--font);
outline: none;
transition: border-color .18s;
min-width: 0;
}
.text-input:focus { border-color: var(--accent); }
.text-input.error { border-color: var(--red); }
/* ── Results ─────────────────────────────────────────────────── */
.results-wrap {
width: min(680px, 100%);
padding: 0 0 2rem;
}
.your-result {
background: var(--surface);
border: 1px solid rgba(26, 58, 112, .28);
border-radius: var(--r);
padding: 0.9rem 1.2rem;
margin-bottom: 1.4rem;
font-size: 0.97rem;
color: var(--text);
}
.table-wrap {
background: var(--surface);
border: 1px solid var(--border);
border-radius: var(--r);
overflow-x: auto;
margin-bottom: 1.5rem;
box-shadow: 0 2px 10px rgba(26, 58, 112, .06);
}
.lb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.lb-table th {
background: var(--surface2);
padding: 0.7rem 1rem;
text-align: left;
color: var(--muted);
font-weight: 600;
font-size: 0.78rem;
text-transform: uppercase;
letter-spacing: .06em;
border-bottom: 1px solid var(--border);
}
.lb-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); }
.lb-table tr:last-child td { border-bottom: none; }
.lb-table tr.highlight td { background: rgba(26, 58, 112, .06); font-weight: 600; }
.lb-table tr.highlight td:first-child { color: var(--accent); }
.results-actions { display: flex; gap: 0.75rem; }
.results-actions .btn-primary,
.results-actions .btn-ghost { flex: 1; margin: 0; }
/* ── Touch vs pointer visibility ────────────────────────────── */
/* touch-hidden: visible on pointer devices, hidden on touch */
.touch-hidden { display: flex; }
.pointer-hidden { display: none; }
@media (hover: none) {
.touch-hidden { display: none; }
.pointer-hidden { display: block; }
}
.tap-hint {
text-align: center;
color: var(--muted);
font-size: 0.9rem;
margin-bottom: 1.75rem;
}
/* ── Hover effects β€” pointer devices only ────────────────────── */
@media (hover: hover) and (pointer: fine) {
.img-panel:not(.disabled):hover {
border-color: var(--accent);
box-shadow: 0 0 0 3px rgba(26, 58, 112, .16);
transform: scale(1.012);
}
.btn-primary:hover:not(:disabled) { opacity: .85; transform: translateY(-1px); }
.btn-ghost:hover { color: var(--text); border-color: var(--muted); }
}
/* ── Mobile ───────────────────────────────────────────────────── */
@media (max-width: 580px) {
/* Welcome card */
h1 { font-size: 1.9rem; }
h2 { font-size: 1.35rem; }
.card { padding: 1.5rem 1.1rem; }
.brand-logo { flex-wrap: wrap; gap: 0.5rem; }
.key-row { gap: 0.5rem; }
.key-card { padding: 0.7rem 0.4rem; }
/* Game header */
.game-header {
grid-template-columns: 1fr 1fr;
grid-template-rows: auto auto;
padding: 0.6rem 1rem;
gap: 0.5rem;
}
.progress-bar { grid-column: 1 / -1; grid-row: 2; }
/* Game arena β€” stacked vertically */
.game-main { padding: 0.75rem 0.75rem 1.25rem; gap: 0.75rem; }
.prompt { font-size: 1.1rem; }
.arena { flex-direction: column; }
.vs-divider { flex-direction: row; padding: 0; gap: 0.5rem; }
.vs-divider::before, .vs-divider::after { flex: 1; height: 1px; width: auto; }
/* Each image: cap at ~32 vh so both fit with header on screen */
.img-panel img { max-height: 32vh; min-height: 0; }
/* Name entry */
.input-row { flex-direction: column; }
.btn-primary.inline { width: 100%; }
/* Results */
.score-big { font-size: 2.8rem; }
.results-actions { flex-direction: column; }
.results-wrap { padding-bottom: 1.5rem; }
}