/*
 * Повний CSS-код для Paper Toss Classic (iOS 2010 Skeuomorphism)
 */

body {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
    background: #333; /* Темний "корпус" пристрою */
    font-family: 'Helvetica Neue', Arial, sans-serif;
    user-select: none;
    overflow: hidden;
}

#game-container {
    width: 320px;
    height: 480px;
    /* Скевоморфна рамка пристрою */
    border: 10px solid #222; 
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.9), inset 0 0 15px rgba(255, 255, 255, 0.15);
    overflow: hidden;
    position: relative;
}

/* --- Офісний Фон (Задня стіна) --- */
#office-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* !!! ВСТАВТЕ ВАШЕ ЗОБРАЖЕННЯ ОФІСУ СЮДИ !!! */
    background: url('https://i.imgur.com/g8vBw0J.jpg') no-repeat center center; 
    background-size: cover;
    filter: blur(2px) grayscale(50%); /* Легкий блюр для фону */
    transform: translateY(-50px);
    z-index: 1;
}

#office-desk {
    width: 100%;
    height: 100%;
    /* Глянцева, насичена текстура дерева */
    background: 
        linear-gradient(to top, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
        #795548; 
    background-size: cover;
    box-shadow: inset 0 8px 20px rgba(0, 0, 0, 0.9);
    position: relative;
    z-index: 2; /* Стіл над фоном */
}

/* --- Вентилятор (Симуляція Вітру) --- */
#fan-container {
    position: absolute;
    top: 20px;
    left: 10px;
    width: 60px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 5;
    transform: rotateY(20deg);
}

#fan-base {
    width: 50px;
    height: 15px;
    background: linear-gradient(to bottom, #777 0%, #444 100%);
    border-radius: 5px;
    box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.5);
    margin-bottom: 5px;
}

#fan-head {
    width: 60px;
    height: 60px;
    background: linear-gradient(to bottom, #ccc 0%, #999 100%);
    border-radius: 50%;
    border: 2px solid #666;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5), 0 2px 5px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#fan-blades {
    width: 40px;
    height: 40px;
    background-color: #555;
    border-radius: 50%;
    position: absolute;
    animation: rotateFan 0.2s linear infinite; /* Швидке обертання */
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.8);
}

#fan-blades::before, #fan-blades::after {
    content: '';
    position: absolute;
    background-color: #555;
    border-radius: 50%;
}
#fan-blades::before {
    width: 50%;
    height: 50%;
    top: 0; left: 0;
    transform: rotate(45deg) translate(-25%, -25%);
    transform-origin: 100% 100%;
}
#fan-blades::after {
    width: 50%;
    height: 50%;
    bottom: 0; right: 0;
    transform: rotate(45deg) translate(25%, 25%);
    transform-origin: 0% 0%;
}

@keyframes rotateFan {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* --- Індикатори UI: Об'ємні Скляні Панелі --- */

#wind-indicator, #score-board {
    position: absolute;
    top: 15px;
    padding: 8px 15px;
    color: white;
    border-radius: 10px;
    font-weight: bold;
    font-size: 14px;
    text-shadow: 0 -1px 0 #000;
    
    /* Скляний скевоморфний ефект */
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.9);
    z-index: 15;
}

#wind-speed {
    font-weight: 900;
}

#wind-indicator { left: 80px; }
#score-board { right: 10px; }

/* --- Сміттєве Відро: Метал та Ребра (Позиціонування за top для фізики) --- */

#trash-can {
    position: absolute;
    top: 310px; 
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 120px;
    
    /* Реалістичний металевий градієнт */
    background: repeating-linear-gradient(to right, 
        #c0c0c0 0px, 
        #c0c0c0 5px, 
        #d0d0d0 5px, 
        #d0d0d0 10px 
    );
    border: 3px solid #666;
    border-top: 15px solid #888;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.9), inset 0 -5px 10px rgba(0, 0, 0, 0.6);
    z-index: 10;
}

/* --- Паперова Кулька: Нова текстура та тінь --- */

#paper-ball {
    position: absolute;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    
    /* Додаємо текстуру паперу (SVG-текстура + градієнт) */
    background: 
        radial-gradient(circle at 10px 10px, #ffffff 0%, #e0e0e0 60%, #c0c0c0 100%),
        /* Імітація зім'ятості */
        url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><filter id="n"><feTurbulence baseFrequency="0.5" type="fractalNoise" result="f" numOctaves="3"/><feComposite in="SourceGraphic" in2="f" operator="arithmetic" k1="0" k2="0" k3="1" k4="0.2"/></filter><rect width="100%" height="100%" fill="white" filter="url(#n)"/></svg>') no-repeat;
    background-size: cover;
    
    border: 1px solid #aaa;
    /* Покращена тінь для об'єму */
    box-shadow: 
        1px 1px 5px rgba(0, 0, 0, 0.3) inset,
        -1px -1px 5px rgba(255, 255, 255, 0.2) inset,
        0 8px 15px rgba(0, 0, 0, 0.7); 
    cursor: grab;
    z-index: 20;
    /* Центрування для коректної роботи фізики */
    transform: translate(-50%, -50%); 
}

/* --- Повідомлення iOS Alert Box --- */

#message-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 100;
}

#popup-content {
    background: linear-gradient(to bottom, #f0f0f0 0%, #d9d9d9 100%);
    color: #333;
    padding: 20px 25px;
    border-radius: 12px;
    border: 1px solid #999;
    width: 80%;
    max-width: 250px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.7);
}

#message-text {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.8);
}

#info-box p {
    color: #555;
    font-size: 13px;
    margin: 5px 0 15px;
}

/* --- Кнопка iOS Blue Button --- */

.ios-button {
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
    border: 1px solid #105a96;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 
        0 1px 0 rgba(255, 255, 255, 0.5) inset, 
        0 1px 2px rgba(0, 0, 0, 0.5); 
    
    background: linear-gradient(to bottom, #4fa3d8 0%, #2e7bbd 50%, #1e5c8e 100%);
    transition: all 0.1s;
    width: 100%;
    box-sizing: border-box;
}

.ios-button:active {
    background: linear-gradient(to bottom, #1e5c8e 0%, #2e7bbd 50%, #4fa3d8 100%);
    box-shadow: 
        0 0 1px rgba(255, 255, 255, 0.5) inset,
        0 1px 1px rgba(0, 0, 0, 0.5);
    transform: translateY(1px);
}

/* --- Ефект Глянцевого Екрана (Фінальний штрих) --- */
#screen-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Не блокує свайп */
    z-index: 1000; /* Над усіма елементами */
    
    /* Створення білого глянцевого відблиску */
    background: 
        linear-gradient(
            to bottom, 
            rgba(255, 255, 255, 0.3) 0%,      /* Верхній відблиск */
            rgba(255, 255, 255, 0.05) 15%,   
            transparent 50%,                 
            rgba(0, 0, 0, 0.05) 85%,         /* Тінь внизу */
            rgba(0, 0, 0, 0.1) 100%
        );
}

.hidden {
    display: none !important;
}