fix: modal overlay and game screen styling

- Move modal overlay CSS to global stylesheet for reliable overlay behavior
- Render GameCompletionModal outside main container for true overlay effect
- Refactor GameCompletionModal to use global overlay and local content styles
- Fix player score layout, color, and button styling on game detail screen
- Add global .modal and .modal.show classes to index.css
- Clean up CSS modules for modal content and responsive design

Fixes #<issue_number>
This commit is contained in:
Frank Schwenk
2025-06-06 15:56:04 +02:00
parent d81c375f1e
commit 7cb79f5ee3
6 changed files with 142 additions and 57 deletions

View File

@@ -2,26 +2,24 @@
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 1000;
display: none;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.8);
z-index: 9999;
display: flex;
justify-content: center;
align-items: center;
}
#game-completion-modal.show {
display: flex;
}
#game-completion-modal .modal-content {
background-color: #2a2a2a;
padding: 30px;
border-radius: 10px;
width: 90%;
max-width: 500px;
.modal-content {
background-color: #222;
padding: 32px 24px 24px 24px;
border-radius: 16px;
width: 90vw;
max-width: 480px;
box-shadow: 0 4px 32px rgba(0,0,0,0.7);
position: relative;
margin: auto;
transform: translateY(0);
transform: none;
}
.final-scores {
margin: 20px 0;
@@ -30,56 +28,88 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px;
margin-bottom: 10px;
padding: 18px 0;
margin-bottom: 8px;
background: #333;
border-radius: 5px;
font-size: 24px;
border-radius: 8px;
font-size: 1.2rem;
color: #fff;
}
.final-score .player-name {
font-size: 24px;
font-size: 1.2rem;
font-weight: bold;
color: white;
color: #fff;
}
.final-score .score {
font-size: 24px;
font-size: 1.2rem;
font-weight: bold;
color: white;
color: #fff;
}
.winner-announcement {
text-align: center;
margin: 20px 0;
padding: 20px;
background: #4CAF50;
border-radius: 5px;
margin: 20px 0 0 0;
padding: 18px 8px;
background: #43a047;
border-radius: 8px;
font-size: 1.2rem;
color: #fff;
font-weight: 700;
}
.winner-announcement h3 {
font-size: 24px;
font-size: 1.2rem;
margin: 0;
color: white;
color: #fff;
}
.modal-buttons {
.modal-footer {
display: flex;
gap: 10px;
margin-top: 20px;
flex-direction: row;
gap: 16px;
margin-top: 24px;
width: 100%;
justify-content: center;
}
.modal-buttons .btn {
.btn {
flex: 1;
padding: 20px;
font-size: 20px;
padding: 18px 0;
font-size: 1.1rem;
border: none;
border-radius: 0;
border-radius: 8px;
cursor: pointer;
color: white;
color: #fff;
background: #333;
font-weight: 600;
transition: background 0.2s;
}
.modal-buttons .btn--warning {
.btn--warning {
background: #f44336;
}
.modal-buttons .btn:not(.btn--warning) {
background: #333;
.btn:not(.btn--warning):hover {
background: #444;
}
#game-completion-modal h2 {
font-size: 24px;
margin-bottom: 20px;
color: white;
.btn--warning:hover {
background: #d32f2f;
}
.close-button {
position: absolute;
top: 12px;
right: 16px;
background: none;
border: none;
color: #aaa;
font-size: 2rem;
cursor: pointer;
z-index: 2;
}
.close-button:hover {
color: #fff;
}
@media (max-width: 600px) {
.modal-content {
padding: 16px 4px 16px 4px;
max-width: 98vw;
}
.btn {
font-size: 1rem;
padding: 14px 0;
}
}