/* ============================================================
   БАЗА
   ============================================================ */
* {
    box-sizing: border-box;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: #000;
    color: #fff;
    font-family: Arial, sans-serif;
    overflow-x: auto;
    overflow-y: auto;
}

/* ============================================================
   КОНТЕЙНЕР
   ============================================================ */
.container {
    width: 100%;
    min-width: 1200px;
    position: relative;
    padding: 12px;
}

/* ============================================================
   БОКОВЫЕ ПАНЕЛИ
   ============================================================ */
.left-panel,
.right-panel {
    position: fixed;
    top: 12px;
    width: 220px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    background: #2f3b46;
    padding: 14px;
    border-radius: 18px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 100;
    border: 2px solid #1f2a33;
}

.left-panel {
    left: 12px;
}

.right-panel {
    right: 12px;
}

/* ============================================================
   ЦЕНТРАЛЬНАЯ ОБЛАСТЬ
   ============================================================ */
.main-content {
    margin-left: 250px;
    margin-right: 250px;
    padding: 8px;
    background: #111;
    border: 2px solid #333;
    border-radius: 16px;
    overflow-x: auto;
    /* min-height: calc(100vh - 24px); */
}

.thermo-row {
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
}

/* ============================================================
   АДАПТИВ ДЛЯ РАЗНЫХ РАЗМЕРОВ ЭКРАНА
   ============================================================ */

/* Для экранов 1700px и меньше */
@media (max-width: 1700px) {
    .container {
        min-width: 1500px;
    }
    
    .left-panel,
    .right-panel {
        width: 200px;
    }
    
    .main-content {
        margin-left: 230px;
        margin-right: 230px;
    }
}

/* Для экранов 1500px и меньше */
@media (max-width: 1500px) {
    .container {
        min-width: 1300px;
    }
    
    .left-panel,
    .right-panel {
        width: 180px;
        padding: 10px;
    }
    
    .main-content {
        margin-left: 210px;
        margin-right: 210px;
    }
}

/* Для экранов 1300px и меньше */
@media (max-width: 1300px) {
    .container {
        min-width: 1100px;
    }
    
    .left-panel,
    .right-panel {
        width: 160px;
        padding: 8px;
    }
    
    .main-content {
        margin-left: 190px;
        margin-right: 190px;
    }
    
    .pretty-btn,
    .anim-btn,
    .back-btn {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    #timerDisplay {
        font-size: 24px;
        padding: 8px 4px;
    }
}

/* Для экранов 1100px и меньше - панели уменьшаются */
@media (max-width: 1100px) {
    .container {
        min-width: 1000px;
    }
    
    .left-panel,
    .right-panel {
        width: 140px;
        padding: 6px;
        top: 8px;
    }
    
    .left-panel {
        left: 8px;
    }
    
    .right-panel {
        right: 8px;
    }
    
    .main-content {
        margin-left: 165px;
        margin-right: 165px;
    }
    
    .pretty-btn,
    .anim-btn,
    .back-btn {
        padding: 6px 8px;
        font-size: 12px;
        min-height: 36px;
    }
    
    #timerDisplay {
        font-size: 20px;
        padding: 6px 4px;
    }
    
    .thermo-block {
        padding: 6px;
        gap: 4px;
    }
    
    .scale-svg {
        height: 200px;
    }
    
    .big-temp {
        font-size: 18px;
        padding: 6px;
    }
    
    .display {
        font-size: 14px;
        padding: 5px;
    }
}

