﻿@font-face {
    font-family: "Calculator";
    src: url("fonts/Digital-7.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
}

/* === ГЛОБАЛЬНЫЕ НАСТРОЙКИ === */
html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    height: 100vh;
    width: 100vw;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.scale-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background: #000;
}

.calculator-wrapper {
    width: 1200px;
    height: 1238px;
    position: relative;
}

.calculator-surface {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('iskra1103.jpg') no-repeat center center;
    background-size: 100% 100%;
    pointer-events: none;
}

.display-area {
    position: absolute;
    top: 256px;
    left: 208px;
    width: 918px;
    display: flex;
    gap: 5px;
    z-index: 10;
    pointer-events: none;
}

.display {
    font-family: "Calculator", monospace;
    background-color: #001a00;
    color: #001a00;
    border: 2px solid #000;
    border-radius: 6px;
    height: 120px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.7);
    overflow: hidden;
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.display.powered-on { 
    color: #00ff00; 
}

.display.powered-on .lcd-digit { 
    color: #00ff00; 
}

.lcd-digit {
    font-family: "Calculator", monospace;
    color: #001a00;
    font-size: 5.0em;
    width: calc(100% / 13);
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

@keyframes powerOnDigit {
    to { color: #00ff00; }
}

.display.power-on .lcd-digit {
    animation: powerOnDigit 0.9s forwards;
}

.display.power-on .lcd-digit:nth-child(13) { animation-delay: 0ms; }
.display.power-on .lcd-digit:nth-child(12) { animation-delay: 80ms; }
.display.power-on .lcd-digit:nth-child(11) { animation-delay: 160ms; }
.display.power-on .lcd-digit:nth-child(10) { animation-delay: 240ms; }
.display.power-on .lcd-digit:nth-child(9)  { animation-delay: 320ms; }
.display.power-on .lcd-digit:nth-child(8)  { animation-delay: 400ms; }
.display.power-on .lcd-digit:nth-child(7)  { animation-delay: 480ms; }
.display.power-on .lcd-digit:nth-child(6)  { animation-delay: 560ms; }
.display.power-on .lcd-digit:nth-child(5)  { animation-delay: 640ms; }
.display.power-on .lcd-digit:nth-child(4)  { animation-delay: 720ms; }
.display.power-on .lcd-digit:nth-child(3)  { animation-delay: 800ms; }
.display.power-on .lcd-digit:nth-child(2)  { animation-delay: 880ms; }
.display.power-on .lcd-digit:nth-child(1)  { animation-delay: 960ms; }

.main-panel {
    position: absolute;
    top: 600px;
    left: 300px;
    width: 300px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
    z-index: 10;
    pointer-events: none;
}

.btn {
    background: transparent;
    border: none;
    font-size: 1.25em;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    color: transparent;
    position: absolute;
    z-index: 20;
    pointer-events: auto;
    transition: transform 0.1s ease;
}

.btn:hover { 
    border: 1px solid #888; 
    border-radius: 2px; 
}

.btn:active {
    transform: translateY(1px);
    box-shadow: inset 0 2px 4px #000;
}

/* === ПОЗИЦИИ КНОПОК === */
.btn-seven    { top: 232px;   left: 340px;   width: 60px; height: 60px; }
.btn-eight    { top: 235px;   left: 432px;   width: 60px; height: 60px; }
.btn-nine     { top: 233px;   left: 520px;   width: 60px; height: 60px; }
.btn-four     { top: 317px;   left: 337px;   width: 60px; height: 60px; }
.btn-five     { top: 320px;   left: 430px;   width: 60px; height: 60px; }
.btn-six      { top: 320px;   left: 518px;   width: 60px; height: 60px; }
.btn-one      { top: 407px;   left: 340px;   width: 60px; height: 60px; }
.btn-two      { top: 406px;   left: 427px;   width: 60px; height: 60px; }
.btn-three    { top: 406px;   left: 518px;   width: 60px; height: 60px; }
.btn-zero     { top: 493px;   left: 340px;   width: 145px; height: 60px; }
.btn-comma    { top: 493px;   left: 514px;   width: 60px; height: 60px; }
.btn-ck       { top: 236px;   left: 640px;   width: 60px; height: 60px; }
.btn-c        { top: 235px;   left: 729px;   width: 60px; height: 60px; }
.btn-minus    { top: 319px;   left: 638px;   width: 60px; height: 60px; }
.btn-divide   { top: 322px;   left: 729px;   width: 60px; height: 60px; }
.btn-plus     { top: 407px;   left: 639px;   width: 60px; height: 60px; }
.btn-multiply { top: 410px;   left: 729px;   width: 60px; height: 60px; }
.btn-equals   { top: 493px;   left: 640px;   width: 145px; height: 60px; }

/* Кнопка питания - прозрачная и прямоугольная */
.power-button {
    position: absolute;
    top: 800px;
    left: 510px;
    width: 60px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
    pointer-events: auto;
    transition: none;
    font-size: 0;
    color: transparent;
}

.power-button:active {
    transform: translateY(1px);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

.power-button:hover {
    background: transparent;
    border: none;
    box-shadow: none;
}

/* === ПАНЕЛЬ ИНСТРУКЦИИ (внутри калькулятора) === */
.instructions {
    position: absolute;
    bottom: 30px;
    right: -560px;
    width: 500px;
    background: rgba(0, 20, 0, 0.95);
    border: 2px solid #00ff00;
    border-radius: 10px;
    padding: 15px 20px;
    color: #00ff00;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    z-index: 200;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
    pointer-events: none;
}

.instructions h3 {
    margin: 0 0 10px 0;
    color: #00ff00;
    text-align: center;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.instructions pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    line-height: 1.5;
    color: #00ff00;
    font-size: 20px;
}

/* Медиа-запрос для мобильных устройств */
@media (max-width: 768px) {
    .instructions {
        font-size: 10px;
        padding: 10px 15px;
        bottom: 15px;
        right: 15px;
        width: 250px;
    }
    
    .instructions h3 {
        font-size: 14px;
    }
}