escape_game/src/style.css

531 lines
20 KiB
CSS

:root {
--bg: #0b0d0f;
--panel: #15181c;
--line: #2a2f36;
--text: #e9e2d0;
--muted: #9a927f;
--brass: #c9a24a;
--brass-dark: #8a6a25;
--hud-h: 76px;
--serif: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html, body {
margin: 0;
height: 100%;
background: var(--bg);
color: var(--text);
font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
overflow: hidden;
user-select: none;
}
#app { height: 100%; }
button {
font: inherit;
color: var(--text);
background: #1e2328;
border: 1px solid var(--line);
border-radius: 6px;
padding: 8px 14px;
cursor: pointer;
transition: background .15s, border-color .15s;
}
button:hover:not(:disabled) { background: #272d34; border-color: var(--brass-dark); }
button.primary { background: var(--brass); color: #1a1408; border-color: var(--brass); font-weight: 600; }
button.primary:hover { background: #dbb55c; }
/* ---------- Écrans (menu, victoire) ---------- */
.screen {
position: absolute;
inset: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 18px;
padding: 24px;
background: radial-gradient(ellipse at 50% 35%, #1d2526 0%, #0b0d0f 70%);
text-align: center;
z-index: 50;
}
.screen h1 {
font-family: var(--serif);
font-size: clamp(48px, 9vw, 96px);
letter-spacing: .25em;
margin: 0;
color: var(--brass);
text-shadow: 0 0 40px rgba(201, 162, 74, .3);
}
.tagline { color: var(--muted); margin: -8px 0 18px; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.chapters { display: flex; flex-direction: column; gap: 14px; width: min(520px, 100%); }
.chapter {
text-align: left;
background: rgba(21, 24, 28, .85);
border: 1px solid var(--line);
border-radius: 10px;
padding: 18px 20px;
}
.chapter-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.chapter h2 { font-family: var(--serif); font-weight: normal; margin: 0; font-size: 22px; }
.chapter p { color: var(--muted); margin: 8px 0 14px; line-height: 1.5; }
.difficulty { color: var(--brass); letter-spacing: 2px; white-space: nowrap; }
.chapter-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.new-game { color: var(--muted); font-size: 14px; margin-left: 4px; }
.keys { color: var(--muted); font-size: 12px; max-width: 560px; line-height: 1.6; margin-top: 18px; }
.win { background: rgba(5, 6, 7, .88); animation: fadeIn 1.2s ease both; }
.win h1 { letter-spacing: .06em; }
.outro { max-width: 560px; line-height: 1.7; color: var(--text); font-family: var(--serif); font-size: 18px; }
.stats { display: flex; gap: 40px; color: var(--muted); text-transform: uppercase; font-size: 12px; letter-spacing: .1em; }
.stats span { display: block; font-family: var(--serif); font-size: 36px; color: var(--brass); letter-spacing: 0; text-transform: none; }
/* ---------- Jeu ---------- */
.game {
position: relative;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.stage-wrap {
flex: 1;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
min-height: 0;
}
.stage {
position: relative;
width: min(100vw, calc((100vh - var(--hud-h)) * var(--ratio)));
aspect-ratio: var(--ratio);
overflow: hidden;
background: #000;
}
.scenes, .hotspots { position: absolute; inset: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.hotspots { pointer-events: none; }
.hotspot { position: absolute; pointer-events: auto; }
.scenes canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.loading {
position: absolute;
inset: 0;
display: grid;
place-items: center;
color: var(--muted);
font-family: var(--serif);
letter-spacing: .1em;
background: #000;
transition: opacity .6s;
pointer-events: none;
z-index: 5;
}
.loading.done { opacity: 0; }
.hotspot.nav[data-id="__left"]:hover { background: linear-gradient(to right, rgba(255, 255, 255, .07), transparent); }
.hotspot.nav[data-id="__right"]:hover { background: linear-gradient(to left, rgba(255, 255, 255, .07), transparent); }
.hotspot.nav[data-id="__back"]:hover { background: linear-gradient(to top, rgba(255, 255, 255, .06), transparent); }
/* Flèches de navigation toujours visibles, mises en avant au survol */
.nav-arrow {
--t: translateY(-50%);
position: absolute;
width: clamp(40px, 4.4vw, 58px);
aspect-ratio: 1;
border-radius: 50%;
display: grid;
place-items: center;
color: #f4e6c8;
background: rgba(8, 9, 10, .5);
border: 1px solid rgba(244, 230, 200, .3);
box-shadow: 0 4px 14px rgba(0, 0, 0, .5);
opacity: .6;
transform: var(--t);
transition: opacity .2s, transform .2s, background .2s, color .2s;
pointer-events: none;
}
.nav-arrow svg { width: 56%; height: 56%; }
.hotspot.nav[data-id="__left"] .nav-arrow { left: 14px; top: 50%; }
.hotspot.nav[data-id="__right"] .nav-arrow { right: 14px; top: 50%; }
.hotspot.nav[data-id="__back"] .nav-arrow { --t: translateX(-50%); bottom: 12px; left: 50%; }
.hotspot.nav:hover .nav-arrow {
opacity: 1;
color: #1a1408;
background: rgba(201, 162, 74, .92);
border-color: #f0d590;
transform: var(--t) scale(1.12);
}
/* Mode debug (touche D) */
.debug .hotspot { outline: 2px dashed rgba(255, 80, 200, .9); background: rgba(255, 80, 200, .12); }
.debug .hotspot.nav { outline-color: rgba(80, 200, 255, .7); background: rgba(80, 200, 255, .06); }
.debug .hotspot::after {
content: attr(data-debug);
position: absolute;
left: 2px;
top: 2px;
font: 11px/1.2 monospace;
background: rgba(0, 0, 0, .7);
color: #fff;
padding: 1px 4px;
}
.debug-info {
display: none;
position: absolute;
top: 0;
left: 0;
right: 0;
font: 12px monospace;
background: rgba(0, 0, 0, .7);
color: #ff8de0;
padding: 4px 8px;
pointer-events: none;
z-index: 30;
}
.debug .debug-info { display: block; }
/* Mode debug : étiquettes des zones (les objets eux-mêmes sont teintés dans le rendu 3D). */
.debug-zones { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.debug-zone-label { position: absolute; transform: translate(-50%, -50%); font: 12px/1 ui-monospace, monospace; white-space: nowrap; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.drag-box { position: absolute; border: 2px solid #ffe14d; background: rgba(255, 225, 77, .15); pointer-events: none; z-index: 25; }
/* Messages et infobulle */
.message {
position: absolute;
left: 50%;
top: 14px;
transform: translate(-50%, -12px);
max-width: min(700px, 80%);
padding: 12px 20px;
background: rgba(8, 9, 10, .86);
border: 1px solid rgba(201, 162, 74, .35);
border-radius: 8px;
font-family: var(--serif);
font-size: clamp(13px, 1.45vw, 17px);
line-height: 1.5;
text-align: center;
opacity: 0;
pointer-events: none;
transition: opacity .3s, transform .3s;
z-index: 20;
box-shadow: 0 10px 40px rgba(0, 0, 0, .6);
}
/* Le message ne bloque jamais les clics sur la scène. */
.message.visible { opacity: 1; transform: translate(-50%, 0); }
.message.hint { border-color: #5aa0d8; }
.message.hint::before { content: 'Indice — '; color: #7fbaea; font-style: italic; }
.message-text { display: block; }
.clue-btn {
pointer-events: auto;
margin-top: 10px;
font: 600 13px/1 system-ui, sans-serif;
padding: 8px 14px;
background: #2a2214;
border-color: var(--brass-dark);
color: #f1d58e;
}
.clue-btn::before { content: ''; display: inline-block; width: 12px; height: 14px; margin-right: 8px; vertical-align: -2px; background: linear-gradient(#e9dec4, #cdb88a); border-left: 3px solid #8a3a2a; border-radius: 1px; }
.clue-btn:disabled { opacity: .8; cursor: default; }
/* Mode difficile : bouton discret, en bas à droite du message. */
.message .clue-btn { display: block; margin: 10px -8px -4px auto; padding: 6px 10px; font-size: 12px; }
/* Mode facile : mention « noté d'office ». */
.clue-noted { display: block; margin-top: 8px; font: italic 12px/1 system-ui, sans-serif; color: #c9a24a; text-align: right; }
.clue-noted::before { content: '✓ '; }
/* Halo de la lampe UV (le révélateur d'encre est calculé en 3D, ceci est l'effet lumineux) */
.uv-halo {
position: absolute;
left: 0;
top: 0;
width: clamp(140px, 17vw, 230px);
aspect-ratio: 1;
border-radius: 50%;
background: radial-gradient(circle, rgba(180, 120, 255, .5) 0%, rgba(140, 80, 255, .28) 40%, rgba(90, 40, 220, 0) 70%);
mix-blend-mode: screen;
pointer-events: none;
opacity: 0;
transition: opacity .25s;
z-index: 12;
}
.uv-halo.visible { opacity: 1; }
/* Annonce « Objet obtenu » */
.item-toast {
position: absolute;
left: 50%;
top: 46%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
padding: 18px 34px 16px;
border-radius: 14px;
background: radial-gradient(ellipse at center, rgba(20, 16, 8, .92), rgba(8, 7, 4, .85));
border: 1px solid rgba(201, 162, 74, .55);
box-shadow: 0 0 60px rgba(201, 162, 74, .25), 0 20px 50px rgba(0, 0, 0, .7);
opacity: 0;
pointer-events: none;
z-index: 24;
}
.item-toast img { width: 72px; height: 72px; filter: drop-shadow(0 0 14px rgba(255, 215, 130, .45)); }
.item-toast-label { font: 600 11px/1 system-ui, sans-serif; letter-spacing: .25em; text-transform: uppercase; color: var(--brass); }
.item-toast-name { font-family: var(--serif); font-size: clamp(20px, 2.4vw, 28px); color: #f4e6c8; }
.item-toast.show { animation: toast 2.4s ease forwards; }
@keyframes toast {
0% { opacity: 0; transform: translate(-50%, -40%) scale(.9); }
12% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
70% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
100% { opacity: 0; transform: translate(-50%, -62%) scale(.98); }
}
.slot.fresh { animation: fresh 0.8s ease 3; border-color: var(--brass); }
@keyframes fresh { 50% { box-shadow: 0 0 0 3px rgba(201, 162, 74, .6), 0 0 22px rgba(201, 162, 74, .6); } }
/* Carnet d'indices */
.notebook-btn b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 4px; padding: 0 4px; border-radius: 9px; background: var(--brass); color: #1a1408; font-size: 11px; }
.notebook-btn.pulse { animation: fresh .8s ease 2; }
.notebook {
position: relative;
width: min(560px, 84%);
max-height: 80%;
overflow: auto;
padding: 26px 34px 30px 52px;
border-radius: 6px;
background:
repeating-linear-gradient(transparent 0 31px, rgba(90, 120, 160, .28) 31px 32px),
linear-gradient(90deg, transparent 38px, rgba(200, 70, 60, .45) 38px 40px, transparent 40px),
#efe6cf;
color: #2a2a4a;
box-shadow: 0 25px 60px rgba(0, 0, 0, .8);
font-family: 'Segoe Script', 'Bradley Hand', 'Comic Sans MS', cursive;
}
.notebook h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 24px; color: #3a2a1a; }
.notebook ol { margin: 0; padding-left: 18px; line-height: 32px; font-size: 16px; }
.notebook-entry { position: relative; cursor: pointer; }
.notebook-entry:hover > span { color: #4a3a6a; }
.notebook-strike { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.notebook-strike path { fill: none; stroke: #c0281e; stroke-linecap: round; opacity: .85; }
.notebook-empty { font-family: var(--serif); font-style: italic; color: #6a5a4a; line-height: 1.6; }
.notebook .puzzle-close { top: 10px; right: 10px; color: var(--text); }
.tooltip {
position: absolute;
left: 0;
top: 0;
padding: 4px 10px;
background: rgba(0, 0, 0, .75);
border-radius: 4px;
font-size: 13px;
white-space: nowrap;
pointer-events: none;
opacity: 0;
transition: opacity .15s;
z-index: 15;
}
.tooltip.visible { opacity: 1; }
/* HUD */
.hud {
height: var(--hud-h);
width: 100%;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 0 16px;
background: linear-gradient(#111417, #0b0d0f);
border-top: 1px solid var(--line);
}
.inventory { display: flex; gap: 8px; }
.slot {
width: 56px;
height: 56px;
padding: 4px;
border-radius: 8px;
background: #15191d;
border: 1px solid var(--line);
display: grid;
place-items: center;
}
.slot:disabled { opacity: .45; cursor: default; }
/* Objet en main ou glissé : toutes les cases invitent à essayer (sans trahir les bonnes paires). */
.slot.target:hover, .slot.drop-over { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(201, 162, 74, .35); }
.inventory.dragging .slot:not(:disabled) { border-style: dashed; }
.slot img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.slot.selected { border-color: var(--brass); box-shadow: 0 0 0 2px rgba(201, 162, 74, .35), 0 0 18px rgba(201, 162, 74, .35); background: #242014; }
.hud-right { display: flex; align-items: center; gap: 8px; }
.hud-btn span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: #5aa0d8; color: #08121b; font-weight: 700; font-size: 12px; margin-right: 4px; }
.timer { font-family: var(--serif); color: var(--muted); font-size: 18px; min-width: 64px; text-align: right; margin-right: 6px; font-variant-numeric: tabular-nums; }
.held-item {
position: fixed;
left: 0;
top: 0;
width: 44px;
height: 44px;
background: center / contain no-repeat;
pointer-events: none;
opacity: 0;
z-index: 40;
filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .6));
}
.held-item.visible { opacity: .95; }
/* Puzzles */
.puzzle-layer { position: absolute; inset: 0; pointer-events: none; z-index: 22; }
.puzzle-overlay {
position: absolute;
inset: 0;
display: grid;
place-items: center;
background: rgba(0, 0, 0, .72);
pointer-events: auto;
opacity: 0;
transition: opacity .25s;
}
.puzzle-overlay.visible { opacity: 1; }
.puzzle-box { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.puzzle-title { font-family: var(--serif); color: var(--muted); letter-spacing: .15em; text-transform: uppercase; font-size: 13px; }
.puzzle-close { position: absolute; top: -6px; right: -54px; width: 38px; height: 38px; border-radius: 50%; padding: 0; font-size: 22px; line-height: 1; }
/* ---------- Puzzle colorCode ---------- */
.cc-panel {
position: relative;
padding: 34px 40px 22px;
border-radius: 14px;
background:
repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 5px),
linear-gradient(160deg, #5d6268, #3a3e43 55%, #2c2f33);
border: 2px solid #1c1e21;
box-shadow: inset 0 2px 0 rgba(255, 255, 255, .18), inset 0 -3px 0 rgba(0, 0, 0, .4), 0 25px 60px rgba(0, 0, 0, .8);
display: flex;
flex-direction: column;
align-items: center;
gap: 22px;
width: min(560px, 80vw);
}
.cc-screws i {
position: absolute;
width: 12px;
height: 12px;
border-radius: 50%;
background: radial-gradient(circle at 35% 35%, #b9bdc2, #565a60);
box-shadow: inset 0 0 0 1px #2a2c2f;
}
.cc-screws i::after { content: ''; position: absolute; left: 2px; right: 2px; top: 5px; height: 2px; background: #2a2c2f; transform: rotate(35deg); }
.cc-screws i:nth-child(1) { top: 10px; left: 10px; }
.cc-screws i:nth-child(2) { top: 10px; right: 10px; }
.cc-screws i:nth-child(3) { bottom: 10px; left: 10px; }
.cc-screws i:nth-child(4) { bottom: 10px; right: 10px; }
.cc-plate {
font-family: var(--serif);
font-size: 13px;
letter-spacing: .2em;
text-transform: uppercase;
color: #2a2418;
background: linear-gradient(#d8bf7a, #a8873d);
padding: 6px 16px;
border-radius: 3px;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 1px 2px rgba(0, 0, 0, .5);
}
.cc-slots { display: flex; gap: clamp(14px, 3vw, 30px); }
.cc-slot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cc-num { font-family: var(--serif); color: #d7d9dc; font-size: 18px; text-shadow: 0 1px 0 #000; }
.cc-button {
--c: #2a2a2a;
width: clamp(56px, 9vw, 84px);
height: clamp(56px, 9vw, 84px);
border-radius: 50%;
padding: 0;
border: 4px solid #1b1c1e;
background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 45%), var(--c);
box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .45), 0 0 0 3px #6b7076, 0 4px 8px rgba(0, 0, 0, .5);
transition: transform .08s, box-shadow .2s;
}
.cc-button:hover:not(:disabled) { background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .55), transparent 45%), var(--c); border-color: #1b1c1e; }
.cc-button:active { transform: scale(.94); }
.cc-button.lit { box-shadow: inset 0 -6px 12px rgba(0, 0, 0, .35), 0 0 0 3px #6b7076, 0 0 26px var(--c); }
.cc-bottom { display: flex; align-items: center; gap: 18px; }
.cc-led { width: 18px; height: 18px; border-radius: 50%; background: #3a1a1a; box-shadow: inset 0 0 4px #000, 0 0 0 2px #222; }
.cc-led.ko { background: #ff3b30; box-shadow: 0 0 14px #ff3b30, 0 0 0 2px #222; }
.cc-led.ok { background: #3fe06a; box-shadow: 0 0 16px #3fe06a, 0 0 0 2px #222; }
.cc-validate {
font-family: var(--serif);
letter-spacing: .2em;
font-weight: bold;
background: linear-gradient(#9b2b22, #6b1a14);
border: 2px solid #2b0d0a;
color: #f3dcd4;
padding: 10px 26px;
border-radius: 6px;
box-shadow: 0 4px 0 #2b0d0a;
}
.cc-validate:hover:not(:disabled) { background: linear-gradient(#b0342a, #7b211a); border-color: #2b0d0a; }
.cc-validate:active { transform: translateY(3px); box-shadow: 0 1px 0 #2b0d0a; }
.cc-validate:disabled { opacity: .5; cursor: default; }
.cc-help { font-size: 11px; color: #b6b9bd; opacity: .7; }
.cc-panel.shake { animation: shake .4s; }
.cc-panel.solved .cc-button { animation: pulse 1s ease; }
@keyframes shake {
20%, 60% { transform: translateX(-8px); }
40%, 80% { transform: translateX(8px); }
}
@keyframes pulse { 50% { transform: scale(1.1); } }
/* ---------- Puzzle caesar (roue de chiffrement) ---------- */
.cz-panel {
display: flex;
gap: 28px;
align-items: center;
padding: 26px 30px;
width: min(760px, 86vw);
border-radius: 12px;
background:
radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, .06), transparent 60%),
linear-gradient(160deg, #3b2a1c, #22170e);
border: 2px solid #120b06;
box-shadow: inset 0 1px 0 rgba(255, 255, 255, .1), 0 25px 60px rgba(0, 0, 0, .8);
}
.cz-wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.cz-wheel { width: clamp(200px, 24vw, 280px); height: auto; user-select: none; }
.cz-outer-disc { fill: #c9a24a; stroke: #6d4f17; stroke-width: 3; }
.cz-inner-disc { fill: #e9dec4; stroke: #8a7a5a; stroke-width: 2; }
.cz-hub { fill: #3b2a1c; stroke: #c9a24a; stroke-width: 3; }
.cz-marker { fill: #d64541; }
.cz-ring-outer text { fill: #2a1d0c; font-family: var(--serif); font-weight: bold; }
.cz-ring-inner text { fill: #5a2323; font-family: var(--serif); }
.cz-ring-inner { transition: transform .25s ease; }
.cz-buttons { display: flex; align-items: center; gap: 12px; }
.cz-buttons button { width: 44px; height: 44px; border-radius: 50%; font-size: 20px; padding: 0; }
.cz-offset { font-family: var(--serif); color: #e2c983; min-width: 92px; text-align: center; }
.cz-text { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cz-caption { font-family: var(--serif); color: #e2c983; font-style: italic; margin-bottom: 6px; }
.cz-label { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #a8906a; margin-top: 8px; }
.cz-cipher, .cz-plain {
font-family: 'Courier New', monospace;
font-size: clamp(14px, 1.6vw, 19px);
letter-spacing: .12em;
line-height: 1.55;
padding: 10px 12px;
border-radius: 6px;
word-break: break-word;
}
.cz-cipher { background: #efe6cf; color: #3a2a6a; }
.cz-plain { background: rgba(0, 0, 0, .35); color: #e9e2d0; border: 1px solid rgba(201, 162, 74, .25); }
.cz-note-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.cz-note-status { font-size: 12px; color: #b9a988; font-style: italic; }
.cz-help { font-size: 12px; color: #b9a988; opacity: .8; line-height: 1.5; margin-top: 8px; }
@media (max-width: 700px) { .cz-panel { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}