/* Для экранов 900px и меньше - панели становятся сверху и снизу */
@media (max-width: 900px) {
    body {
        overflow-x: auto;
    }
    
    .container {
        min-width: auto;
        padding: 80px 12px 12px 12px;
    }
    
    .left-panel {
        position: fixed;
        top: 8px;
        left: 8px;
        right: 8px;
        width: auto;
        max-height: 70px;
        overflow-y: visible;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        z-index: 200;
        gap: 6px;
    }
    
    .right-panel {
        position: fixed;
        bottom: 8px;
        left: 8px;
        right: 8px;
        top: auto;
        width: auto;
        max-height: 70px;
        overflow-y: visible;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        z-index: 200;
        gap: 6px;
    }
    
    .main-content {
        margin-left: 0;
        margin-right: 0;
        margin-top: 0;
        margin-bottom: 90px;
    }
    
    .panel-separator {
        display: none;
    }
    
    .left-panel button,
    .right-panel button {
        padding: 5px 10px;
        font-size: 11px;
        white-space: nowrap;
        width: auto;
        min-width: 70px;
    }
    
    #timerDisplay {
        font-size: 18px;
        padding: 4px 8px;
        width: auto;
        min-width: 100px;
    }
    
    .timer-buttons {
        display: flex;
        gap: 5px;
        width: auto;
    }
    
    .timer-buttons button {
        padding: 5px 10px;
        font-size: 12px;
    }
    
    .thermo-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
}

/* Для мобильных устройств */
@media (max-width: 600px) {
    .container {
        padding: 90px 8px 8px 8px;
    }
    
    .left-panel {
        max-height: 80px;
        gap: 5px;
    }
    
    .right-panel {
        max-height: 80px;
        gap: 5px;
    }
    
    .main-content {
        margin-bottom: 100px;
    }
    
    .left-panel button,
    .right-panel button {
        padding: 4px 8px;
        font-size: 10px;
        min-width: 60px;
    }
    
    #timerDisplay {
        font-size: 14px;
        padding: 3px 6px;
        min-width: 80px;
    }
    
    .thermo-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    
    .thermo-block {
        padding: 8px;
    }
    
    .scale-svg {
        height: 150px;
    }
    
    .big-temp {
        font-size: 14px;
        padding: 4px;
    }
    
    .display {
        font-size: 12px;
        padding: 4px;
    }
}

/* ============================================================
   ОСТАЛЬНЫЕ СТИЛИ (без изменений)
   ============================================================ */
.panel-separator {
    width: 100%;
    height: 2px;
    background: #738291;
    margin: 6px 0 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.6);
}

/* Термометр */
.thermo-block {
    background: #2f3b46;
    border-radius: 18px;
    padding: 10px;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
    border: 3px solid #1f2a33;
    display: grid;
    grid-template-rows: auto auto auto auto auto auto auto 1fr auto;
    gap: 8px;
    justify-items: center;
}

/* Таймер */
#timerDisplay {
    font-size: 30px;
    font-weight: bold;
    color: #c9f508;
    margin-bottom: 4px;
    text-shadow: 0 0 10px rgba(80,120,160,0.7);
    text-align: center;
    width: 100%;
    background: #1c242d;
    border: 2px solid #0a0f14;
    border-radius: 10px;
    padding: 10px 6px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
}

.timer-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.timer-buttons button {
    padding: 10px 8px;
    font-size: 16px;
    border-radius: 8px;
    border: 2px solid #3f4a55;
    background: #4d5c6b;
    color: #e5eef9;
    cursor: pointer;
    transition: 0.2s;
    min-width: 0;
}

.timer-buttons button:hover {
    background: #5f7388;
}

