Files
kaltaquise-gamification/kidney_lab/css/styles.css
2026-04-16 08:14:20 +02:00

638 lines
14 KiB
CSS

/* ═══════════════════════════════════════════════════════════════
styles.css — Mario Lab (MW-56 Game & Watch clone)
All look-and-feel: layout, typography, colours, animations.
No game logic lives here.
═══════════════════════════════════════════════════════════════ */
/* ── Reset & base ────────────────────────────────────────────── */
*, *::before, *::after {
box-sizing: border-box;
margin: 0;
padding: 0;
}
:root {
--bg: #06101e;
--surface: #0d1e38;
--surface2: #10243f;
--border: #1a3a60;
--border2: #2a5a90;
--text: #88ccff;
--text-dim: #4a7aaa;
--text-bright:#cceeff;
--gold: #ffdd44;
--green: #44ffaa;
--red: #ff4455;
--accent: #4499ff;
--font-mono: "Courier New", "Lucida Console", monospace;
}
html, body {
height: 100%;
width: 100%;
background: var(--bg);
color: var(--text);
font-family: var(--font-mono);
overflow: hidden;
user-select: none;
}
/* ── Screen system ───────────────────────────────────────────── */
#app {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.screen {
display: none;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
flex-direction: column;
overflow-y: auto;
}
.screen.active {
display: flex;
}
/* ── Game screen: canvas centred ─────────────────────────────── */
#game-screen {
gap: 10px;
background: var(--bg);
}
#game-canvas {
display: block;
border: 2px solid var(--border2);
border-radius: 8px;
box-shadow:
0 0 0 4px var(--surface),
0 0 30px rgba(68,153,255,0.25),
0 0 60px rgba(0,0,0,0.6);
outline: none;
image-rendering: crisp-edges;
image-rendering: pixelated;
}
.controls-legend {
font-size: 11px;
color: var(--text-dim);
text-align: center;
display: flex;
gap: 24px;
flex-wrap: wrap;
justify-content: center;
}
.controls-legend kbd {
display: inline-block;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: 3px;
padding: 1px 5px;
font-size: 10px;
color: var(--text);
}
/* ── Shared button style ─────────────────────────────────────── */
.btn-primary {
display: inline-block;
background: linear-gradient(135deg, #1a5caa 0%, #0a3070 100%);
color: #cceeff;
border: 2px solid var(--border2);
border-radius: 6px;
padding: 12px 36px;
font-family: var(--font-mono);
font-size: 16px;
font-weight: bold;
letter-spacing: 3px;
cursor: pointer;
transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
text-transform: uppercase;
box-shadow: 0 0 16px rgba(68,153,255,0.3);
}
.btn-primary:hover {
background: linear-gradient(135deg, #2a7aee 0%, #1a4aa0 100%);
box-shadow: 0 0 24px rgba(68,153,255,0.55);
}
.btn-primary:active {
transform: scale(0.97);
}
/* ══════════════════════════════════════════════════════════════
INTRO SCREEN
══════════════════════════════════════════════════════════════ */
#intro-screen {
background: radial-gradient(ellipse at center, #0d1e38 0%, #06101e 100%);
}
.intro-inner {
max-width: 560px;
width: 90%;
display: flex;
flex-direction: column;
gap: 24px;
padding: 24px 0;
}
/* Logo block */
.intro-logo {
text-align: center;
line-height: 1.1;
}
.logo-gw {
display: block;
font-size: 13px;
letter-spacing: 6px;
color: var(--text-dim);
text-transform: uppercase;
}
.logo-title {
display: block;
font-size: clamp(32px, 8vw, 54px);
font-weight: bold;
letter-spacing: 8px;
color: var(--text-bright);
text-shadow:
0 0 20px rgba(68,153,255,0.7),
0 0 40px rgba(68,153,255,0.4);
animation: title-pulse 3s ease-in-out infinite;
}
.logo-model {
display: block;
font-size: 14px;
letter-spacing: 4px;
color: var(--gold);
margin-top: 4px;
}
@keyframes title-pulse {
0%, 100% { text-shadow: 0 0 20px rgba(68,153,255,0.7), 0 0 40px rgba(68,153,255,0.4); }
50% { text-shadow: 0 0 30px rgba(68,200,255,1), 0 0 60px rgba(68,153,255,0.7); }
}
/* Description */
.intro-description {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 18px;
font-size: 13px;
line-height: 1.7;
color: var(--text);
}
.intro-description strong {
color: var(--gold);
}
/* Rules */
.intro-rules {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 18px;
}
.intro-rules table {
width: 100%;
border-collapse: collapse;
font-size: 12px;
}
.intro-rules td {
padding: 4px 6px;
color: var(--text);
}
.intro-rules .pts {
text-align: right;
font-weight: bold;
font-size: 13px;
}
.intro-rules .pos { color: var(--green); }
.intro-rules .neg { color: var(--red); }
.rule-note {
margin-top: 10px;
font-size: 11px;
color: var(--text-dim);
line-height: 1.6;
}
.rule-note strong {
color: var(--text-bright);
}
/* Controls hint */
.intro-controls {
font-size: 12px;
color: var(--text-dim);
line-height: 1.8;
text-align: center;
}
.intro-controls kbd {
display: inline-block;
background: var(--surface2);
border: 1px solid var(--border);
border-radius: 3px;
padding: 1px 6px;
font-size: 11px;
color: var(--text);
}
.intro-controls em {
color: var(--accent);
font-style: normal;
}
/* Form */
.intro-form {
display: flex;
flex-direction: column;
align-items: center;
gap: 14px;
}
.intro-form label {
font-size: 12px;
letter-spacing: 3px;
color: var(--text-dim);
text-transform: uppercase;
}
.intro-form input[type="text"] {
background: var(--surface2);
border: 2px solid var(--border2);
border-radius: 6px;
color: #ffffff;
font-family: var(--font-mono);
font-size: 20px;
font-weight: bold;
letter-spacing: 4px;
padding: 10px 20px;
text-align: center;
text-transform: uppercase;
width: 240px;
outline: none;
transition: border-color 0.15s, box-shadow 0.15s;
}
.intro-form input[type="text"]:focus {
border-color: var(--accent);
box-shadow: 0 0 16px rgba(68,153,255,0.4);
}
.intro-form input[type="text"]::placeholder {
color: var(--text-dim);
letter-spacing: 2px;
}
/* Player count selection */
.player-select {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
.player-select-label {
font-size: 11px;
letter-spacing: 4px;
color: var(--text-dim);
text-transform: uppercase;
}
.player-select-btns {
display: flex;
gap: 20px;
}
.btn-player-count {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 110px;
height: 100px;
background: var(--surface2);
border: 2px solid var(--border);
border-radius: 10px;
color: var(--text);
font-family: var(--font-mono);
cursor: pointer;
transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
gap: 4px;
}
.btn-player-count:hover {
background: linear-gradient(135deg, #1a5caa 0%, #0a3070 100%);
border-color: var(--accent);
box-shadow: 0 0 20px rgba(68,153,255,0.45);
}
.btn-player-count:active {
transform: scale(0.96);
}
.btn-player-count .pcount {
font-size: 42px;
font-weight: bold;
color: var(--gold);
line-height: 1;
}
.btn-player-count .pcount-label {
font-size: 11px;
letter-spacing: 3px;
color: var(--text-dim);
}
/* Mode badge & name rows (step 2) */
.mode-badge {
font-size: 11px;
letter-spacing: 4px;
color: var(--gold);
background: rgba(255,221,68,0.1);
border: 1px solid rgba(255,221,68,0.3);
border-radius: 4px;
padding: 4px 14px;
margin-bottom: 4px;
}
.name-row {
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.name-row label {
font-size: 11px;
letter-spacing: 3px;
color: var(--text-dim);
text-transform: uppercase;
}
.form-actions {
display: flex;
gap: 14px;
align-items: center;
margin-top: 4px;
}
/* Secondary (back) button */
.btn-secondary {
display: inline-block;
background: transparent;
color: var(--text-dim);
border: 2px solid var(--border);
border-radius: 6px;
padding: 10px 20px;
font-family: var(--font-mono);
font-size: 13px;
letter-spacing: 2px;
cursor: pointer;
transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover {
border-color: var(--border2);
color: var(--text);
}
/* ══════════════════════════════════════════════════════════════
HIGH SCORE SCREEN
══════════════════════════════════════════════════════════════ */
#highscore-screen {
background: radial-gradient(ellipse at center, #0d1e38 0%, #06101e 100%);
}
.hs-inner {
max-width: 580px;
width: 90%;
display: flex;
flex-direction: column;
gap: 20px;
padding: 24px 0;
}
.hs-logo {
text-align: center;
line-height: 1.1;
}
.hs-result {
text-align: center;
background: var(--surface);
border: 2px solid var(--border);
border-radius: 10px;
padding: 20px 16px;
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
}
.hs-result.hs-gold {
border-color: var(--gold);
box-shadow: 0 0 24px rgba(255,221,68,0.35);
animation: gold-pulse 2s ease-in-out infinite;
}
@keyframes gold-pulse {
0%, 100% { box-shadow: 0 0 24px rgba(255,221,68,0.35); }
50% { box-shadow: 0 0 40px rgba(255,221,68,0.65); }
}
.hs-rank-label {
font-size: 14px;
font-weight: bold;
color: var(--gold);
letter-spacing: 2px;
}
.hs-player {
font-size: 22px;
font-weight: bold;
color: var(--text-bright);
letter-spacing: 5px;
}
.hs-score-display {
font-size: 56px;
font-weight: bold;
color: var(--gold);
line-height: 1;
text-shadow: 0 0 20px rgba(255,221,68,0.6);
}
.hs-score-label {
font-size: 12px;
letter-spacing: 4px;
color: var(--text-dim);
text-transform: uppercase;
}
/* Table */
.hs-table-wrap {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px;
overflow-x: auto;
}
.hs-heading {
font-size: 12px;
letter-spacing: 4px;
color: var(--text-dim);
text-align: center;
margin-bottom: 12px;
text-transform: uppercase;
}
.hs-table {
width: 100%;
border-collapse: collapse;
font-size: 13px;
}
.hs-table th {
text-align: left;
color: var(--text-dim);
font-size: 10px;
letter-spacing: 2px;
padding: 4px 8px 8px;
border-bottom: 1px solid var(--border);
}
.hs-table td {
padding: 6px 8px;
color: var(--text);
border-bottom: 1px solid rgba(26,58,96,0.4);
}
.hs-table .rank-col { color: var(--text-dim); width: 30px; }
.hs-table .name-col { font-weight: bold; letter-spacing: 2px; }
.hs-table .score-col { color: var(--gold); text-align: right; }
.hs-table .date-col { color: var(--text-dim); font-size: 11px; text-align: right; }
.hs-table tr.my-row td {
background: rgba(68,153,255,0.12);
color: #cceeff;
}
.hs-table tr.my-row .score-col { color: var(--gold); }
.hs-actions {
display: flex;
justify-content: center;
}
/* ══════════════════════════════════════════════════════════════
MOBILE JOYSTICK CONTROLS
══════════════════════════════════════════════════════════════ */
.joystick-wrap {
position: fixed;
bottom: 24px;
/* horizontal position is set entirely by .joy-left / .joy-right */
display: none; /* hidden by default on desktop/mouse */
flex-direction: column;
align-items: center;
gap: 6px;
z-index: 100;
}
/* Only show on touch/coarse-pointer devices (phones, tablets) */
@media (pointer: coarse) {
.joystick-wrap { display: flex; }
}
/* Explicit left AND right on every variant so fixed positioning
never falls back to the element's static (centred) position */
.joystick-wrap.joy-right { right: 24px; left: unset; }
.joystick-wrap.joy-left { left: 24px; right: unset; }
.joystick-label {
font-size: 10px;
letter-spacing: 3px;
color: var(--text-dim);
text-transform: uppercase;
}
/* Outer ring */
.joystick-base {
width: 120px;
height: 120px;
border-radius: 50%;
background: rgba(13, 30, 56, 0.75);
border: 2px solid var(--border2);
box-shadow: 0 0 24px rgba(0,0,0,0.55), inset 0 0 16px rgba(0,0,0,0.3);
position: relative;
touch-action: none;
-webkit-tap-highlight-color: transparent;
}
.joystick-base.active {
border-color: var(--accent);
box-shadow: 0 0 24px rgba(68,153,255,0.35), inset 0 0 16px rgba(0,0,0,0.3);
}
/* Direction hint rings (subtle) */
.joystick-base::before {
content: '';
position: absolute;
inset: 14px;
border-radius: 50%;
border: 1px dashed rgba(68,153,255,0.18);
pointer-events: none;
}
/* Draggable knob */
.joystick-knob {
width: 48px;
height: 48px;
border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #4499ff, #1a4aa0);
border: 2px solid var(--accent);
box-shadow: 0 0 14px rgba(68,153,255,0.55);
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
pointer-events: none;
transition: box-shadow 0.1s;
will-change: transform;
}
.joystick-base.active .joystick-knob {
box-shadow: 0 0 22px rgba(68,153,255,0.85);
}
/* ── Scrollbar styling ───────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border2); }