:root {
    --primary-bg: #009acb;
    /* New global background color */
    --secondary-bg: #ffffff;
    --text-color: #ffffff;
    /* Adjusted for readability on dark background */
    --accent-color: #66ccff;
    /* Adjusted accent for new background */
    --accent-hover: #33bbff;
    /* Adjusted accent hover for new background */
    --danger-color: #dc3545;
    --card-bg-next: #ffc107;
    /* Orange for 'pass device' */
    --card-bg-imposter: #dc3545;
    /* Red for imposter */
    --card-bg-crewmate: #17a2b8;
    /* Blue for crewmate */
    --font-family: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
  touch-action: manipulation;
  -ms-touch-action: manipulation;
}
body {
    font-family: var(--font-family);
    background-color: var(--primary-bg);
    color: var(--text-color);
    /* Apply new text color */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}
main {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}
.screen {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding-top: 80px;
    /* Space for the fixed logo */
    padding-bottom: 80px;
    /* Balance the top padding to re-center content */
    box-sizing: border-box;
    /* Ensure padding is included in height calculation */
}
.screen.active {
    display: flex;
}
h1,
h2 {
    color: #ffffff;
    /* Adjusted for readability on dark background */
}
.subtitle {
    font-size: 1rem;
    font-weight: 300;
    /* Light font weight */
    color: rgba(255, 255, 255, 0.8);
    /* Slightly less opaque white */
    margin-top: -10px;
    /* Pull it slightly closer to the h1 */
    margin-bottom: 20px;
    /* Space before the next element */
}
.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
input[type="number"],
input[type="text"] {
    padding: 10px;
    border: 1px solid #999;
    /* Adjusted border color */
    border-radius: 8px;
    font-size: 1rem;
    text-align: center;
    width: 80%;
    max-width: 250px;
    color: var(--text-color);
    /* Ensure input text is readable */
    background-color: rgba(255, 255, 255, 0.1);
    /* Slightly transparent background for inputs */
}
input[type="number"]::placeholder,
input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.7);
    /* Light placeholder text for readability */
}
#player-names-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}
.player-name-input {
    width: 90%;
    max-width: 300px;
}
button {
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background-color: var(--accent-color);
    border: none;
    border-radius: 9999px;
    /* Fully rounded corners */
    cursor: pointer;
    transition: background-color 0.2s;
    width: 80%;
    max-width: 250px;
}
button:hover {
    background-color: var(--accent-hover);
}
button:active {
    transform: translateY(1px);
}
.card {
    background-color: var(--secondary-bg);
    /* Default white background */
    color: #333;
    /* Default dark text color */
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    aspect-ratio: 1 / 1;
    /* Make it at least square */
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    transition: background-color 0.3s, color 0.3s;
}
.card.state-next-turn {
    background-color: var(--card-bg-next);
    color: #333;
}
.card.state-imposter {
    background-color: var(--card-bg-imposter);
    color: #ffffff;
}
.card.state-crewmate {
    background-color: var(--card-bg-crewmate);
    color: #ffffff;
}
#word-display {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}
#instruction-text {
    font-size: 1.5rem;
    font-weight: 700;
}
.card-icon-container {
    order: -1;
    /* Puts the icon at the top of the flex container */
}
span.material-symbols-rounded.crewmate-icon,
span.material-symbols-rounded.imposter-icon {
    display: none;
    /* Hide icons by default */
    font-size: 3rem;
    /* Icon size */
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #ffffff;
    /* Ensure icon color is white on colored backgrounds */
}
.card.state-crewmate span.material-symbols-rounded.crewmate-icon {
    display: inline-block;
}
.card.state-imposter span.material-symbols-rounded.imposter-icon {
    display: inline-block;
}
#category-text {
    font-size: 0.9rem;
    color: #666;
    /* Default for light backgrounds */
}
.card.state-imposter #category-text,
.card.state-crewmate #category-text {
    color: rgba(255, 255, 255, 0.8);
    /* Lighter for dark card backgrounds */
}
#word-text {
    font-size: 2rem;
    font-weight: bold;
    color: var(--danger-color);
}
.card.state-imposter #word-text {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}
.card.state-imposter #category-text {
    font-size: 2rem;
    font-weight: bold;
    color: #ffffff;
}
.card.state-imposter #word-text,
.card.state-crewmate #word-text {
    color: #ffffff;
    /* White for dark card backgrounds */
}
#reveal-imposter-text {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 10px;
}
#game-over-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}
.hidden {
    display: none !important;
}
/* Start Screen Styles */
#start-screen {
    position: relative;
    height: 100vh;
    /* Full viewport height */
    justify-content: flex-start;
    /* Align content to top initially */
    padding-top: 60px;
    /* This will override the generic screen padding */
}
/* Rules screen styles */
.steps p{
	margin: 4px 0 2px 0;
}
.step-title{
	margin: 10px 0 4px 0;
	font-weight:800;
	display:block;
}
.info-icon-container {
    position: absolute;
    top: 20px;
    left: 20px;
    cursor: pointer;
}
.language-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 5px;
    z-index: 200;
}
.lang-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 0.9rem;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid #fff;
    border-radius: 50%; /* Make them circular */
    max-width: none;
}
.lang-btn.active {
    background-color: #fff;
    color: var(--primary-bg);
    font-weight: bold;
}
.info-icon {
    width: 30px;
    height: 30px;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    font-family: serif;
    /* For a classic 'i' look */
    font-size: 1.2rem;
}
.logo-container {
    margin-bottom: 20px;
    margin-top: 50px;
    width: 100%;
    display: flex;
    justify-content: center;
}
.game-logo {
    max-width: 80%;
    height: auto;
    max-height: 200px;
}
.start-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
    z-index: 10;
    /* Ensure buttons are above the image if overlap occurs */
}
.bottom-image {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 100%;
    max-height: 30vh;
    /* Limit height so it doesn't cover buttons */
    z-index: 1;
    pointer-events: none;
    /* Allow clicks pass through if needed */
}
.game-title {
    margin-bottom: 20px;
    /* Space between logo and buttons */
}
.game-title h2 {
    font-size: 2.5rem;
    /* Large font size */
    font-weight: 700;
    /* Bold (Raleway 700) */
    color: #ffffff;
    /* White for readability on dark background */
}
.subtitle-start {
    font-size: 1.2rem;
    /* A bit larger than the other subtitle */
    font-weight: 300;
    /* Light (Raleway 300) */
    color: rgba(255, 255, 255, 0.8);
    /* Slightly less opaque white */
}
.screen-logo-container {
    position: fixed;
    /* Pin to the top of the viewport */
    top: 0px;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    z-index: 100;
    /* Ensure it's above other screen content */
	background-color: var(--primary-bg);
    padding-top: 20px;
}
.screen-logo {
    max-height: 50px;
    width: auto;
}
/* Info Screen Styles */
.info-content {
    text-align: center;
    line-height: 1.6;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 12px;
    width: 100%; /* Make it take full width of its container */
}
.info-content a {
    color: #ffffff;
    font-weight: bold;
    text-decoration: underline;
}
.info-content a:hover {
    color: var(--accent-color);
}
.info-copyright {
    position: fixed; /* Position at the absolute bottom of the viewport */
    bottom: 10px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 99; /* Ensure it's above most content, but below screen-logo if present */
}
