/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #ff3456 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Tablet container */
.tablet-container {
    position: relative;
    width: 37.5rem;
    height: 50rem;
    background: #1a1a1a;
    border-radius: 2.5rem;
    padding: 3.75rem 2.5rem;
    box-shadow:
        0 1.25rem 3.75rem rgba(0, 0, 0, 0.3),
        inset 0 0.0625rem 0 rgba(255, 255, 255, 0.1);
    transform: perspective(62.5rem) rotateX(5deg);
}

/* Tablet screen */
.tablet-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #2d2d2d, #1a1a1a);
    border-radius: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-start;
    align-items: flex-start;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 0 0 3.125rem rgba(0, 0, 0, 0.5),
        0 0 3.75rem rgba(0, 212, 255, 0.3),
        0 0 7.5rem rgba(0, 212, 255, 0.2);
    cursor: pointer;
    padding: 0.625rem;
    gap: 0.3125rem;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Screen light emission effect */
.tablet-screen::before {
    content: '';
    position: absolute;
    top: -1.25rem;
    left: -1.25rem;
    right: -1.25rem;
    bottom: -1.25rem;
    background: radial-gradient(ellipse at center, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    border-radius: 2.5rem;
    z-index: -1;
    animation: screenGlow 3s ease-in-out infinite alternate;
}

@keyframes screenGlow {
    0% {
        opacity: 0.3;
        transform: scale(0.98);
    }
    100% {
        opacity: 0.6;
        transform: scale(1.02);
    }
}

/* Tablet bezels */
.tablet-bezel-top,
.tablet-bezel-bottom {
    position: absolute;
    width: 1.5625rem;
    height: 1.5625rem;
    background: radial-gradient(circle, #333, #1a1a1a);
    border-radius: 50%;
    left: 50%;
    transform: translateX(-50%);
}

.tablet-bezel-top {
    top: 0.9375rem;
}

.tablet-bezel-bottom {
    bottom: 0.9375rem;
}

/* Icon styling */
.icon-svg {
    width: 7.25rem;
    height: 7.25rem;
    transition: all 0.2s ease;
    cursor: pointer;
    filter: drop-shadow(0 0 0.5rem rgba(0, 212, 255, 0.4));
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    pointer-events: none;
}

.icon-svg:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 0.75rem rgba(0, 212, 255, 0.6));
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.5s ease;
}

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

.loading-spinner {
    width: 3.125rem;
    height: 3.125rem;
    border: 0.1875rem solid #333;
    border-top: 0.1875rem solid #00d4ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1.25rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #fff;
    font-size: 1rem;
}

/* Responsive design */
@media (max-width: 48rem) {
    .tablet-container {
        width: 90vw;
        height: 75vh;
        max-width: 31.25rem;
        max-height: 43.75rem;
        padding: 2.5rem 1.875rem;
    }
    
    .icon-svg {
        width: 6rem;
        height: 6rem;
    }
}

@media (max-width: 30rem) {
    .tablet-container {
        width: 95vw;
        height: 70vh;
        padding: 1.875rem 1.25rem;
        border-radius: 1.875rem;
    }
    
    .tablet-screen {
        border-radius: 0.9375rem;
    }
    
    .icon-svg {
        width: 4.875rem;
        height: 4.875rem;
    }
}

/* Touch-friendly enhancements */
@media (hover: none) and (pointer: coarse) {
    .icon-svg:active {
        transform: scale(0.9);
        transition: transform 0.1s ease;
    }
}