* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: linear-gradient(135deg, #1a237e 0%, #283593 25%, #3949ab 50%, #3f51b5 75%, #1a237e 100%);
    color: white;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 20%, rgba(63, 81, 181, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(26, 35, 126, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 40% 60%, rgba(57, 73, 171, 0.2) 0%, transparent 50%);
    animation: backgroundShift 20s ease-in-out infinite;
    z-index: -1;
}

@keyframes backgroundShift {
    0%, 100% { transform: translateX(0) translateY(0); }
    25% { transform: translateX(-20px) translateY(-20px); }
    50% { transform: translateX(20px) translateY(20px); }
    75% { transform: translateX(-10px) translateY(10px); }
}

/* Logo */
.logo-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    animation: logoGlow 3s ease-in-out infinite;
}

.logo {
    height: 140px;
    width: auto;
    filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3));
}

@keyframes logoGlow {
    0%, 100% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.5)); }
}

/* Screen Management */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(50px);
}

.screen.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 180px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Username Screen */
.welcome-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    animation: cardFloat 6s ease-in-out infinite;
}

@keyframes cardFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.title {
    font-family: 'Orbitron', monospace;
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(45deg, #00d4ff, #ffd700, #ff6b6b);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    animation: titleGlow 3s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.6)); }
}

.subtitle {
    font-size: 1.8rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-weight: 500;
    text-align: center;
    white-space: nowrap;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
}

#username-input {
    width: 100%;
    max-width: 300px;
    padding: 15px 20px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    color: white;
    text-align: center;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    transition: all 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

#username-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

#username-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Primary Button */
.primary-btn {
    position: relative;
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Orbitron', monospace;
    background: linear-gradient(45deg, #00d4ff, #0099cc);
    border: none;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 180px;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.primary-btn:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.4);
}

.primary-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.2);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.primary-btn:hover:not(.disabled) .btn-glow {
    left: 100%;
}

/* Loading Screen */
.loading-content {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    animation: cardFloat 6s ease-in-out infinite;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ffd700;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 25px;
}

.loading-text {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 25px;
    color: rgba(255, 255, 255, 0.9);
}

.loading-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, #00d4ff, #ffd700);
    border-radius: 2px;
    animation: loadingProgress 2s ease-in-out forwards;
}

@keyframes loadingProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Cards Screen */
.player-greeting {
    text-align: center;
    margin-bottom: 50px;
}

