Files
web-imposter-game/styles.css
Dasemu b05a59706c feat: add exit game button with confirmation dialog
- Add exit game button in top-left corner (door icon)
- Button only visible during active game phases (not in welcome/setup)
- Confirmation dialog prevents accidental exits
- Clears localStorage state and returns to welcome screen
- Fully responsive with mobile-optimized styling
- Bilingual support with Spanish/English confirmation messages
2026-01-06 18:30:42 +01:00

469 lines
14 KiB
CSS

/* Theme variables */
:root {
/* Light theme (default) */
--bg-gradient-start: #667eea;
--bg-gradient-end: #764ba2;
--container-bg: rgba(255, 255, 255, 0.15);
--container-border: rgba(255, 255, 255, 0.2);
--text-primary: #ffffff;
--text-secondary: rgba(255, 255, 255, 0.85);
--text-tertiary: rgba(255, 255, 255, 0.7);
--input-bg: rgba(255, 255, 255, 0.95);
--input-text: #2d3748;
--input-focus: #f5576c;
--button-gradient-start: #f093fb;
--button-gradient-end: #f5576c;
--button-secondary-start: #a8edea;
--button-secondary-end: #fed6e3;
--button-ghost-bg: rgba(255, 255, 255, 0.15);
--card-bg: rgba(255, 255, 255, 0.18);
--card-hover: rgba(255, 255, 255, 0.25);
--border-color: rgba(255, 255, 255, 0.25);
--shadow-color: rgba(31, 38, 135, 0.37);
--info-bg: rgba(0, 0, 0, 0.2);
--curtain-bg: #2d3748;
--pool-gradient: rgba(102, 126, 234, 0.4);
}
/* Dark theme */
[data-theme="dark"] {
--bg-gradient-start: #1a1a2e;
--bg-gradient-end: #16213e;
--container-bg: rgba(30, 30, 50, 0.85);
--container-border: rgba(255, 255, 255, 0.1);
--text-primary: #e0e0e0;
--text-secondary: rgba(224, 224, 224, 0.85);
--text-tertiary: rgba(224, 224, 224, 0.6);
--input-bg: rgba(40, 40, 60, 0.9);
--input-text: #e0e0e0;
--input-focus: #ff6b9d;
--button-gradient-start: #c850c0;
--button-gradient-end: #ff6b9d;
--button-secondary-start: #4158d0;
--button-secondary-end: #c850c0;
--button-ghost-bg: rgba(255, 255, 255, 0.08);
--card-bg: rgba(60, 60, 80, 0.5);
--card-hover: rgba(80, 80, 100, 0.6);
--border-color: rgba(255, 255, 255, 0.15);
--shadow-color: rgba(0, 0, 0, 0.5);
--info-bg: rgba(0, 0, 0, 0.4);
--curtain-bg: #1a1a2e;
--pool-gradient: rgba(30, 30, 50, 0.6);
}
/* Mobile styles and main UI */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: flex-start;
padding: 80px 10px 10px 10px;
color: var(--text-primary);
transition: background 0.3s ease;
}
.container {
width: 100%;
max-width: 480px;
background: var(--container-bg);
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 20px;
box-shadow: 0 8px 32px var(--shadow-color);
border: 1px solid var(--container-border);
display: flex;
flex-direction: column;
transition: background 0.3s ease, border 0.3s ease;
margin-bottom: 20px;
}
h1 { text-align: center; margin-bottom: 12px; font-size: 1.5em; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
h2 { text-align: center; margin: 8px 0; font-size: 1.2em; }
.screen { display: none; animation: fadeIn 0.25s ease; flex: 1; overflow-y: auto; }
.screen.active { display: flex; flex-direction: column; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.form-group { margin-bottom: 10px; }
.form-group.compact { margin-bottom: 6px; }
label { display: block; margin-bottom: 4px; font-weight: 700; font-size: 0.9em; color: var(--text-secondary); }
input {
width: 100%;
padding: 10px 12px;
border: 2px solid var(--border-color);
border-radius: 10px;
font-size: 0.95em;
background: var(--input-bg);
color: var(--input-text);
transition: border-color 0.2s ease, background 0.3s ease;
}
input:focus { outline: none; border-color: var(--input-focus); }
button {
width: 100%;
padding: 14px;
border: none;
border-radius: 12px;
font-size: 1em;
font-weight: 800;
cursor: pointer;
background: linear-gradient(135deg, var(--button-gradient-start) 0%, var(--button-gradient-end) 100%);
color: white;
box-shadow: 0 4px 15px rgba(0,0,0,0.3);
transition: transform 0.15s, box-shadow 0.15s, background 0.3s ease;
margin-top: 10px;
}
button:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
button:active { transform: scale(0.98); box-shadow: 0 2px 10px rgba(0,0,0,0.2); }
button.secondary { background: linear-gradient(135deg, var(--button-secondary-start) 0%, var(--button-secondary-end) 100%); color: #fff; }
button.ghost { background: var(--button-ghost-bg); color: var(--text-primary); font-weight: 600; }
.player-names-list { max-height: 280px; overflow-y: auto; margin-bottom: 8px; -webkit-overflow-scrolling: touch; }
.player-name-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; background: var(--card-bg); padding: 10px; border-radius: 10px; border: 1px solid var(--border-color); transition: background 0.2s ease; }
.player-name-item:hover { background: var(--card-hover); }
.player-name-item span { font-weight: 700; min-width: 76px; font-size: 0.9em; color: var(--text-secondary); }
.player-name-item input { flex: 1; padding: 8px; margin: 0; font-size: 0.9em; }
.curtain { position: relative; width: 100%; height: 280px; background: var(--curtain-bg); border-radius: 16px; overflow: hidden; margin: 12px 0; box-shadow: 0 6px 20px rgba(0,0,0,0.4); cursor: grab; user-select: none; border: 2px solid var(--border-color); transition: background 0.3s ease; }
.curtain:active { cursor: grabbing; }
.curtain-cover { position: absolute; inset: 0; background: linear-gradient(135deg, #ffa585 0%, #ffeda0 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font-size: 1.1em; font-weight: 800; color: #333; transition: transform 0.5s ease; z-index: 10; user-select: none; }
.curtain-cover.lifted { transform: translateY(-100%); }
.curtain-icon { font-size: 2.2em; }
.curtain-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; text-align: center; }
.role { font-size: 2em; font-weight: 800; padding: 10px 20px; border-radius: 12px; text-transform: uppercase; border: 3px solid transparent; }
.role.civil { background: rgba(74, 222, 128, 0.26); color: #4ade80; border-color: #4ade80; }
.role.impostor { background: rgba(239, 68, 68, 0.28); color: #ef4444; border-color: #ef4444; }
.word { font-size: 1.7em; font-weight: 800; background: rgba(255,255,255,0.16); padding: 16px 24px; border-radius: 10px; border: 2px solid rgba(255,255,255,0.28); }
.timer { font-size: 2.8em; font-weight: 800; text-align: center; margin: 16px 0; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); padding: 14px; background: rgba(0,0,0,0.22); border-radius: 12px; }
.timer.warning { color: #fbbf24; animation: pulse 1s infinite; }
.timer.danger { color: #ef4444; animation: pulse 0.55s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.info-text { text-align: center; margin: 10px 0; font-size: 0.95em; line-height: 1.5; background: var(--info-bg); padding: 12px; border-radius: 10px; color: var(--text-secondary); border: 1px solid var(--border-color); }
.player-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 12px 0; max-height: 300px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.player-item { padding: 16px 12px; background: var(--card-bg); border-radius: 12px; text-align: center; cursor: pointer; transition: transform 0.18s, background 0.18s, border 0.18s; font-weight: 700; font-size: 0.95em; border: 2px solid var(--border-color); }
.player-item:hover { background: var(--card-hover); transform: translateY(-2px); }
.player-item:active { transform: scale(0.96); }
.player-item.selected { background: var(--button-gradient-end); border-color: #fff; box-shadow: 0 0 16px rgba(245, 87, 108, 0.7); }
.player-item .vote-count { display: block; font-size: 0.85em; margin-top: 4px; opacity: 0.88; }
.results { background: rgba(255,255,255,0.16); border-radius: 10px; padding: 14px; margin: 10px 0; max-height: 400px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.role-reveal { background: rgba(0,0,0,0.3); padding: 10px; border-radius: 8px; margin: 5px 0; border-left: 4px solid transparent; font-size: 0.9em; }
.role-reveal.civil-reveal { border-left-color: #4ade80; }
.role-reveal.impostor-reveal { border-left-color: #ef4444; }
.role-reveal.executed { opacity: 0.6; background: rgba(0,0,0,0.45); }
.tag { display: inline-block; padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,0.18); margin: 3px 0; font-weight: 700; font-size: 0.85em; }
.pool-buttons {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 6px;
max-height: 200px;
overflow-y: auto;
padding: 4px 0;
-webkit-overflow-scrolling: touch;
/* Hide scrollbar in all browsers */
scrollbar-width: none; /* Firefox */
-ms-overflow-style: none; /* IE/Edge */
}
.pool-buttons::-webkit-scrollbar {
display: none; /* Chrome/Safari/Opera */
}
/* Wrapper for gradient effect */
.pool-buttons-wrapper {
position: relative;
}
.pool-buttons-wrapper::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
right: 0;
height: 30px;
background: linear-gradient(to bottom, transparent, rgba(102, 126, 234, 0.4));
pointer-events: none;
border-radius: 0 0 8px 8px;
}
.pool-btn {
padding: 10px 8px;
border-radius: 10px;
border: 2px solid var(--border-color);
background: var(--card-bg);
color: var(--text-primary);
font-weight: 700;
font-size: 0.85em;
cursor: pointer;
transition: transform 0.12s, border 0.12s, background 0.12s;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.pool-btn:hover { transform: translateY(-2px); background: var(--card-hover); }
.pool-btn.selected { border-color: var(--button-gradient-start); background: var(--button-gradient-start); color: white; box-shadow: 0 0 12px rgba(240,147,251,0.6); }
/* Welcome screen */
.welcome-content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
height: 100%;
gap: 20px;
padding: 20px 0;
}
.welcome-logo {
width: 140px;
height: 140px;
object-fit: contain;
filter: drop-shadow(0 8px 16px rgba(0,0,0,0.3));
animation: float 3s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-10px); }
}
.welcome-title {
font-size: 2em;
margin: 0;
background: linear-gradient(135deg, var(--button-gradient-start), var(--button-gradient-end));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
font-weight: 900;
text-shadow: none;
}
.welcome-subtitle {
font-size: 1.1em;
color: var(--text-secondary);
margin: -10px 0 0 0;
font-weight: 500;
}
.welcome-buttons {
display: flex;
flex-direction: column;
gap: 12px;
width: 100%;
max-width: 300px;
margin-top: 10px;
}
.welcome-credits {
color: var(--text-tertiary);
font-size: 0.85em;
margin-top: auto;
font-weight: 500;
}
/* Rules screen */
.rules-content {
flex: 1;
overflow-y: auto;
padding: 10px 0;
-webkit-overflow-scrolling: touch;
}
.rule-section {
background: var(--card-bg);
border: 2px solid var(--border-color);
border-radius: 12px;
padding: 16px;
margin-bottom: 16px;
transition: background 0.3s ease, transform 0.2s ease;
}
.rule-section:hover {
background: var(--card-hover);
transform: translateY(-2px);
}
.rule-section h3 {
margin: 0 0 12px 0;
color: var(--text-primary);
font-size: 1.1em;
}
.rule-section p {
margin: 6px 0;
color: var(--text-secondary);
line-height: 1.6;
font-size: 0.95em;
}
.rule-section p:first-of-type {
margin-top: 0;
}
.rule-section strong {
color: var(--button-gradient-end);
font-weight: 800;
}
/* Theme toggle button */
.theme-toggle {
position: fixed;
top: 20px;
right: 20px;
width: 50px;
height: 50px;
border-radius: 50%;
border: 2px solid var(--border-color);
background: var(--container-bg);
backdrop-filter: blur(10px);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5em;
box-shadow: 0 4px 12px var(--shadow-color);
transition: transform 0.2s ease, background 0.3s ease, border 0.3s ease;
z-index: 1000;
margin: 0;
padding: 0;
}
.theme-toggle:hover {
transform: scale(1.1) rotate(15deg);
background: var(--card-hover);
}
.theme-toggle:active {
transform: scale(0.95);
}
.theme-icon {
transition: transform 0.3s ease;
display: inline-block;
}
/* Language toggle button */
.language-toggle {
position: fixed;
top: 80px;
right: 20px;
width: auto;
min-width: 50px;
height: 50px;
padding: 0 15px;
border-radius: 25px;
border: 2px solid var(--border-color);
background: var(--container-bg);
backdrop-filter: blur(10px);
cursor: pointer;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 6px;
font-size: 1em;
font-weight: 600;
box-shadow: 0 4px 12px var(--shadow-color);
transition: transform 0.2s ease, background 0.3s ease, border 0.3s ease;
z-index: 1000;
color: var(--text-primary);
margin: 0;
}
.language-toggle:hover {
transform: scale(1.05);
background: var(--card-hover);
}
.language-toggle:active {
transform: scale(0.95);
}
.language-icon {
font-size: 1.2em;
transition: transform 0.3s ease;
display: inline-block;
}
.language-text {
font-size: 0.9em;
letter-spacing: 0.5px;
}
/* Exit game button */
.exit-game {
position: fixed;
top: 20px;
left: 20px;
width: auto;
height: 50px;
padding: 0 15px;
border-radius: 25px;
border: 2px solid var(--border-color);
background: var(--container-bg);
backdrop-filter: blur(10px);
cursor: pointer;
display: none;
align-items: center;
justify-content: center;
gap: 8px;
font-size: 0.9em;
font-weight: 600;
box-shadow: 0 4px 12px var(--shadow-color);
transition: transform 0.2s ease, background 0.3s ease, border 0.3s ease;
z-index: 1000;
color: var(--text-primary);
}
.exit-game.visible {
display: inline-flex;
}
.exit-game:hover {
transform: scale(1.05);
background: var(--card-hover);
}
.exit-game:active {
transform: scale(0.95);
}
.exit-icon {
font-size: 1.2em;
}
.exit-text {
font-size: 0.85em;
}
/* Mobile optimization */
@media (max-width: 600px) {
body {
padding: 70px 10px 10px 10px;
}
.theme-toggle {
top: 10px;
right: 10px;
width: 45px;
height: 45px;
font-size: 1.3em;
}
.language-toggle {
top: 65px;
right: 10px;
min-width: 45px;
height: 45px;
padding: 0 12px;
font-size: 0.9em;
}
.language-icon {
font-size: 1.1em;
}
.language-text {
font-size: 0.85em;
}
.exit-game {
top: 10px;
left: 10px;
height: 45px;
padding: 0 12px;
font-size: 0.85em;
}
.exit-icon {
font-size: 1.1em;
}
.exit-text {
font-size: 0.8em;
}
}