* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 600px;
}

.screen {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: white;
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: center;
}

h1 {
    font-size: 2.5em;
    color: #333;
    margin-bottom: 10px;
}

h2 {
    font-size: 2em;
    color: #333;
    margin-bottom: 20px;
}

.subtitle {
    color: #666;
    margin-bottom: 30px;
    font-size: 1.1em;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    transition: border-color 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.btn {
    padding: 15px 40px;
    font-size: 1.1em;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-weight: bold;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

.admin-link {
    display: block;
    margin-top: 20px;
    color: #667eea;
    text-decoration: none;
    font-size: 0.9em;
}

.admin-link:hover {
    text-decoration: underline;
}

.player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.player-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    transition: all 0.3s;
}

.player-item.you {
    background: #e7f3ff;
    border-color: #667eea;
    font-weight: bold;
}

.player-item.traitor-ally {
    background: #fff5f5;
    border-color: #dc3545;
    border-width: 2px;
}

.vote-item {
    cursor: pointer;
}

.vote-item:hover {
    background: #667eea;
    color: white;
    transform: scale(1.05);
}

.vote-item:active {
    transform: scale(0.98);
}

.vote-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.vote-item.disabled:hover {
    background: #f8f9fa;
    color: inherit;
    transform: none;
}

/* Player name header styling */
.player-name-header {
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #667eea;
    font-weight: bold;
    padding: 10px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.role-reveal-name {
    color: rgba(255, 255, 255, 0.95);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.waiting-vote-message {
    text-align: center;
    padding: 30px;
    margin: 20px 0;
}

.waiting-vote-message .message {
    font-size: 1.1em;
    font-weight: bold;
}

.message {
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #666;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.role-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.role-display {
    margin: 30px 0;
}

.role-icon {
    font-size: 5em;
    margin-bottom: 20px;
}

.role-name {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.role-name.traitor {
    color: #ff6b6b;
}

.role-name.faithful {
    color: #51cf66;
}

.role-description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
    opacity: 0.9;
}

#revealButton {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
}

#revealButton:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

#revealProgress {
    max-width: 300px;
    margin: 20px auto 0;
}

.round-info {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
    margin-bottom: 20px;
}

.vote-status {
    margin-top: 20px;
}

.vote-results {
    margin: 20px 0;
}

.vote-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.vote-count {
    font-weight: bold;
    color: #667eea;
    font-size: 1.2em;
}

.clues-display {
    margin: 20px 0;
}

.clue-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
}

.clue-header {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.clue-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #333;
}

.winner-display {
    margin: 30px 0;
}

.winner {
    font-size: 2.5em;
    font-weight: bold;
    padding: 30px;
    border-radius: 10px;
    margin: 20px 0;
}

.winner.traitor {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.winner.faithful {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

/* Mobile-friendly responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
        min-height: 100vh;
        align-items: flex-start;
        padding-top: 20px;
    }

    .container {
        max-width: 100%;
        width: 100%;
    }

    .card {
        padding: 20px;
        border-radius: 12px;
        margin: 0;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 8px;
    }

    h2 {
        font-size: 1.5em;
        margin-bottom: 15px;
    }

    .subtitle {
        font-size: 1em;
        margin-bottom: 20px;
    }

    input[type="text"] {
        padding: 12px;
        font-size: 1em;
        margin-bottom: 15px;
    }

    .btn {
        padding: 12px 30px;
        font-size: 1em;
        width: 100%;
        max-width: 100%;
    }

    .player-list {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 15px 0;
    }

    .player-item {
        padding: 12px;
        font-size: 0.95em;
    }

    .role-icon {
        font-size: 4em;
        margin-bottom: 15px;
    }

    .role-name {
        font-size: 2em;
        margin-bottom: 10px;
    }

    .role-description {
        font-size: 1em;
        line-height: 1.5;
        margin-bottom: 20px;
    }

    #revealButton {
        padding: 15px 40px;
        font-size: 1em;
        width: 100%;
        max-width: 300px;
    }

    .round-info {
        font-size: 1em;
        margin-bottom: 15px;
    }

    .vote-result-item {
        padding: 12px;
        margin: 8px 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .vote-count {
        font-size: 1.1em;
        align-self: flex-end;
    }

    .message {
        padding: 12px;
        font-size: 0.95em;
        margin: 15px 0;
    }

    .waiting-vote-message {
        padding: 20px;
        margin: 15px 0;
    }

    .waiting-vote-message .message {
        font-size: 1em;
    }

    .winner {
        font-size: 1.8em;
        padding: 20px;
        margin: 15px 0;
    }

    .clue-item {
        padding: 15px;
        margin: 10px 0;
    }

    .clue-text {
        font-size: 1em;
        line-height: 1.5;
    }

    /* Player name header */
    #playerNameHeader,
    #votingPlayerName,
    #resultsPlayerName {
        font-size: 0.95em;
        margin-bottom: 12px;
        padding: 8px;
        background: rgba(102, 126, 234, 0.1);
        border-radius: 8px;
    }

    /* Role reveal player name */
    #roleReveal .card > div:first-child {
        font-size: 0.9em;
        margin-bottom: 12px;
        padding: 8px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
        padding-top: 10px;
    }

    .card {
        padding: 15px;
    }

    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
    }

    .role-icon {
        font-size: 3em;
    }

    .role-name {
        font-size: 1.6em;
    }

    .player-list {
        gap: 8px;
    }

    .player-item {
        padding: 10px;
        font-size: 0.9em;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.95em;
    }

    input[type="text"] {
        padding: 10px;
        font-size: 0.95em;
    }

    .winner {
        font-size: 1.5em;
        padding: 15px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding: 10px;
        align-items: center;
    }

    .card {
        padding: 20px;
        max-height: 90vh;
        overflow-y: auto;
    }

    .player-list {
        grid-template-columns: repeat(2, 1fr);
        max-height: 40vh;
        overflow-y: auto;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .vote-item {
        min-height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .player-item {
        min-height: 44px;
    }

    input[type="text"] {
        min-height: 44px;
    }
}

