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

:root {
    --device-width: 375px;
    --device-height: 667px;
    --safe-area-top: env(safe-area-inset-top, 15px);
}

body {
    background: #0a0a0a;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mobile-container {
    width: 100%;
    height: 100vh;
    background: white;
    display: flex;
    flex-direction: column;
    position: relative;
}

.header {
    background: linear-gradient(to right, #302c76, #4f2481);
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-size: 20px;
    font-weight: 600;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 1000;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
}

/* Add safe area border in standalone PWA mode */
@media (display-mode: standalone) {
    .header {
        border-top: var(--safe-area-top) solid black;
        height: calc(46px + var(--safe-area-top));
    }
}

.header-title {
    display: flex;
    align-items: center;
}

.lang-selector {
    height: 16px;
    border-radius: 2px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.lang-selector img {
    height: 16px;
    width: 24px;
    border-radius: 2px;
}

.lang-selector:hover {
    opacity: 0.8;
}

.content {
    flex: 1;
    background: white;
    overflow: hidden;
    z-index: 1;
    margin-bottom: 80px;
    position: relative;
}

.content-container {
    display: flex;
    width: 600%;
    height: 100%;
    transition: transform 0.3s ease-out;
    transform: translateX(0%);
}

.content-section {
    width: 16.666667%;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex-shrink: 0;
}

/* Hide scrollbars in Safari/WebKit */
.content-section::-webkit-scrollbar {
    display: none;
}

.mobile-container {
    -webkit-overflow-scrolling: touch;
}

/* Additional Safari scrollbar hiding */
*::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

.footer {
    background: #07030e;
    height: 80px;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 1px;
    padding: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.menu-item {
    background: transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    transition: all 0.2s ease;
    cursor: pointer;
}

.menu-item.selected {
    background: #004bb5;
}

.menu-item:active {
    transform: scale(0.95);
    opacity: 0.7;
}

.menu-item:hover:not(.selected) {
    opacity: 0.8;
}

/* Desktop view - mobile simulator */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .mobile-container {
        width: var(--device-width);
        height: var(--device-height);
        overflow: hidden;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
        border: 8px solid #2c2c2c;
        position: relative;
    }

    .header {
        position: sticky;
        top: 0;
    }

    .footer {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }
}

.device-switcher {
    position: fixed;
    right: 20px;
    top: 45%;
    transform: translateY(-50%);
    background: #2c2c2c;
    border: none;
    border-radius: 12px;
    padding: 12px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    z-index: 1000;
    display: none;
    transition: all 0.2s ease;
}

.device-switcher:hover {
    background: #404040;
}

.offline-simulator {
    position: fixed;
    right: 20px;
    top: 55%;
    transform: translateY(-50%);
    background: #22c55e;
    border: none;
    border-radius: 12px;
    padding: 12px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    z-index: 1000;
    display: none;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
}

.offline-simulator:hover {
    opacity: 0.8;
}

.offline-simulator.offline {
    background: #ef4444;
}

.offline-simulator.online {
    background: #22c55e;
}

.device-menu {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: #2c2c2c;
    border-radius: 12px;
    padding: 8px;
    z-index: 1001;
    display: none;
    min-width: 180px;
}

.device-option {
    padding: 12px 16px;
    color: white;
    cursor: pointer;
    border-radius: 8px;
    font-size: 14px;
    transition: background 0.2s ease;
}

.device-option:hover {
    background: #404040;
}

.device-option.active {
    background: #8B5CF6;
}

/* Show device switcher and offline simulator only on desktop */
@media (min-width: 768px) {
    .device-switcher {
        display: block;
    }
    .offline-simulator {
        display: block;
    }
}

/* Offline overlay styles */
.offline-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10002;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* On desktop, overlay only covers mobile container */
@media (min-width: 768px) {
    .offline-overlay {
        /* No border-radius needed - will inherit container's rounded corners */
    }
}

.offline-overlay.show {
    display: flex;
}

.offline-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
}

.offline-icon {
    font-size: 32px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.offline-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ff6b6b;
}

.offline-message {
    font-size: 16px;
    line-height: 1.5;
    margin-bottom: 30px;
    opacity: 0.9;
}

.retry-button {
    background: #8B5CF6;
    color: white;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-button:hover {
    background: #7C3AED;
    transform: translateY(-1px);
}

.retry-button:active {
    transform: translateY(0);
}

/* Language overlay styles */
.language-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.language-overlay.show {
    display: flex;
}

.language-content {
    text-align: center;
    padding: 40px 20px;
    max-width: 400px;
}

.language-option {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 16px 24px;
    margin: 8px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    color: white;
    font-size: 16px;
    width: 100%;
}

.language-option:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.language-option:active {
    transform: translateY(0);
}

.language-flag {
    height: 24px;
    width: 36px;
    margin-right: 16px;
    border-radius: 4px;
}

.language-name {
    font-weight: 500;
}

.version-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    font-size: 12px;
    opacity: 0.6;
}

/* Splash screen overlay styles */
.splash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #302c76 0%, #4f2481 100%);
    color: white;
    display: flex;
    flex-direction: column;
    z-index: 10000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(0);
}

.splash-overlay.hide {
    transform: translateY(-100%);
}

.splash-overlay.hidden {
    display: none;
}

.splash-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

/* Splash screen header */
.splash-header {
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 10001;
}

.splash-header-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}

.splash-header-title {
    font-size: 20px;
    font-weight: 600;
}

/* Splash screen content */
.splash-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 20px;
    text-align: center;
}

.splash-logo {
    margin-bottom: 30px;
}

.splash-logo-img {
    width: 120px;
    height: 120px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.splash-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 50px;
    text-align: center;
    line-height: 1.3;
}

.splash-buttons {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 300px;
}

.splash-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 54px;
}

.splash-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.splash-button-login {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.splash-button-register {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.splash-button-guest {
    background: white;
    color: #302c76;
    font-weight: 600;
}

.splash-button-guest:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.splash-button-guest:active {
    transform: translateY(0);
}

.splash-footer {
    padding: 20px;
    text-align: center;
}

.splash-version {
    font-size: 12px;
    opacity: 0.7;
}

/* Add safe area padding for PWA mode */
@media (display-mode: standalone) {
    .splash-header {
        padding-top: var(--safe-area-top);
        height: calc(46px + var(--safe-area-top));
    }
}