/* Apple Calculator clone – always dark, system font stack. */

html body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 800px at 70% 20%, #0e3b2e 0%, #07110d 55%, #020403 100%);
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-user-select: none;
  user-select: none;
}

/* ---------- iPhone frame ---------- */

.iphone {
  position: relative;
  width: 302px;
  background: #0b0b0d;
  border-radius: 66px;
  padding: 12px;
  border: 3px solid #2e3238;
  box-shadow: 0 0 0 2px #000, 0 30px 80px rgba(0, 0, 0, 0.8), inset 0 0 6px rgba(255, 255, 255, 0.06);
}

.iphone-screen {
  position: relative;
  background: #000;
  border-radius: 54px;
  overflow: hidden;
  padding: 18px 14px 14px;
}

.iphone-notch {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 112px;
  height: 30px;
  background: #000;
  border-radius: 20px;
  z-index: 5;
  border: 1px solid #1c1e22;
}

.iphone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 18px 0 22px;
  font-size: 14px;
  font-weight: 600;
  height: 28px;
}

.iphone-signal {
  display: flex;
  align-items: center;
  gap: 6px;
}

.iphone-home {
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  margin: 10px auto 4px;
}

.iphone-btn {
  position: absolute;
  background: #2e3238;
  border-radius: 3px;
}

.iphone-mute { left: -5px; top: 130px; width: 4px; height: 28px; }
.iphone-volup { left: -5px; top: 175px; width: 4px; height: 56px; }
.iphone-voldn { left: -5px; top: 238px; width: 4px; height: 56px; }
.iphone-power { right: -5px; top: 200px; width: 4px; height: 84px; }

/* ---------- Calculator ---------- */

.calc {
  width: 100%;
  padding: 26px 6px 6px;
  box-sizing: border-box;
}

.calc-display {
  text-align: right;
  font-size: 60px;
  font-weight: 200;
  padding: 8px 10px 4px;
  min-height: 72px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: none;
  font-variant-numeric: tabular-nums;
}

.calc-display::-webkit-scrollbar { display: none; }

.calc-keys {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.calc-keys button {
  border: none;
  border-radius: 50%;
  aspect-ratio: 1;
  font-size: 22px;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}

.calc-keys button.digit { background: #333; color: #fff; }
.calc-keys button.digit:hover { background: #505050; }
.calc-keys button.digit:active { background: #737373; }

.calc-keys button.fn { background: #a5a5a5; color: #000; }
.calc-keys button.fn:hover { background: #c6c6c6; }
.calc-keys button.fn:active { background: #d9d9d9; }

.calc-keys button.op { background: #ff9f0a; color: #fff; font-size: 26px; }
.calc-keys button.op:hover { background: #ffb340; }
.calc-keys button.op.active { background: #fff; color: #ff9f0a; }

.calc-keys button.zero {
  grid-column: span 2;
  border-radius: 999px;
  aspect-ratio: auto;
  text-align: left;
  padding-left: 20px;
}

.calc-keys button:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}
