* { box-sizing: border-box; }

:root {
  --calc-bg: #111;
  --btn-black: #1a1a1a;
  --btn-black-hov: #262626;
  --btn-blue: #2d8cff;
  --btn-blue-hov: #4ea1ff;
  --btn-gray: #7a7a7a;
  --btn-gray-hov: #8a8a8a;
  --btn-orange: #ff9500;
  --btn-orange-hov: #ffa533;
  --text: #fff;
  --green: #00ff40;
  --display-bg: #141414;
}

body {
  margin: 0;
  padding: 0;
  background: #fff;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}

.wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.calculator {
  background: var(--calc-bg);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
  max-width: 340px;
  width: 100%;
}

#display {
  width: 100%;
  height: 86px;
  font-size: 52px;
  font-family: "Courier New", "Lucida Console", Consolas, Menlo, Monaco, monospace;
  font-variant-numeric: tabular-nums;
  text-align: right;
  padding: 18px 15px;
  margin-bottom: 15px;
  border: none;
  background: var(--display-bg);
  color: var(--green);
  border-radius: 12px;
  box-shadow:
    inset 0 0 12px rgba(0,0,0,0.6),
    0 0 8px rgba(0,255,64,0.25);
  text-shadow:
    0 0 3px rgba(0,255,64,0.8),
    0 0 8px rgba(0,255,64,0.45),
    0 0 16px rgba(0,255,64,0.3);
  overflow-x: auto;
  white-space: nowrap;
  outline: none;
  user-select: none;
  caret-color: transparent;
}

#display::-webkit-scrollbar { height: 6px; }
#display::-webkit-scrollbar-track { background: #111; border-radius: 6px; }
#display::-webkit-scrollbar-thumb { background: #0c0; border-radius: 6px; }

.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.btn {
  padding: 20px;
  font-size: 20px;
  border: none;
  border-radius: 10px;
  background: var(--btn-black);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 4px 0 #000;
  transition: 0.15s ease, transform 0.05s ease, box-shadow 0.05s ease;
}

.btn:hover { background: var(--btn-black-hov); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #000; }

.btn-blue { background: var(--btn-blue); color: #fff; }
.btn-blue:hover { background: var(--btn-blue-hov); }

.btn-gray { background: var(--btn-gray); color: #fff; }
.btn-gray:hover { background: var(--btn-gray-hov); }

.btn-operator { background: var(--btn-orange); color: #fff; }
.btn-operator:hover { background: var(--btn-orange-hov); }

.btn.equals { grid-column: span 2; }
