body {
    font-family: 'Roboto', sans-serif;
    background-color: #282c34;
    color: #f1f1f1;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    box-sizing: border-box;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
}

header {
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-family: 'Press Start 2P', cursive;
    color: #61dafb;
    margin: 0;
}

#room-info {
    font-size: 0.9em;
    color: #bbb;
}

.panel {
    background-color: #3a3f47;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    width: 100%;
    box-sizing: border-box;
}

#main-menu-panel h2, #settings-panel h2, #game-area h2, #players-panel h2, #game-over-panel h2, #used-words-panel h2, #waiting-room-panel h2 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1.2em;
    color: #61dafb;
    margin-top: 0;
    text-align: center;
}
#main-menu-panel h3 {
    font-family: 'Press Start 2P', cursive;
    font-size: 1em;
    color: #7dd3fc; 
    margin-top: 15px;
    margin-bottom: 10px;
}
#main-menu-panel h4 {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    color: #f1f1f1;
    margin-top: 10px;
    margin-bottom: 5px;
}

#game-version {
    font-size: 0.5em;
    color: #88e1fc;
    vertical-align: super;
}

#main-menu-panel #achievements-btn {
    display: block;
    margin: 15px auto;
    background-color: #ff9800; 
}
#main-menu-panel #achievements-btn:hover {
    background-color: #fb8c00;
}

#main-menu-panel label, #settings-panel label {
    margin: 10px 0 5px 0;
    display: block;
    font-size: 0.9em;
}
#main-menu-panel input[type="text"],
#main-menu-panel input[type="checkbox"],
#settings-panel input[type="number"] {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #444951;
    color: #f1f1f1;
    margin-bottom: 10px;
}
#main-menu-panel input[type="text"] {
    width: calc(100% - 18px);
}
#main-menu-panel input#private-room-code-input {
    text-transform: uppercase;
}

#main-menu-panel hr {
    border: 0;
    height: 1px;
    background: #555;
    margin: 20px 0;
}

#public-rooms-list {
    list-style: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #555;
    border-radius: 4px;
    margin-bottom: 10px;
}
#public-rooms-list li {
    padding: 10px;
    border-bottom: 1px solid #4a4f56;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#public-rooms-list li:last-child {
    border-bottom: none;
}
#public-rooms-list li button {
    font-size: 0.9em;
    padding: 5px 10px;
}

#prompt-container {
    font-size: 2em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 20px;
    color: #ffcc00;
    font-family: 'Press Start 2P', cursive;
}
#current-prompt {
    padding: 5px 10px;
    background-color: #000;
    border-radius: 4px;
}

#bomb-timer-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

#bomb-visual {
    width: 100px;
    height: 100px;
    margin-bottom: 10px;
    position: relative;
}

#bomb-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

#bomb-image.shaking {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both infinite;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0) rotate(-1deg); }
  20%, 80% { transform: translate3d(2px, 0, 0) rotate(2deg); }
  30%, 50%, 70% { transform: translate3d(-3px, 0, 0) rotate(-3deg); }
  40%, 60% { transform: translate3d(3px, 0, 0) rotate(3deg); }
}

#timer-bar-container {
    width: 80%;
    height: 20px;
    background-color: #555;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

#timer-bar {
    width: 100%;
    height: 100%;
    background-color: #4CAF50;
    border-radius: 10px;
    transition: width 0.2s linear, background-color 0.5s ease;
}

#timer-display {
    font-size: 1em;
    color: #ccc;
}

#word-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#word-input {
    flex-grow: 1;
    padding: 10px;
    font-size: 1.2em;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #444951;
    color: #f1f1f1;
}
#word-input:disabled {
    background-color: #333;
    cursor: not-allowed;
}

button {
    padding: 10px 15px;
    font-size: 1em;
    background-color: #61dafb;
    color: #282c34;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s ease;
    margin-top: 5px; 
}
button:hover:not(:disabled) {
    background-color: #88e1fc;
}
button:disabled {
    background-color: #555;
    color: #888;
    cursor: not-allowed;
}
button.back-button {
    background-color: #f44336; 
    color: white;
    margin-top: 15px;
}
button.back-button:hover:not(:disabled) {
    background-color: #d32f2f;
}

#settings-panel #reset-stats-btn {
    background-color: #ffc107; 
    color: #282c34;
    margin-left: 10px;
}
#settings-panel #reset-stats-btn:hover {
    background-color: #ffb300;
}

#message-area {
    min-height: 20px;
    text-align: center;
    color: #ff6b6b;
    font-weight: bold;
}

#player-list {
    list-style: none;
    padding: 0;
}

#player-list li {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #444951;
}
#player-list li:last-child {
    border-bottom: none;
}

.turn-arrow {
    display: inline-block;
    width: 25px; 
    font-weight: bold;
    font-size: 1.2em;
    color: yellow;
    text-align: center;
    visibility: hidden; 
}

#player-list li.current-turn .turn-arrow {
    visibility: visible; 
}

.player-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
    background-color: #555; 
    object-fit: cover;
}

.player-info {
    flex-grow: 1;
}
.player-name {
    font-weight: bold;
}
.player-name.current-player-text-highlight { 
    color: #61dafb;
}
.player-name.eliminated {
    text-decoration: line-through;
    color: #aaa;
}

.player-lives {
    font-size: 0.9em;
    color: #ffcc00;
}
.player-lives .heart { 
    color: red;
    margin-left: 2px;
}

#used-words-list {
    list-style-type: none;
    padding: 0;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.9em;
}
#used-words-list li {
    padding: 3px;
    background-color: #444951;
    margin-bottom: 3px;
    border-radius: 3px;
}

#game-over-panel {
    text-align: center;
}
#winner-message {
    font-size: 1.5em;
    color: #61dafb;
    margin-bottom: 20px;
}

#achievements-panel ul {
    list-style: none;
    padding: 0;
}

#achievements-panel li {
    background-color: #444951;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    opacity: 0.6;
}

#achievements-panel li.unlocked {
    opacity: 1;
    border-left: 5px solid #61dafb; 
}

#achievements-panel li img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
    object-fit: contain;
}

#achievements-panel li .achievement-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: #f1f1f1;
}
#achievements-panel li.unlocked .achievement-info h3 {
    color: #61dafb;
}

#achievements-panel li .achievement-info p {
    margin: 0;
    font-size: 0.9em;
    color: #ccc;
}

.achievement-toast {
    position: fixed;
    bottom: 20px;
    left: -350px; 
    background-color: #2c3e50;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 1000;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.5s ease, left 0.5s ease; 
    max-width: 300px;
}

.achievement-toast.show {
    opacity: 1;
    left: 20px;
}

.achievement-toast img {
    width: 40px;
    height: 40px;
    margin-right: 15px;
}

.achievement-toast #toast-text p {
    margin: 0;
}
.achievement-toast #toast-title {
    font-weight: bold;
    font-size: 1.1em;
    color: #61dafb;
}
.achievement-toast #toast-description {
    font-size: 0.9em;
}

#settings-room-code-display {
    font-size: 0.8em;
    background-color: #282c34;
    padding: 2px 5px;
    border-radius: 3px;
    color: #ccc;
}