* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

#app {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none !important;
}

.screen {
    display: none;
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.screen.active {
    display: block;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

p {
    font-size: 1.3rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.lead {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 20px;
}

.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 10px;
    min-width: 140px;
    font-family: inherit;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-secondary {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #e9ecef;
}

.btn-warning {
    background: linear-gradient(135deg, #ff9a56, #ff6b6b);
    color: white;
}

.btn-danger {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* Game Instructions Styles */
.game-instructions {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    text-align: left;
    border: 1px solid #e9ecef;
}

.game-instructions h3 {
    font-size: 1.2rem;
    color: #495057;
    margin-bottom: 15px;
    font-weight: 600;
}

.game-instructions ol {
    margin-left: 20px;
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
}

.game-instructions li {
    margin-bottom: 10px;
}

.game-instructions li strong {
    color: #333;
}

/* Player Setup Styles */
.player-input {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.player-name-input {
    flex: 1;
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.player-name-input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-remove {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
    margin: 0;
    /* Override default button margin */
    min-width: auto;
    /* Override default button min-width */
}

.btn-remove:hover {
    background: #ee5a52;
}

/* Word Setup Styles */
.word-input {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.normal-word-input,
.unwissenden-word-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.normal-word-input:focus,
.unwissenden-word-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Game Screen Styles */
.player-avatar {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 20px auto;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.word-display {
    margin: 30px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    /* Check interaction on whole area */
    transition: background-color 0.2s;
    user-select: none;
    /* Prevent text selection during clicking/swiping */
}

.word-display:active {
    background-color: #e9ecef;
}

.word-instruction {
    font-size: 1.2rem;
    color: #495057;
    margin-bottom: 20px;
}

.swipe-area {
    width: 200px;
    height: 120px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 20px auto;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    border: 3px solid #fff;
    position: relative;
    overflow: hidden;
}

.swipe-area:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);
}

.swipe-area:active {
    transform: translateY(0);
}

.swipe-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
    pointer-events: none;
}

.swipe-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    animation: swipeUp 2s infinite;
}

.swipe-text {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

@keyframes swipeUp {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    50% {
        transform: translateY(-10px);
        opacity: 0.7;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.word-content {
    text-align: center;
    transition: opacity 0.3s ease;
}

.word-content.hidden {
    opacity: 0;
}

.word-content:not(.hidden) {
    opacity: 1;
}

#word-text {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.unwissenden-notice {
    color: #2d3748;
    padding: 8px 0;
    font-weight: 500;
    text-align: center;
    margin-top: 12px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.unwissenden-notice.hidden {
    display: none;
}

.game-controls {
    margin-top: 30px;
}

/* Unwissenden Reveal Styles */
.unwissenden-player {
    text-align: center;
    margin: 32px 0;
}

.unwissenden-player .player-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto 16px;
    font-size: 48px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    border: 4px solid #fff;
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

#unwissenden-name {
    font-size: 1.5rem;
    color: #333;
}

/* Swipe Animation */
@keyframes swipeUp {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    100% {
        transform: translateY(-20px);
        opacity: 1;
    }
}

.swipe-up {
    animation: swipeUp 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 20px;
        margin: 10px;
        border-radius: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
        min-width: 120px;
    }

    .player-input {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 8px;
        align-items: center;
        width: 100%;
        overflow: hidden;
    }

    .player-name-input {
        flex: 1;
        min-width: 0;
        padding: 10px;
        font-size: 1rem;
    }

    .btn-remove {
        flex-shrink: 0;
        width: 40px;
        height: 40px;
    }

    .game-instructions {
        padding: 15px;
        margin-top: 20px;
    }

    .game-instructions h3 {
        font-size: 1.1rem;
    }

    .game-instructions ol {
        font-size: 0.85rem;
        padding-left: 15px;
    }

    .player-avatar {
        width: 100px;
        height: 100px;
        font-size: 2.5rem;
    }

    .word-display {
        padding: 15px;
        min-height: 120px;
    }

    #word-text {
        font-size: 1.4rem;
        word-break: break-word;
    }
}

/* Touch-friendly improvements */
.btn {
    min-height: 48px;
}

input,
select {
    min-height: 44px;
}

/* Smooth transitions */
.screen {
    transition: opacity 0.3s ease;
}

/* Loading states */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Success animations */
@keyframes successPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.success {
    animation: successPulse 0.6s ease-in-out;
}

.version-display {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    padding: 15px;
    position: absolute;
    bottom: 0;
    width: 100%;
}

.version-start-screen {
    font-size: 0.85rem;
    color: #888;
    margin-top: 10px;
}

/* Improve spacing for resolution text */
#resolution-text {
    margin-bottom: 5px;
    /* Reduced from default 20px of .lead */
    margin-top: 10px;
}

#show-resolution-btn {
    margin-top: 0;
}

/* PWA Install Banner */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transform: translateY(120%);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-install-banner.show {
    transform: translateY(0);
}

.pwa-info {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.pwa-icon-preview {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.pwa-text h4 {
    margin: 0;
    font-size: 1rem;
    color: #333;
}

.pwa-text p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

.pwa-actions {
    display: flex;
    gap: 8px;
}

.pwa-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.pwa-btn-install {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.pwa-btn-close {
    background: #f1f3f5;
    color: #495057;
}

@media (max-width: 600px) {
    .pwa-install-banner {
        bottom: 15px;
        left: 15px;
        right: 15px;
        padding: 12px;
    }
    .pwa-text p {
        display: none;
    }
}

/* iOS PWA Banner - points to share button at bottom */
.pwa-ios-banner {
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
    padding: 18px 20px 28px;
}

.pwa-ios-banner::after {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: #ccc;
    border-radius: 2px;
    margin: 10px auto 0;
}