theme_guess/style.css

509 lines
13 KiB
CSS

:root {
--ink: #0a0a12;
--panel: #1b1b2e;
--panel-2: #24243c;
--panel-3: #32324f;
--fg: #e9e6ff;
--fg-dim: #9a97c2;
--yellow: #ffd23f;
--pink: #ff5da2;
--cyan: #4cd4ff;
--green: #5fd75f;
--red: #ff5555;
--orange: #ffa657;
--radius: 0px;
--mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Consolas, monospace;
--pixel: 'Press Start 2P', var(--mono);
--sans: 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
--shadow-off: 4px;
}
* { box-sizing: border-box; image-rendering: pixelated; }
html, body { height: 100%; margin: 0; }
body {
min-height: 100vh;
color: var(--fg);
font-family: var(--sans);
display: flex;
justify-content: center;
padding: 14px 16px;
overflow-y: auto;
background:
repeating-linear-gradient(rgba(0,0,0,.18) 0 1px, transparent 1px 3px),
radial-gradient(ellipse at top, #232347, #0f0f1e 72%);
}
#app {
width: 100%;
max-width: 1400px;
height: calc(100vh - 28px);
max-height: calc(100vh - 28px);
display: flex;
flex-direction: column;
gap: 10px;
}
/* ---------- pixel button primitive ---------- */
.btn, .icon-btn, .theme-badge, .cat-card, .theme-card {
border-radius: var(--radius);
}
.btn {
border: 3px solid var(--ink);
padding: 12px 16px;
font-family: var(--pixel);
font-size: 11px;
text-transform: uppercase;
letter-spacing: .04em;
cursor: pointer;
color: var(--ink);
background: var(--fg);
box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink);
transition: transform .08s ease, box-shadow .08s ease, filter .1s ease;
}
.btn:hover:not(:disabled) { filter: brightness(1.08); transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active:not(:disabled) { transform: translate(var(--shadow-off), var(--shadow-off)); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: 2px 2px 0 var(--ink); }
.btn.small { padding: 7px 10px; font-size: 9px; box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost { background: var(--panel-2); color: var(--fg); }
.btn.primary { background: var(--cyan); }
.btn.reveal { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.btn.reveal:not(:disabled) { animation: revealPulse 1.6s steps(2) infinite; }
.btn.big { padding: 16px 22px; font-size: 13px; }
@keyframes revealPulse {
0%, 100% { box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink), 0 0 0 0 rgba(255,210,63,.6); }
50% { box-shadow: var(--shadow-off) var(--shadow-off) 0 var(--ink), 0 0 0 6px rgba(255,210,63,0); }
}
/* ---------- topbar ---------- */
.topbar {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-swatches { display: flex; gap: 3px; }
.brand-swatches i {
display: block; width: 8px; height: 20px;
border: 2px solid var(--ink);
}
.brand h1 {
font-family: var(--pixel);
font-size: 15px;
margin: 0;
color: var(--fg);
text-shadow: 2px 2px 0 var(--ink);
}
.brand h1 span { color: var(--yellow); }
.theme-badge {
margin-left: auto;
font-family: var(--pixel);
font-size: 9px;
color: var(--fg);
background: var(--panel-2);
border: 3px solid var(--ink);
padding: 8px 12px;
cursor: pointer;
box-shadow: 3px 3px 0 var(--ink);
transition: transform .08s ease;
}
.theme-badge:hover { transform: translate(-1px, -1px); }
.theme-badge strong { color: var(--orange); }
.topbar-actions { display: flex; gap: 8px; flex-shrink: 0; }
.icon-btn {
width: 38px; height: 38px;
border: 3px solid var(--ink);
background: var(--panel-2);
color: var(--fg);
cursor: pointer;
font-size: 15px;
box-shadow: 3px 3px 0 var(--ink);
transition: transform .08s ease;
}
.icon-btn:hover { transform: translate(-1px, -1px); }
/* ---------- progress ---------- */
.progress-wrap {
flex: 0 0 auto;
display: flex;
align-items: center;
gap: 12px;
}
.progress-track {
flex: 1;
height: 16px;
background: var(--panel-2);
border: 3px solid var(--ink);
overflow: hidden;
}
.progress-fill {
height: 100%;
width: 0%;
background: repeating-linear-gradient(90deg, var(--green) 0 8px, #4bc44b 8px 16px);
transition: width .5s steps(12);
}
#progress-label { font-family: var(--pixel); font-size: 9px; color: var(--fg-dim); white-space: nowrap; }
/* ---------- board layout ---------- */
.board {
flex: 1 1 auto;
min-height: 0;
display: flex;
gap: 14px;
}
.canvas-wrap {
position: relative;
flex: 1 1 auto;
min-height: 0;
min-width: 0;
background: var(--panel);
border: 3px solid var(--ink);
box-shadow: 5px 5px 0 var(--ink);
padding: 6px;
overflow: auto;
}
#code-canvas {
display: block;
cursor: default;
}
.panel-col {
width: 330px;
flex: 0 0 330px;
min-height: 0;
display: flex;
flex-direction: column;
gap: 8px;
}
.panel {
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
align-content: start;
padding: 2px 6px 2px 2px;
}
.panel-actions {
flex: 0 0 auto;
display: flex;
flex-direction: column;
gap: 8px;
}
.panel-actions .btn { width: 100%; }
.cat-card {
background: var(--panel-2);
border: 3px solid var(--ink);
padding: 8px;
display: flex;
align-items: center;
gap: 8px;
cursor: pointer;
box-shadow: 3px 3px 0 var(--ink);
transition: transform .08s ease, box-shadow .08s ease;
position: relative;
min-width: 0;
}
.cat-card:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.cat-card.active {
border-color: var(--yellow);
box-shadow: 3px 3px 0 var(--yellow);
}
.cat-card.assigned::after {
content: '✓';
position: absolute;
top: 2px; right: 4px;
font-size: 9px;
color: var(--green);
font-family: var(--pixel);
}
.cat-swatch {
width: 24px; height: 24px;
border: 2px solid var(--ink);
flex-shrink: 0;
background: repeating-conic-gradient(#4b4540 0% 25%, #302f2a 0% 50%) 0 0/8px 8px;
transition: transform .15s ease;
}
.cat-swatch.pop { animation: pop .4s steps(4); }
@keyframes pop {
0% { transform: scale(1); }
40% { transform: scale(1.3); }
100% { transform: scale(1); }
}
.cat-info { min-width: 0; }
.cat-label {
font-size: 8px;
line-height: 1.5;
font-family: var(--pixel);
color: var(--fg);
white-space: normal;
display: block;
margin-bottom: 4px;
}
.cat-count { font-size: 10px; color: var(--fg-dim); }
/* ---------- popover ---------- */
.popover {
position: fixed;
z-index: 50;
background: var(--panel-2);
border: 3px solid var(--ink);
padding: 12px;
box-shadow: 5px 5px 0 var(--ink);
width: 220px;
animation: popIn .15s steps(3);
}
.popover.hidden { display: none; }
@keyframes popIn {
from { opacity: 0; transform: translateY(-4px); }
to { opacity: 1; transform: translateY(0); }
}
.popover-label {
font-family: var(--pixel);
font-size: 10px;
color: var(--yellow);
margin-bottom: 10px;
text-transform: uppercase;
}
.popover-row { display: flex; gap: 8px; margin-bottom: 10px; }
.popover-row input[type="color"] {
width: 40px; height: 34px;
border: 2px solid var(--ink);
background: none; cursor: pointer;
padding: 0;
}
.popover-row input[type="text"] {
flex: 1;
min-width: 0;
background: var(--panel);
border: 2px solid var(--ink);
color: var(--fg);
font-family: var(--mono);
padding: 0 8px;
font-size: 13px;
}
.popover-actions { display: flex; justify-content: flex-end; gap: 6px; }
/* ---------- modals ---------- */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(6,6,14,.65);
backdrop-filter: blur(4px);
display: flex;
align-items: center;
justify-content: center;
z-index: 100;
padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
background: var(--panel);
border: 4px solid var(--ink);
box-shadow: 8px 8px 0 var(--ink);
padding: 26px 28px;
max-width: 480px;
width: 100%;
max-height: 90vh;
overflow: auto;
animation: modalIn .2s steps(4);
}
@keyframes modalIn {
from { opacity: 0; transform: scale(.9) translateY(14px); }
to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h2 {
margin-top: 0;
font-family: var(--pixel);
font-size: 16px;
text-shadow: 2px 2px 0 var(--ink);
color: var(--yellow);
}
.modal ol { padding-left: 20px; line-height: 1.7; color: var(--fg-dim); font-size: 13px; }
.modal p { color: var(--fg-dim); font-size: 13px; }
.pick-theme-label {
font-family: var(--pixel);
font-size: 9px;
color: var(--cyan);
text-align: center;
margin: 18px 0 10px;
}
.theme-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 8px;
margin-bottom: 16px;
}
.theme-card {
background: var(--card-bg, var(--panel-2));
border: 3px solid var(--ink);
padding: 10px;
cursor: pointer;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
box-shadow: 3px 3px 0 var(--ink);
transition: transform .08s ease;
}
.theme-card:hover { transform: translate(-1px, -1px); }
.theme-card.selected { border-color: var(--yellow); box-shadow: 3px 3px 0 var(--yellow); }
.theme-swatches { display: flex; gap: 3px; }
.theme-swatches i { width: 12px; height: 12px; border: 1px solid rgba(0,0,0,.5); display: block; }
.theme-name {
font-family: var(--pixel);
font-size: 8px;
color: var(--fg);
text-shadow: 1px 1px 0 var(--ink);
text-align: center;
}
/* ---------- theme preview countdown ---------- */
.preview-box {
background: var(--panel);
border: 4px solid var(--ink);
box-shadow: 8px 8px 0 var(--ink);
padding: 26px 30px;
max-width: 92vw;
text-align: center;
animation: modalIn .2s steps(4);
}
.preview-countdown {
font-family: var(--pixel);
font-size: 56px;
line-height: 1;
color: var(--yellow);
text-shadow: 4px 4px 0 var(--ink);
margin-bottom: 10px;
}
.preview-countdown.tick { animation: countdownPulse .45s steps(6); }
@keyframes countdownPulse {
0% { transform: scale(1.7); color: var(--pink); }
100% { transform: scale(1); color: var(--yellow); }
}
.preview-caption {
font-family: var(--pixel);
font-size: 10px;
color: var(--cyan);
margin-bottom: 18px;
letter-spacing: .05em;
}
.preview-canvas-wrap {
display: inline-block;
border: 3px solid var(--ink);
box-shadow: 4px 4px 0 var(--ink);
padding: 4px;
max-width: 100%;
max-height: 60vh;
overflow: auto;
}
#preview-canvas { display: block; }
/* ---------- score meter ---------- */
.score-meter-wrap { text-align: center; margin: 10px 0 4px; }
.score-meter-number {
font-family: var(--pixel);
font-size: 34px;
color: var(--yellow);
text-shadow: 3px 3px 0 var(--ink);
margin-bottom: 10px;
}
.score-meter-track {
display: flex;
gap: 3px;
justify-content: center;
flex-wrap: wrap;
}
.meter-block {
width: 14px; height: 20px;
background: var(--panel-2);
border: 2px solid var(--ink);
}
.meter-block.lit { background: var(--lit-color, var(--green)); }
.verdict {
text-align: center;
font-family: var(--pixel);
font-size: 12px;
margin-bottom: 16px;
min-height: 16px;
color: var(--fg);
}
.breakdown { display: flex; flex-direction: column; gap: 7px; max-height: 240px; overflow-y: auto; padding-right: 4px; }
.breakdown-row {
display: flex;
align-items: center;
gap: 10px;
opacity: 0;
animation: rowIn .3s steps(4) forwards;
}
@keyframes rowIn {
from { opacity: 0; transform: translateX(-10px); }
to { opacity: 1; transform: translateX(0); }
}
.swatch-pair { display: flex; flex-shrink: 0; }
.swatch-pair span { width: 14px; height: 14px; display: block; border: 2px solid var(--ink); }
.swatch-pair span + span { margin-left: 2px; }
.breakdown-info { flex: 1; min-width: 0; }
.breakdown-label { font-size: 10px; color: var(--fg-dim); margin-bottom: 3px; }
.breakdown-bar { height: 6px; background: var(--panel-2); border: 1px solid var(--ink); overflow: hidden; }
.breakdown-bar-fill { height: 100%; width: 0%; transition: width .6s steps(10); }
.breakdown-pct { font-size: 11px; font-weight: 700; width: 34px; text-align: right; color: var(--fg); }
.compare-toggle {
display: flex;
margin: 16px 0 6px;
background: var(--panel-2);
border: 2px solid var(--ink);
padding: 3px;
gap: 3px;
}
.toggle-btn {
flex: 1;
border: none;
background: transparent;
color: var(--fg-dim);
padding: 8px 6px;
font-family: var(--pixel);
font-size: 8px;
cursor: pointer;
}
.toggle-btn.active { background: var(--panel-3); color: var(--fg); }
.modal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.modal-actions .btn { flex: 1 1 auto; min-width: 110px; }
@media (max-width: 900px) {
body { height: auto; overflow-y: auto; }
#app { height: auto; max-height: none; }
.board { flex-direction: column; }
.canvas-wrap { max-height: 60vh; }
.panel-col { width: 100%; flex: 0 0 auto; }
.panel { grid-template-columns: repeat(3, 1fr); max-height: 40vh; }
.theme-grid { grid-template-columns: repeat(2, 1fr); }
}