/* styles.css */

* {
  box-sizing: border-box;
}

:root{
  --keysH: 232px;
  --keysGap: 8px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #2a2a2a;
  font-family: 'Courier New', monospace;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
}

.calculator {
  width: 900px;

  background: linear-gradient(180deg, #2d6b6e 0%, #1f4f52 100%);

  border-radius: 8px;

  padding: 30px;

  box-shadow:
    0 20px 60px rgba(0,0,0,0.6),
    inset 0 2px 0 rgba(255,255,255,0.1);

  border: 2px solid #1a3a3c;
}

.title {
  color: #eae5d8;
  text-align: center;
  margin-bottom: 15px;

  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;

  opacity: 0.7;
}

.display-frame {
  background: #0a0a0a;

  border: 4px solid #111;
  border-radius: 4px;

  padding: 15px 20px;

  box-shadow: inset 0 4px 20px rgba(0,0,0,0.9);

  margin-bottom: 30px;
}

.display {
  display: flex;
  justify-content: flex-end;
  gap: 6px;

  height: 80px;

  align-items: center;
}

.tube {
  width: 38px;
  height: 70px;

  background:
    radial-gradient(
      ellipse at center,
      #1a1208 0%,
      #0a0604 70%,
      #000 100%
    );

  border-radius: 50% / 20%;

  border: 1px solid #222;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;

  box-shadow:
    inset 0 0 8px rgba(255,140,40,0.05);
}

.tube::before {
  content: '';

  position: absolute;

  top: 4px;
  left: 4px;
  right: 4px;
  bottom: 4px;

  border-radius: 50% / 20%;

  background:
    radial-gradient(
      ellipse at 30% 30%,
      rgba(255,255,255,0.08),
      transparent 60%
    );

  pointer-events: none;
}

.digit {
  position: relative;

  font-family: 'Courier New', monospace;
  font-size: 38px;
  font-weight: bold;

  color: #ff6a14;

  text-shadow:
    0 0 4px #ff8838,
    0 0 10px #ff5a00,
    0 0 18px #ff4400,
    0 0 28px rgba(255,80,0,0.6);

  line-height: 1;
}

.decimal {
  position: absolute;

  right: -4px;
  bottom: 6px;

  font-size: 20px;

  color: #ff6a14;

  text-shadow:
    0 0 4px #ff8838,
    0 0 10px #ff5a00,
    0 0 18px #ff4400;
}

.digit.off {
  color: #2a1a0a;
  text-shadow: none;
  opacity: 0.3;
}

.panel {
  background:
    linear-gradient(
      180deg,
      #eae5d8 0%,
      #d8d2c0 100%
    );

  border-radius: 4px;

  padding: 25px;

  display: grid;

  grid-template-columns:
    100px
    1fr
    160px
    140px;

  gap: 25px;

  align-items: center;

  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.2);
}

.speaker {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
}

.speaker-bar {
  width: 60px;
  height: 2px;

  background: #555;

  border-radius: 1px;
}

.speaker-bar:nth-child(odd) {
  width: 50px;
}

.speaker-bar:nth-child(even) {
  width: 70px;
}

.badge {
  width: 36px;
  height: 36px;

  border-radius: 50%;

  background:
    radial-gradient(circle, #c0a060, #80603a);

  border: 2px solid #5a4020;

  margin-top: 10px;

  font-size: 7px;
  color: #2a1a00;

  display: flex;
  align-items: center;
  justify-content: center;

  text-align: center;

  line-height: 1;

  font-weight: bold;
}

.key-group {
  display: grid;
  gap: var(--keysGap);
}

.key {
  width: 52px;
  height: 52px;

  background:
    linear-gradient(
      180deg,
      #f5efe0 0%,
      #d8d0bc 100%
    );

  border: 1px solid #8a8270;
  border-radius: 3px;

  font-family: inherit;
  font-size: 18px;
  font-weight: bold;

  color: #2a2a2a;

  cursor: pointer;

  box-shadow:
    0 2px 0 #a89e80,
    0 3px 4px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.6);

  transition: all 0.05s;

  user-select: none;
}

.key:active {
  transform: translateY(2px);

  box-shadow:
    0 0 0 #a89e80,
    inset 0 2px 4px rgba(0,0,0,0.2);
}

.key.label {
  font-size: 14px;
}



.panel > div[style*="display:flex"] {
  align-items: stretch !important;
}

.key-group.arrows.iskratall,
.key-group.digits.iskradigits,
.key-group.ops.iskraops {
  height: var(--keysH);
}

.key-group.arrows.iskratall {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 130px;
  align-items: stretch;
}

.key.key-tall {
  width: 60px;
  height: auto; 
  font-size: 14px;
}


.key[data-act="up"],
.key[data-act="down"]{
  font-size: 26px;
  font-weight: 900;
  line-height: 1;
}


.key-group.digits.iskradigits {
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(4, 1fr);
  width: 190px;
  justify-self: center;
}

.key-group.digits.iskradigits .key {
  width: 100%;
  height: auto; 
}

.key.key-zero-wide {
  grid-column: span 2;
  width: 100%;
  height: auto;
}

.key-group.ops.iskraops {
  width: 160px;

  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: 0.8fr 1.6fr 1fr;

  align-items: stretch;
}

.key.key-small,
.key.key-op-tall,
.key.key-eq {
  width: 100%;
  height: auto; 
}

.key.key-op-tall {
  font-size: 22px;
}

.key.key-eq {
  grid-column: span 2;
  font-size: 20px;
}

.right-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.switches {
  display: flex;
  gap: 8px;
  align-items: center;
}

.lamp {
  width: 14px;
  height: 14px;

  background:
    radial-gradient(circle, #8a8070, #4a4030);

  border-radius: 2px;

  border: 1px solid #2a2a2a;
}

.lamp.on {
  background:
    radial-gradient(circle, #ff8855, #cc4400);

  box-shadow:
    0 0 8px #ff6622;
}

.toggle {
  width: 20px;
  height: 36px;

  background:
    linear-gradient(180deg, #5a5a5a, #2a2a2a);

  border-radius: 2px;

  cursor: pointer;

  position: relative;

  border: 1px solid #111;
}

.toggle::after {
  content: '';

  position: absolute;

  left: 3px;
  right: 3px;

  height: 14px;

  background:
    linear-gradient(180deg, #d0d0d0, #888);

  border-radius: 2px;

  top: 2px;

  transition: top 0.15s;
}

.toggle.on::after {
  top: 18px;
}

.precision-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.precision-display {
  width: 48px;
  height: 82px;

  background:
    linear-gradient(
      180deg,
      #d8d0bc 0%,
      #b5ac96 100%
    );

  border: 2px solid #6a6050;
  border-radius: 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    inset 0 2px 4px rgba(255,255,255,0.3),
    inset 0 -2px 4px rgba(0,0,0,0.2),
    0 2px 4px rgba(0,0,0,0.35);
}

.precision-display span {
  font-size: 26px;
  font-weight: bold;
  color: #2a2a2a;
}

.precision-btn {
  width: 42px;
  height: 28px;

  background:
    linear-gradient(
      180deg,
      #f5efe0 0%,
      #d8d0bc 100%
    );

  border: 1px solid #8a8270;
  border-radius: 4px;

  font-size: 14px;
  font-weight: bold;

  cursor: pointer;

  box-shadow:
    0 2px 0 #a89e80,
    0 3px 4px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

.precision-btn:active {
  transform: translateY(2px);

  box-shadow:
    0 0 0 #a89e80,
    inset 0 2px 4px rgba(0,0,0,0.2);
}