/* Кнопки */
.pretty-btn,
.anim-btn,
.back-btn,
.thermo-block button {
    padding: 11px 12px;
    font-size: 15px;
    font-weight: 700;
    color: #e9f3ff;
    background: linear-gradient(180deg, #5f7fa0 0%, #4a6a82 100%);
    border: 2px solid #1f2f3a;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4), inset 0 1px 3px rgba(255,255,255,0.3);
    transition: 0.2s ease;
    width: 100%;
    min-height: 42px;
}

.pretty-btn:hover,
.anim-btn:hover,
.back-btn:hover,
.thermo-block button:hover {
    background: linear-gradient(180deg, #6f8fb3 0%, #557a94 100%);
    transform: translateY(-2px);
}

.reset-btn {
    display: block;
    margin: 0 auto;
    width: 100%;
}

.back-btn,
.reset-btn {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    text-align: center;
    padding-left: 8px;
    padding-right: 8px;
    box-sizing: border-box;
    min-height: 36px;
}

.back-btn {
    background: #064523;
    color: #0f0;
    border: 1px solid #0f0;
    box-shadow: 0 0 8px #0f0;
}

.back-btn:hover {
    background: #0a6a36;
    box-shadow: 0 0 12px #0f0;
}

/* Остальные стили (SVG, модальные окна и т.д.) остаются без изменений */
.hint {
    position: relative;
    z-index: 10;
    font-size: 14px;
    min-height: 40px;
}

.hint:hover::after {
    content: attr(data-hint);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #0f0;
    padding: 6px 10px;
    border: 1px solid #0f0;
    border-radius: 6px;
    white-space: nowrap;
    margin-top: 6px;
    font-size: 12px;
    box-shadow: 0 0 8px #0f0;
    z-index: 99999;
}

.step-block {
    border: 2px solid #4a6a82;
    border-radius: 12px;
    padding: 8px;
    margin-top: 2px;
    background: rgba(0,0,0,0.2);
    width: 100%;
}

.step-block label {
    display: block;
    text-align: center;
    font-size: 13px;
    margin-bottom: 4px;
}

.display {
    background: #1c242d;
    border: 2px solid #0a0f14;
    padding: 7px 8px;
    width: 100%;
    border-radius: 10px;
    font-family: Consolas, monospace;
    font-size: 19px;
    color: #c9f508;
    text-shadow: 0 0 6px rgba(200,255,0,0.6);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
    text-align: center;
    line-height: 1.2;
}

.hidden {
    display: none !important;
}

input[type="range"] {
    width: 100%;
    box-sizing: border-box;
    margin: 2px 0 0;
}

.scale-svg {
    width: 100%;
    height: 280px;
    background: #050505;
    border-radius: 12px;
    border: 4px solid #151e28;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.5);
    margin: 4px 0;
    display: block;
}

.big-temp {
    font-size: 26px;
    font-weight: bold;
    padding: 10px 8px;
    background: #1c242d;
    border: 2px solid #0a0f14;
    border-radius: 10px;
    width: 100%;
    text-align: center;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
}

.big-temp.green {
    color: #0f0;
    text-shadow: 0 0 10px #0f0;
}

.big-temp.yellow {
    color: #ff0;
    text-shadow: 0 0 10px #ff0;
}

.big-temp.red {
    color: #f00;
    text-shadow: 0 0 10px #f00;
}

.nice-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.nice-modal.show {
    opacity: 1;
    pointer-events: all;
}

.nice-modal.hidden {
    display: none;
}

.nice-modal-window {
    background: #111;
    border: 2px solid #0f0;
    padding: 24px;
    width: 700px;
    max-width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 0 25px #0f0;
    animation: modalPop 0.25s ease;
}

@keyframes modalPop {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.nice-modal-text {
    font-size: 18px;
    margin-bottom: 25px;
    color: #fff;
    line-height: 1.5;
    white-space: pre-line;
}

.nice-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.nice-btn {
    padding: 10px 18px;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    border: none;
    font-weight: bold;
    transition: 0.2s;
    width: auto;
    min-width: 120px;
}

.nice-btn.ok {
    background: #0f0;
    color: #000;
}

.nice-btn.ok:hover {
    background: #5f5;
}

.nice-btn.cancel {
    background: #444;
    color: #fff;
}

.nice-btn.cancel:hover {
    background: #666;
}

.nice-btn.example {
    background: #08f;
    color: #fff;
}

.nice-btn.example:hover {
    background: #3af;
}

/* ============================================================
   ПОДПИСЬ КОНКУРСНОЙ РАЗРАБОТКИ
   ============================================================ */
.contest-note {
    padding: 8px 10px;
    border: 1px solid #52697d;
    border-radius: 10px;
    background: #202a33;
    color: #b8c7d6;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
}

@media (max-width: 900px) {
    .contest-note {
        display: none;
    }
}
