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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background-color: #f5f5f7;
    padding: 40px 20px;
    color: #1c1c1e;
}

.container {
    max-width: 950px;
    margin: 0 auto;
}

.back-link {
    display: inline-block;
    color: #0071e3;
    text-decoration: none;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

h1 {
    margin-bottom: 25px;
    font-size: 28px;
    font-weight: 700;
}

/* === КАРТОЧКА ПИКЕРА === */
.picker-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* === ЛЕВАЯ ЧАСТЬ: ВИЗУАЛЬНЫЙ ВЫБОР === */
.visual-section {
    position: relative;
    width: 280px;
    height: 280px;
    flex-shrink: 0;
}

#colorWheel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 100%;
    cursor: crosshair;
}

.square-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 20px;
    overflow: hidden;
    cursor: crosshair;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#colorSquare {
    width: 100%;
    height: 100%;
    display: block;
}

/* Маркеры (кружочки) */
.marker {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 10;
}

#wheelMarker {
    z-index: 20;
}

#squareMarker {
    width: 12px;
    height: 12px;
}

/* === ПРАВАЯ ЧАСТЬ: ИНФОРМАЦИЯ === */
.info-section {
    flex: 1;
    min-width: 0; /* Позволяет сжиматься */
}

.info-label {
    font-size: 14px;
    color: #8e8e93;
    margin-bottom: 10px;
    font-weight: 500;
}

.color-preview {
    width: 100%;
    height: 80px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e5e5ea;
    background: #ff0000;
}

/* Сетка значений */
.values-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    width: 100%;
}

.value-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.value-item label {
    font-size: 12px;
    color: #8e8e93;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-row {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.input-row input {
    flex: 1;
    min-width: 0;
    background: #f8f8fa;
    border: 1px solid #e5e5ea;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: #1c1c1e;
    outline: none;
    transition: border-color 0.2s;
    overflow: hidden;
    text-overflow: ellipsis;
}

.input-row input:focus {
    border-color: #0071e3;
    background: #fff;
}

/* Кнопка копирования */
.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0071e3;
    color: white;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.copy-btn:hover {
    background: #0077ed;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,113,227,0.3);
}

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

.copy-btn.copied {
    background: #34c759;
}

.copy-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* Уведомление о копировании */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #1c1c1e;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast svg {
    color: #34c759;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 750px) {
    .picker-card {
        flex-direction: column;
        align-items: center;
    }

    .visual-section {
        margin-bottom: 20px;
    }

    .values-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    h1 {
        text-align: center;
    }
}

@media (max-width: 480px) {
    .values-grid {
        grid-template-columns: 1fr;
    }

    .copy-btn {
        width: 32px;
        height: 32px;
    }
}
