:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #14141f;
  --bg-tertiary: #1e1e2e;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #606070;
  --accent: #00d4ff;
  --accent-secondary: #00ff88;
  --danger: #ff4466;
  --focus-ring: #00d4ff;
  --focus-glow: rgba(0, 212, 255, 0.4);
  --radius-md: 12px;
}

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

html, body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: #000;
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#app { width: 100%; height: 100%; position: relative; }

.screen {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
}

.screen.hidden { display: none; }

.focusable {
  transition: box-shadow 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
  border: 2px solid transparent;
  cursor: pointer;
  outline: none;
}

.focusable:focus {
  border-color: var(--focus-ring);
  box-shadow: 0 0 20px var(--focus-glow);
}

.hidden { display: none !important; }

/* Calculator-specific */
.display {
  height: 130px;
  background: var(--bg-primary);
  padding: 14px 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  border-bottom: 1px solid var(--bg-tertiary);
}

.display-history {
  color: var(--text-secondary);
  font-size: 20px;
  font-weight: 400;
  line-height: 1.2;
  min-height: 26px;
  width: 100%;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

.display-main {
  color: var(--text-primary);
  font-size: 60px;
  font-weight: 300;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  width: 100%;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

.calc-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--bg-secondary);
}

.calc-btn {
  font-size: 30px;
  font-weight: 500;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  user-select: none;
  -webkit-user-select: none;
}

.btn-wide { grid-column: 1 / 3; }

.btn-num {
  background: var(--bg-tertiary);
}

.btn-fn {
  background: #2a2a3e;
  color: var(--text-secondary);
  font-size: 26px;
  font-weight: 600;
}

.btn-op {
  background: #1a4a6a;
  color: #ffffff;
  font-size: 34px;
  font-weight: 600;
}

.btn-equals {
  background: var(--accent);
  color: #001823;
  font-weight: 700;
  font-size: 34px;
}

.btn-op.is-active {
  background: var(--accent);
  color: #001823;
}

.calc-btn:focus {
  transform: scale(1.03);
  z-index: 1;
}

.calc-btn.pressed {
  transform: scale(0.97);
}
