@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700&display=swap');

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

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #0a0a0a;
  background-image: 
    radial-gradient(800px 600px at 50% 0%, rgba(255,255,255,0.08), transparent 60%),
    radial-gradient(600px 400px at 0% 100%, rgba(251,146,60,0.08), transparent 50%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 24px;
  -webkit-font-smoothing: antialiased;
}

.shell {
  width: 100%;
  max-width: 360px;
}

.container {
  width: 100%;
  background: #111111;
  border: 1px solid #1f1f1f;
  border-radius: 32px;
  padding: 24px 20px 20px;
  box-shadow: 
    0 32px 64px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.04) inset,
    0 1px 0 rgba(255,255,255,0.06) inset;
  animation: rise 0.6s cubic-bezier(0.16,1,0.3,1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.display-wrap {
  background: #0e0e0e;
  border: 1px solid #1a1a1a;
  border-radius: 20px;
  padding: 18px 20px 14px;
  margin-bottom: 18px;
  min-height: 86px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.display-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #52525b;
  font-weight: 600;
  margin-bottom: 8px;
}

.js-calculation {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: #fafafa;
  text-align: right;
  line-height: 1;
  min-height: 36px;
  word-break: break-all;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.keys p {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.keys p:last-child {
  margin-bottom: 0;
}

.number, .operation {
  height: 64px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 22px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16,1,0.3,1);
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.number {
  background: #1e1e1e;
  border-color: #262626;
  color: #e4e4e7;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset;
}

.number:hover {
  background: #27272a;
  border-color: #2e2e32;
  transform: translateY(-1px);
}

.number:active {
  transform: translateY(0) scale(0.96);
  background: #1a1a1a;
}

.operation {
  background: #fb923c;
  background: linear-gradient(180deg, #fb923c 0%, #f97316 100%);
  color: white;
  border-color: rgba(255,255,255,0.12);
  font-weight: 600;
  box-shadow: 
    0 8px 20px rgba(249,115,22,0.28),
    0 1px 0 rgba(255,255,255,0.25) inset;
}

.operation:hover {
  background: linear-gradient(180deg, #fdba74 0%, #fb923c 100%);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(249,115,22,0.36), 0 1px 0 rgba(255,255,255,0.3) inset;
}

.operation:active {
  transform: translateY(0) scale(0.96);
  box-shadow: 0 4px 12px rgba(249,115,22,0.24);
}

.equal {
  background: #fafafa !important;
  color: #0a0a0a !important;
  border-color: #fafafa !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 20px rgba(255,255,255,0.12), 0 1px 0 rgba(255,255,255,0.8) inset !important;
}

.equal:hover {
  background: white !important;
  transform: translateY(-1px);
}

.clear-row {
  grid-template-columns: 1fr !important;
  margin-top: 4px;
}

.clear {
  height: 52px !important;
  background: transparent !important;
  border: 1.5px solid #262626 !important;
  color: #a1a1aa !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  letter-spacing: 0.02em;
  border-radius: 999px !important;
  box-shadow: none !important;
}

.clear:hover {
  background: #1a1a1a !important;
  border-color: #3f3f46 !important;
  color: #e4e4e7 !important;
}

@media (max-width: 400px) {
  .container { padding: 20px 16px 16px; border-radius: 28px; }
  .number, .operation { height: 58px; font-size: 20px; }
  .js-calculation { font-size: 32px; }
}
