/* Подключение шрифта Comics Sun */
/* Если у вас есть файл шрифта Comics Sun, поместите его в папку fonts/ 
   и раскомментируйте следующий код: */
/*
@font-face {
    font-family: 'Comics Sun';
    src: url('fonts/ComicsSun.woff2') format('woff2'),
         url('fonts/ComicsSun.woff') format('woff'),
         url('fonts/ComicsSun.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
*/

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

:root {
    /* Apple Design цвета - яркие и чистые */
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --accent-color: #FF3B30;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --background-light: #F5F5F7;
    --background-white: #FFFFFF;
    --text-primary: #1D1D1F;
    --text-secondary: #86868B;
    --border-color: #D2D2D7;
    
    /* Градиенты для яркости */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-accent: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
    background: var(--background-light);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    overflow-x: hidden;
    box-sizing: border-box;
}

.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content {
    padding: 40px;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    position: relative;
}

.logo-image {
    max-width: 100%;
    height: auto;
    margin-bottom: 32px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.title {
    font-size: 48px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.description {
    font-size: 64px;
    color: rgba(158, 158, 158, 1);
    margin-bottom: 32px;
    line-height: 1.5;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", monospace;
    font-weight: 700;
    font-style: italic;
    background-clip: unset;
    -webkit-background-clip: unset;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Кнопки в стиле Apple */
.btn {
    padding: 42px 96px;
    font-size: 51px;
    font-weight: 600;
    border: none;
    border-radius: 36px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    display: inline-block;
    text-decoration: none;
    min-width: 420px;
    box-sizing: border-box;
    max-width: 100%;
}

.btn-primary {
    background-color: #39FF14;
    color: #1D1D1F;
    box-shadow: 0 12px 42px rgba(57, 255, 20, 0.4);
}

.btn-primary:hover {
    background: #32E614;
    transform: translateY(-6px);
    box-shadow: 0 18px 60px rgba(57, 255, 20, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

#next-btn {
    background-color: rgba(255, 112, 229, 1);
}

#next-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: auto;
}

/* Часы */
.clock-container {
    margin: 32px 0;
    padding: 40px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    text-align: center;
}

.clock-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
}

.clock-icon {
    font-size: 64px;
    margin-bottom: 8px;
}

.clock-time {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.clock-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.clock-status {
    margin-top: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
}

.clock-ready {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
    border: 2px solid rgba(52, 199, 89, 0.3);
}

.clock-waiting {
    background: rgba(255, 159, 10, 0.1);
    color: #FF9F0A;
    border: 2px solid rgba(255, 159, 10, 0.3);
}

.btn-secondary {
    background: var(--background-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #E5E5EA;
}

/* Прогресс бар */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--background-light);
    border-radius: 3px;
    margin-top: 50px;
    margin-bottom: 24px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.task-number {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 24px;
}

.task-content {
    background: var(--background-white);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 32px;
}

.task-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    line-height: 1.2;
}

.task-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.task-input-container {
    margin-bottom: 24px;
}

.task-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 17px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--background-white);
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.task-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.task-input-file {
    cursor: pointer;
    padding: 16px 20px;
    background: var(--background-white);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    font-size: 17px;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.task-input-file:hover {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.05);
}

.task-input-file:focus {
    outline: none;
    border-color: var(--primary-color);
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.task-input-file::file-selector-button {
    padding: 8px 16px;
    margin-right: 12px;
    border-radius: 8px;
    border: 1px solid var(--primary-color);
    background: var(--primary-color);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-input-file::file-selector-button:hover {
    background: #0051D5;
    transform: translateY(-1px);
}

    .task-image-container {
        margin: 24px 0;
        border-radius: 16px;
        overflow: hidden;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    }

    .marker-cross {
        width: 30px;
        height: 30px;
    }

    .marker-cross::before {
        height: 30px;
    }

    .marker-cross::after {
        width: 30px;
    }


.task-image-container img {
    width: 100%;
    height: auto;
    display: block;
}

.image-with-marker-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.task-image-with-marker {
    width: 100%;
    height: auto;
    display: block;
}

.marker-cross {
    position: absolute;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

.marker-cross::before,
.marker-cross::after {
    content: '';
    position: absolute;
    background-color: #FF0000;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.marker-cross::before {
    width: 3px;
    height: 40px;
}

.marker-cross::after {
    width: 40px;
    height: 3px;
}


.btn-back {
    position: absolute;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    z-index: 10;
}

.btn-back:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-back:active {
    transform: translateY(0);
}

.task-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 32px;
}

.message {
    margin-top: 24px;
    padding: 16px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    display: none;
}

.message.success {
    background: rgba(52, 199, 89, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(52, 199, 89, 0.3);
    display: block;
}

.message.error {
    background: rgba(255, 59, 48, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(255, 59, 48, 0.3);
    display: block;
}

/* Экран подсказки */
.hint-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
}

.hint-content {
    font-size: 20px;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 32px;
    line-height: 1.6;
    border: 2px solid rgba(102, 126, 234, 0.2);
}

/* Финальный экран */
.final-hint {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
    padding: 24px;
    border-radius: 16px;
    margin: 32px 0;
    border: 2px solid rgba(0, 122, 255, 0.2);
}

.final-message {
    font-size: 20px;
    color: var(--text-secondary);
    margin-top: 24px;
}

/* Адаптация для iPhone 17 Pro (393x852) */
@media screen and (max-width: 428px) {
    body {
        padding: 12px;
        overflow-x: hidden;
    }

    .container {
        max-width: 100%;
        width: 100%;
    }

    .content {
        padding: 24px 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .btn-back {
        top: 12px;
        left: 12px;
        padding: 6px 12px;
        font-size: 12px;
    }

    .progress-bar {
        margin-top: 45px;
    }

    .logo-image {
        margin-bottom: 20px;
        max-width: 85%;
    }

    .title {
        font-size: 32px;
        line-height: 1.2;
        word-wrap: break-word;
    }

    .subtitle {
        font-size: 18px;
        line-height: 1.3;
    }

    .description {
        font-size: 36px;
        line-height: 1.3;
        word-wrap: break-word;
        padding: 0 8px;
        margin-bottom: 24px;
    }

    .btn {
        padding: 24px 32px;
        font-size: 32px;
        min-width: auto;
        width: calc(100% - 32px);
        max-width: 100%;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .task-content {
        padding: 24px 16px;
        margin-bottom: 24px;
    }

    .task-number {
        font-size: 12px;
        margin-bottom: 16px;
    }

    .task-title {
        font-size: 22px;
        line-height: 1.3;
        word-wrap: break-word;
        margin-bottom: 12px;
    }

    .task-description {
        font-size: 16px;
        line-height: 1.5;
        word-wrap: break-word;
        margin-bottom: 24px;
    }

    .task-input {
        padding: 14px 16px;
        font-size: 16px;
        width: 100%;
        box-sizing: border-box;
    }

    .task-actions {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
    }

    .task-actions .btn {
        width: 100%;
        padding: 20px 24px;
        font-size: 18px;
    }

    .hint-title {
        font-size: 22px;
    }

    .hint-content {
        font-size: 16px;
        padding: 20px 16px;
    }

    .final-hint {
        font-size: 18px;
        padding: 20px 16px;
    }

    .final-message {
        font-size: 16px;
    }

    .clock-container {
        padding: 24px 16px;
        margin: 24px 0;
    }

    .clock-icon {
        font-size: 48px;
    }

    .clock-time {
        font-size: 32px;
    }

    .clock-label {
        font-size: 11px;
    }

    .clock-status {
        font-size: 15px;
        padding: 12px 16px;
        margin-top: 16px;
    }
}

/* Анимации */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

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

.spinning-cat {
    display: inline-block;
    animation: spin 1s linear infinite;
    font-size: 1.2em;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}
