/* ===== Shared play page styles ===== */

.share-button {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-button:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

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

/* ===== Desktop play page ===== */

.play-desktop body {
    margin: 0;
    padding: 0;
    background: var(--color-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.play-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 20px;
    position: relative;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

.play-container .share-button {
    position: absolute;
    top: 20px;
    right: 20px;
}

.game-header {
    text-align: center;
    color: white;
}

.game-header h1 {
    margin: 0 0 10px 0;
    font-size: 2em;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-header p {
    margin: 0;
    font-size: 1em;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .play-container .share-button {
        position: static;
        margin-bottom: 10px;
    }
}

.device-mockup {
    width: calc(393px + 30px);
    height: calc(852px + 30px);
    max-height: 90vh;
    position: relative;
    transition: transform var(--transition-base);
}

.device-mockup:hover {
    transform: translateY(-4px);
}

@media (max-height: 900px) {
    .device-mockup {
        width: calc(360px + 30px);
        height: calc(780px + 30px);
    }
}

@media (max-height: 800px) {
    .device-mockup {
        width: calc(320px + 30px);
        height: calc(693px + 30px);
    }
}

@media (max-width: 768px) {
    .device-mockup {
        width: 90vw;
        max-width: calc(393px + 30px);
    }
}

.device-frame {
    width: calc(393px + 30px);
    height: calc(852px + 30px);
    background: var(--color-device-frame);
    border-radius: 50px;
    padding: 15px;
    position: relative;
    box-shadow:
        0 0 0 3px var(--color-device-bezel),
        var(--shadow-xl),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: box-shadow var(--transition-base);
}

.device-mockup:hover .device-frame {
    box-shadow:
        0 0 0 3px var(--color-device-bezel),
        0 30px 60px rgba(0, 0, 0, 0.5),
        inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.device-screen {
    width: 393px;
    height: 852px;
    background: #ffffff;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
}

.screen-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.device-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 30px;
    background: var(--color-device-notch);
    border-radius: 0 0 20px 20px;
    z-index: 10;
}

.device-home-indicator {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 32%;
    height: 5px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 3px;
    z-index: 10;
}

.placeholder-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: var(--color-text-on-light-secondary);
}

.placeholder-icon {
    font-size: 4em;
    margin-bottom: 20px;
}

/* ===== Mobile play page ===== */

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

.play-mobile html,
.play-mobile body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: fixed;
}

.play-mobile body {
    background: var(--color-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#gameContainer {
    width: 100%;
    height: 100%;
    position: relative;
}

#gameFrame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    color: white;
    z-index: 1000;
    transition: opacity var(--transition-slow);
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-icon {
    font-size: 4em;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.loading-text {
    font-size: 1.2em;
    font-weight: 600;
}

.play-mobile .share-button {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(253, 40, 141, 0.9);
    border: none;
    padding: 7px 15px;
    border-radius: 30px;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    z-index: 100;
}

.play-mobile .share-button:hover {
    transform: none;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.play-mobile .share-button:active {
    transform: scale(0.95);
}
