chemie-spiel/style.css

449 lines
9.0 KiB
CSS

:root {
--bg-dark: #2c3e50;
--bg-sidebar: #1e272e;
--border-color: #3d4f5d;
--workspace-bg: #f8f9fa;
--text-light: #f5f6fa;
--text-muted: #a4b0be;
--primary: #3498db;
--primary-hover: #2980b9;
--shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
display: flex;
height: 100vh;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: var(--bg-dark);
color: var(--text-light);
overflow: hidden;
}
/* Sidebar Layout */
#sidebar {
width: 320px;
background-color: var(--bg-sidebar);
border-right: 1px solid var(--border-color);
display: flex;
flex-direction: column;
height: 100%;
}
.sidebar-header {
padding: 20px;
border-bottom: 1px solid var(--border-color);
}
.sidebar-header h2 {
font-size: 1.5rem;
margin-bottom: 5px;
color: #fff;
}
.sidebar-header p {
font-size: 0.85rem;
color: var(--text-muted);
}
/* Elements Selector */
#elements-section {
padding: 20px;
border-bottom: 1px solid var(--border-color);
}
#elements-section h3, #book-section h3 {
font-size: 0.9rem;
text-transform: uppercase;
letter-spacing: 1px;
color: var(--text-muted);
margin-bottom: 15px;
}
.elements-grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
gap: 10px;
}
.spawn-btn {
height: 50px;
width: 50px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
font-weight: bold;
font-size: 1.1rem;
cursor: pointer;
user-select: none;
color: #333;
border: 2px solid rgba(0,0,0,0.15);
box-shadow: 0 4px 6px rgba(0,0,0,0.2);
background-image: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, rgba(0, 0, 0, 0.3) 100%);
transition: transform 0.1s, box-shadow 0.1s;
}
/* Element Colors defined in JS, but base defaults for fallback */
.spawn-btn:hover {
transform: scale(1.1);
box-shadow: 0 6px 10px rgba(0,0,0,0.3);
}
.spawn-btn:active {
transform: scale(0.95);
}
/* Specific button text colors */
.spawn-btn[data-element="C"] {
color: #fff;
}
/* Discovery Book (Lexikon) */
#book-section {
padding: 20px;
flex-grow: 1;
display: flex;
flex-direction: column;
overflow: hidden;
}
.book-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 15px;
}
#discovery-progress {
background-color: var(--primary);
padding: 3px 8px;
border-radius: 12px;
font-size: 0.8rem;
font-weight: bold;
}
#discovery-book {
flex-grow: 1;
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 8px;
padding-right: 5px;
}
/* Scrollbar styles */
#discovery-book::-webkit-scrollbar {
width: 6px;
}
#discovery-book::-webkit-scrollbar-track {
background: transparent;
}
#discovery-book::-webkit-scrollbar-thumb {
background: var(--border-color);
border-radius: 3px;
}
.book-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 15px;
background-color: rgba(255, 255, 255, 0.03);
border: 1px solid rgba(255, 255, 255, 0.05);
border-radius: 8px;
font-size: 0.9rem;
transition: background-color 0.2s, border-color 0.2s;
user-select: none;
}
.book-item.locked {
color: var(--text-muted);
opacity: 0.6;
}
.book-item.unlocked {
background-color: rgba(52, 152, 219, 0.1);
border-color: rgba(52, 152, 219, 0.2);
cursor: pointer;
}
.book-item.unlocked:hover {
background-color: rgba(52, 152, 219, 0.2);
border-color: rgba(52, 152, 219, 0.4);
}
.book-formula {
font-weight: bold;
}
.book-name {
font-size: 0.85rem;
}
/* Labor Tisch Layout */
#lab-desk {
flex-grow: 1;
display: flex;
flex-direction: column;
height: 100%;
background-color: var(--bg-dark);
}
.desk-header {
padding: 20px;
display: flex;
justify-content: space-between;
align-items: center;
background-color: rgba(0, 0, 0, 0.1);
border-bottom: 1px solid var(--border-color);
}
.desk-header h2 {
font-size: 1.4rem;
color: #fff;
}
.desk-header p {
font-size: 0.85rem;
color: var(--text-muted);
}
.desk-controls {
display: flex;
align-items: center;
gap: 15px;
}
#stats {
font-size: 0.9rem;
color: var(--text-muted);
background-color: rgba(0,0,0,0.2);
padding: 8px 12px;
border-radius: 6px;
border: 1px solid rgba(255,255,255,0.05);
}
#clear-desk-btn {
background-color: #e74c3c;
color: white;
border: none;
padding: 8px 15px;
border-radius: 6px;
cursor: pointer;
font-weight: bold;
font-size: 0.9rem;
transition: background-color 0.2s, transform 0.1s;
}
#clear-desk-btn:hover {
background-color: #c0392b;
}
#clear-desk-btn:active {
transform: scale(0.95);
}
/* Workspace Canvas */
#workspace {
flex-grow: 1;
background-color: var(--workspace-bg);
background-image:
linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px);
background-size: 30px 30px;
margin: 20px;
border-radius: 12px;
position: relative;
overflow: hidden;
box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.15);
border: 1px solid var(--border-color);
}
/* Atoms and Molecules inside workspace */
.atom {
width: 55px;
height: 55px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
font-weight: bold;
font-size: 1.15rem;
cursor: grab;
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
user-select: none;
border: 2px solid rgba(0,0,0,0.2);
background-image: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4) 0%, rgba(0, 0, 0, 0.45) 100%);
transition: transform 0.1s;
}
.atom:active {
cursor: grabbing;
transform: scale(1.05);
}
.molecule {
padding: 12px 24px;
border-radius: 30px;
display: flex;
justify-content: center;
align-items: center;
position: absolute;
font-weight: bold;
font-size: 1.05rem;
cursor: grab;
box-shadow: 0 5px 12px rgba(0,0,0,0.3);
color: white;
user-select: none;
border: 2px solid rgba(0,0,0,0.25);
background-image: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.2) 100%);
transition: transform 0.1s;
text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.molecule:active {
cursor: grabbing;
transform: scale(1.05);
}
/* Particle Explosion Sparks */
.particle {
position: absolute;
width: 8px;
height: 8px;
border-radius: 50%;
pointer-events: none;
z-index: 100;
}
/* Modals */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
z-index: 2000;
transition: opacity 0.3s ease;
}
.modal.hidden {
opacity: 0;
pointer-events: none;
}
.modal-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(5px);
}
.modal-content {
position: relative;
background-color: #2c3e50;
border: 2px solid var(--border-color);
border-radius: 16px;
width: 450px;
max-width: 90%;
box-shadow: 0 10px 30px rgba(0,0,0,0.5);
overflow: hidden;
transform: scale(0.8);
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
color: white;
}
.modal:not(.hidden) .modal-content {
transform: scale(1);
}
.modal-header {
background-color: rgba(0, 0, 0, 0.2);
padding: 20px;
display: flex;
align-items: center;
gap: 15px;
border-bottom: 1px solid var(--border-color);
}
.modal-emoji {
font-size: 2rem;
}
.modal-header h2 {
font-size: 1.3rem;
}
.modal-body {
padding: 30px 20px;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
}
#modal-formula-badge {
background-color: var(--primary);
font-weight: bold;
font-size: 1.8rem;
padding: 10px 25px;
border-radius: 50px;
box-shadow: 0 4px 10px rgba(0,0,0,0.3);
margin-bottom: 15px;
border: 2px solid rgba(255,255,255,0.1);
}
#modal-molecule-name {
font-size: 1.4rem;
margin-bottom: 20px;
color: #ffeaa7;
}
#modal-description {
font-size: 0.95rem;
line-height: 1.5;
color: #dfe6e9;
}
.modal-footer {
padding: 15px 20px;
background-color: rgba(0, 0, 0, 0.1);
border-top: 1px solid var(--border-color);
display: flex;
justify-content: center;
}
#modal-close-btn {
background-color: var(--primary);
color: white;
border: none;
padding: 10px 30px;
border-radius: 8px;
font-size: 1rem;
font-weight: bold;
cursor: pointer;
transition: background-color 0.2s, transform 0.1s;
box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}
#modal-close-btn:hover {
background-color: var(--primary-hover);
}
#modal-close-btn:active {
transform: scale(0.95);
}