.player-greeting h1 {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.player-greeting span {
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.player-greeting p {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 50px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.card-item {
    cursor: pointer;
    transition: all 0.4s ease;
    animation: cardSlideIn 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(50px);
    aspect-ratio: 2.5 / 3.5;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

.card-item:nth-child(1) { animation-delay: 0.1s; }
.card-item:nth-child(2) { animation-delay: 0.2s; }
.card-item:nth-child(3) { animation-delay: 0.3s; }
.card-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardSlideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-wrapper {
    position: relative;
    background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #1e88e5 100%);
    border: 3px solid #2196f3;
    border-radius: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    height: 100%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.card-item:hover .card-wrapper {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(33, 150, 243, 0.4);
    border-color: #64b5f6;
}

.card-item.selected .card-wrapper {
    border-color: #ffd700;
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.6);
    background: linear-gradient(135deg, #1976d2 0%, #2196f3 50%, #42a5f5 100%);
}

/* Bottom row cards (3rd and 4th) zoom down */
.card-item:nth-child(3).selected .card-wrapper,
.card-item:nth-child(4).selected .card-wrapper {
    transform: translateY(10px) scale(1.03);
}

/* Top row cards (1st and 2nd) zoom up */
.card-item:nth-child(1).selected .card-wrapper,
.card-item:nth-child(2).selected .card-wrapper {
    transform: translateY(-10px) scale(1.03);
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.4s ease;
    padding: 0;
    margin: 0;
    display: block;
}

.card-item:hover .card-image {
    transform: scale(1.02);
}

.card-overlay {
    display: none;
}

.card-overlay h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 2px;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.card-overlay p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    margin-bottom: 8px;
    font-weight: 500;
}

.card-stats {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat {
    background: linear-gradient(45deg, #ff1744, #f50057);
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* Add rating diamond */
.card-rating {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: linear-gradient(45deg, #2196f3, #64b5f6);
    transform: rotate(45deg);
    border: 2px solid white;
    z-index: 2;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-rating span {
    color: white;
    font-weight: 900;
    font-size: 0.9rem;
    font-family: 'Orbitron', monospace;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    transform: rotate(-45deg);
}

/* Add MLB logo styling */
.card-wrapper .mlb-logo {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 30px;
    height: 20px;
    background: white;
    border-radius: 3px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 900;
    color: #1976d2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Add red chevron pattern */
.card-wrapper .chevron-pattern {
    position: absolute;
    top: 50%;
    right: -20px;
    width: 40px;
    height: 100px;
    background: linear-gradient(45deg, #ff1744, #f50057);
    transform: translateY(-50%) skew(-20deg);
    z-index: 1;
    opacity: 0.8;
}

/* Add geometric pattern overlay */
.card-wrapper .pattern-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%),
        linear-gradient(-45deg, transparent 30%, rgba(255, 255, 255, 0.03) 50%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

#continue-btn {
    display: block;
    margin: 0 auto;
    z-index: 100;
    position: relative;
    margin-top: 38px;
}

/* Success Screen */
.success-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.success-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #28a745, #20c997);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin: 0 auto 30px;
    animation: successPulse 2s ease-in-out infinite;
}

.error-icon {
    width: 100px;
    height: 100px;
    background: linear-gradient(45deg, #ff6b35, #f7931e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    font-weight: bold;
    color: white;
    margin: 50px auto 30px;
    animation: errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes successPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.success-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 40px;
    color: #28a745;
    text-shadow: 0 0 20px rgba(40, 167, 69, 0.5);
}

.error-title {
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: #ff6b35;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
}

.error-message {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-weight: 500;
}

.verify-instruction {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 30px;
    font-weight: 500;
    text-align: center;
}

.selected-card-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    animation: cardReveal 1s ease-out forwards;
}

@keyframes cardReveal {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

.success-card-image {
    width: 150px;
    height: 200px;
    object-fit: contain;
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.success-card-info h2 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #ffd700;
}

.success-card-info p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Fix for verify button link styling */
#verify-btn {
    text-decoration: none !important;
    color: white !important;
    display: inline-block;
}

#verify-btn:hover, #verify-btn:focus, #verify-btn:active, #verify-btn:visited {
    text-decoration: none !important;
    color: white !important;
    outline: none !important;
}

#verify-btn::before, #verify-btn::after {
    display: none !important;
}

/* Remove any list-style or bullet points */
#verify-btn {
    list-style: none !important;
    list-style-type: none !important;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (max-width: 900px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 100px 15px 20px;
        height: 100vh !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .loading-content {
        padding: 40px 20px;
        max-width: 90% !important;
        width: 100% !important;
    }
    
    .loading-text {
        font-size: 1.2rem;
        margin-bottom: 20px;
    }
    
    .loading-spinner,
    .processing-spinner {
        width: 50px;
        height: 50px;
        border-width: 3px;
        margin-bottom: 20px;
    }
    
    .player-greeting {
        margin-bottom: 20px;
        flex-shrink: 0;
    }
    
    .player-greeting h1 {
        font-size: 1.6rem;
        margin-bottom: 5px;
    }
    
    .player-greeting p {
        font-size: 1rem;
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 15px;
        margin-bottom: 20px;
        flex-shrink: 0;
        justify-content: center;
        align-items: center;
    }
    
    .card-item {
        height: 240px;
        max-width: 180px;
        margin: 0 auto;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .verify-instruction {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    #verify-btn {
        margin-bottom: 40px;
    }
    
    .primary-btn {
        padding: 10px 25px;
        font-size: 0.9rem;
        min-width: 120px;
        z-index: 100;
        position: relative;
    }
    
    #continue-btn {
        margin-top: 28px;
        margin-bottom: 20px;
        flex-shrink: 0;
    }
    
    .selected-card-display {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
        padding: 20px;
        flex-shrink: 0;
    }
    
    .success-card-image {
        width: 100px;
        height: 130px;
    }
    
    .logo {
        height: 80px;
    }
    
    .logo-container {
        top: 30px;
    }
}

@media (max-width: 480px) {
    .welcome-card {
        padding: 30px 15px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
        white-space: normal;
    }
    
    .loading-content {
        padding: 35px 20px;
        max-width: 85% !important;
        width: 100% !important;
    }
    
    .loading-text {
        font-size: 1rem;
        margin-bottom: 18px;
    }
    
    .loading-spinner,
    .processing-spinner {
        width: 45px;
        height: 45px;
        border-width: 2px;
        margin-bottom: 18px;
    }
    
    #username-input {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
        padding: 12px 16px;
    }
    
    .logo {
        height: 70px;
    }
    
    .logo-container {
        top: 25px;
    }
    
    .container {
        padding: 90px 10px 15px;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .player-greeting {
        flex-shrink: 0;
        margin-bottom: 15px;
    }
    
    .player-greeting h1 {
        font-size: 1.4rem;
    }
    
    .player-greeting p {
        font-size: 0.9rem;
    }
    
    .cards-grid {
        gap: 12px;
        padding: 0 10px;
        flex-shrink: 0;
        justify-content: center;
        align-items: center;
    }
    
    .card-item {
        height: 200px;
        max-width: 150px;
    }
    
    .error-title {
        font-size: 1.3rem;
    }
    
    .verify-instruction {
        font-size: 0.9rem;
        margin-bottom: 18px;
    }
    
    #verify-btn {
        margin-bottom: 50px;
    }
    
    .primary-btn {
        padding: 8px 20px;
        font-size: 0.8rem;
        min-width: 100px;
        z-index: 100;
        position: relative;
    }
    
    #continue-btn {
        margin-top: 23px;
        margin-bottom: 15px;
        flex-shrink: 0;
    }
    
    .success-title {
        font-size: 1.6rem;
    }
    
    .success-card-image {
        width: 80px;
        height: 100px;
    }
    
    .selected-card-display {
        padding: 15px;
        gap: 10px;
        flex-shrink: 0;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    body {
        -webkit-overflow-scrolling: touch;
        background: linear-gradient(135deg, #1a237e 0%, #283593 25%, #3949ab 50%, #3f51b5 75%, #1a237e 100%) !important;
        background-attachment: fixed;
    }
    
    .primary-btn {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
        background: linear-gradient(45deg, #00d4ff, #0099cc) !important;
        color: white !important;
    }
    
    #continue-btn {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
        z-index: 999;
        background: linear-gradient(45deg, #00d4ff, #0099cc) !important;
        color: white !important;
    }
    
    .card-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
    }
    
    .card-wrapper {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        will-change: transform;
        background: linear-gradient(135deg, #1565c0 0%, #1976d2 50%, #1e88e5 100%) !important;
    }
    
    /* Force hardware acceleration for better performance */
    .card-item:hover .card-wrapper,
    .card-item.selected .card-wrapper {
        -webkit-transform: translateZ(0) translateY(-10px) scale(1.02);
        transform: translateZ(0) translateY(-10px) scale(1.02);
    }
    
    /* Bottom row cards (3rd and 4th) zoom down */
    .card-item:nth-child(3).selected .card-wrapper,
    .card-item:nth-child(4).selected .card-wrapper {
        -webkit-transform: translateZ(0) translateY(10px) scale(1.03);
        transform: translateZ(0) translateY(10px) scale(1.03);
        background: linear-gradient(135deg, #1976d2 0%, #2196f3 50%, #42a5f5 100%) !important;
    }
    
    /* Top row cards (1st and 2nd) zoom up */
    .card-item:nth-child(1).selected .card-wrapper,
    .card-item:nth-child(2).selected .card-wrapper {
        -webkit-transform: translateZ(0) translateY(-10px) scale(1.03);
        transform: translateZ(0) translateY(-10px) scale(1.03);
        background: linear-gradient(135deg, #1976d2 0%, #2196f3 50%, #42a5f5 100%) !important;
    }
}

/* iOS viewport fix */
@supports (-webkit-touch-callout: none) {
    .screen {
        min-height: -webkit-fill-available;
    }
    
    .container {
        min-height: -webkit-fill-available;
    }
}

/* iPhone specific fixes */
@supports (-webkit-touch-callout: none) and (orientation: portrait) {
    /* Prevent auto-zoom on iPhone */
    input, select, textarea, button {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100%;
        -webkit-appearance: none;
        appearance: none;
    }
    
    /* Fix iPhone viewport issues */
    html {
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
    
    body {
        position: relative;
        width: 100%;
        height: 100vh;
        height: -webkit-fill-available;
        overflow: hidden;
        background: linear-gradient(135deg, #1a237e 0%, #283593 25%, #3949ab 50%, #3f51b5 75%, #1a237e 100%) !important;
    }
    
    .screen {
        height: 100vh;
        height: -webkit-fill-available;
        position: fixed;
        overflow: hidden;
        background: transparent;
    }
    
    .container {
        height: 100vh !important;
        height: -webkit-fill-available !important;
        overflow: hidden;
        background: transparent;
        padding-bottom: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    /* Fix iPhone button issues */
    .primary-btn {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        outline: none;
        border: none;
        font-size: 16px !important;
        background: linear-gradient(45deg, #00d4ff, #0099cc) !important;
        color: white !important;
    }
    
    #continue-btn {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-tap-highlight-color: rgba(0,0,0,0);
        outline: none;
        border: none;
        font-size: 16px !important;
        position: relative;
        z-index: 9999;
        display: block !important;
        visibility: visible !important;
        background: linear-gradient(45deg, #00d4ff, #0099cc) !important;
        color: white !important;
        margin-top: 28px;
        margin-bottom: 20px;
        flex-shrink: 0;
    }
    
    /* Fix iPhone card issues */
    .card-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-tap-highlight-color: rgba(0,0,0,0);
    }
    
    .cards-grid {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        margin-bottom: 20px;
        flex-shrink: 0;
    }
    
    .player-greeting {
        flex-shrink: 0;
        margin-bottom: 15px;
    }
}

/* iPhone landscape fixes */
@supports (-webkit-touch-callout: none) and (orientation: landscape) {
    .container {
        padding: 100px 15px 20px;
    }
    
    .cards-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
    
    .card-item {
        height: 200px;
        max-width: 140px;
    }
}

/* Prevent iPhone Safari bounce - iOS only */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: 100%;
        overflow: hidden;
        position: relative;
        width: 100%;
        background: linear-gradient(135deg, #1a237e 0%, #283593 25%, #3949ab 50%, #3f51b5 75%, #1a237e 100%) !important;
    }
    
    .screen {
        height: 100%;
        overflow: hidden;
        position: fixed;
        width: 100%;
        background: transparent;
    }
    
    .screen.active {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        background: transparent;
        overflow: hidden;
    }
    
    /* Ensure animated background works on iPhone */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: 
            radial-gradient(circle at 20% 20%, rgba(63, 81, 181, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 80%, rgba(26, 35, 126, 0.2) 0%, transparent 50%),
            radial-gradient(circle at 40% 60%, rgba(57, 73, 171, 0.2) 0%, transparent 50%);
        animation: backgroundShift 20s ease-in-out infinite;
        z-index: -1;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Override iPhone fixes for Android */
@supports not (-webkit-touch-callout: none) {
    html, body {
        height: 100% !important;
        overflow: hidden !important;
        position: relative !important;
        width: 100% !important;
        min-height: 100vh;
    }
    
    .screen {
        height: 100% !important;
        min-height: 100vh;
        overflow: hidden !important;
        position: fixed;
        background: transparent;
    }
    
    .screen.active {
        height: 100% !important;
        min-height: 100vh;
        overflow: hidden !important;
        align-items: center !important;
        justify-content: center !important;
    }
}

/* Android specific fixes */
@media screen and (max-width: 768px) {
    .container {
        height: 100vh !important;
        overflow: hidden;
        padding-bottom: 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .screen {
        height: 100vh !important;
        overflow: hidden;
        position: fixed;
        align-items: center;
        justify-content: center;
        padding-top: 0;
    }
    
    .screen.active {
        overflow: hidden;
        height: 100vh;
        align-items: center;
        justify-content: center;
    }
    
    #continue-btn {
        margin-top: 28px;
        margin-bottom: 20px;
        position: relative;
        z-index: 1000;
        flex-shrink: 0;
    }
    
    .cards-grid {
        margin-bottom: 20px;
        flex-shrink: 0;
        justify-content: center;
        align-items: center;
    }
    
    .player-greeting {
        flex-shrink: 0;
        margin-bottom: 15px;
    }
}

/* Android Chrome specific fixes */
@supports not (-webkit-touch-callout: none) {
    .container {
        height: 100vh !important;
        min-height: 100vh;
        padding-bottom: 20px;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    
    .screen {
        height: 100vh !important;
        min-height: 100vh;
        overflow: hidden;
        align-items: center;
        justify-content: center;
        padding-top: 0;
    }
    
    .screen.active {
        overflow: hidden;
        height: 100vh;
        min-height: 100vh;
        align-items: center;
        justify-content: center;
    }
    
    #continue-btn {
        margin-top: 28px;
        margin-bottom: 20px;
        position: relative;
        z-index: 1000;
        display: block !important;
        visibility: visible !important;
        flex-shrink: 0;
    }
    
    .cards-grid {
        flex-shrink: 0;
        justify-content: center;
        align-items: center;
    }
    
    .player-greeting {
        flex-shrink: 0;
    }
}
